Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| ResourceAddResourceHeader | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
| getFallbackText | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | namespace Apie\Core\Translator\ValueObjects; |
| 3 | |
| 4 | use Apie\Core\Attributes\Description; |
| 5 | use Apie\Core\Attributes\ExampleValue; |
| 6 | |
| 7 | #[Description('Header shown on add resource form')] |
| 8 | #[ExampleValue('apie.bounded.test.example.user.action.add.header.authenticated')] |
| 9 | class ResourceAddResourceHeader extends AbstractTranslation |
| 10 | { |
| 11 | protected const MIDDLE_REGEX = 'action\.add\.header'; |
| 12 | |
| 13 | public function getFallbackText(): string |
| 14 | { |
| 15 | $id = $this->prefix->getResourceIdentifier(); |
| 16 | if ($id) { |
| 17 | return 'Create ' . $id->humanize(); |
| 18 | } |
| 19 | return 'Create'; |
| 20 | } |
| 21 | } |