From 548b4c7d6d5663d5550fdc1bd74dba1c79e81766 Mon Sep 17 00:00:00 2001 From: AJ Meireles Date: Wed, 12 Jun 2024 11:07:06 -0300 Subject: [PATCH] finishing --- .github/workflows/tests.yml | 2 +- app/helpers.php | 6 +- composer.json | 2 + composer.lock | 132 +++++++++++++++++++++++++++++++++++- 4 files changed, 137 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 44b0d5f1..c413032c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - php: [8.1] + php: [8.2] laravel: [10.*] name: PHP:${{ matrix.php }} / Laravel:${{ matrix.laravel }} diff --git a/app/helpers.php b/app/helpers.php index a4f9fc72..1c4524b2 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -10,10 +10,10 @@ function apply_prefix(array $data): array } return collect($data) - ->filter(fn ($value) => is_string($value)) - ->filter(fn ($value) => str_contains($value, 'filter(fn (mixed $value) => is_string($value)) + ->filter(fn (string $value) => str_contains($value, 'mapWithKeys(function (string $value, string $key) use ($prefix) { - $value = preg_replace_callback('/(<\/?x-(?!slot:))([^>]*>)/', function ($matches) use ($prefix) { + $value = preg_replace_callback('/(<\/?x-(?!slot:))([^>]*>)/', function (array $matches) use ($prefix) { return "{$matches[1]}{$prefix}{$matches[2]}"; }, $value); diff --git a/composer.json b/composer.json index 22c73a86..9edc49cd 100644 --- a/composer.json +++ b/composer.json @@ -20,6 +20,7 @@ "mockery/mockery": "^1.4.4", "nunomaduro/collision": "^8.1", "pestphp/pest": "^2.0", + "pestphp/pest-plugin-type-coverage": "^2.0", "spatie/laravel-ignition": "^2.0", "spatie/laravel-ray": "^1.33" }, @@ -57,6 +58,7 @@ "format": "./vendor/bin/pint", "ci": [ "./vendor/bin/pint --test", + "./vendor/bin/pest --type-coverage", "./vendor/bin/pest" ] }, diff --git a/composer.lock b/composer.lock index d023276e..33c5fd79 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": "aa1625db83916e721b6b3317fdb5b6ff", + "content-hash": "fba04654b3ed812e36202ccebfb02d1d", "packages": [ { "name": "brick/math", @@ -6957,6 +6957,79 @@ ], "time": "2024-01-26T09:46:42+00:00" }, + { + "name": "pestphp/pest-plugin-type-coverage", + "version": "v2.8.3", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest-plugin-type-coverage.git", + "reference": "bb232225c3dd6468dffdab271b3d67377afed369" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest-plugin-type-coverage/zipball/bb232225c3dd6468dffdab271b3d67377afed369", + "reference": "bb232225c3dd6468dffdab271b3d67377afed369", + "shasum": "" + }, + "require": { + "pestphp/pest-plugin": "^2.1.1", + "php": "^8.1", + "phpstan/phpstan": "^1.11.3", + "tomasvotruba/type-coverage": "^0.2.8" + }, + "require-dev": { + "pestphp/pest": "^2.34.7", + "pestphp/pest-dev-tools": "^2.16.0" + }, + "type": "library", + "extra": { + "pest": { + "plugins": [ + "Pest\\TypeCoverage\\Plugin" + ] + } + }, + "autoload": { + "psr-4": { + "Pest\\TypeCoverage\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "The Type Coverage plugin for Pest PHP.", + "keywords": [ + "coverage", + "framework", + "pest", + "php", + "plugin", + "test", + "testing", + "type-coverage", + "unit" + ], + "support": { + "issues": "https://github.com/pestphp/pest-plugin-type-coverage/issues", + "source": "https://github.com/pestphp/pest-plugin-type-coverage/tree/v2.8.3" + }, + "funding": [ + { + "url": "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" + } + ], + "time": "2024-06-03T19:38:34+00:00" + }, { "name": "phar-io/manifest", "version": "2.0.4", @@ -9585,6 +9658,63 @@ ], "time": "2024-03-03T12:36:25+00:00" }, + { + "name": "tomasvotruba/type-coverage", + "version": "0.2.8", + "source": { + "type": "git", + "url": "https://github.com/TomasVotruba/type-coverage.git", + "reference": "ab4f0506f8df8c6418ec877e356c0efd2c50ed6b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/TomasVotruba/type-coverage/zipball/ab4f0506f8df8c6418ec877e356c0efd2c50ed6b", + "reference": "ab4f0506f8df8c6418ec877e356c0efd2c50ed6b", + "shasum": "" + }, + "require": { + "nette/utils": "^3.2 || ^4.0", + "php": "^7.2 || ^8.0", + "phpstan/phpstan": "^1.9.3" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "config/extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "TomasVotruba\\TypeCoverage\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Measure type coverage of your project", + "keywords": [ + "phpstan-extension", + "static analysis" + ], + "support": { + "issues": "https://github.com/TomasVotruba/type-coverage/issues", + "source": "https://github.com/TomasVotruba/type-coverage/tree/0.2.8" + }, + "funding": [ + { + "url": "https://www.paypal.me/rectorphp", + "type": "custom" + }, + { + "url": "https://github.com/tomasvotruba", + "type": "github" + } + ], + "time": "2024-04-26T13:56:40+00:00" + }, { "name": "zbateson/mail-mime-parser", "version": "2.4.1",