diff --git a/src/JoliTypo/Bridge/Symfony/DependencyInjection/Configuration.php b/src/JoliTypo/Bridge/Symfony/DependencyInjection/Configuration.php index 62c8d06..d02b4c4 100644 --- a/src/JoliTypo/Bridge/Symfony/DependencyInjection/Configuration.php +++ b/src/JoliTypo/Bridge/Symfony/DependencyInjection/Configuration.php @@ -17,7 +17,7 @@ class Configuration implements ConfigurationInterface /** * {@inheritdoc} */ - public function getConfigTreeBuilder() + public function getConfigTreeBuilder(): TreeBuilder { $treeBuilder = new TreeBuilder('joli_typo'); $rootNode = $this->getRootNode($treeBuilder, 'joli_typo'); diff --git a/src/JoliTypo/Bridge/Twig/JoliTypoExtension.php b/src/JoliTypo/Bridge/Twig/JoliTypoExtension.php index 6f9f4c0..bc54677 100644 --- a/src/JoliTypo/Bridge/Twig/JoliTypoExtension.php +++ b/src/JoliTypo/Bridge/Twig/JoliTypoExtension.php @@ -21,14 +21,14 @@ public function __construct($presets) $this->presets = $presets; } - public function getFunctions() + public function getFunctions(): array { return [ new \Twig\TwigFunction('jolitypo', [$this, 'translate']), ]; } - public function getFilters() + public function getFilters(): array { return [ new \Twig\TwigFilter('jolitypo', [$this, 'translate'], ['pre_escape' => 'html', 'is_safe' => ['html']]), diff --git a/tests/JoliTypo/Tests/Bridge/app/AppKernel.php b/tests/JoliTypo/Tests/Bridge/app/AppKernel.php index 02d4fff..61d6c70 100644 --- a/tests/JoliTypo/Tests/Bridge/app/AppKernel.php +++ b/tests/JoliTypo/Tests/Bridge/app/AppKernel.php @@ -19,7 +19,7 @@ class AppKernel extends Kernel { - public function registerBundles() + public function registerBundles(): iterable { $bundles = [ new FrameworkBundle(), @@ -54,12 +54,12 @@ public function registerContainerConfiguration(LoaderInterface $loader) } } - public function getCacheDir() + public function getCacheDir(): string { return '/tmp/jolitypo/cache/'.$this->environment; } - public function getLogDir() + public function getLogDir(): string { return '/tmp/jolitypo/logs/'.$this->environment; } diff --git a/tests/JoliTypo/Tests/JoliTypoTest.php b/tests/JoliTypo/Tests/JoliTypoTest.php index ae073aa..2231ace 100644 --- a/tests/JoliTypo/Tests/JoliTypoTest.php +++ b/tests/JoliTypo/Tests/JoliTypoTest.php @@ -171,7 +171,7 @@ public function testNonHTMLContent() NOT_HTML; $this->assertEquals($fixed, $fixer->fix($toFix)); - $this->assertEquals(html_entity_decode($fixed, null, 'UTF-8'), $fixer->fixString($toFix)); + $this->assertEquals(html_entity_decode($fixed, \ENT_COMPAT, 'UTF-8'), $fixer->fixString($toFix)); $this->assertEquals('Here is a “protip©”!', $fixer->fixString('Here is a "protip(c)"!')); }