mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-23 00:25:35 +08:00
Merge pull request #196 from zhamao-robot/fix-class-psr-4
修复 getClassesPsr4 中默认过滤方法的路径 Bug
This commit is contained in:
@@ -6,67 +6,77 @@ declare(strict_types=1);
|
|||||||
* @since 2.7.0
|
* @since 2.7.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$rules = [
|
||||||
|
'@PSR12' => true,
|
||||||
|
'@Symfony' => true,
|
||||||
|
'@PhpCsFixer' => true,
|
||||||
|
'array_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
'list_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
'concat_space' => [
|
||||||
|
'spacing' => 'one',
|
||||||
|
],
|
||||||
|
'blank_line_before_statement' => [
|
||||||
|
'statements' => [
|
||||||
|
'declare',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'ordered_imports' => [
|
||||||
|
'imports_order' => [
|
||||||
|
'class',
|
||||||
|
'function',
|
||||||
|
'const',
|
||||||
|
],
|
||||||
|
'sort_algorithm' => 'alpha',
|
||||||
|
],
|
||||||
|
'single_line_comment_style' => [
|
||||||
|
'comment_types' => [
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'yoda_style' => [
|
||||||
|
'always_move_variable' => false,
|
||||||
|
'equal' => false,
|
||||||
|
'identical' => false,
|
||||||
|
],
|
||||||
|
'multiline_whitespace_before_semicolons' => [
|
||||||
|
'strategy' => 'no_multi_line',
|
||||||
|
],
|
||||||
|
'constant_case' => [
|
||||||
|
'case' => 'lower',
|
||||||
|
],
|
||||||
|
'class_attributes_separation' => true,
|
||||||
|
'combine_consecutive_unsets' => true,
|
||||||
|
'declare_strict_types' => true,
|
||||||
|
'linebreak_after_opening_tag' => true,
|
||||||
|
'lowercase_static_reference' => true,
|
||||||
|
'no_useless_else' => true,
|
||||||
|
'no_unused_imports' => true,
|
||||||
|
'not_operator_with_successor_space' => false,
|
||||||
|
'not_operator_with_space' => false,
|
||||||
|
'ordered_class_elements' => true,
|
||||||
|
'php_unit_strict' => false,
|
||||||
|
'phpdoc_separation' => false,
|
||||||
|
'single_quote' => true,
|
||||||
|
'standardize_not_equals' => true,
|
||||||
|
'multiline_comment_opening_closing' => true,
|
||||||
|
'phpdoc_summary' => 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())
|
return (new PhpCsFixer\Config())
|
||||||
->setRiskyAllowed(true)
|
->setRiskyAllowed(true)
|
||||||
->setRules([
|
->setRules($rules)
|
||||||
'@PSR12' => true,
|
|
||||||
'@Symfony' => true,
|
|
||||||
'@PhpCsFixer' => true,
|
|
||||||
'array_syntax' => [
|
|
||||||
'syntax' => 'short',
|
|
||||||
],
|
|
||||||
'list_syntax' => [
|
|
||||||
'syntax' => 'short',
|
|
||||||
],
|
|
||||||
'concat_space' => [
|
|
||||||
'spacing' => 'one',
|
|
||||||
],
|
|
||||||
'blank_line_before_statement' => [
|
|
||||||
'statements' => [
|
|
||||||
'declare',
|
|
||||||
],
|
|
||||||
],
|
|
||||||
'ordered_imports' => [
|
|
||||||
'imports_order' => [
|
|
||||||
'class',
|
|
||||||
'function',
|
|
||||||
'const',
|
|
||||||
],
|
|
||||||
'sort_algorithm' => 'alpha',
|
|
||||||
],
|
|
||||||
'single_line_comment_style' => [
|
|
||||||
'comment_types' => [
|
|
||||||
],
|
|
||||||
],
|
|
||||||
'yoda_style' => [
|
|
||||||
'always_move_variable' => false,
|
|
||||||
'equal' => false,
|
|
||||||
'identical' => false,
|
|
||||||
],
|
|
||||||
'multiline_whitespace_before_semicolons' => [
|
|
||||||
'strategy' => 'no_multi_line',
|
|
||||||
],
|
|
||||||
'constant_case' => [
|
|
||||||
'case' => 'lower',
|
|
||||||
],
|
|
||||||
'class_attributes_separation' => true,
|
|
||||||
'combine_consecutive_unsets' => true,
|
|
||||||
'declare_strict_types' => true,
|
|
||||||
'linebreak_after_opening_tag' => true,
|
|
||||||
'lowercase_static_reference' => true,
|
|
||||||
'no_useless_else' => true,
|
|
||||||
'no_unused_imports' => true,
|
|
||||||
'not_operator_with_successor_space' => false,
|
|
||||||
'not_operator_with_space' => false,
|
|
||||||
'ordered_class_elements' => true,
|
|
||||||
'php_unit_strict' => false,
|
|
||||||
'phpdoc_separation' => false,
|
|
||||||
'single_quote' => true,
|
|
||||||
'standardize_not_equals' => true,
|
|
||||||
'multiline_comment_opening_closing' => true,
|
|
||||||
'phpdoc_summary' => false,
|
|
||||||
'php_unit_test_class_requires_covers' => false,
|
|
||||||
])
|
|
||||||
->setFinder(
|
->setFinder(
|
||||||
PhpCsFixer\Finder::create()
|
PhpCsFixer\Finder::create()
|
||||||
->in(__DIR__ . '/src')
|
->in(__DIR__ . '/src')
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -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_') {
|
||||||
|
|||||||
@@ -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];
|
||||||
|
|||||||
Reference in New Issue
Block a user