@@ -17,8 +17,8 @@ |
||
17 | 17 | |
18 | 18 | private function __construct(...$objects) |
19 | 19 | { |
20 | - $this->objects = $objects; |
|
21 | - $this->current = 0; |
|
20 | + $this->objects=$objects; |
|
21 | + $this->current=0; |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -62,7 +62,7 @@ |
||
62 | 62 | |
63 | 63 | private function newInstanceFromDeserialization(): object |
64 | 64 | { |
65 | - $class = $this->getName(); |
|
65 | + $class=$this->getName(); |
|
66 | 66 | return unserialize(sprintf( |
67 | 67 | 'O:%d:"%s":0:{}', |
68 | 68 | strlen($class), |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | function creating_instances_without_calling_the_constructor(string $class) |
38 | 38 | { |
39 | - $instance = Instantiator::forThe($class)->instance(); |
|
39 | + $instance=Instantiator::forThe($class)->instance(); |
|
40 | 40 | |
41 | 41 | $this->assertInstanceOf($class, $instance); |
42 | 42 | } |
@@ -47,10 +47,10 @@ discard block |
||
47 | 47 | */ |
48 | 48 | function creating_a_new_instance_on_each_call(string $class) |
49 | 49 | { |
50 | - $instantiator = Instantiator::forThe($class); |
|
50 | + $instantiator=Instantiator::forThe($class); |
|
51 | 51 | |
52 | - $instance1 = $instantiator->instance(); |
|
53 | - $instance2 = $instantiator->instance(); |
|
52 | + $instance1=$instantiator->instance(); |
|
53 | + $instance2=$instantiator->instance(); |
|
54 | 54 | |
55 | 55 | $this->assertEquals($instance1, $instance2); |
56 | 56 | $this->assertNotSame($instance1, $instance2); |
@@ -86,17 +86,17 @@ discard block |
||
86 | 86 | */ |
87 | 87 | function either_throwing_an_exception_in_the_constructor_or_correctly_instantiating( |
88 | 88 | string $class, |
89 | - string $expectedClass = 'N/A', |
|
90 | - string $expectedMessage = 'N/A' |
|
89 | + string $expectedClass='N/A', |
|
90 | + string $expectedMessage='N/A' |
|
91 | 91 | ) { |
92 | 92 | try { |
93 | - $instantiator = Instantiator::forThe($class); |
|
93 | + $instantiator=Instantiator::forThe($class); |
|
94 | 94 | } catch (CannotInstantiateThis $exception) { |
95 | 95 | $this->assertInstanceOf($expectedClass, $exception); |
96 | 96 | $this->assertEquals($expectedMessage, $exception->getMessage()); |
97 | 97 | return; |
98 | 98 | } |
99 | - $instance = $instantiator->instance(); |
|
99 | + $instance=$instantiator->instance(); |
|
100 | 100 | $this->assertInstanceOf($class, $instance); |
101 | 101 | } |
102 | 102 |
@@ -18,9 +18,9 @@ discard block |
||
18 | 18 | /** @test */ |
19 | 19 | function retrieving_the_objects_one_by_one() |
20 | 20 | { |
21 | - $foo1 = new Foo; |
|
22 | - $foo2 = new Foo; |
|
23 | - $instances = PredefinedObjects::use($foo1, $foo2); |
|
21 | + $foo1=new Foo; |
|
22 | + $foo2=new Foo; |
|
23 | + $instances=PredefinedObjects::use($foo1, $foo2); |
|
24 | 24 | |
25 | 25 | $this->assertSame($foo1, $instances->instance()); |
26 | 26 | $this->assertSame($foo2, $instances->instance()); |
@@ -29,10 +29,10 @@ discard block |
||
29 | 29 | /** @test */ |
30 | 30 | function retrieving_the_class_of_the_next_instance() |
31 | 31 | { |
32 | - $foo = new Foo; |
|
33 | - $bar = new Bar; |
|
32 | + $foo=new Foo; |
|
33 | + $bar=new Bar; |
|
34 | 34 | |
35 | - $instances = PredefinedObjects::use($foo, $bar); |
|
35 | + $instances=PredefinedObjects::use($foo, $bar); |
|
36 | 36 | |
37 | 37 | $this->assertSame(Foo::class, $instances->class()); |
38 | 38 | $this->assertInstanceOf(Foo::class, $instances->instance()); |
@@ -44,10 +44,10 @@ discard block |
||
44 | 44 | /** @test */ |
45 | 45 | function throwing_an_exception_when_out_of_objects() |
46 | 46 | { |
47 | - $foo = new Foo; |
|
48 | - $bar = new Bar; |
|
47 | + $foo=new Foo; |
|
48 | + $bar=new Bar; |
|
49 | 49 | |
50 | - $instances = PredefinedObjects::use($foo, $bar); |
|
50 | + $instances=PredefinedObjects::use($foo, $bar); |
|
51 | 51 | |
52 | 52 | $instances->instance(); |
53 | 53 | $instances->instance(); |
@@ -63,10 +63,10 @@ discard block |
||
63 | 63 | /** @test */ |
64 | 64 | function returning_an_empty_string_when_asked_for_the_class_while_out_of_objects() |
65 | 65 | { |
66 | - $foo = new Foo; |
|
67 | - $bar = new Bar; |
|
66 | + $foo=new Foo; |
|
67 | + $bar=new Bar; |
|
68 | 68 | |
69 | - $instances = PredefinedObjects::use($foo, $bar); |
|
69 | + $instances=PredefinedObjects::use($foo, $bar); |
|
70 | 70 | |
71 | 71 | $instances->instance(); |
72 | 72 | $instances->instance(); |