{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/19273","repository_url":"https://api.github.com/repos/symfony/symfony","labels_url":"https://api.github.com/repos/symfony/symfony/issues/19273/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/19273/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/19273/events","html_url":"https://github.com/symfony/symfony/pull/19273","id":163529696,"number":19273,"title":"[Routing] UrlGenerator: add a method 'hasRoute' to check whether a route exists","user":{"login":"voronkovich","id":2299535,"avatar_url":"https://avatars2.githubusercontent.com/u/2299535?v=4","gravatar_id":"","url":"https://api.github.com/users/voronkovich","html_url":"https://github.com/voronkovich","followers_url":"https://api.github.com/users/voronkovich/followers","following_url":"https://api.github.com/users/voronkovich/following{/other_user}","gists_url":"https://api.github.com/users/voronkovich/gists{/gist_id}","starred_url":"https://api.github.com/users/voronkovich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/voronkovich/subscriptions","organizations_url":"https://api.github.com/users/voronkovich/orgs","repos_url":"https://api.github.com/users/voronkovich/repos","events_url":"https://api.github.com/users/voronkovich/events{/privacy}","received_events_url":"https://api.github.com/users/voronkovich/received_events","type":"User","site_admin":false},"labels":[{"id":100378,"url":"https://api.github.com/repos/symfony/symfony/labels/Feature","name":"Feature","color":"02e10c","default":false},{"id":111254,"url":"https://api.github.com/repos/symfony/symfony/labels/Routing","name":"Routing","color":"DDDDDD","default":false},{"id":237003792,"url":"https://api.github.com/repos/symfony/symfony/labels/Status:%20Needs%20Review","name":"Status: Needs Review","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/symfony/symfony/milestones/17","html_url":"https://github.com/symfony/symfony/milestone/17","labels_url":"https://api.github.com/repos/symfony/symfony/milestones/17/labels","id":2795131,"number":17,"title":"4.1","description":"https://symfony.com/roadmap?version=4.1#checker","creator":{"login":"nicolas-grekas","id":243674,"avatar_url":"https://avatars3.githubusercontent.com/u/243674?v=4","gravatar_id":"","url":"https://api.github.com/users/nicolas-grekas","html_url":"https://github.com/nicolas-grekas","followers_url":"https://api.github.com/users/nicolas-grekas/followers","following_url":"https://api.github.com/users/nicolas-grekas/following{/other_user}","gists_url":"https://api.github.com/users/nicolas-grekas/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolas-grekas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolas-grekas/subscriptions","organizations_url":"https://api.github.com/users/nicolas-grekas/orgs","repos_url":"https://api.github.com/users/nicolas-grekas/repos","events_url":"https://api.github.com/users/nicolas-grekas/events{/privacy}","received_events_url":"https://api.github.com/users/nicolas-grekas/received_events","type":"User","site_admin":false},"open_issues":129,"closed_issues":154,"state":"open","created_at":"2017-09-26T15:40:00Z","updated_at":"2018-02-19T10:00:13Z","due_on":"2018-05-31T07:00:00Z","closed_at":null},"comments":11,"created_at":"2016-07-02T18:07:49Z","updated_at":"2018-02-19T10:16:35Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/19273","html_url":"https://github.com/symfony/symfony/pull/19273","diff_url":"https://github.com/symfony/symfony/pull/19273.diff","patch_url":"https://github.com/symfony/symfony/pull/19273.patch"},"body":"| Q | A |\r\n| --- | --- |\r\n| Branch? | 3.4 |\r\n| Bug fix? | no |\r\n| New feature? | yes |\r\n| BC breaks? | no |\r\n| Deprecations? | no |\r\n| Tests pass? | yes |\r\n| Fixed tickets | - |\r\n| License | MIT |\r\n| Doc PR | - |\r\n\r\nThis method is usefull when you want just to check whether a route exists:\r\n\r\n``` php\r\nif ($router->hasRoute('homepage')) {\r\n    // ...\r\n}\r\n```\r\n\r\nSee https://github.com/symfony/symfony/pull/19270 and https://github.com/symfony/symfony-docs/issues/6710\r\n"},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/366645061","html_url":"https://github.com/symfony/symfony/pull/19273#issuecomment-366645061","issue_url":"https://api.github.com/repos/symfony/symfony/issues/19273","id":366645061,"user":{"login":"nicolas-grekas","id":243674,"avatar_url":"https://avatars3.githubusercontent.com/u/243674?v=4","gravatar_id":"","url":"https://api.github.com/users/nicolas-grekas","html_url":"https://github.com/nicolas-grekas","followers_url":"https://api.github.com/users/nicolas-grekas/followers","following_url":"https://api.github.com/users/nicolas-grekas/following{/other_user}","gists_url":"https://api.github.com/users/nicolas-grekas/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolas-grekas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolas-grekas/subscriptions","organizations_url":"https://api.github.com/users/nicolas-grekas/orgs","repos_url":"https://api.github.com/users/nicolas-grekas/repos","events_url":"https://api.github.com/users/nicolas-grekas/events{/privacy}","received_events_url":"https://api.github.com/users/nicolas-grekas/received_events","type":"User","site_admin":false},"created_at":"2018-02-19T10:16:35Z","updated_at":"2018-02-19T10:16:35Z","author_association":"OWNER","body":"I'm really no fan of the extra interface, so 👎 to add it in the Routing component.\r\n\r\nInstead, I'd propose to add a new twig `has_route` function (because the same use case exists in twig templates), and add a `ControllerTrait::hasRoute()` method. For other use cases, the implementation is simple (try/catch) so I ppl could easily create their own helper if needed."}}
{"actor":{"display_login":"nicolas-grekas"}}