update deps & install rector

This commit is contained in:
Dominik Liebler
2019-12-14 12:50:05 +01:00
parent 04acce6759
commit 579a5ac946
87 changed files with 2432 additions and 786 deletions

View File

@@ -11,10 +11,8 @@ class Character implements Text
/**
* Any state stored by the concrete flyweight must be independent of its context.
* For flyweights representing characters, this is usually the corresponding character code.
*
* @var string
*/
private $name;
private string $name;
public function __construct(string $name)
{

View File

@@ -7,9 +7,10 @@ use PHPUnit\Framework\TestCase;
class FlyweightTest extends TestCase
{
private $characters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k',
private array $characters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k',
'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
private $fonts = ['Arial', 'Times New Roman', 'Verdana', 'Helvetica'];
private array $fonts = ['Arial', 'Times New Roman', 'Verdana', 'Helvetica'];
public function testFlyweight()
{

View File

@@ -2,16 +2,18 @@
namespace DesignPatterns\Structural\Flyweight;
use Countable;
/**
* A factory manages shared flyweights. Clients should not instantiate them directly,
* but let the factory take care of returning existing objects or creating new ones.
*/
class TextFactory implements \Countable
class TextFactory implements Countable
{
/**
* @var Text[]
*/
private $charPool = [];
private array $charPool = [];
public function get(string $name): Text
{

View File

@@ -4,10 +4,7 @@ namespace DesignPatterns\Structural\Flyweight;
class Word implements Text
{
/**
* @var string
*/
private $name;
private string $name;
public function __construct(string $name)
{