Codeception / Codeception/AspectMock
Parent class not found by locator
- 主要言語
- PHP
- スター
- 784
- フォーク
- 132
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
When using custom autoloader and try to get an instance of a class which has parent or implements an interface form the same custom namespace I have an error "PHP Fatal error: Uncaught InvalidArgumentException: Class [parent class name] was not found by locator in /workspace/projects/test/vendor/goaop/parser-reflection/src/ReflectionEngine.php:112".
I have very simple setup:
```
init([
'debug' => true,
'includePaths' => [__DIR__. '/lib'],
]);
$kernel->loadFile(__DIR__ . '/autoload.php'); // custom autoloader
$b = new \lib\B();
```
Class \lib\B:
```
namespace lib;
class B extends A {}
```
Class \lib\A:
```
namespace lib;
class A
{
public function getName()
{
return static::class;
}
}
```
Class B is loaded via my custom autoloader, but then the locator tries to load parent class A via composer autoloader and returns this error. Is this a bug, or I'm doing something wrong?
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
Start with the reproduction using AspectMock\Kernel::init and loadFile in the custom autoload.php, then inspect vendor/goaop/parser-reflection/src/ReflectionEngine.php at line 112. Reproduce the failure with lib\B extending lib\A and trace how the locator handles the parent class. Done means the setup no longer reports the parent class as missing, with a regression test covering the custom namespace autoloader.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- php
- 領域
- testing
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100