Minor tweak for phpstan and pathinfo return array

This commit is contained in:
MarkBaker 2022-09-25 18:08:05 +02:00
parent 5f644c0144
commit 8969b81886
2 changed files with 38 additions and 42 deletions

78
composer.lock generated
View File

@ -1124,24 +1124,24 @@
},
{
"name": "dompdf/dompdf",
"version": "v2.0.0",
"version": "v2.0.1",
"source": {
"type": "git",
"url": "https://github.com/dompdf/dompdf.git",
"reference": "79573d8b8a141ec8a17312515de8740eed014fa9"
"reference": "c5310df0e22c758c85ea5288175fc6cd777bc085"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dompdf/dompdf/zipball/79573d8b8a141ec8a17312515de8740eed014fa9",
"reference": "79573d8b8a141ec8a17312515de8740eed014fa9",
"url": "https://api.github.com/repos/dompdf/dompdf/zipball/c5310df0e22c758c85ea5288175fc6cd777bc085",
"reference": "c5310df0e22c758c85ea5288175fc6cd777bc085",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-mbstring": "*",
"masterminds/html5": "^2.0",
"phenx/php-font-lib": "^0.5.4",
"phenx/php-svg-lib": "^0.3.3 || ^0.4.0",
"phenx/php-font-lib": ">=0.5.4 <1.0.0",
"phenx/php-svg-lib": ">=0.3.3 <1.0.0",
"php": "^7.1 || ^8.0"
},
"require-dev": {
@ -1172,25 +1172,17 @@
],
"authors": [
{
"name": "Fabien Ménager",
"email": "fabien.menager@gmail.com"
},
{
"name": "Brian Sweeney",
"email": "eclecticgeek@gmail.com"
},
{
"name": "Gabriel Bull",
"email": "me@gabrielbull.com"
"name": "The Dompdf Community",
"homepage": "https://github.com/dompdf/dompdf/blob/master/AUTHORS.md"
}
],
"description": "DOMPDF is a CSS 2.1 compliant HTML to PDF converter",
"homepage": "https://github.com/dompdf/dompdf",
"support": {
"issues": "https://github.com/dompdf/dompdf/issues",
"source": "https://github.com/dompdf/dompdf/tree/v2.0.0"
"source": "https://github.com/dompdf/dompdf/tree/v2.0.1"
},
"time": "2022-06-21T21:14:57+00:00"
"time": "2022-09-22T13:43:41+00:00"
},
{
"name": "friendsofphp/php-cs-fixer",
@ -1795,21 +1787,21 @@
},
{
"name": "phenx/php-svg-lib",
"version": "0.4.1",
"version": "0.5.0",
"source": {
"type": "git",
"url": "https://github.com/dompdf/php-svg-lib.git",
"reference": "4498b5df7b08e8469f0f8279651ea5de9626ed02"
"reference": "76876c6cf3080bcb6f249d7d59705108166a6685"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dompdf/php-svg-lib/zipball/4498b5df7b08e8469f0f8279651ea5de9626ed02",
"reference": "4498b5df7b08e8469f0f8279651ea5de9626ed02",
"url": "https://api.github.com/repos/dompdf/php-svg-lib/zipball/76876c6cf3080bcb6f249d7d59705108166a6685",
"reference": "76876c6cf3080bcb6f249d7d59705108166a6685",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"php": "^7.1 || ^7.2 || ^7.3 || ^7.4 || ^8.0",
"php": "^7.1 || ^8.0",
"sabberworm/php-css-parser": "^8.4"
},
"require-dev": {
@ -1835,9 +1827,9 @@
"homepage": "https://github.com/PhenX/php-svg-lib",
"support": {
"issues": "https://github.com/dompdf/php-svg-lib/issues",
"source": "https://github.com/dompdf/php-svg-lib/tree/0.4.1"
"source": "https://github.com/dompdf/php-svg-lib/tree/0.5.0"
},
"time": "2022-03-07T12:52:04+00:00"
"time": "2022-09-06T12:16:56+00:00"
},
{
"name": "php-http/message-factory",
@ -1957,16 +1949,16 @@
},
{
"name": "phpstan/phpstan",
"version": "1.8.5",
"version": "1.8.6",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "f6598a5ff12ca4499a836815e08b4d77a2ddeb20"
"reference": "c386ab2741e64cc9e21729f891b28b2b10fe6618"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/f6598a5ff12ca4499a836815e08b4d77a2ddeb20",
"reference": "f6598a5ff12ca4499a836815e08b4d77a2ddeb20",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/c386ab2741e64cc9e21729f891b28b2b10fe6618",
"reference": "c386ab2741e64cc9e21729f891b28b2b10fe6618",
"shasum": ""
},
"require": {
@ -1996,7 +1988,7 @@
],
"support": {
"issues": "https://github.com/phpstan/phpstan/issues",
"source": "https://github.com/phpstan/phpstan/tree/1.8.5"
"source": "https://github.com/phpstan/phpstan/tree/1.8.6"
},
"funding": [
{
@ -2012,7 +2004,7 @@
"type": "tidelift"
}
],
"time": "2022-09-07T16:05:32+00:00"
"time": "2022-09-23T09:54:39+00:00"
},
{
"name": "phpstan/phpstan-phpunit",
@ -2386,16 +2378,16 @@
},
{
"name": "phpunit/phpunit",
"version": "9.5.24",
"version": "9.5.25",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "d0aa6097bef9fd42458a9b3c49da32c6ce6129c5"
"reference": "3e6f90ca7e3d02025b1d147bd8d4a89fd4ca8a1d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d0aa6097bef9fd42458a9b3c49da32c6ce6129c5",
"reference": "d0aa6097bef9fd42458a9b3c49da32c6ce6129c5",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3e6f90ca7e3d02025b1d147bd8d4a89fd4ca8a1d",
"reference": "3e6f90ca7e3d02025b1d147bd8d4a89fd4ca8a1d",
"shasum": ""
},
"require": {
@ -2417,14 +2409,14 @@
"phpunit/php-timer": "^5.0.2",
"sebastian/cli-parser": "^1.0.1",
"sebastian/code-unit": "^1.0.6",
"sebastian/comparator": "^4.0.5",
"sebastian/comparator": "^4.0.8",
"sebastian/diff": "^4.0.3",
"sebastian/environment": "^5.1.3",
"sebastian/exporter": "^4.0.3",
"sebastian/exporter": "^4.0.5",
"sebastian/global-state": "^5.0.1",
"sebastian/object-enumerator": "^4.0.3",
"sebastian/resource-operations": "^3.0.3",
"sebastian/type": "^3.1",
"sebastian/type": "^3.2",
"sebastian/version": "^3.0.2"
},
"suggest": {
@ -2468,7 +2460,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.24"
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.25"
},
"funding": [
{
@ -2478,9 +2470,13 @@
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit",
"type": "tidelift"
}
],
"time": "2022-08-30T07:42:16+00:00"
"time": "2022-09-25T03:44:45+00:00"
},
{
"name": "psr/cache",
@ -5278,5 +5274,5 @@
"ext-zlib": "*"
},
"platform-dev": [],
"plugin-api-version": "2.2.0"
"plugin-api-version": "2.3.0"
}

View File

@ -85,7 +85,7 @@ class Sample
foreach ($regex as $file) {
$file = str_replace(str_replace('\\', '/', $baseDir) . '/', '', str_replace('\\', '/', $file[0]));
$info = pathinfo($file);
$category = str_replace('_', ' ', $info['dirname']);
$category = str_replace('_', ' ', $info['dirname'] ?? '');
$name = str_replace('_', ' ', (string) preg_replace('/(|\.php)/', '', $info['filename']));
if (!in_array($category, ['.', 'boostrap', 'templates'])) {
if (!isset($files[$category])) {