Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 5596e1a

Browse files
committed
CS fixes
1 parent 3697e79 commit 5596e1a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+127
-124
lines changed

src/Controller/AbstractActionController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function notFoundAction()
6060
public function onDispatch(MvcEvent $e)
6161
{
6262
$routeMatch = $e->getRouteMatch();
63-
if (!$routeMatch) {
63+
if (! $routeMatch) {
6464
/**
6565
* @todo Determine requirements for when route match is missing.
6666
* Potentially allow pulling directly from request metadata?
@@ -71,7 +71,7 @@ public function onDispatch(MvcEvent $e)
7171
$action = $routeMatch->getParam('action', 'not-found');
7272
$method = static::getMethodFromAction($action);
7373

74-
if (!method_exists($this, $method)) {
74+
if (! method_exists($this, $method)) {
7575
$method = 'notFoundAction';
7676
}
7777

src/Controller/AbstractController.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ abstract public function onDispatch(MvcEvent $e);
8989
public function dispatch(Request $request, Response $response = null)
9090
{
9191
$this->request = $request;
92-
if (!$response) {
92+
if (! $response) {
9393
$response = new HttpResponse();
9494
}
9595
$this->response = $response;
@@ -118,7 +118,7 @@ public function dispatch(Request $request, Response $response = null)
118118
*/
119119
public function getRequest()
120120
{
121-
if (!$this->request) {
121+
if (! $this->request) {
122122
$this->request = new HttpRequest();
123123
}
124124

@@ -132,7 +132,7 @@ public function getRequest()
132132
*/
133133
public function getResponse()
134134
{
135-
if (!$this->response) {
135+
if (! $this->response) {
136136
$this->response = new HttpResponse();
137137
}
138138

@@ -175,7 +175,7 @@ public function setEventManager(EventManagerInterface $events)
175175
*/
176176
public function getEventManager()
177177
{
178-
if (!$this->events) {
178+
if (! $this->events) {
179179
$this->setEventManager(new EventManager());
180180
}
181181

@@ -192,7 +192,7 @@ public function getEventManager()
192192
*/
193193
public function setEvent(Event $e)
194194
{
195-
if (!$e instanceof MvcEvent) {
195+
if (! $e instanceof MvcEvent) {
196196
$eventParams = $e->getParams();
197197
$e = new MvcEvent();
198198
$e->setParams($eventParams);
@@ -210,7 +210,7 @@ public function setEvent(Event $e)
210210
*/
211211
public function getEvent()
212212
{
213-
if (!$this->event) {
213+
if (! $this->event) {
214214
$this->setEvent(new MvcEvent());
215215
}
216216

@@ -224,7 +224,7 @@ public function getEvent()
224224
*/
225225
public function getPluginManager()
226226
{
227-
if (!$this->plugins) {
227+
if (! $this->plugins) {
228228
$this->setPluginManager(new PluginManager(new ServiceManager()));
229229
}
230230

src/Controller/AbstractRestfulController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ public function requestHasContentType(Request $request, $contentType = '')
482482
{
483483
/** @var $headerContentType \Zend\Http\Header\ContentType */
484484
$headerContentType = $request->getHeaders()->get('content-type');
485-
if (!$headerContentType) {
485+
if (! $headerContentType) {
486486
return false;
487487
}
488488

@@ -531,7 +531,7 @@ public function requestHasContentType(Request $request, $contentType = '')
531531
*/
532532
public function addHttpMethodHandler($method, /* Callable */ $handler)
533533
{
534-
if (!is_callable($handler)) {
534+
if (! is_callable($handler)) {
535535
throw new Exception\InvalidArgumentException(sprintf(
536536
'Invalid HTTP method handler: must be a callable; received "%s"',
537537
(is_object($handler) ? get_class($handler) : gettype($handler))
@@ -594,7 +594,7 @@ protected function processBodyContent($request)
594594
parse_str($content, $parsedParams);
595595

596596
// If parse_str fails to decode, or we have a single element with empty value
597-
if (!is_array($parsedParams) || empty($parsedParams)
597+
if (! is_array($parsedParams) || empty($parsedParams)
598598
|| (1 == count($parsedParams) && '' === reset($parsedParams))
599599
) {
600600
return $content;

src/Controller/Plugin/AcceptableViewModelSelector.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ public function getViewModel(
8787
) {
8888
$name = $this->getViewModelName($matchAgainst, $returnDefault, $resultReference);
8989

90-
if (!$name) {
90+
if (! $name) {
9191
return;
9292
}
9393

94-
if (!class_exists($name)) {
94+
if (! class_exists($name)) {
9595
throw new InvalidArgumentException('The supplied View Model could not be found');
9696
}
9797

@@ -133,11 +133,11 @@ public function match(array $matchAgainst = null)
133133
$request = $this->getRequest();
134134
$headers = $request->getHeaders();
135135

136-
if ((!$matchAgainst && !$this->defaultMatchAgainst) || !$headers->has('accept')) {
136+
if ((! $matchAgainst && ! $this->defaultMatchAgainst) || ! $headers->has('accept')) {
137137
return;
138138
}
139139

140-
if (!$matchAgainst) {
140+
if (! $matchAgainst) {
141141
$matchAgainst = $this->defaultMatchAgainst;
142142
}
143143

@@ -240,9 +240,9 @@ protected function getRequest()
240240

241241
$event = $this->getEvent();
242242
$request = $event->getRequest();
243-
if (!$request instanceof Request) {
243+
if (! $request instanceof Request) {
244244
throw new DomainException(
245-
'The event used does not contain a valid Request, but must.'
245+
'The event used does not contain a valid Request, but must.'
246246
);
247247
}
248248

@@ -263,15 +263,15 @@ protected function getEvent()
263263
}
264264

265265
$controller = $this->getController();
266-
if (!$controller instanceof InjectApplicationEventInterface) {
266+
if (! $controller instanceof InjectApplicationEventInterface) {
267267
throw new DomainException(
268-
'A controller that implements InjectApplicationEventInterface '
268+
'A controller that implements InjectApplicationEventInterface '
269269
. 'is required to use ' . __CLASS__
270270
);
271271
}
272272

273273
$event = $controller->getEvent();
274-
if (!$event instanceof MvcEvent) {
274+
if (! $event instanceof MvcEvent) {
275275
$params = $event->getParams();
276276
$event = new MvcEvent();
277277
$event->setParams($params);

src/Controller/Plugin/Forward.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ protected function detachProblemListeners(SharedEvents $sharedEvents)
162162
// Convert the problem list from two-dimensional array to more convenient id => event => class format:
163163
$formattedProblems = [];
164164
foreach ($this->getListenersToDetach() as $current) {
165-
if (!isset($formattedProblems[$current['id']])) {
165+
if (! isset($formattedProblems[$current['id']])) {
166166
$formattedProblems[$current['id']] = [];
167167
}
168-
if (!isset($formattedProblems[$current['id']][$current['event']])) {
168+
if (! isset($formattedProblems[$current['id']][$current['event']])) {
169169
$formattedProblems[$current['id']][$current['event']] = [];
170170
}
171171
$formattedProblems[$current['id']][$current['event']][] = $current['class'];
@@ -181,7 +181,7 @@ protected function detachProblemListeners(SharedEvents $sharedEvents)
181181
$events = $this->getSharedListenersById($id, $eventName, $sharedEvents);
182182
foreach ($events as $priority => $currentPriorityEvents) {
183183
// v2 fix
184-
if (!is_array($currentPriorityEvents)) {
184+
if (! is_array($currentPriorityEvents)) {
185185
$currentPriorityEvents = [$currentPriorityEvents];
186186
}
187187
// v3
@@ -200,7 +200,7 @@ protected function detachProblemListeners(SharedEvents $sharedEvents)
200200
}
201201

202202
// This routine is only valid for object callbacks
203-
if (!is_object($currentCallback)) {
203+
if (! is_object($currentCallback)) {
204204
continue;
205205
}
206206

@@ -260,15 +260,15 @@ protected function getEvent()
260260
}
261261

262262
$controller = $this->getController();
263-
if (!$controller instanceof InjectApplicationEventInterface) {
263+
if (! $controller instanceof InjectApplicationEventInterface) {
264264
throw new Exception\DomainException(sprintf(
265265
'Forward plugin requires a controller that implements InjectApplicationEventInterface; received %s',
266266
(is_object($controller) ? get_class($controller) : var_export($controller, 1))
267267
));
268268
}
269269

270270
$event = $controller->getEvent();
271-
if (!$event instanceof MvcEvent) {
271+
if (! $event instanceof MvcEvent) {
272272
$params = [];
273273
if ($event) {
274274
$params = $event->getParams();

src/Controller/Plugin/Layout.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ protected function getEvent()
6464
}
6565

6666
$controller = $this->getController();
67-
if (!$controller instanceof InjectApplicationEventInterface) {
67+
if (! $controller instanceof InjectApplicationEventInterface) {
6868
throw new Exception\DomainException('Layout plugin requires a controller that implements InjectApplicationEventInterface');
6969
}
7070

7171
$event = $controller->getEvent();
72-
if (!$event instanceof MvcEvent) {
72+
if (! $event instanceof MvcEvent) {
7373
$params = $event->getParams();
7474
$event = new MvcEvent();
7575
$event->setParams($params);
@@ -89,7 +89,7 @@ protected function getViewModel()
8989
{
9090
$event = $this->getEvent();
9191
$viewModel = $event->getViewModel();
92-
if (!$viewModel instanceof Model) {
92+
if (! $viewModel instanceof Model) {
9393
throw new Exception\DomainException('Layout plugin requires that event view model is populated');
9494
}
9595
return $viewModel;

src/Controller/Plugin/Params.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function fromRoute($param = null, $default = null)
105105
{
106106
$controller = $this->getController();
107107

108-
if (!$controller instanceof InjectApplicationEventInterface) {
108+
if (! $controller instanceof InjectApplicationEventInterface) {
109109
throw new RuntimeException(
110110
'Controllers must implement Zend\Mvc\InjectApplicationEventInterface to use this plugin.'
111111
);

src/Controller/Plugin/Redirect.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Redirect extends AbstractPlugin
3636
public function toRoute($route = null, $params = [], $options = [], $reuseMatchedParams = false)
3737
{
3838
$controller = $this->getController();
39-
if (!$controller || !method_exists($controller, 'plugin')) {
39+
if (! $controller || ! method_exists($controller, 'plugin')) {
4040
throw new Exception\DomainException('Redirect plugin requires a controller that defines the plugin() method');
4141
}
4242

@@ -89,7 +89,7 @@ protected function getResponse()
8989

9090
$event = $this->getEvent();
9191
$response = $event->getResponse();
92-
if (!$response instanceof Response) {
92+
if (! $response instanceof Response) {
9393
throw new Exception\DomainException('Redirect plugin requires event compose a response');
9494
}
9595
$this->response = $response;
@@ -109,12 +109,12 @@ protected function getEvent()
109109
}
110110

111111
$controller = $this->getController();
112-
if (!$controller instanceof InjectApplicationEventInterface) {
112+
if (! $controller instanceof InjectApplicationEventInterface) {
113113
throw new Exception\DomainException('Redirect plugin requires a controller that implements InjectApplicationEventInterface');
114114
}
115115

116116
$event = $controller->getEvent();
117-
if (!$event instanceof MvcEvent) {
117+
if (! $event instanceof MvcEvent) {
118118
$params = $event->getParams();
119119
$event = new MvcEvent();
120120
$event->setParams($params);

src/Controller/Plugin/Url.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ class Url extends AbstractPlugin
3636
public function fromRoute($route = null, $params = [], $options = [], $reuseMatchedParams = false)
3737
{
3838
$controller = $this->getController();
39-
if (!$controller instanceof InjectApplicationEventInterface) {
39+
if (! $controller instanceof InjectApplicationEventInterface) {
4040
throw new Exception\DomainException('Url plugin requires a controller that implements InjectApplicationEventInterface');
4141
}
4242

43-
if (!is_array($params)) {
44-
if (!$params instanceof Traversable) {
43+
if (! is_array($params)) {
44+
if (! $params instanceof Traversable) {
4545
throw new Exception\InvalidArgumentException(
4646
'Params is expected to be an array or a Traversable object'
4747
);
@@ -59,7 +59,7 @@ public function fromRoute($route = null, $params = [], $options = [], $reuseMatc
5959
$router = $event->getParam('router', false);
6060
$matches = $event->getParam('route-match', false);
6161
}
62-
if (!$router instanceof RouteStackInterface) {
62+
if (! $router instanceof RouteStackInterface) {
6363
throw new Exception\DomainException('Url plugin requires that controller event compose a router; none found');
6464
}
6565

@@ -69,7 +69,7 @@ public function fromRoute($route = null, $params = [], $options = [], $reuseMatc
6969
}
7070

7171
if ($route === null) {
72-
if (!$matches) {
72+
if (! $matches) {
7373
throw new Exception\RuntimeException('No RouteMatch instance present');
7474
}
7575

src/Controller/PluginManager.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,15 @@ public function getController()
132132
*/
133133
public function injectController($plugin)
134134
{
135-
if (!is_object($plugin)) {
135+
if (! is_object($plugin)) {
136136
return;
137137
}
138-
if (!method_exists($plugin, 'setController')) {
138+
if (! method_exists($plugin, 'setController')) {
139139
return;
140140
}
141141

142142
$controller = $this->getController();
143-
if (!$controller instanceof DispatchableInterface) {
143+
if (! $controller instanceof DispatchableInterface) {
144144
return;
145145
}
146146

0 commit comments

Comments
 (0)