| Total Complexity | 4 |
| Total Lines | 22 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 14 | final class TwemojiExtension implements ConfigurableExtensionInterface |
||
| 15 | { |
||
| 16 | public function __construct() |
||
| 17 | { |
||
| 18 | if (! \class_exists('\Astrotomic\Twemoji\Twemoji')) { |
||
| 19 | throw new ExtensionRequiredLibraryException('astrotomic/php-twemoji', $this); |
||
| 20 | } |
||
| 21 | } |
||
| 22 | |||
| 23 | public function configureSchema(ConfigurationBuilderInterface $builder): void |
||
| 24 | { |
||
| 25 | $builder->addSchema('twemoji', Expect::structure([ |
||
| 26 | 'base' => Expect::string('https://twemoji.maxcdn.com/v/latest'), |
||
| 27 | 'classes' => Expect::arrayOf('string')->default(['twemoji']), |
||
| 28 | 'size' => Expect::int()->nullable(), |
||
| 29 | 'type' => Expect::anyOf('png', 'svg')->default('svg'), |
||
| 30 | ])); |
||
| 31 | } |
||
| 32 | |||
| 33 | public function register(EnvironmentBuilderInterface $environment): void |
||
| 36 | } |
||
| 37 | } |
||
| 38 |