{"action":"created","issue":{"url":"https://api.github.com/repos/Happyr/Doctrine-Specification/issues/145","repository_url":"https://api.github.com/repos/Happyr/Doctrine-Specification","labels_url":"https://api.github.com/repos/Happyr/Doctrine-Specification/issues/145/labels{/name}","comments_url":"https://api.github.com/repos/Happyr/Doctrine-Specification/issues/145/comments","events_url":"https://api.github.com/repos/Happyr/Doctrine-Specification/issues/145/events","html_url":"https://github.com/Happyr/Doctrine-Specification/issues/145","id":220151524,"number":145,"title":"CountOf expects Specification","user":{"login":"peter-gribanov","id":1954436,"avatar_url":"https://avatars2.githubusercontent.com/u/1954436?v=3","gravatar_id":"","url":"https://api.github.com/users/peter-gribanov","html_url":"https://github.com/peter-gribanov","followers_url":"https://api.github.com/users/peter-gribanov/followers","following_url":"https://api.github.com/users/peter-gribanov/following{/other_user}","gists_url":"https://api.github.com/users/peter-gribanov/gists{/gist_id}","starred_url":"https://api.github.com/users/peter-gribanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peter-gribanov/subscriptions","organizations_url":"https://api.github.com/users/peter-gribanov/orgs","repos_url":"https://api.github.com/users/peter-gribanov/repos","events_url":"https://api.github.com/users/peter-gribanov/events{/privacy}","received_events_url":"https://api.github.com/users/peter-gribanov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-04-07T08:55:12Z","updated_at":"2017-04-14T13:08:22Z","closed_at":null,"body":"[CountOf expects Specification](https://github.com/Happyr/Doctrine-Specification/blob/master/src/Spec.php#L340).\r\n\r\nIs not good because impossible use filters as specification for CountOf:\r\n\r\n```php\r\n$total = (int)$contest_vote_rep->match(\r\n    Spec::сountOf(\r\n        Spec::eq('user', $user->getId()\r\n    ),\r\n    new AsSingleScalar()\r\n);\r\n```"},"comment":{"url":"https://api.github.com/repos/Happyr/Doctrine-Specification/issues/comments/294150730","html_url":"https://github.com/Happyr/Doctrine-Specification/issues/145#issuecomment-294150730","issue_url":"https://api.github.com/repos/Happyr/Doctrine-Specification/issues/145","id":294150730,"user":{"login":"peter-gribanov","id":1954436,"avatar_url":"https://avatars2.githubusercontent.com/u/1954436?v=3","gravatar_id":"","url":"https://api.github.com/users/peter-gribanov","html_url":"https://github.com/peter-gribanov","followers_url":"https://api.github.com/users/peter-gribanov/followers","following_url":"https://api.github.com/users/peter-gribanov/following{/other_user}","gists_url":"https://api.github.com/users/peter-gribanov/gists{/gist_id}","starred_url":"https://api.github.com/users/peter-gribanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peter-gribanov/subscriptions","organizations_url":"https://api.github.com/users/peter-gribanov/orgs","repos_url":"https://api.github.com/users/peter-gribanov/repos","events_url":"https://api.github.com/users/peter-gribanov/events{/privacy}","received_events_url":"https://api.github.com/users/peter-gribanov/received_events","type":"User","site_admin":false},"created_at":"2017-04-14T13:08:22Z","updated_at":"2017-04-14T13:08:22Z","body":"Now, for use filters as specification for CountOf need wrap the filters:\r\n\r\n```php\r\n$total = (int)$rep->match(\r\n    Spec::сountOf(\r\n        Spec::andX(\r\n            Spec::eq('user', $user->getId()\r\n        )\r\n    ),\r\n    new AsSingleScalar()\r\n);\r\n```"}}
{"actor":{"display_login":"peter-gribanov"}}