{"action":"created","issue":{"url":"https://api.github.com/repos/vimeo/psalm/issues/510","repository_url":"https://api.github.com/repos/vimeo/psalm","labels_url":"https://api.github.com/repos/vimeo/psalm/issues/510/labels{/name}","comments_url":"https://api.github.com/repos/vimeo/psalm/issues/510/comments","events_url":"https://api.github.com/repos/vimeo/psalm/issues/510/events","html_url":"https://github.com/vimeo/psalm/issues/510","id":297135028,"number":510,"title":"Discover missing dependencies","user":{"login":"mxr576","id":1755573,"avatar_url":"https://avatars2.githubusercontent.com/u/1755573?v=4","gravatar_id":"","url":"https://api.github.com/users/mxr576","html_url":"https://github.com/mxr576","followers_url":"https://api.github.com/users/mxr576/followers","following_url":"https://api.github.com/users/mxr576/following{/other_user}","gists_url":"https://api.github.com/users/mxr576/gists{/gist_id}","starred_url":"https://api.github.com/users/mxr576/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mxr576/subscriptions","organizations_url":"https://api.github.com/users/mxr576/orgs","repos_url":"https://api.github.com/users/mxr576/repos","events_url":"https://api.github.com/users/mxr576/events{/privacy}","received_events_url":"https://api.github.com/users/mxr576/received_events","type":"User","site_admin":false},"labels":[{"id":486061586,"url":"https://api.github.com/repos/vimeo/psalm/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-14T15:22:46Z","updated_at":"2018-02-14T17:16:59Z","closed_at":"2018-02-14T16:21:47Z","author_association":"NONE","body":"It occurred that my library had a missing dependency in its composer.json. It has not been discovered until somebody did not install it without dev dependencies, because one of the dev dependencies of my library has installed that missing, but required dependency as its dependency. After this problem had been discovered I tried to update my Travis script to run Psalm on an installation of my library where dev dependencies are not being installed. I hoped Psalm will be able to find missing dependencies in my library because I think it should be discoverable by static code analysis if a used class does not exist.\r\nActually, it did not find the missing dependency.\r\n\r\n```sh\r\n/var/www/html$ vendor/bin/psalm --version\r\nPsalm 0.3.93@a8ab9728898f529914c83d968f8b3d14af862e65\r\n```\r\n\r\n\r\nIf I try to run an example script from my library I clearly got a PHP error\r\n\r\n```\r\nFatal error: Uncaught Error: Class 'phpDocumentor\\Reflection\\DocBlockFactory' not found in /tmp/test/vendor/symfony/property-info/Extractor/PhpDocExtractor.php on line 56\r\n\r\nError: Class 'phpDocumentor\\Reflection\\DocBlockFactory' not found in /tmp/test/vendor/symfony/property-info/Extractor/PhpDocExtractor.php on line 56\r\n```\r\n The code part that triggers this error is in a constructor:\r\n\r\n ```php\r\n\r\nclass Foo {\r\n   public function __construct()\r\n    {\r\n        $reflectionExtractor = new ReflectionExtractor();\r\n        $phpDocExtractor = new PhpDocExtractor();\r\n\r\n        $this->propertyTypeExtractor = new PropertyInfoExtractor(\r\n            [\r\n                $reflectionExtractor,\r\n                $phpDocExtractor,\r\n            ],\r\n            // Type extractors\r\n            [\r\n                $phpDocExtractor,\r\n                $reflectionExtractor,\r\n            ]\r\n        );\r\n    }\r\n}\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/vimeo/psalm/issues/comments/365679133","html_url":"https://github.com/vimeo/psalm/issues/510#issuecomment-365679133","issue_url":"https://api.github.com/repos/vimeo/psalm/issues/510","id":365679133,"user":{"login":"mxr576","id":1755573,"avatar_url":"https://avatars2.githubusercontent.com/u/1755573?v=4","gravatar_id":"","url":"https://api.github.com/users/mxr576","html_url":"https://github.com/mxr576","followers_url":"https://api.github.com/users/mxr576/followers","following_url":"https://api.github.com/users/mxr576/following{/other_user}","gists_url":"https://api.github.com/users/mxr576/gists{/gist_id}","starred_url":"https://api.github.com/users/mxr576/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mxr576/subscriptions","organizations_url":"https://api.github.com/users/mxr576/orgs","repos_url":"https://api.github.com/users/mxr576/repos","events_url":"https://api.github.com/users/mxr576/events{/privacy}","received_events_url":"https://api.github.com/users/mxr576/received_events","type":"User","site_admin":false},"created_at":"2018-02-14T17:16:59Z","updated_at":"2018-02-14T17:16:59Z","author_association":"NONE","body":"Thanks this was quick.\r\n\r\nI have installed dev-master with Composer from Psalm but it was still unable to find the mentioned problem. Can you double check your implementation?\r\n\r\n```sh\r\n/var/www/html$ composer show vimeo/psalm\r\nname     : vimeo/psalm\r\ndescrip. : A static analysis tool for finding errors in PHP applications\r\nkeywords : code, inspection, php\r\nversions : * dev-master\r\ntype     : library\r\nlicense  : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText\r\nsource   : [git] https://github.com/vimeo/psalm.git be75c143d4a434ea4fc0930f8c1771e8d5830c71\r\ndist     : [zip] https://api.github.com/repos/vimeo/psalm/zipball/be75c143d4a434ea4fc0930f8c1771e8d5830c71 be75c143d4a434ea4fc0930f8c1771e8d5830c71\r\n\r\n```"}}
{"actor":{"display_login":"mxr576"}}