Skip to content

Commit

Permalink
Merge pull request #1 from core23/analysis-XVll6B
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
core23 committed Nov 20, 2017
2 parents ed2341d + 85352e0 commit 0ab2621
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/EventListener/ORM/AbstractListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ abstract class AbstractListener implements EventSubscriber
*
* @return bool
*/
final protected function containsTrait(ReflectionClass $reflection, string $class):bool
final protected function containsTrait(ReflectionClass $reflection, string $class): bool
{
do {
$traits = $reflection->getTraitNames();
Expand Down
2 changes: 1 addition & 1 deletion src/EventListener/ORM/ConfirmableListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function getSubscribedEvents()
*
* @throws MappingException
*/
public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs) : void
public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs): void
{
$meta = $eventArgs->getClassMetadata();

Expand Down
2 changes: 1 addition & 1 deletion src/EventListener/ORM/DeletableListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function getSubscribedEvents()
*
* @throws MappingException
*/
public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs) : void
public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs): void
{
$meta = $eventArgs->getClassMetadata();

Expand Down
2 changes: 1 addition & 1 deletion src/EventListener/ORM/LifecycleDateListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function preUpdate(LifecycleEventArgs $args): void
*
* @throws MappingException
*/
public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs) : void
public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs): void
{
$meta = $eventArgs->getClassMetadata();

Expand Down
6 changes: 3 additions & 3 deletions src/EventListener/ORM/SortableListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function preRemove(LifecycleEventArgs $args): void
*
* @throws MappingException
*/
public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs) : void
public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs): void
{
$meta = $eventArgs->getClassMetadata();

Expand All @@ -103,7 +103,7 @@ public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs) : void
* @param LifecycleEventArgs $args
* @param int|null $oldPosition
*/
private function uniquePosition(LifecycleEventArgs $args, ? int $oldPosition = null) : void
private function uniquePosition(LifecycleEventArgs $args, ? int $oldPosition = null): void
{
$entity = $args->getEntity();

Expand Down Expand Up @@ -177,7 +177,7 @@ private function getNextPosition(EntityManager $em, PositionAwareInterface $enti
$qb->andWhere('e.'.$field.' = :'.$field)->setParameter($field, $value);
}

/** @var PositionAwareInterface $result */
/* @var PositionAwareInterface $result */
try {
$result = $qb->getQuery()->getOneOrNullResult();
} catch (NonUniqueResultException $ignored) {
Expand Down
3 changes: 2 additions & 1 deletion src/Manager/BaseQueryTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,12 @@ public function addOrder(QueryBuilder $builder, array $sort, string $defaultEnti
$table = $defaultEntity;

// Map entity to table name
if (count($fieldSpl) === 2) {
if (2 === count($fieldSpl)) {
foreach ($aliasMapping as $k => $v) {
if ($fieldSpl[0] === $k) {
$table = $v;
$field = $fieldSpl[1];

break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Manager/SearchQueryTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function searchWhere(QueryBuilder $qb, string $field, array $values, bool
* @param string $word
* @param int $index
*/
private function buildLikeExpressions(QueryBuilder $qb, Orx $orx, string $field, string $word, int $index) : void
private function buildLikeExpressions(QueryBuilder $qb, Orx $orx, string $field, string $word, int $index): void
{
$orx->add(sprintf('%s LIKE :name'.$index.'_any', $field));
$orx->add(sprintf('%s LIKE :name'.$index.'_pre', $field));
Expand Down
2 changes: 1 addition & 1 deletion src/Model/ConfirmableInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ public function setConfirmed(bool $confirmed);
*
* @return bool
*/
public function isConfirmed() : bool;
public function isConfirmed(): bool;
}
2 changes: 1 addition & 1 deletion src/Model/DeletableInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ public function setDeleted(bool $deleted);
*
* @return bool
*/
public function isDeleted() : bool;
public function isDeleted(): bool;
}
2 changes: 1 addition & 1 deletion src/Model/LifecycleDateTimeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function getCreatedAt(): ? \DateTime;
*
* @return \DateTime|null
*/
public function getUpdatedAt() : ? \DateTime;
public function getUpdatedAt(): ? \DateTime;

/**
* Set createdAt.
Expand Down
2 changes: 1 addition & 1 deletion src/Model/PositionAwareInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ public function setPosition(? int $position);
*
* @return string[]
*/
public function getPositionGroup() : array;
public function getPositionGroup(): array;
}
4 changes: 2 additions & 2 deletions src/Model/Traits/ConfirmableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ public function setConfirmed(bool $confirmed)
*
* @return bool
*/
public function isConfirmed() : bool
public function isConfirmed(): bool
{
return $this->confirmedAt !== null;
return null !== $this->confirmedAt;
}
}
4 changes: 2 additions & 2 deletions src/Model/Traits/DeleteableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ public function setDeleted(bool $deleted)
*
* @return bool
*/
public function isDeleted() : bool
public function isDeleted(): bool
{
return $this->deletedAt !== null;
return null !== $this->deletedAt;
}
}
4 changes: 2 additions & 2 deletions src/Model/Traits/LifecycleDateTimeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function setCreatedAt(? \DateTime $createdAt)
*
* @return \DateTime|null
*/
public function getCreatedAt() : ? \DateTime
public function getCreatedAt(): ? \DateTime
{
return $this->createdAt;
}
Expand All @@ -64,7 +64,7 @@ public function setUpdatedAt(? \DateTime $updatedAt)
*
* @return \DateTime|null
*/
public function getUpdatedAt() : ? \DateTime
public function getUpdatedAt(): ? \DateTime
{
return $this->updatedAt;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Model/Traits/SortableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ public function setPosition(? int $position)
/**
* @return int|null
*/
public function getPosition() : int
public function getPosition(): int
{
return $this->position;
}

/**
* @return array
*/
public function getPositionGroup() : array
public function getPositionGroup(): array
{
return array();
}
Expand Down

0 comments on commit 0ab2621

Please sign in to comment.