From a800155450ffb24b66d6f502d8d9177bc2121c06 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 29 Jun 2017 15:36:31 +0200 Subject: [PATCH] Fix spacing around ! operator --- lib/Doctrine/MongoDB/Aggregation/Expr.php | 8 ++++---- lib/Doctrine/MongoDB/Aggregation/Stage/Bucket.php | 2 +- lib/Doctrine/MongoDB/Aggregation/Stage/BucketAuto.php | 2 +- lib/Doctrine/MongoDB/Aggregation/Stage/Facet.php | 4 ++-- lib/Doctrine/MongoDB/GridFS.php | 8 ++++---- lib/Doctrine/MongoDB/Query/Expr.php | 2 +- lib/Doctrine/MongoDB/Util/ReadPreference.php | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/Doctrine/MongoDB/Aggregation/Expr.php b/lib/Doctrine/MongoDB/Aggregation/Expr.php index 456a91af..27de0a84 100644 --- a/lib/Doctrine/MongoDB/Aggregation/Expr.php +++ b/lib/Doctrine/MongoDB/Aggregation/Expr.php @@ -59,7 +59,7 @@ class Expr public function __call($method, $args) { $internalMethodName = $method . 'Internal'; - if (!is_callable([$this, $internalMethodName])) { + if (! is_callable([$this, $internalMethodName])) { throw new \BadMethodCallException('The method ' . $method . ' does not exist.'); } @@ -1203,10 +1203,10 @@ private function requiresSwitchStatement($method = null) $message = ($method ?: 'This method') . ' requires a valid switch statement (call switch() first).'; if ($this->currentField) { - if (!isset($this->expr[$this->currentField]['$switch'])) { + if (! isset($this->expr[$this->currentField]['$switch'])) { throw new \BadMethodCallException($message); } - } elseif (!isset($this->expr['$switch'])) { + } elseif (! isset($this->expr['$switch'])) { throw new \BadMethodCallException($message); } } @@ -1612,7 +1612,7 @@ protected function switchInternal() */ protected function thenInternal($expression) { - if (!is_array($this->switchBranch)) { + if (! is_array($this->switchBranch)) { throw new \BadMethodCallException(static::class . '::then requires a valid case statement (call case() first).'); } diff --git a/lib/Doctrine/MongoDB/Aggregation/Stage/Bucket.php b/lib/Doctrine/MongoDB/Aggregation/Stage/Bucket.php index c3a27274..b2b0f90f 100644 --- a/lib/Doctrine/MongoDB/Aggregation/Stage/Bucket.php +++ b/lib/Doctrine/MongoDB/Aggregation/Stage/Bucket.php @@ -83,7 +83,7 @@ public function defaultBucket($default) */ public function output() { - if (!$this->output) { + if (! $this->output) { $this->output = new Stage\Bucket\BucketOutput($this->builder, $this); } diff --git a/lib/Doctrine/MongoDB/Aggregation/Stage/BucketAuto.php b/lib/Doctrine/MongoDB/Aggregation/Stage/BucketAuto.php index 424e53f9..eab7cc7c 100644 --- a/lib/Doctrine/MongoDB/Aggregation/Stage/BucketAuto.php +++ b/lib/Doctrine/MongoDB/Aggregation/Stage/BucketAuto.php @@ -78,7 +78,7 @@ public function granularity($granularity) */ public function output() { - if (!$this->output) { + if (! $this->output) { $this->output = new Stage\Bucket\BucketAutoOutput($this->builder, $this); } diff --git a/lib/Doctrine/MongoDB/Aggregation/Stage/Facet.php b/lib/Doctrine/MongoDB/Aggregation/Stage/Facet.php index 1a974ae2..c08bf45c 100644 --- a/lib/Doctrine/MongoDB/Aggregation/Stage/Facet.php +++ b/lib/Doctrine/MongoDB/Aggregation/Stage/Facet.php @@ -71,7 +71,7 @@ public function field($field) */ public function pipeline($builder) { - if (!$this->field) { + if (! $this->field) { throw new \LogicException(__METHOD__ . ' requires you set a current field using field().'); } @@ -79,7 +79,7 @@ public function pipeline($builder) $builder = $builder->builder; } - if (!$builder instanceof Builder) { + if (! $builder instanceof Builder) { throw new \InvalidArgumentException(__METHOD__ . ' expects either an aggregation builder or an aggregation stage.'); } diff --git a/lib/Doctrine/MongoDB/GridFS.php b/lib/Doctrine/MongoDB/GridFS.php index 60f9ad64..49c04aa0 100644 --- a/lib/Doctrine/MongoDB/GridFS.php +++ b/lib/Doctrine/MongoDB/GridFS.php @@ -268,7 +268,7 @@ protected function doUpdate(array $query, array $newObj, array $options = []) /* If findAndRemove() returned nothing (no match or removal), create * a new document with the query's "_id" if available. */ - if (!isset($document)) { + if (! isset($document)) { /* If $newObj had modifiers, we'll need to do an update later, * so default to an empty array for now. Otherwise, we can do * without that update and store $newObj now. @@ -279,11 +279,11 @@ protected function doUpdate(array $query, array $newObj, array $options = []) * or $newObj, we can use that instead of having storeFile() * generate one. */ - if (!isset($document['_id']) && isset($query['_id'])) { + if (! isset($document['_id']) && isset($query['_id'])) { $document['_id'] = $query['_id']; } - if (!isset($document['_id']) && isset($newObj['_id'])) { + if (! isset($document['_id']) && isset($newObj['_id'])) { $document['_id'] = $newObj['_id']; } } @@ -291,7 +291,7 @@ protected function doUpdate(array $query, array $newObj, array $options = []) // Document will definitely have an "_id" after storing the file. $this->storeFile($file, $document); - if (!$newObjHasModifiers) { + if (! $newObjHasModifiers) { /* TODO: MongoCollection::update() would return a boolean if * $newObj was not empty, or an array describing the update * operation. Improvise, since we only stored the file and that diff --git a/lib/Doctrine/MongoDB/Query/Expr.php b/lib/Doctrine/MongoDB/Query/Expr.php index 806af9f6..eb2be5ba 100644 --- a/lib/Doctrine/MongoDB/Query/Expr.php +++ b/lib/Doctrine/MongoDB/Query/Expr.php @@ -359,7 +359,7 @@ public function comment($comment) */ public function currentDate($type = 'date') { - if (!in_array($type, ['date', 'timestamp'])) { + if (! in_array($type, ['date', 'timestamp'])) { throw new InvalidArgumentException('Type for currentDate operator must be date or timestamp.'); } diff --git a/lib/Doctrine/MongoDB/Util/ReadPreference.php b/lib/Doctrine/MongoDB/Util/ReadPreference.php index bc7d8509..43a6185c 100644 --- a/lib/Doctrine/MongoDB/Util/ReadPreference.php +++ b/lib/Doctrine/MongoDB/Util/ReadPreference.php @@ -61,7 +61,7 @@ private function __construct() {} */ public static function convertNumericType($type) { - if (!isset(self::$types[$type])) { + if (! isset(self::$types[$type])) { throw new \InvalidArgumentException('Unknown numeric read preference type: ' . $type); } @@ -118,7 +118,7 @@ public static function convertTagSets(array $tagSets) * does not contain a colon character, we can assume this tag set is * already in the format expected by setReadPreference(). */ - if (!isset($tagSet[0]) || false === strpos($tagSet[0], ':')) { + if (! isset($tagSet[0]) || false === strpos($tagSet[0], ':')) { return $tagSet; }