bug #3505 Fix code for PHP 8.1 (fabpot)

This PR was merged into the 2.x branch.

Discussion
----------

Fix code for PHP 8.1

Commits
-------

953974a7 Fix code for PHP 8.1
This commit is contained in:
Fabien Potencier
2021-04-10 10:17:25 +02:00
2 changed files with 2 additions and 4 deletions
+1 -1
View File
@@ -252,7 +252,7 @@ class FilesystemLoader implements LoaderInterface, ExistsLoaderInterface, Source
private function normalizeName($name)
{
return preg_replace('#/{2,}#', '/', str_replace('\\', '/', $name));
return preg_replace('#/{2,}#', '/', str_replace('\\', '/', (string) $name));
}
private function parseName($name, $default = self::MAIN_NAMESPACE)
+1 -3
View File
@@ -214,10 +214,8 @@ class FilesystemTest extends TestCase
/**
* @dataProvider getArrayInheritanceTests
*
* @param $templateName string Template name with array inheritance
*/
public function testArrayInheritance($templateName)
public function testArrayInheritance(string $templateName)
{
$loader = new FilesystemLoader([]);
$loader->addPath(__DIR__.'/Fixtures/inheritance');