refactor: susun semula struktur folder — Laravel source ke src/

This commit is contained in:
Saufi
2026-05-19 15:58:35 +08:00
parent f052251b94
commit bf53c71b45
10806 changed files with 1385379 additions and 121 deletions

View File

@@ -0,0 +1,50 @@
<?php
/**
* League.Csv (https://csv.thephpleague.com)
*
* (c) Ignace Nyamagana Butera <nyamsprod@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace League\Csv\Serializer;
use Attribute;
use Deprecated;
use ReflectionAttribute;
use ReflectionClass;
/**
* @deprecated since version 9.17.0
*
* @see MapRecord
*/
#[Attribute(Attribute::TARGET_CLASS)]
final class AfterMapping
{
public readonly MapRecord $mapRecord;
public readonly array $methods;
#[Deprecated(message: 'use League\Csv\Serializer\MapRecord instead', since: 'league/csv:9.17.0')]
public function __construct(string ...$methods)
{
$this->mapRecord = new MapRecord($methods);
$this->methods = $this->mapRecord->afterMapping;
}
public static function from(ReflectionClass $class): ?self
{
$attributes = $class->getAttributes(self::class, ReflectionAttribute::IS_INSTANCEOF);
$nbAttributes = count($attributes);
return match (true) {
0 === $nbAttributes => null,
1 < $nbAttributes => throw new MappingFailed('Using more than one `'.self::class.'` attribute on a class property or method is not supported.'),
default => $attributes[0]->newInstance(),
};
}
}