{"action":"created","issue":{"url":"https://api.github.com/repos/zendframework/zend-code/issues/67","repository_url":"https://api.github.com/repos/zendframework/zend-code","labels_url":"https://api.github.com/repos/zendframework/zend-code/issues/67/labels{/name}","comments_url":"https://api.github.com/repos/zendframework/zend-code/issues/67/comments","events_url":"https://api.github.com/repos/zendframework/zend-code/issues/67/events","html_url":"https://github.com/zendframework/zend-code/issues/67","id":161666252,"number":67,"title":"v3 only: Unknown Notices from ClassScanner","user":{"login":"aight8","id":1138623,"avatar_url":"https://avatars.githubusercontent.com/u/1138623?v=3","gravatar_id":"","url":"https://api.github.com/users/aight8","html_url":"https://github.com/aight8","followers_url":"https://api.github.com/users/aight8/followers","following_url":"https://api.github.com/users/aight8/following{/other_user}","gists_url":"https://api.github.com/users/aight8/gists{/gist_id}","starred_url":"https://api.github.com/users/aight8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aight8/subscriptions","organizations_url":"https://api.github.com/users/aight8/orgs","repos_url":"https://api.github.com/users/aight8/repos","events_url":"https://api.github.com/users/aight8/events{/privacy}","received_events_url":"https://api.github.com/users/aight8/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-06-22T12:15:58Z","updated_at":"2016-08-15T10:41:27Z","closed_at":null,"body":"```PHP\r\nNotice: Undefined offset: 585 in /var/www/.../current/vendor/zendframework/zend-code/src/Scanner/ClassScanner.php on line 939\r\n\r\nNotice: Uninitialized string offset: 1 in /var/www/.../current/vendor/zendframework/zend-code/src/Scanner/ClassScanner.php on line 971\r\n\r\nNotice: Uninitialized string offset: 1 in /var/www/.../current/vendor/zendframework/zend-code/src/Scanner/ClassScanner.php on line 971\r\n\r\nNotice: Uninitialized string offset: 1 in /var/www/.../current/vendor/zendframework/zend-code/src/Scanner/ClassScanner.php on line 971\r\n\r\nNotice: Undefined offset: 267 in /var/www/.../current/vendor/zendframework/zend-code/src/Scanner/ClassScanner.php on line 939\r\n```\r\n\r\nBTW: I just added a new directory to scan via the great zend annotation module but it fails with a fatal exception in the ClassScanner. Is it possible to add more accurate error messages which make it simple to locate the file?\r\n\r\n**edit**:\r\n- Error when folder contains empty file.\r\n- Notice:\r\n```PHP\r\nNotice: Uninitialized string offset: 1 in /var/www/.../current/vendor/zendframework/zend-code/src/Scanner/TokenArrayScanner.php on line 582 Notice: Uninitialized string offset: 1 in /var/www/.../current/vendor/zendframework/zend-code/src/Scanner/TokenArrayScanner.php on line 582\r\n```\r\nwhen you have a php config file with ::class syntax:\r\n```PHP\r\n<?php\r\n\r\nreturn [\r\n    'xxxx' => [\r\n        'zzzz' => [\r\n            'source_class' => \\Test\\Bla::class\r\n        ]\r\n    ]\r\n];\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/zendframework/zend-code/issues/comments/239774756","html_url":"https://github.com/zendframework/zend-code/issues/67#issuecomment-239774756","issue_url":"https://api.github.com/repos/zendframework/zend-code/issues/67","id":239774756,"user":{"login":"alex-oleshkevich","id":635848,"avatar_url":"https://avatars.githubusercontent.com/u/635848?v=3","gravatar_id":"","url":"https://api.github.com/users/alex-oleshkevich","html_url":"https://github.com/alex-oleshkevich","followers_url":"https://api.github.com/users/alex-oleshkevich/followers","following_url":"https://api.github.com/users/alex-oleshkevich/following{/other_user}","gists_url":"https://api.github.com/users/alex-oleshkevich/gists{/gist_id}","starred_url":"https://api.github.com/users/alex-oleshkevich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alex-oleshkevich/subscriptions","organizations_url":"https://api.github.com/users/alex-oleshkevich/orgs","repos_url":"https://api.github.com/users/alex-oleshkevich/repos","events_url":"https://api.github.com/users/alex-oleshkevich/events{/privacy}","received_events_url":"https://api.github.com/users/alex-oleshkevich/received_events","type":"User","site_admin":false},"created_at":"2016-08-15T10:41:27Z","updated_at":"2016-08-15T10:41:27Z","body":"@aight8, this issue is when the scanner scans plain php file with \"::class\" token.\r\nfor example:\r\n```php\r\n<?php\r\n\r\nuse App\\Controller\\ErrorController;\r\n\r\nreturn [\r\n    'controllers' => [\r\n        'invokables' => [\r\n            ErrorController::class => ErrorController::class,\r\n        ],\r\n        'aliases' => [\r\n            'ErrorController' => ErrorController::class\r\n        ]\r\n    ],\r\n    'zf_annotation' => [\r\n        'scan_modules' => ['App'],\r\n    ],\r\n];\r\n```\r\n\r\nwill fail as it recognizes \"::class\" as \"class Name\".\r\nas a temporary solution, do not use that and change your code to, eg.:\r\n```php\r\n<?php\r\n\r\nreturn [\r\n    'controllers' => [\r\n        'invokables' => [\r\n            'App\\Controller\\ErrorController' => 'App\\Controller\\ErrorController',\r\n        ],\r\n        'aliases' => [\r\n            'ErrorController' => 'App\\Controller\\ErrorController'\r\n        ]\r\n    ],\r\n    'zf_annotation' => [\r\n        'scan_modules' => ['App'],\r\n    ],\r\n];\r\n```\r\n\r\n![image](https://cloud.githubusercontent.com/assets/635848/17662369/a7a05110-62ed-11e6-823a-6a39edab8db0.png)\r\n\r\n![image](https://cloud.githubusercontent.com/assets/635848/17662352/8bcc162c-62ed-11e6-8d50-208588306f00.png)\r\n"}}
{"actor":{"display_login":"alex-oleshkevich"}}