{"action":"created","issue":{"url":"https://api.github.com/repos/zendframework/zend-mvc/issues/146","repository_url":"https://api.github.com/repos/zendframework/zend-mvc","labels_url":"https://api.github.com/repos/zendframework/zend-mvc/issues/146/labels{/name}","comments_url":"https://api.github.com/repos/zendframework/zend-mvc/issues/146/comments","events_url":"https://api.github.com/repos/zendframework/zend-mvc/issues/146/events","html_url":"https://github.com/zendframework/zend-mvc/issues/146","id":157905600,"number":146,"title":"Throwable vs. Exception","user":{"login":"PhoneBuster","id":17943903,"avatar_url":"https://avatars.githubusercontent.com/u/17943903?v=3","gravatar_id":"","url":"https://api.github.com/users/PhoneBuster","html_url":"https://github.com/PhoneBuster","followers_url":"https://api.github.com/users/PhoneBuster/followers","following_url":"https://api.github.com/users/PhoneBuster/following{/other_user}","gists_url":"https://api.github.com/users/PhoneBuster/gists{/gist_id}","starred_url":"https://api.github.com/users/PhoneBuster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhoneBuster/subscriptions","organizations_url":"https://api.github.com/users/PhoneBuster/orgs","repos_url":"https://api.github.com/users/PhoneBuster/repos","events_url":"https://api.github.com/users/PhoneBuster/events{/privacy}","received_events_url":"https://api.github.com/users/PhoneBuster/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/zendframework/zend-mvc/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-06-01T13:24:11Z","updated_at":"2016-06-01T14:21:07Z","closed_at":null,"body":"I use zend-mvc 2.7.8. If i have a bad argument in my own factory the framework throws the following error :\r\n\r\n**Fatal error: Uncaught TypeError: Argument 4 passed to Zend\\Mvc\\DispatchListener::marshalBadControllerEvent() must be an instance of Exception, instance of TypeError given...**\r\n\r\nTo fix this i've to change the the argument type in the DispatchListener class (method marshalBadControllerEvent) from \r\n``` php\r\n   protected function marshalBadControllerEvent(\r\n        $controllerName,\r\n        MvcEvent $event,\r\n        Application $application,\r\n        \\Exception $exception\r\n    ) {\r\n        $event->setName(MvcEvent::EVENT_DISPATCH_ERROR);\r\n        $event->setError($application::ERROR_EXCEPTION);\r\n        $event->setController($controllerName);\r\n        $event->setParam('exception', $exception);\r\n\r\n        $events  = $application->getEventManager();\r\n        $results = $events->triggerEvent($event);\r\n        $return  = $results->last();\r\n        if (! $return) {\r\n            return $event->getResult();\r\n        }\r\n\r\n        return $return;\r\n    }\r\n```\r\nto\r\n\r\n``` php\r\n   protected function marshalBadControllerEvent(\r\n        $controllerName,\r\n        MvcEvent $event,\r\n        Application $application,\r\n        Throwable $exception\r\n    ) {\r\n        $event->setName(MvcEvent::EVENT_DISPATCH_ERROR);\r\n        $event->setError($application::ERROR_EXCEPTION);\r\n        $event->setController($controllerName);\r\n        $event->setParam('exception', $exception);\r\n\r\n        $events  = $application->getEventManager();\r\n        $results = $events->triggerEvent($event);\r\n        $return  = $results->last();\r\n        if (! $return) {\r\n            return $event->getResult();\r\n        }\r\n\r\n        return $return;\r\n    }\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/zendframework/zend-mvc/issues/comments/223007491","html_url":"https://github.com/zendframework/zend-mvc/issues/146#issuecomment-223007491","issue_url":"https://api.github.com/repos/zendframework/zend-mvc/issues/146","id":223007491,"user":{"login":"Ocramius","id":154256,"avatar_url":"https://avatars.githubusercontent.com/u/154256?v=3","gravatar_id":"","url":"https://api.github.com/users/Ocramius","html_url":"https://github.com/Ocramius","followers_url":"https://api.github.com/users/Ocramius/followers","following_url":"https://api.github.com/users/Ocramius/following{/other_user}","gists_url":"https://api.github.com/users/Ocramius/gists{/gist_id}","starred_url":"https://api.github.com/users/Ocramius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ocramius/subscriptions","organizations_url":"https://api.github.com/users/Ocramius/orgs","repos_url":"https://api.github.com/users/Ocramius/repos","events_url":"https://api.github.com/users/Ocramius/events{/privacy}","received_events_url":"https://api.github.com/users/Ocramius/received_events","type":"User","site_admin":false},"created_at":"2016-06-01T14:21:07Z","updated_at":"2016-06-01T14:21:07Z","body":"The library still supports some versions of PHP 5.x\n\nMarco Pivetta\n\nhttp://twitter.com/Ocramius\n\nhttp://ocramius.github.com/\n\nOn 1 June 2016 at 15:58, PhoneBuster <notifications@github.com> wrote:\n\n> My PHP Version is 7\n>\n> —\n> You are receiving this because you commented.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/zendframework/zend-mvc/issues/146#issuecomment-223000699>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe/AAJakNH_UrdaiMsQrDm9K4u--IUObNO7ks5qHZAcgaJpZM4Irijo>\n> .\n>\n"}}
{"actor":{"display_login":"Ocramius"}}