Skip to content

Commit 00ffa5e

Browse files
committed
Remove spaces after logical not operator
1 parent 776d4c2 commit 00ffa5e

File tree

13 files changed

+33
-27
lines changed

13 files changed

+33
-27
lines changed

ruleset.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,10 @@
2121
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.OneParamPerLine" />
2222
<exclude name="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace" />
2323
</rule>
24+
25+
<rule ref="Generic.Formatting.SpaceAfterNot">
26+
<properties>
27+
<property name="spacing" value="0" />
28+
</properties>
29+
</rule>
2430
</ruleset>

src/RefactoringGuru/AbstractFactory/RealWorld/AbstractFactoryRealWorld.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public function __construct(TitleTemplate $titleTemplate)
188188
*/
189189
class TwigPageTemplate extends BasePageTemplate
190190
{
191-
public function getTemplateString(): string
191+
public function getTemplateString(): string
192192
{
193193
$renderedTitle = $this->titleTemplate->getTemplateString();
194194

src/RefactoringGuru/ChainOfResponsibility/RealWorld/ChainOfResponsibilityRealWorld.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function linkWith(Middleware $next): Middleware
102102
*/
103103
public function check(string $email, string $password): bool
104104
{
105-
if (! $this->next) {
105+
if (!$this->next) {
106106
return true;
107107
}
108108

@@ -128,13 +128,13 @@ public function __construct(Server $server)
128128

129129
public function check(string $email, string $password): bool
130130
{
131-
if (! $this->server->hasEmail($email)) {
131+
if (!$this->server->hasEmail($email)) {
132132
echo "UserExistsMiddleware: This email is not registered!\n";
133133

134134
return false;
135135
}
136136

137-
if (! $this->server->isValidPassword($email, $password)) {
137+
if (!$this->server->isValidPassword($email, $password)) {
138138
echo "UserExistsMiddleware: Wrong password!\n";
139139

140140
return false;
@@ -321,4 +321,4 @@ public function isValidPassword(string $email, string $password): bool
321321
echo "Enter your password:\n";
322322
$password = readline();
323323
$success = $server->logIn($email, $password);
324-
} while (! $success);
324+
} while (!$success);

src/RefactoringGuru/Command/RealWorld/CommandRealWorld.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ public function completeCommand(Command $command): void
294294

295295
public function work(): void
296296
{
297-
while (! $this->isEmpty()) {
297+
while (!$this->isEmpty()) {
298298
$command = $this->getCommand();
299299
$command->execute();
300300
}
@@ -308,7 +308,7 @@ public function work(): void
308308
public static function get(): Queue
309309
{
310310
static $instance;
311-
if (! $instance) {
311+
if (!$instance) {
312312
$instance = new Queue;
313313
}
314314

src/RefactoringGuru/Flyweight/RealWorld/FlyweightRealWorld.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ public function getVariation(
319319
): CatVariation {
320320
$key = $this->getKey(get_defined_vars());
321321

322-
if (! isset($this->variations[$key])) {
322+
if (!isset($this->variations[$key])) {
323323
$this->variations[$key] =
324324
new CatVariation($breed, $image, $color, $texture, $fur, $size);
325325
}

src/RefactoringGuru/Flyweight/Structural/FlyweightStructural.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function getFlyweight(array $sharedState): Flyweight
9898
{
9999
$key = $this->getKey($sharedState);
100100

101-
if (! isset($this->flyweights[$key])) {
101+
if (!isset($this->flyweights[$key])) {
102102
echo "FlyweightFactory: Can't find a flyweight, creating new one.\n";
103103
$this->flyweights[$key] = new Flyweight($sharedState);
104104
} else {

src/RefactoringGuru/Iterator/RealWorld/IteratorRealWorld.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public function key(): int
164164
public function next(): bool
165165
{
166166
if (is_resource($this->filePointer)) {
167-
return ! feof($this->filePointer);
167+
return !feof($this->filePointer);
168168
}
169169

170170
return false;
@@ -181,7 +181,7 @@ public function next(): bool
181181
*/
182182
public function valid(): bool
183183
{
184-
if (! $this->next()) {
184+
if (!$this->next()) {
185185
if (is_resource($this->filePointer)) {
186186
fclose($this->filePointer);
187187
}

src/RefactoringGuru/Mediator/RealWorld/MediatorRealWorld.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function __construct()
7373

7474
private function initEventGroup(string &$event = "*"): void
7575
{
76-
if (! isset($this->observers[$event])) {
76+
if (!isset($this->observers[$event])) {
7777
$this->observers[$event] = [];
7878
}
7979
}
@@ -122,7 +122,7 @@ public function trigger(string $event, object $emitter, $data = null): void
122122
function events(): EventDispatcher
123123
{
124124
static $eventDispatcher;
125-
if (! $eventDispatcher) {
125+
if (!$eventDispatcher) {
126126
$eventDispatcher = new EventDispatcher;
127127
}
128128

@@ -219,7 +219,7 @@ public function createUser(array $data, bool $silent = false): User
219219
$user->update(["id" => $id]);
220220
$this->users[$id] = $user;
221221

222-
if (! $silent) {
222+
if (!$silent) {
223223
events()->trigger("users:created", $this, $user);
224224
}
225225

@@ -231,14 +231,14 @@ public function updateUser(User $user, array $data, bool $silent = false): User
231231
echo "UserRepository: Updating a user.\n";
232232

233233
$id = $user->attributes["id"];
234-
if (! isset($this->users[$id])) {
234+
if (!isset($this->users[$id])) {
235235
return null;
236236
}
237237

238238
$user = $this->users[$id];
239239
$user->update($data);
240240

241-
if (! $silent) {
241+
if (!$silent) {
242242
events()->trigger("users:updated", $this, $user);
243243
}
244244

@@ -250,13 +250,13 @@ public function deleteUser(User $user, bool $silent = false): void
250250
echo "UserRepository: Deleting a user.\n";
251251

252252
$id = $user->attributes["id"];
253-
if (! isset($this->users[$id])) {
253+
if (!isset($this->users[$id])) {
254254
return;
255255
}
256256

257257
unset($this->users[$id]);
258258

259-
if (! $silent) {
259+
if (!$silent) {
260260
events()->trigger("users:deleted", $this, $user);
261261
}
262262
}

src/RefactoringGuru/Memento/Structural/MementoStructural.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public function backup(): void
194194

195195
public function undo(): void
196196
{
197-
if (! count($this->mementos)) {
197+
if (!count($this->mementos)) {
198198
return;
199199
}
200200
$memento = array_pop($this->mementos);

src/RefactoringGuru/Observer/RealWorld/ObserverRealWorld.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function __construct()
7272

7373
private function initEventGroup(string $event = "*"): void
7474
{
75-
if (! isset($this->observers[$event])) {
75+
if (!isset($this->observers[$event])) {
7676
$this->observers[$event] = [];
7777
}
7878
}
@@ -142,7 +142,7 @@ public function updateUser(User $user, array $data): User
142142
echo "UserRepository: Updating a user.\n";
143143

144144
$id = $user->attributes["id"];
145-
if (! isset($this->users[$id])) {
145+
if (!isset($this->users[$id])) {
146146
return null;
147147
}
148148

@@ -159,7 +159,7 @@ public function deleteUser(User $user): void
159159
echo "UserRepository: Deleting a user.\n";
160160

161161
$id = $user->attributes["id"];
162-
if (! isset($this->users[$id])) {
162+
if (!isset($this->users[$id])) {
163163
return;
164164
}
165165

src/RefactoringGuru/Observer/Structural/ObserverStructural.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ class ConcreteObserverA implements \SplObserver
178178
{
179179
public function update(\SplSubject $subject): void
180180
{
181-
if (! $subject instanceof Subject) {
181+
if (!$subject instanceof Subject) {
182182
return;
183183
}
184184

@@ -192,7 +192,7 @@ class ConcreteObserverB implements \SplObserver
192192
{
193193
public function update(\SplSubject $subject): void
194194
{
195-
if (! $subject instanceof Subject) {
195+
if (!$subject instanceof Subject) {
196196
return;
197197
}
198198

src/RefactoringGuru/Singleton/Structural/SingletonStructural.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function __wakeup()
6565
public static function getInstance(): Singleton
6666
{
6767
$cls = static::class;
68-
if (! isset(static::$instances[$cls])) {
68+
if (!isset(static::$instances[$cls])) {
6969
static::$instances[$cls] = new static;
7070
}
7171

src/RefactoringGuru/Strategy/RealWorld/StrategyRealWorld.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function get(string $url): void
106106
// значением, переданным в запросе.
107107
$paymentMethod = PaymentFactory::getPaymentMethod($matches[2]);
108108

109-
if (! isset($matches[3])) {
109+
if (!isset($matches[3])) {
110110
$this->getPayment($paymentMethod, $order, $data);
111111
} else {
112112
$this->getPaymentReturn($paymentMethod, $order, $data);
@@ -332,7 +332,7 @@ public function validateReturn(Order $order, array $data): bool
332332
throw new \Exception("Payment key is wrong.");
333333
}
334334

335-
if (! isset($data['success']) || ! $data['success'] || $data['success'] == 'false') {
335+
if (!isset($data['success']) || !$data['success'] || $data['success'] == 'false') {
336336
throw new \Exception("Payment failed.");
337337
}
338338

0 commit comments

Comments
 (0)