{"action":"created","issue":{"url":"https://api.github.com/repos/bitExpert/pathfinder/issues/12","labels_url":"https://api.github.com/repos/bitExpert/pathfinder/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/bitExpert/pathfinder/issues/12/comments","events_url":"https://api.github.com/repos/bitExpert/pathfinder/issues/12/events","html_url":"https://github.com/bitExpert/pathfinder/issues/12","id":120461819,"number":12,"title":"Adding an interface for custom routes","user":{"login":"geekishmatt","id":5528460,"avatar_url":"https://avatars.githubusercontent.com/u/5528460?v=3","gravatar_id":"","url":"https://api.github.com/users/geekishmatt","html_url":"https://github.com/geekishmatt","followers_url":"https://api.github.com/users/geekishmatt/followers","following_url":"https://api.github.com/users/geekishmatt/following{/other_user}","gists_url":"https://api.github.com/users/geekishmatt/gists{/gist_id}","starred_url":"https://api.github.com/users/geekishmatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geekishmatt/subscriptions","organizations_url":"https://api.github.com/users/geekishmatt/orgs","repos_url":"https://api.github.com/users/geekishmatt/repos","events_url":"https://api.github.com/users/geekishmatt/events{/privacy}","received_events_url":"https://api.github.com/users/geekishmatt/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bitExpert/pathfinder/labels/discussion","name":"discussion","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-04T18:48:09Z","updated_at":"2015-12-04T19:51:45Z","closed_at":null,"body":"At the moment routes must be an instance of \\bitExpert\\Pathfinder\\Route.\r\nI would like to suggest an interface for custom routes which might be defined in this way:\r\n\r\n```php\r\ninterface Route\r\n{\r\n    public function __construct($methods = [], $path = null, $target = null, $matchers = []);\r\n\r\n    public function getPath();\r\n    public function getTarget();\r\n    public function getMethods();\r\n    public function getMatchers();\r\n    public function getName();\r\n\r\n    public function accepting($methods);\r\n    public function refusing($methods);\r\n    public function ifMatches($param, $matchers);\r\n    public function whateverMatches($param);\r\n    public function from($path);\r\n    public function to($target);\r\n    public function named($name);\r\n    public function noName();\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/bitExpert/pathfinder/issues/comments/162065416","html_url":"https://github.com/bitExpert/pathfinder/issues/12#issuecomment-162065416","issue_url":"https://api.github.com/repos/bitExpert/pathfinder/issues/12","id":162065416,"user":{"login":"peterhildenbrand","id":3219267,"avatar_url":"https://avatars.githubusercontent.com/u/3219267?v=3","gravatar_id":"","url":"https://api.github.com/users/peterhildenbrand","html_url":"https://github.com/peterhildenbrand","followers_url":"https://api.github.com/users/peterhildenbrand/followers","following_url":"https://api.github.com/users/peterhildenbrand/following{/other_user}","gists_url":"https://api.github.com/users/peterhildenbrand/gists{/gist_id}","starred_url":"https://api.github.com/users/peterhildenbrand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterhildenbrand/subscriptions","organizations_url":"https://api.github.com/users/peterhildenbrand/orgs","repos_url":"https://api.github.com/users/peterhildenbrand/repos","events_url":"https://api.github.com/users/peterhildenbrand/events{/privacy}","received_events_url":"https://api.github.com/users/peterhildenbrand/received_events","type":"User","site_admin":false},"created_at":"2015-12-04T19:51:45Z","updated_at":"2015-12-04T19:51:45Z","body":"I was thinking about this earlier when I implemented Route, but I don't know if this makes sense because Route is just a dumb configuration storage object. If we used an interface it should only care about the methods the router is using in order to leave the way the configuration is done open to the new implementation. This is the only use case which makes sense to me - Or can you provide another example in which the interface as a whole makes sense?"}}