{"action":"created","issue":{"url":"https://api.github.com/repos/Codeception/AspectMock/issues/117","repository_url":"https://api.github.com/repos/Codeception/AspectMock","labels_url":"https://api.github.com/repos/Codeception/AspectMock/issues/117/labels{/name}","comments_url":"https://api.github.com/repos/Codeception/AspectMock/issues/117/comments","events_url":"https://api.github.com/repos/Codeception/AspectMock/issues/117/events","html_url":"https://github.com/Codeception/AspectMock/issues/117","id":193451083,"number":117,"title":"Parent class not found by locator","user":{"login":"biserantonov","id":3635324,"avatar_url":"https://avatars.githubusercontent.com/u/3635324?v=3","gravatar_id":"","url":"https://api.github.com/users/biserantonov","html_url":"https://github.com/biserantonov","followers_url":"https://api.github.com/users/biserantonov/followers","following_url":"https://api.github.com/users/biserantonov/following{/other_user}","gists_url":"https://api.github.com/users/biserantonov/gists{/gist_id}","starred_url":"https://api.github.com/users/biserantonov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biserantonov/subscriptions","organizations_url":"https://api.github.com/users/biserantonov/orgs","repos_url":"https://api.github.com/users/biserantonov/repos","events_url":"https://api.github.com/users/biserantonov/events{/privacy}","received_events_url":"https://api.github.com/users/biserantonov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-12-05T09:44:13Z","updated_at":"2016-12-06T08:18:45Z","closed_at":null,"body":"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\".\r\n\r\nI have very simple setup:\r\n\r\n```\r\n<?php\r\n\r\nrequire_once __DIR__ . '/vendor/autoload.php';\r\n\r\n$kernel = AspectMock\\Kernel::getInstance();\r\n$kernel->init([\r\n    'debug' => true,\r\n    'includePaths' => [__DIR__. '/lib'],\r\n]);\r\n$kernel->loadFile(__DIR__ . '/autoload.php'); // custom autoloader\r\n\r\n$b = new \\lib\\B();\r\n```\r\n\r\nClass \\lib\\B:\r\n\r\n```\r\nnamespace lib;\r\n\r\nclass B extends A {}\r\n```\r\n\r\nClass \\lib\\A:\r\n\r\n```\r\nnamespace lib;\r\n\r\nclass A\r\n{\r\n    public function getName()\r\n    {\r\n        return static::class;\r\n    }\r\n}\r\n```\r\n\r\nClass 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? "},"comment":{"url":"https://api.github.com/repos/Codeception/AspectMock/issues/comments/265088319","html_url":"https://github.com/Codeception/AspectMock/issues/117#issuecomment-265088319","issue_url":"https://api.github.com/repos/Codeception/AspectMock/issues/117","id":265088319,"user":{"login":"biserantonov","id":3635324,"avatar_url":"https://avatars.githubusercontent.com/u/3635324?v=3","gravatar_id":"","url":"https://api.github.com/users/biserantonov","html_url":"https://github.com/biserantonov","followers_url":"https://api.github.com/users/biserantonov/followers","following_url":"https://api.github.com/users/biserantonov/following{/other_user}","gists_url":"https://api.github.com/users/biserantonov/gists{/gist_id}","starred_url":"https://api.github.com/users/biserantonov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biserantonov/subscriptions","organizations_url":"https://api.github.com/users/biserantonov/orgs","repos_url":"https://api.github.com/users/biserantonov/repos","events_url":"https://api.github.com/users/biserantonov/events{/privacy}","received_events_url":"https://api.github.com/users/biserantonov/received_events","type":"User","site_admin":false},"created_at":"2016-12-06T08:18:45Z","updated_at":"2016-12-06T08:18:45Z","body":"Thank you both for the responses. I'm using Yii2 framework for my project so I added psr-0 autoloader in composer and fixed the issue, but since I didn't saw it in the examples I wasn't sure if this is the right way to do it. Maybe it's good idea to update examples."}}
{"actor":{"display_login":"biserantonov"}}