@@ -46,7 +46,7 @@ class ApiProblemListener extends AbstractListenerAggregate
4646 */
4747 public function __construct ($ filters = null )
4848 {
49- if (!empty ($ filters )) {
49+ if (! empty ($ filters )) {
5050 if (is_string ($ filters )) {
5151 $ this ->acceptFilters = [$ filters ];
5252 }
@@ -81,14 +81,14 @@ public function attach(EventManagerInterface $events, $priority = 1)
8181 */
8282 public function onRender (MvcEvent $ e )
8383 {
84- if (!$ this ->validateErrorEvent ($ e )) {
84+ if (! $ this ->validateErrorEvent ($ e )) {
8585 return ;
8686 }
8787
8888 // Next, do we have a view model in the result?
8989 // If not, nothing more to do.
9090 $ model = $ e ->getResult ();
91- if (!$ model instanceof ModelInterface || $ model instanceof ApiProblemModel) {
91+ if (! $ model instanceof ModelInterface || $ model instanceof ApiProblemModel) {
9292 return ;
9393 }
9494
@@ -122,13 +122,13 @@ public function onDispatch(MvcEvent $e)
122122 $ services = $ app ->getServiceManager ();
123123 $ config = $ services ->get ('config ' );
124124
125- if (!isset ($ config ['zf-api-problem ' ]['render_error_controllers ' ])) {
125+ if (! isset ($ config ['zf-api-problem ' ]['render_error_controllers ' ])) {
126126 return ;
127127 }
128128
129129 $ controller = $ e ->getRouteMatch ()->getParam ('controller ' );
130130 $ controllers = $ config ['zf-api-problem ' ]['render_error_controllers ' ];
131- if (!in_array ($ controller , $ controllers )) {
131+ if (! in_array ($ controller , $ controllers )) {
132132 // The current controller is not in our list of controllers to handle
133133 return ;
134134 }
@@ -150,13 +150,13 @@ public function onDispatch(MvcEvent $e)
150150 */
151151 public function onDispatchError (MvcEvent $ e )
152152 {
153- if (!$ this ->validateErrorEvent ($ e )) {
153+ if (! $ this ->validateErrorEvent ($ e )) {
154154 return ;
155155 }
156156
157157 // Marshall an ApiProblem and view model based on the exception
158158 $ exception = $ e ->getParam ('exception ' );
159- if (!$ exception instanceof \Exception) {
159+ if (! $ exception instanceof \Exception) {
160160 // If it's not an exception, do not know what to do.
161161 return ;
162162 }
@@ -178,24 +178,24 @@ public function onDispatchError(MvcEvent $e)
178178 protected function validateErrorEvent (MvcEvent $ e )
179179 {
180180 // only worried about error pages
181- if (!$ e ->isError ()) {
181+ if (! $ e ->isError ()) {
182182 return false ;
183183 }
184184
185185 // and then, only if we have an Accept header...
186186 $ request = $ e ->getRequest ();
187- if (!$ request instanceof HttpRequest) {
187+ if (! $ request instanceof HttpRequest) {
188188 return false ;
189189 }
190190
191191 $ headers = $ request ->getHeaders ();
192- if (!$ headers ->has ('Accept ' )) {
192+ if (! $ headers ->has ('Accept ' )) {
193193 return false ;
194194 }
195195
196196 // ... that matches certain criteria
197197 $ accept = $ headers ->get ('Accept ' );
198- if (!$ this ->matchAcceptCriteria ($ accept )) {
198+ if (! $ this ->matchAcceptCriteria ($ accept )) {
199199 return false ;
200200 }
201201
0 commit comments