From 69f436e7581d3a32d4477049ffba90e9f6317bab Mon Sep 17 00:00:00 2001 From: Chris Kankiewicz Date: Wed, 19 May 2021 08:35:28 -0700 Subject: [PATCH] Updated phlak/splat to v4.0 --- app/src/Factories/FinderFactory.php | 9 +++++---- composer.json | 2 +- composer.lock | 18 ++++++++++-------- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/app/src/Factories/FinderFactory.php b/app/src/Factories/FinderFactory.php index f7727d6..5a9956d 100644 --- a/app/src/Factories/FinderFactory.php +++ b/app/src/Factories/FinderFactory.php @@ -8,6 +8,7 @@ use App\HiddenFiles; use Closure; use DI\Container; use PHLAK\Splat\Glob; +use PHLAK\Splat\Pattern; use Symfony\Component\Finder\Finder; use Symfony\Component\Finder\SplFileInfo; @@ -19,7 +20,7 @@ class FinderFactory /** @var HiddenFiles Collection of hidden files */ protected $hiddenFiles; - /** @var Glob|null Hidden files pattern cache */ + /** @var Pattern|null Hidden files pattern cache */ protected $pattern; /** @var Config The application configuration */ @@ -69,12 +70,12 @@ class FinderFactory /** Determine if a file should be hidden. */ protected function isHidden(SplFileInfo $file): bool { - if (! isset($this->pattern)) { - $this->pattern = Glob::pattern(sprintf('%s{%s}', Glob::escape( + if (! $this->pattern instanceof Pattern) { + $this->pattern = Pattern::make(sprintf('%s{%s}', Pattern::escape( $this->config->get('base_path') . DIRECTORY_SEPARATOR ), $this->hiddenFiles->implode(','))); } - return $this->pattern->matchStart($file->getRealPath()); + return Glob::matchStart($this->pattern, $file->getRealPath()); } } diff --git a/composer.json b/composer.json index 4bf4e61..357e4ed 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "erusev/parsedown-extra": "^0.8.1", "filp/whoops": "^2.7", "middlewares/cache": "^2.0", - "phlak/splat": "^3.0", + "phlak/splat": "^4.0", "php-di/php-di": "^6.0", "php-di/slim-bridge": "^3.0", "psr/http-message": "^1.0.1", diff --git a/composer.lock b/composer.lock index d1b5564..63c3d4b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "44a453ef59a78a7e969be445b1e561f3", + "content-hash": "c135cb50c4c9716cdaa6d47f57f861f6", "packages": [ { "name": "erusev/parsedown", @@ -585,16 +585,16 @@ }, { "name": "phlak/splat", - "version": "3.1.0", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/PHLAK/Splat.git", - "reference": "a57702eec01b9da631e39f936a6341edce2eb103" + "reference": "a3da691298336dfd541aded61d4612170652ddf1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHLAK/Splat/zipball/a57702eec01b9da631e39f936a6341edce2eb103", - "reference": "a57702eec01b9da631e39f936a6341edce2eb103", + "url": "https://api.github.com/repos/PHLAK/Splat/zipball/a3da691298336dfd541aded61d4612170652ddf1", + "reference": "a3da691298336dfd541aded61d4612170652ddf1", "shasum": "" }, "require": { @@ -603,11 +603,13 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "^2.10", + "phlak/coding-standards": "^1.2", "php": ">=7.2", "phpunit/phpunit": "^8.0 || ^9.0", "psy/psysh": "^0.10", "symfony/var-dumper": "^5.0", - "vimeo/psalm": "^3.8" + "vimeo/psalm": "^4.7", + "yoast/phpunit-polyfills": "^0.2.0" }, "type": "library", "autoload": { @@ -628,7 +630,7 @@ "description": "Glob-like pattern matching and utilities", "support": { "issues": "https://github.com/PHLAK/Splat/issues", - "source": "https://github.com/PHLAK/Splat/tree/3.1.0" + "source": "https://github.com/PHLAK/Splat/tree/4.0.0" }, "funding": [ { @@ -640,7 +642,7 @@ "type": "paypal" } ], - "time": "2020-10-10T06:24:40+00:00" + "time": "2021-05-17T00:50:22+00:00" }, { "name": "php-di/invoker",