Skip to content

Commit

Permalink
fixbug - excludedPsr4Prefixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wangliming07 committed Jan 9, 2020
1 parent b57fc12 commit 5934088
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/annotation/src/Resource/AnnotationResource.php
Expand Up @@ -83,7 +83,7 @@ class AnnotationResource extends AbstractResource
* @var array
* eg. ['Psr\\', 'PHPUnit\\', 'Symfony\\']
*/
private $excludedPsr4Prefixes;
private $excludedPsr4Prefixes = [];

/**
* Can disable AutoLoader class before load component classes.
Expand Down Expand Up @@ -119,12 +119,12 @@ class AnnotationResource extends AbstractResource
*/
public function __construct(array $config = [])
{
// Init $excludedPsr4Prefixes
$this->excludedPsr4Prefixes = self::DEFAULT_EXCLUDED_PSR4_PREFIXES;

// Can set property by array
ObjectHelper::init($this, $config);

// Init $excludedPsr4Prefixes
array_push($this->excludedPsr4Prefixes, ...self::DEFAULT_EXCLUDED_PSR4_PREFIXES);

$this->registerLoader();

$this->classLoader = ComposerHelper::getClassLoader();
Expand Down
2 changes: 1 addition & 1 deletion src/framework/src/Processor/AnnotationProcessor.php
Expand Up @@ -35,7 +35,7 @@ public function handle(): bool
'notifyHandler' => [$this, 'notifyHandle'],
// TODO force load framework components: bean, error, event, aop
'disabledAutoLoaders' => $app->getDisabledAutoLoaders(),
'disabledPsr4Prefixes' => $app->getDisabledPsr4Prefixes(),
'excludedPsr4Prefixes' => $app->getDisabledPsr4Prefixes(),
]);

$stats = AnnotationRegister::getClassStats();
Expand Down

0 comments on commit 5934088

Please sign in to comment.