{"action":"closed","issue":{"url":"https://api.github.com/repos/K-Phoen/rulerz/issues/3","labels_url":"https://api.github.com/repos/K-Phoen/rulerz/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/K-Phoen/rulerz/issues/3/comments","events_url":"https://api.github.com/repos/K-Phoen/rulerz/issues/3/events","html_url":"https://github.com/K-Phoen/rulerz/issues/3","id":63092454,"number":3,"title":"Cannot use the same specification multiple times?","user":{"login":"estelsmith","id":363670,"avatar_url":"https://avatars.githubusercontent.com/u/363670?v=3","gravatar_id":"","url":"https://api.github.com/users/estelsmith","html_url":"https://github.com/estelsmith","followers_url":"https://api.github.com/users/estelsmith/followers","following_url":"https://api.github.com/users/estelsmith/following{/other_user}","gists_url":"https://api.github.com/users/estelsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/estelsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/estelsmith/subscriptions","organizations_url":"https://api.github.com/users/estelsmith/orgs","repos_url":"https://api.github.com/users/estelsmith/repos","events_url":"https://api.github.com/users/estelsmith/events{/privacy}","received_events_url":"https://api.github.com/users/estelsmith/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/K-Phoen/rulerz/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/K-Phoen/rulerz/labels/under%20discussion","name":"under discussion","color":"eb6420"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-03-19T21:17:24Z","updated_at":"2015-03-21T18:07:07Z","closed_at":"2015-03-21T18:07:07Z","body":"Hello. I love that someone is finally making a nice specification-pattern library for PHP. However, I have a concern I've ran across.\r\n\r\nIn the example below, it appears that if I want to filter by more than one group, it will overwrite the parameter with the last group that was specified. This effectively makes the specification as if I had set ```$spec``` to ```new GroupSpec('group 2')```.\r\n\r\nAre there any plans to remedy this within the library itself, or is it something users will need to be aware of when writing custom specifications?\r\n\r\n```php\r\nclass GroupSpec implements RulerZ\\Spec\\Specification\r\n{\r\n    private $group;\r\n\r\n    public function __construct($group)\r\n    {\r\n        $this->group = $group;\r\n    }\r\n\r\n    public function getRule()\r\n    {\r\n        return 'group = :group';\r\n    }\r\n\r\n    public function getParameters()\r\n    {\r\n        return [\r\n            'group' => $this->group\r\n        ];\r\n    }\r\n}\r\n\r\n\r\n$spec = new RulerZ\\Spec\\OrX([\r\n    new GroupSpec('group 1'),\r\n    new GroupSpec('group 2')\r\n]);\r\n\r\nvar_dump($spec->getParameters());\r\n/*\r\n * array(1) {\r\n *  'group' =>\r\n *  string(7) \"group 2\"\r\n * }\r\n */\r\n\r\nvar_dump($spec->getRule());\r\n// string(32) \"group = :group OR group = :group\"\r\n```"}}