Merge pull request #196 from zhamao-robot/fix-class-psr-4

修复 getClassesPsr4 中默认过滤方法的路径 Bug
This commit is contained in:
Jerry
2022-12-24 13:43:47 +08:00
committed by GitHub
4 changed files with 73 additions and 62 deletions

View File

@@ -6,9 +6,7 @@ declare(strict_types=1);
* @since 2.7.0 * @since 2.7.0
*/ */
return (new PhpCsFixer\Config()) $rules = [
->setRiskyAllowed(true)
->setRules([
'@PSR12' => true, '@PSR12' => true,
'@Symfony' => true, '@Symfony' => true,
'@PhpCsFixer' => true, '@PhpCsFixer' => true,
@@ -66,7 +64,19 @@ return (new PhpCsFixer\Config())
'multiline_comment_opening_closing' => true, 'multiline_comment_opening_closing' => true,
'phpdoc_summary' => false, 'phpdoc_summary' => false,
'php_unit_test_class_requires_covers' => false, 'php_unit_test_class_requires_covers' => false,
]) 'global_namespace_import' => false,
'phpdoc_order' => false,
];
if (PHP_VERSION_ID > 70400) {
$rules['no_useless_concat_operator'] = false;
}
// 'no_useless_concat_operator' => false,
return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules($rules)
->setFinder( ->setFinder(
PhpCsFixer\Finder::create() PhpCsFixer\Finder::create()
->in(__DIR__ . '/src') ->in(__DIR__ . '/src')

View File

@@ -30,7 +30,7 @@ class ConsoleApplication extends Application
{ {
public const VERSION_ID = 478; public const VERSION_ID = 478;
public const VERSION = '2.8.4'; public const VERSION = '2.8.5';
private static $obj; private static $obj;

View File

@@ -103,7 +103,7 @@ class ZMUtil
/*if (substr(file_get_contents($dir . '/' . $v), 6, 6) == '#plain') { /*if (substr(file_get_contents($dir . '/' . $v), 6, 6) == '#plain') {
continue; continue;
}*/ }*/
if (file_exists($dir . '/' . $pathinfo['basename'] . '.plain')) { if (file_exists($dir . '/' . $v . '.plain')) {
continue; continue;
} }
if (mb_substr($pathinfo['basename'], 0, 7) == 'global_' || mb_substr($pathinfo['basename'], 0, 7) == 'script_') { if (mb_substr($pathinfo['basename'], 0, 7) == 'global_' || mb_substr($pathinfo['basename'], 0, 7) == 'script_') {

View File

@@ -14,8 +14,9 @@ function loader__generated_id__()
require_once Phar::running() . '/' . $v; require_once Phar::running() . '/' . $v;
} }
} }
if ('__generate' . 'd_id__' === _PHAR_STUB_ID) { if (('__generate' . 'd_id__') === _PHAR_STUB_ID) {
echo 'Cannot execute this file directly!' . PHP_EOL; echo 'Cannot execute this file directly!' . PHP_EOL;
exit(1); exit(1);
} }
/* @phpstan-ignore-next-line */
return json_decode(file_get_contents(__DIR__ . '/zmplugin.json'), true) ?? ['zm_module' => false]; return json_decode(file_get_contents(__DIR__ . '/zmplugin.json'), true) ?? ['zm_module' => false];