style: Adopt PSR12

Dev dependency flyeralarm/php-code-validator has been removed.

Closes #444
This commit is contained in:
Mario Simão 2021-10-01 10:26:04 -03:00
parent 7c0b7ece07
commit 56970cc221
167 changed files with 511 additions and 226 deletions

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\ChainOfResponsibilities;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\ChainOfResponsibilities\Responsible;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\ChainOfResponsibilities\Responsible;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\ChainOfResponsibilities\Tests;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Command;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Command;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Command;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Command;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Command;
@ -17,7 +19,7 @@ class Receiver
public function write(string $str)
{
if ($this->enableDate) {
$str .= ' ['.date('Y-m-d').']';
$str .= ' [' . date('Y-m-d') . ']';
}
$this->output[] = $str;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Command\Tests;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Command\Tests;
@ -23,11 +25,11 @@ class UndoableCommandTest extends TestCase
$messageDateCommand->execute();
$invoker->run();
$this->assertSame("Hello World\nHello World [".date('Y-m-d').']', $receiver->getOutput());
$this->assertSame("Hello World\nHello World [" . date('Y-m-d') . ']', $receiver->getOutput());
$messageDateCommand->undo();
$invoker->run();
$this->assertSame("Hello World\nHello World [".date('Y-m-d')."]\nHello World", $receiver->getOutput());
$this->assertSame("Hello World\nHello World [" . date('Y-m-d') . "]\nHello World", $receiver->getOutput());
}
}

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Command;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Interpreter;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Interpreter;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Interpreter;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Interpreter;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Interpreter\Tests;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Interpreter;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Iterator;
@ -20,6 +22,6 @@ class Book
public function getAuthorAndTitle(): string
{
return $this->getTitle().' by '.$this->getAuthor();
return $this->getTitle() . ' by ' . $this->getAuthor();
}
}

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Iterator;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Iterator\Tests;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Mediator;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Mediator;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Tests\Mediator\Tests;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Mediator;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Mediator;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Mediator;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Memento;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Memento;
@ -6,10 +8,10 @@ use InvalidArgumentException;
class State implements \Stringable
{
const STATE_CREATED = 'created';
const STATE_OPENED = 'opened';
const STATE_ASSIGNED = 'assigned';
const STATE_CLOSED = 'closed';
public const STATE_CREATED = 'created';
public const STATE_OPENED = 'opened';
public const STATE_ASSIGNED = 'assigned';
public const STATE_CLOSED = 'closed';
private string $state;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Memento\Tests;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Memento;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\NullObject;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\NullObject;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\NullObject;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\NullObject;
@ -14,6 +16,6 @@ class Service
public function doSomething()
{
// notice here that you don't have to check if the logger is set with eg. is_null(), instead just use it
$this->logger->log('We are in '.__METHOD__);
$this->logger->log('We are in ' . __METHOD__);
}
}

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\NullObject\Tests;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Observer\Tests;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Observer;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Observer;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Specification;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Specification;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Specification;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Specification;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Specification;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Specification;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Specification\Tests;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\State;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\State;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\State;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\State;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\State;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\State\Tests;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Strategy;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Strategy;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Strategy;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Strategy;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Strategy\Tests;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\TemplateMethod;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\TemplateMethod;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\TemplateMethod;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\TemplateMethod\Tests;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Visitor;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Visitor;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Visitor;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Visitor;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Tests\Visitor\Tests;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Visitor;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\AbstractFactory\Tests;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\Builder;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\Builder;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\Builder;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\Builder\Parts;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\Builder\Parts;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\Builder\Parts;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\Builder\Parts;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\Builder\Parts;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\Builder\Parts;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\Builder\Tests;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\Builder;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\FactoryMethod;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\FactoryMethod;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\FactoryMethod;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\FactoryMethod;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\FactoryMethod;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\FactoryMethod;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\FactoryMethod\Tests;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\Pool;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\Pool\Tests;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\Pool;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\Prototype;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\Prototype;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\Prototype;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\Prototype\Tests;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\SimpleFactory;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\SimpleFactory;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\SimpleFactory\Tests;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\Singleton;
@ -34,7 +36,7 @@ final class Singleton
private function __clone()
{
}
/**
* prevent from being unserialized (which would create a second instance of it)
*/

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\Singleton\Tests;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\StaticFactory;

View File

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace DesignPatterns\Creational\StaticFactory;

Some files were not shown because too many files have changed in this diff Show More