From bded7581329766616bf35f1018326c9b3912df0b Mon Sep 17 00:00:00 2001 From: Maks Rafalko Date: Sat, 8 Jan 2022 16:06:28 +0300 Subject: [PATCH] Remove `string` type declaration of parameter (#1639) Fixes #1635 because: * Covariance allows a child's method to return a more specific type than the return type of its parent's method. * Contravariance allows a parameter type to be less specific in a child method, than that of its parent. --- src/FileSystem/Finder/Iterator/RealPathFilterIterator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FileSystem/Finder/Iterator/RealPathFilterIterator.php b/src/FileSystem/Finder/Iterator/RealPathFilterIterator.php index ecadd0e51..4047e1711 100644 --- a/src/FileSystem/Finder/Iterator/RealPathFilterIterator.php +++ b/src/FileSystem/Finder/Iterator/RealPathFilterIterator.php @@ -77,7 +77,7 @@ public function accept() * * @return string regexp corresponding to a given string or regexp */ - protected function toRegex(string $str): string + protected function toRegex($str): string { return $this->isRegex($str) ? $str : '/' . preg_quote($str, '/') . '/'; }