{"action":"opened","issue":{"url":"https://api.github.com/repos/ovr/phpsa/issues/233","repository_url":"https://api.github.com/repos/ovr/phpsa","labels_url":"https://api.github.com/repos/ovr/phpsa/issues/233/labels{/name}","comments_url":"https://api.github.com/repos/ovr/phpsa/issues/233/comments","events_url":"https://api.github.com/repos/ovr/phpsa/issues/233/events","html_url":"https://github.com/ovr/phpsa/issues/233","id":182201066,"number":233,"title":"[Analyzer] For multiple conditions","user":{"login":"ddmler","id":510150,"avatar_url":"https://avatars.githubusercontent.com/u/510150?v=3","gravatar_id":"","url":"https://api.github.com/users/ddmler","html_url":"https://github.com/ddmler","followers_url":"https://api.github.com/users/ddmler/followers","following_url":"https://api.github.com/users/ddmler/following{/other_user}","gists_url":"https://api.github.com/users/ddmler/gists{/gist_id}","starred_url":"https://api.github.com/users/ddmler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddmler/subscriptions","organizations_url":"https://api.github.com/users/ddmler/orgs","repos_url":"https://api.github.com/users/ddmler/repos","events_url":"https://api.github.com/users/ddmler/events{/privacy}","received_events_url":"https://api.github.com/users/ddmler/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ovr/phpsa/labels/analyzer","name":"analyzer","color":"1d76db"},{"url":"https://api.github.com/repos/ovr/phpsa/labels/hacktoberfest","name":"hacktoberfest","color":"0052cc"},{"url":"https://api.github.com/repos/ovr/phpsa/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-11T08:16:10Z","updated_at":"2016-10-11T08:16:10Z","closed_at":null,"body":"Simple Task: Statement Analyzer for For_ Node.\r\nIt should notice on:\r\n```php\r\nfor($i=0, $j=0; $i<3, $j<2;$i++,$j++){\r\n    echo \"test\"; // 2 times\r\n}\r\n```\r\n\r\nHow to do it:\r\n1. Create Analyzer (you can use this one as a template: https://github.com/ovr/phpsa/blob/master/src/Analyzer/Pass/Statement/GotoUsage.php )\r\nand register it to Stmt\\For_. Now:\r\nCheck that `count($stmt->cond) > 1`\r\n\r\nIf yes write a nice notice message (that you should merge the conditions into one with `&&`), else return false.\r\n\r\n2. Add it to PHPSA\\Analyzer\\Factory (registerStatementPasses)\r\n3. Write Tests (analyze-fixtures directory): One example with equals null and without (again look at the existing ones for statements)\r\n4. Write a chapter in docs/05_Analyzers.md (its sorted alphabetically)\r\n\r\nCheck our Contribution Guide and create a pull request.\r\n\r\nThanks :cake:"}}
{"actor":{"display_login":"ddmler"}}