diff --git a/composer.json b/composer.json index 07c942e1..1413ad68 100755 --- a/composer.json +++ b/composer.json @@ -47,6 +47,7 @@ "cocur/slugify": "~4.0.0", "ramsey/uuid": "~4.0.1", "symfony/yaml": "~4.4.4", + "symfony/finder": "5.1.3", "bnf/slim3-psr15": "~1.1.1", @@ -81,7 +82,7 @@ "require-dev": { "doctrine/coding-standard": "7.0.2", "victorjonsson/markdowndocs": "^1.3", - "phpstan/phpstan": "^0.11.19", + "phpstan/phpstan": "^0.12.34", "symfony/var-dumper": "^4.4" } } diff --git a/src/flextype/app/Support/helpers.php b/src/flextype/app/Support/helpers.php index 248c6d03..d603dea7 100644 --- a/src/flextype/app/Support/helpers.php +++ b/src/flextype/app/Support/helpers.php @@ -8,6 +8,7 @@ declare(strict_types=1); */ use Flextype\App\Support\Collection; +use Symfony\Component\Finder\Finder; if (! function_exists('collect')) { /** @@ -155,3 +156,13 @@ if (! function_exists('collect_filter')) { return $items; } } + +if (! function_exists('find')) { + /** + * Create a Finder instance. + */ + function find() : Finder + { + return new Finder(); + } +}