Merge branch '2.x' into 3.x

This commit is contained in:
Nuno Maduro
2024-08-22 21:21:52 +01:00
10 changed files with 75 additions and 1588 deletions

View File

@ -509,7 +509,7 @@ final class Expectation
{
return Targeted::make(
$this,
fn (ObjectDescription $object): bool => str_contains((string) file_get_contents($object->path), 'declare(strict_types=1);'),
fn (ObjectDescription $object): bool => (bool) preg_match('/^<\?php\s+declare\(.*?strict_types\s?=\s?1.*?\);/', (string) file_get_contents($object->path)),
'to use strict types',
FileLineFinder::where(fn (string $line): bool => str_contains($line, '<?php')),
);