{"action":"created","issue":{"url":"https://api.github.com/repos/goaop/framework/issues/292","repository_url":"https://api.github.com/repos/goaop/framework","labels_url":"https://api.github.com/repos/goaop/framework/issues/292/labels{/name}","comments_url":"https://api.github.com/repos/goaop/framework/issues/292/comments","events_url":"https://api.github.com/repos/goaop/framework/issues/292/events","html_url":"https://github.com/goaop/framework/issues/292","id":163527311,"number":292,"title":"__PHP_Incomplete_Class sometimes instead annotation","user":{"login":"clicman","id":1079535,"avatar_url":"https://avatars.githubusercontent.com/u/1079535?v=3","gravatar_id":"","url":"https://api.github.com/users/clicman","html_url":"https://github.com/clicman","followers_url":"https://api.github.com/users/clicman/followers","following_url":"https://api.github.com/users/clicman/following{/other_user}","gists_url":"https://api.github.com/users/clicman/gists{/gist_id}","starred_url":"https://api.github.com/users/clicman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clicman/subscriptions","organizations_url":"https://api.github.com/users/clicman/orgs","repos_url":"https://api.github.com/users/clicman/repos","events_url":"https://api.github.com/users/clicman/events{/privacy}","received_events_url":"https://api.github.com/users/clicman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-07-02T17:03:24Z","updated_at":"2016-07-02T17:30:27Z","closed_at":null,"body":"I've trying to deal with annotation values in around aspect and got strange behaviour:\r\nin my aspect :\r\n\r\n```php\r\n<?php\r\n\r\nnamespace Stom\\Api\\Util\\Aop\\Aspect;\r\n\r\n\r\nuse Annotation\\Cacheable;\r\nuse Go\\Aop\\Aspect;\r\nuse Go\\Aop\\Intercept\\MethodInvocation;\r\nuse Stom\\Api\\Config\\Application;\r\nuse Exception;\r\nuse Go\\Lang\\Annotation\\Around;\r\n\r\n\r\n/**\r\n * Caching aspect\r\n */\r\nclass CachingAspect implements Aspect {\r\n\r\n    /**\r\n     * This advice intercepts the execution of cacheable methods\r\n     *\r\n     * The logic is pretty simple: we look for the value in the cache and if we have a cache miss\r\n     * we then invoke original method and store its result in the cache.\r\n     * @see Around\r\n     * @param MethodInvocation $invocation Invocation\r\n     *\r\n     * @Around(\"@execution(Annotation\\Cacheable)\")\r\n     *\r\n     * @return mixed\r\n     */\r\n    public function aroundCacheable(MethodInvocation $invocation) {\r\n        $cache = null;\r\n        try {\r\n            $cache = Application::getMemCache();\r\n        } catch (Exception $ex) {\r\n            var_dump('NO_CACHE');\r\n        }\r\n        if ($cache !== null) {\r\n            $obj = $invocation->getThis();\r\n            $class = is_object($obj) ? get_class($obj) : $obj;\r\n            $key = $class . ':' . $invocation->getMethod()->name;\r\n            $key .= ':' . serialize($invocation->getArguments());\r\n            $result = $cache->get($key);\r\n            if ($result === false) {\r\n                var_dump($invocation->getMethod()->getAnnotations());\r\n                $time = $invocation->getMethod()->getAnnotation('Annotation\\Cacheable');\r\n                $result = $invocation->proceed();\r\n                var_dump($time);\r\n                $cache->set($key, $result);\r\n                echo('no');\r\n            }\r\n            echo ('cache');\r\n            return $result;\r\n        } else {\r\n            echo ('nullcache');\r\n            return $invocation->proceed();\r\n        }\r\n\r\n```\r\n\r\nAnd at first time it dumps as expected, but in another times it's wrapped into __PHP_Incomplete_Class :\r\n```php\r\narray(1) {\r\n  [0]=>\r\n  object(__PHP_Incomplete_Class)#394 (3) {\r\n    [\"__PHP_Incomplete_Class_Name\"]=>\r\n    string(20) \"Annotation\\Cacheable\"\r\n    [\"time\"]=>\r\n    int(10)\r\n    [\"value\"]=>\r\n    NULL\r\n  }\r\n}\r\n```\r\n\r\nWhy can it be so?\r\n\r\nubuntu 16.04 x64 PHP 7.0.4-7ubuntu2.1 (cli) ( NTS )\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/goaop/framework/issues/comments/230113080","html_url":"https://github.com/goaop/framework/issues/292#issuecomment-230113080","issue_url":"https://api.github.com/repos/goaop/framework/issues/292","id":230113080,"user":{"login":"clicman","id":1079535,"avatar_url":"https://avatars.githubusercontent.com/u/1079535?v=3","gravatar_id":"","url":"https://api.github.com/users/clicman","html_url":"https://github.com/clicman","followers_url":"https://api.github.com/users/clicman/followers","following_url":"https://api.github.com/users/clicman/following{/other_user}","gists_url":"https://api.github.com/users/clicman/gists{/gist_id}","starred_url":"https://api.github.com/users/clicman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clicman/subscriptions","organizations_url":"https://api.github.com/users/clicman/orgs","repos_url":"https://api.github.com/users/clicman/repos","events_url":"https://api.github.com/users/clicman/events{/privacy}","received_events_url":"https://api.github.com/users/clicman/received_events","type":"User","site_admin":false},"created_at":"2016-07-02T17:30:27Z","updated_at":"2016-07-02T17:30:27Z","body":"Ok. I'm using composer only. Tried your suggestion and it doesn't help.\r\nStill works first time only. All another times it returnt Incomplete_Class\r\n"}}
{"actor":{"display_login":"clicman"}}