{"action":"created","issue":{"url":"https://api.github.com/repos/wimg/PHPCompatibility/issues/601","repository_url":"https://api.github.com/repos/wimg/PHPCompatibility","labels_url":"https://api.github.com/repos/wimg/PHPCompatibility/issues/601/labels{/name}","comments_url":"https://api.github.com/repos/wimg/PHPCompatibility/issues/601/comments","events_url":"https://api.github.com/repos/wimg/PHPCompatibility/issues/601/events","html_url":"https://github.com/wimg/PHPCompatibility/issues/601","id":301506410,"number":601,"title":"Add a new sniff category / Function call parameter value sniffs","user":{"login":"jrfnl","id":663378,"avatar_url":"https://avatars1.githubusercontent.com/u/663378?v=4","gravatar_id":"","url":"https://api.github.com/users/jrfnl","html_url":"https://github.com/jrfnl","followers_url":"https://api.github.com/users/jrfnl/followers","following_url":"https://api.github.com/users/jrfnl/following{/other_user}","gists_url":"https://api.github.com/users/jrfnl/gists{/gist_id}","starred_url":"https://api.github.com/users/jrfnl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrfnl/subscriptions","organizations_url":"https://api.github.com/users/jrfnl/orgs","repos_url":"https://api.github.com/users/jrfnl/repos","events_url":"https://api.github.com/users/jrfnl/events{/privacy}","received_events_url":"https://api.github.com/users/jrfnl/received_events","type":"User","site_admin":false},"labels":[{"id":860731105,"url":"https://api.github.com/repos/wimg/PHPCompatibility/labels/meta","name":"meta","color":"6212ed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-01T18:13:41Z","updated_at":"2018-03-25T09:54:25Z","closed_at":null,"author_association":"COLLABORATOR","body":"Historically, all sniffs for the PHPCompatibility library have been in the `PHP` category.\r\nThere are now 60+ sniffs in that category and that category is the only one used.\r\n\r\nSniff libraries have the freedom to add their own categories.\r\n\r\nI'm currently working on a sniff to solve #475, #553, #557 and #559, all of which deal with examining the values of parameters.\r\n\r\nWhile looking at some of the changelogs, I believe there are more things we could sniff for by examining the values passed as parameters to function calls.\r\n\r\nMy current line of thinking leads me to a structural choice for the directory layout of the library, so I would like some opinions on this.\r\n\r\nThere's basically two ways of going about solving this:\r\n1. Create one `PHP.FunctionParameterValues` sniff which sniffs for all the functions and has dedicated methods to examine each function/change.\r\n    This will very quickly become an enormous sniff and probably quite unwieldy.\r\n2. Create an abstract base sniff and concrete child sniffs for each typical parameter value change.\r\n    This would mean adding quite a lot of new sniffs which each would have to have a unique name in an already full category.\r\n\r\nWhich brings me to the topic of this issue: what about adding a new category `ParameterValues` (or something like that) ?\r\n\r\nWe could then gather all those new sniffs which examine function call parameter values in that one category.\r\n\r\nOf the existing sniffs, there are a number of candidates to move to such a new category (as well as to use the abstract sniff):\r\n* `ConstantArraysUsingDefine`\r\n* `MbstringReplaceEModifier`\r\n* `PregReplaceEModifier`\r\n\r\nAnd maybe:\r\n* `ForbiddenCallTimePassByReference`\r\n\r\nIf these sniffs would be moved, I suggest we do so in a version `9.0.0`.\r\n\r\nFor now, the exceptions would be the `DeprecatedIniDirectives`, `NewIniDirectives`, `NewHashAlgorithms` and `RemovedHashAlgorithms` sniffs.\r\nWhile of the same ilk, these sniffs - IMHO - benefit more from extending the abstract `ComplexVersion` sniff as they do now."},"comment":{"url":"https://api.github.com/repos/wimg/PHPCompatibility/issues/comments/375958275","html_url":"https://github.com/wimg/PHPCompatibility/issues/601#issuecomment-375958275","issue_url":"https://api.github.com/repos/wimg/PHPCompatibility/issues/601","id":375958275,"user":{"login":"MarkMaldaba","id":1492120,"avatar_url":"https://avatars0.githubusercontent.com/u/1492120?v=4","gravatar_id":"","url":"https://api.github.com/users/MarkMaldaba","html_url":"https://github.com/MarkMaldaba","followers_url":"https://api.github.com/users/MarkMaldaba/followers","following_url":"https://api.github.com/users/MarkMaldaba/following{/other_user}","gists_url":"https://api.github.com/users/MarkMaldaba/gists{/gist_id}","starred_url":"https://api.github.com/users/MarkMaldaba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarkMaldaba/subscriptions","organizations_url":"https://api.github.com/users/MarkMaldaba/orgs","repos_url":"https://api.github.com/users/MarkMaldaba/repos","events_url":"https://api.github.com/users/MarkMaldaba/events{/privacy}","received_events_url":"https://api.github.com/users/MarkMaldaba/received_events","type":"User","site_admin":false},"created_at":"2018-03-25T09:54:25Z","updated_at":"2018-03-25T09:54:25Z","author_association":"CONTRIBUTOR","body":">> ... and perhaps for test isolation if that is supported\r\n>\r\n>That's already handled differently and should not play a role in the decision here.\r\n>All tests now have @group annotations allowing selective running of one or more groups of tests \r\n>instead of always having to run the complete set.\r\n\r\nI actually meant tests as in sniffs, as breaking up the sniffs into smaller sub-categories potentially makes wildcarding simpler.  That said, I'm not sure how useful this would be in practice, as you're more likely to want to disable individual tokens within a single sniff, rather than entire categories of sniff.\r\n\r\n> The one thing we have to keep in mind is, that reorganizing the repo for existing sniffs will be a big BC-break\r\n\r\nGood point.  I agree with the cautious approach, in that case."}}
{"actor":{"display_login":"MarkMaldaba"}}