Skip to content

Commit

Permalink
Fix ScrutinizerCS issues
Browse files Browse the repository at this point in the history
  • Loading branch information
josegonzalez committed Dec 28, 2015
1 parent 207235a commit d797bce
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/Listener/ViewListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class ViewListener extends BaseListener
public function beforeFind(Event $event)
{
$this->associations = $this->_associations(array_keys($this->_getRelatedModels()));
if (!$event->subject->query->contain()) {
$event->subject->query->contain($this->_getRelatedModels());
if (!$event->subject()->query->contain()) {
$event->subject()->query->contain($this->_getRelatedModels());
}
}

Expand All @@ -43,8 +43,8 @@ public function beforeFind(Event $event)
public function beforePaginate(Event $event)
{
$this->associations = $this->_associations(array_keys($this->_getRelatedModels()));
if (!$event->subject->query->contain()) {
$event->subject->query->contain($this->_getRelatedModels(['manyToOne', 'oneToOne']));
if (!$event->subject()->query->contain()) {
$event->subject()->query->contain($this->_getRelatedModels(['manyToOne', 'oneToOne']));
}
}

Expand All @@ -60,8 +60,8 @@ public function beforeRender(Event $event)
return;
}

if (!empty($event->subject->entity)) {
$this->_entity = $event->subject->entity;
if (!empty($event->subject()->entity)) {
$this->_entity = $event->subject()->entity;
}

$this->ensureConfig();
Expand Down Expand Up @@ -111,8 +111,8 @@ public function ensureConfig()
*/
public function setFlash(Event $event)
{
unset($event->subject->params['class']);
$event->subject->element = ltrim($event->subject->type);
unset($event->subject()->params['class']);
$event->subject()->element = ltrim($event->subject()->type);
}

/**
Expand Down Expand Up @@ -522,9 +522,9 @@ protected function _deriveFieldFromContext($field)
$controller = $this->_controller();
$entity = $this->_entity();
$request = $this->_request();
$value = null;
$value = $entity->get($field);

if ($value = $entity->get($field)) {
if ($value) {
return $value;
}

Expand Down

0 comments on commit d797bce

Please sign in to comment.