Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| AutonumberTransformer | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| supports | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | /** @license For full copyright and license information, please see the LICENSE.md file. */ |
| 6 | |
| 7 | namespace App\Core\Engine\Application\Transformer; |
| 8 | |
| 9 | defined('AMMONLY_APP') || exit('Direct script access is forbidden.'); |
| 10 | |
| 11 | use App\Core\Engine\Domain\Model\FieldMetadata; |
| 12 | |
| 13 | /** |
| 14 | * Auto Number / Prefix UiType Transformer. |
| 15 | * |
| 16 | * Handles UiType: autonumber, prefix_number. |
| 17 | * Formats sequential generated prefix codes for safe UI display and database writes. |
| 18 | * |
| 19 | * @package App\Core\Engine\Application\Transformer |
| 20 | */ |
| 21 | final class AutonumberTransformer extends AbstractStringTransformer |
| 22 | { |
| 23 | /** @var string[] Supported UiType names. */ |
| 24 | private const array SUPPORTED = ['autonumber', 'prefix_number']; |
| 25 | |
| 26 | /** {@inheritdoc} */ |
| 27 | public function supports(string $uitypeName): bool |
| 28 | { |
| 29 | return in_array($uitypeName, self::SUPPORTED, true); |
| 30 | } |
| 31 | } |