{"action":"closed","issue":{"url":"https://api.github.com/repos/Level-2/Router-ModuleJson/issues/7","repository_url":"https://api.github.com/repos/Level-2/Router-ModuleJson","labels_url":"https://api.github.com/repos/Level-2/Router-ModuleJson/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/Level-2/Router-ModuleJson/issues/7/comments","events_url":"https://api.github.com/repos/Level-2/Router-ModuleJson/issues/7/events","html_url":"https://github.com/Level-2/Router-ModuleJson/issues/7","id":224477562,"number":7,"title":"Inherit","user":{"login":"TomBZombie","id":2454540,"avatar_url":"https://avatars0.githubusercontent.com/u/2454540?v=4","gravatar_id":"","url":"https://api.github.com/users/TomBZombie","html_url":"https://github.com/TomBZombie","followers_url":"https://api.github.com/users/TomBZombie/followers","following_url":"https://api.github.com/users/TomBZombie/following{/other_user}","gists_url":"https://api.github.com/users/TomBZombie/gists{/gist_id}","starred_url":"https://api.github.com/users/TomBZombie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomBZombie/subscriptions","organizations_url":"https://api.github.com/users/TomBZombie/orgs","repos_url":"https://api.github.com/users/TomBZombie/repos","events_url":"https://api.github.com/users/TomBZombie/events{/privacy}","received_events_url":"https://api.github.com/users/TomBZombie/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-04-26T13:57:47Z","updated_at":"2017-10-21T12:04:34Z","closed_at":"2017-10-21T12:04:34Z","author_association":"OWNER","body":"@solleer  I really like the inherit feature you added, but shouldn't the merge be the other way around? I have this:\r\n\r\n```json\r\n{\r\n\t\"GET\": {\r\n\t\t\"defaultRoute\": \"index\",\r\n\t\t\"index\": {\r\n\t\t\t\"view\": {\r\n\t\t\t\t\"instanceOf\": \"Transphporm\\\\Builder\",\r\n\t\t\t\t\"constructParams\": [ \r\n\t\t\t\t\t\"Layouts/admin.xml\",\r\n\t\t\t\t\t\"./view/index.tss\"\r\n\t\t\t\t]\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"edit\": {\r\n\t\t\t\"view\": {\r\n\t\t\t\t\"instanceOf\": \"Transphporm\\\\Builder\",\r\n\t\t\t\t\"constructParams\": [ \r\n\t\t\t\t\t\"Layouts/admin.xml\",\r\n\t\t\t\t\t\"./view/edit.tss\"\r\n\t\t\t\t]\r\n\t\t\t},\r\n\t\t\t\"controller\": {\"instanceOf\": \"Level2\\\\MVC\\\\Controller\\\\Form\"},\r\n\t\t\t\"models\": {\r\n\t\t\t\t\"edit\": {\"instanceOf\": \"Admin\\\\Model\\\\Edit\"},\r\n\t\t\t\t\"user\": {\"instanceOf\": \"MVCDemo\\\\User\"}\r\n\t\t\t},\r\n\t\t\t\"action\": \"$1\",\r\n\t\t\t\"defaultAction\": \"main\"\r\n\t\t}\r\n\t},\r\n\t\"POST\": {\r\n\t\t\"edit\": {\r\n\t\t\t\"inherit\": \"GET\",\r\n\t\t\t\"defaultAction\": \"submit\"\r\n\t\t}\r\n\t}\r\n}\r\n```\r\n\r\nEffectively I want to say that POST is identical to GET, but the defaultAction is submit instead of main. This would be solved by changing\r\n\r\n\r\n```php\r\n\t\t\t\t$matchedRoute = (object) array_merge(array)$matchedRoute, (array)$config->$inheritMethod->$routeName);\r\n```\r\n\r\nto\r\n\r\n```php\r\n\t\t\t\t$matchedRoute = (object) array_merge((array)$config->$inheritMethod->$routeName, (array)$matchedRoute);\r\n```\r\n\r\nso that the inherited rules can be overridden. I just wanted to check this won't break anything you've done if I make this change."}}
{"actor":{"display_login":"TomBZombie"}}