Skip to content

Commit

Permalink
fix: adjust signature of inherited method (#1616)
Browse files Browse the repository at this point in the history
Infection currently requires:
`symfony/finder:^3.4.29 || ^4.1.19 || ^5.0 || ^6.0`

In version ^5.0, the signature of the following parameter changed:
`MultiplePcreFilterIterator::toRegex(string $str)`

In version ^6.0, the return type of the method changed as well.

To ensure inheritance compatibility, the signature of the method
`RealPathFilterIterator::toRegex` is changed.

Co-authored-by: Romain Canon <ext-r.canon@vattenfall.fr>
  • Loading branch information
romm and Romain Canon committed Dec 16, 2021
1 parent 497bd4a commit 6844063
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/FileSystem/Finder/Iterator/RealPathFilterIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function accept()
*
* @return string regexp corresponding to a given string or regexp
*/
protected function toRegex($str)
protected function toRegex(string $str): string
{
return $this->isRegex($str) ? $str : '/' . preg_quote($str, '/') . '/';
}
Expand Down

0 comments on commit 6844063

Please sign in to comment.