{"action":"created","issue":{"url":"https://api.github.com/repos/scrutinizer-ci/scrutinizer/issues/383","repository_url":"https://api.github.com/repos/scrutinizer-ci/scrutinizer","labels_url":"https://api.github.com/repos/scrutinizer-ci/scrutinizer/issues/383/labels{/name}","comments_url":"https://api.github.com/repos/scrutinizer-ci/scrutinizer/issues/383/comments","events_url":"https://api.github.com/repos/scrutinizer-ci/scrutinizer/issues/383/events","html_url":"https://github.com/scrutinizer-ci/scrutinizer/issues/383","id":155356588,"number":383,"title":"Wrong \"{var} can also be of type boolean; however {FQCN} seem to accept array\"","user":{"login":"chalasr","id":7502063,"avatar_url":"https://avatars.githubusercontent.com/u/7502063?v=3","gravatar_id":"","url":"https://api.github.com/users/chalasr","html_url":"https://github.com/chalasr","followers_url":"https://api.github.com/users/chalasr/followers","following_url":"https://api.github.com/users/chalasr/following{/other_user}","gists_url":"https://api.github.com/users/chalasr/gists{/gist_id}","starred_url":"https://api.github.com/users/chalasr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chalasr/subscriptions","organizations_url":"https://api.github.com/users/chalasr/orgs","repos_url":"https://api.github.com/users/chalasr/repos","events_url":"https://api.github.com/users/chalasr/events{/privacy}","received_events_url":"https://api.github.com/users/chalasr/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-17T20:41:37Z","updated_at":"2016-05-17T21:37:59Z","closed_at":"2016-05-17T21:37:59Z","body":"I have the following class:\r\n\r\n```php\r\n<?php\r\n\r\nclass Foo {\r\n    public function __construct(array $var) {\r\n        // ...\r\n    }\r\n}\r\n```\r\n\r\nAnd the following method:\r\n\r\n```php\r\n<?php\r\n\r\n/**\r\n * array|bool $var\r\n */\r\npublic function doSomething ($var) {\r\n    if (!$var) {\r\n        return false;\r\n    }\r\n\r\n   return new Foo($var);\r\n}\r\n```\r\n\r\nI get this patch :\r\n\r\n> [Bug] It seems like $var defined by {random method calling `doSomething()`} on line {line} can also be of type boolean; however, Foo::__construct() does only seem to accept array, maybe add an additional type check?\r\n\r\nIn fact, `Foo::__construct()` cannot receive a boolean in `doSomething()`.\r\n\r\n[The real analysis](https://scrutinizer-ci.com/g/lexik/LexikJWTAuthenticationBundle/inspections/6c993f39-9bd0-4176-967a-2c339037e17d/issues/files/Services/JWTManager.php?status=new&orderField=path&order=asc&honorSelectedPaths=0) (will be quickly unavailable)"},"comment":{"url":"https://api.github.com/repos/scrutinizer-ci/scrutinizer/issues/comments/219862217","html_url":"https://github.com/scrutinizer-ci/scrutinizer/issues/383#issuecomment-219862217","issue_url":"https://api.github.com/repos/scrutinizer-ci/scrutinizer/issues/383","id":219862217,"user":{"login":"chalasr","id":7502063,"avatar_url":"https://avatars.githubusercontent.com/u/7502063?v=3","gravatar_id":"","url":"https://api.github.com/users/chalasr","html_url":"https://github.com/chalasr","followers_url":"https://api.github.com/users/chalasr/followers","following_url":"https://api.github.com/users/chalasr/following{/other_user}","gists_url":"https://api.github.com/users/chalasr/gists{/gist_id}","starred_url":"https://api.github.com/users/chalasr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chalasr/subscriptions","organizations_url":"https://api.github.com/users/chalasr/orgs","repos_url":"https://api.github.com/users/chalasr/repos","events_url":"https://api.github.com/users/chalasr/events{/privacy}","received_events_url":"https://api.github.com/users/chalasr/received_events","type":"User","site_admin":false},"created_at":"2016-05-17T21:37:59Z","updated_at":"2016-05-17T21:37:59Z","body":"Yes, you got it. \r\n\r\nAnd sure, there is nothing to do. I think that I would have liked to have a patch for the inverse side, saying that if `@x` can be only false because not it cannot be `true` and is not checked for `true` in the method, the doc should be `@param false|string` and not `boolstring`.\r\n\r\nOverkill (or impossible), I close this."}}