@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | */ |
| 136 | 136 | private function getExamplePathFromExampleDirectory($file) |
| 137 | 137 | { |
| 138 | - return getcwd() . DIRECTORY_SEPARATOR . 'examples' . DIRECTORY_SEPARATOR . $file; |
|
| 138 | + return getcwd().DIRECTORY_SEPARATOR.'examples'.DIRECTORY_SEPARATOR.$file; |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | /** |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | */ |
| 149 | 149 | private function constructExamplePath($directory, $file) |
| 150 | 150 | { |
| 151 | - return rtrim($directory, '\\/') . DIRECTORY_SEPARATOR . $file; |
|
| 151 | + return rtrim($directory, '\\/').DIRECTORY_SEPARATOR.$file; |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | /** |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * @var string $summary |
| 30 | 30 | * @var Description $description |
| 31 | 31 | */ |
| 32 | - include(__DIR__ . '/../../examples/01-interpreting-a-simple-docblock.php'); |
|
| 32 | + include(__DIR__.'/../../examples/01-interpreting-a-simple-docblock.php'); |
|
| 33 | 33 | |
| 34 | 34 | $descriptionText = <<<DESCRIPTION |
| 35 | 35 | This is a Description. A Summary and Description are separated by either |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * @var Tag[] $tags |
| 54 | 54 | * @var See[] $seeTags |
| 55 | 55 | */ |
| 56 | - include(__DIR__ . '/../../examples/02-interpreting-tags.php'); |
|
| 56 | + include(__DIR__.'/../../examples/02-interpreting-tags.php'); |
|
| 57 | 57 | |
| 58 | 58 | $this->assertTrue($hasSeeTag); |
| 59 | 59 | $this->assertCount(1, $tags); |
@@ -63,8 +63,8 @@ discard block |
||
| 63 | 63 | $this->assertInstanceOf(See::class, $seeTags[0]); |
| 64 | 64 | |
| 65 | 65 | $seeTag = $seeTags[0]; |
| 66 | - $this->assertSame('\\' . StandardTagFactory::class, (string)$seeTag->getReference()); |
|
| 67 | - $this->assertSame('', (string)$seeTag->getDescription()); |
|
| 66 | + $this->assertSame('\\'.StandardTagFactory::class, (string) $seeTag->getReference()); |
|
| 67 | + $this->assertSame('', (string) $seeTag->getDescription()); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | public function testDescriptionsCanEscapeAtSignsAndClosingBraces() |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | * @var string $foundDescription |
| 78 | 78 | */ |
| 79 | 79 | |
| 80 | - include(__DIR__ . '/../../examples/playing-with-descriptions/02-escaping.php'); |
|
| 80 | + include(__DIR__.'/../../examples/playing-with-descriptions/02-escaping.php'); |
|
| 81 | 81 | $this->assertSame(<<<'DESCRIPTION' |
| 82 | 82 | You can escape the @-sign by surrounding it with braces, for example: @. And escape a closing brace within an |
| 83 | 83 | inline tag by adding an opening brace in front of it like this: }. |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | |
| 62 | 62 | $fixture = new Description($body, $tags); |
| 63 | 63 | |
| 64 | - $this->assertSame($expected, (string)$fixture); |
|
| 64 | + $this->assertSame($expected, (string) $fixture); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /** |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | { |
| 122 | 122 | $fixture = new PropertyWrite('myProperty', new String_(), new Description('Description')); |
| 123 | 123 | |
| 124 | - $this->assertSame('string $myProperty Description', (string)$fixture); |
|
| 124 | + $this->assertSame('string $myProperty Description', (string) $fixture); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | /** |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | $fixture = PropertyWrite::create('string $myProperty My Description', $typeResolver, $descriptionFactory, |
| 144 | 144 | $context); |
| 145 | 145 | |
| 146 | - $this->assertSame('string $myProperty My Description', (string)$fixture); |
|
| 146 | + $this->assertSame('string $myProperty My Description', (string) $fixture); |
|
| 147 | 147 | $this->assertSame('myProperty', $fixture->getVariableName()); |
| 148 | 148 | $this->assertInstanceOf(String_::class, $fixture->getType()); |
| 149 | 149 | $this->assertSame($description, $fixture->getDescription()); |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | { |
| 104 | 104 | $fixture = new Uses(new Fqsen('\DateTime'), new Description('Description')); |
| 105 | 105 | |
| 106 | - $this->assertSame('\DateTime Description', (string)$fixture); |
|
| 106 | + $this->assertSame('\DateTime Description', (string) $fixture); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | $fixture = Uses::create('DateTime My Description', $resolver, $descriptionFactory, $context); |
| 133 | 133 | |
| 134 | - $this->assertSame('\DateTime My Description', (string)$fixture); |
|
| 134 | + $this->assertSame('\DateTime My Description', (string) $fixture); |
|
| 135 | 135 | $this->assertSame($fqsen, $fixture->getReference()); |
| 136 | 136 | $this->assertSame($description, $fixture->getDescription()); |
| 137 | 137 | } |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | { |
| 122 | 122 | $fixture = new PropertyRead('myProperty', new String_(), new Description('Description')); |
| 123 | 123 | |
| 124 | - $this->assertSame('string $myProperty Description', (string)$fixture); |
|
| 124 | + $this->assertSame('string $myProperty Description', (string) $fixture); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | /** |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | $fixture = PropertyRead::create('string $myProperty My Description', $typeResolver, $descriptionFactory, |
| 144 | 144 | $context); |
| 145 | 145 | |
| 146 | - $this->assertSame('string $myProperty My Description', (string)$fixture); |
|
| 146 | + $this->assertSame('string $myProperty My Description', (string) $fixture); |
|
| 147 | 147 | $this->assertSame('myProperty', $fixture->getVariableName()); |
| 148 | 148 | $this->assertInstanceOf(String_::class, $fixture->getType()); |
| 149 | 149 | $this->assertSame($description, $fixture->getDescription()); |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | { |
| 122 | 122 | $fixture = new Author('Mike van Riel', '[email protected]'); |
| 123 | 123 | |
| 124 | - $this->assertSame('Mike van Riel<[email protected]>', (string)$fixture); |
|
| 124 | + $this->assertSame('Mike van Riel<[email protected]>', (string) $fixture); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | /** |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | { |
| 133 | 133 | $fixture = Author::create('Mike van Riel <[email protected]>'); |
| 134 | 134 | |
| 135 | - $this->assertSame('Mike van Riel<[email protected]>', (string)$fixture); |
|
| 135 | + $this->assertSame('Mike van Riel<[email protected]>', (string) $fixture); |
|
| 136 | 136 | $this->assertSame('Mike van Riel', $fixture->getAuthorName()); |
| 137 | 137 | $this->assertSame('[email protected]', $fixture->getEmail()); |
| 138 | 138 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | public function testHasArguments() |
| 100 | 100 | { |
| 101 | 101 | $arguments = [ |
| 102 | - [ 'name' => 'argument1', 'type' => new String_() ] |
|
| 102 | + ['name' => 'argument1', 'type' => new String_()] |
|
| 103 | 103 | ]; |
| 104 | 104 | |
| 105 | 105 | $fixture = new Method('myMethod', $arguments); |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | { |
| 116 | 116 | $arguments = ['argument1']; |
| 117 | 117 | $expected = [ |
| 118 | - [ 'name' => $arguments[0], 'type' => new Void_() ] |
|
| 118 | + ['name' => $arguments[0], 'type' => new Void_()] |
|
| 119 | 119 | ]; |
| 120 | 120 | |
| 121 | 121 | $fixture = new Method('myMethod', $arguments); |
@@ -129,9 +129,9 @@ discard block |
||
| 129 | 129 | */ |
| 130 | 130 | public function testArgumentTypeCanBeInferredAsVoid() |
| 131 | 131 | { |
| 132 | - $arguments = [ [ 'name' => 'argument1' ] ]; |
|
| 132 | + $arguments = [['name' => 'argument1']]; |
|
| 133 | 133 | $expected = [ |
| 134 | - [ 'name' => $arguments[0]['name'], 'type' => new Void_() ] |
|
| 134 | + ['name' => $arguments[0]['name'], 'type' => new Void_()] |
|
| 135 | 135 | ]; |
| 136 | 136 | |
| 137 | 137 | $fixture = new Method('myMethod', $arguments); |
@@ -145,15 +145,15 @@ discard block |
||
| 145 | 145 | public function testRestArgumentIsParsedAsRegularArg() |
| 146 | 146 | { |
| 147 | 147 | $expected = [ |
| 148 | - [ 'name' => 'arg1', 'type' => new Void_() ], |
|
| 149 | - [ 'name' => 'rest', 'type' => new Void_() ], |
|
| 150 | - [ 'name' => 'rest2', 'type' => new Array_() ], |
|
| 148 | + ['name' => 'arg1', 'type' => new Void_()], |
|
| 149 | + ['name' => 'rest', 'type' => new Void_()], |
|
| 150 | + ['name' => 'rest2', 'type' => new Array_()], |
|
| 151 | 151 | ]; |
| 152 | 152 | |
| 153 | 153 | $descriptionFactory = m::mock(DescriptionFactory::class); |
| 154 | 154 | $resolver = new TypeResolver(); |
| 155 | 155 | $context = new Context(''); |
| 156 | - $description = new Description(''); |
|
| 156 | + $description = new Description(''); |
|
| 157 | 157 | $descriptionFactory->shouldReceive('create')->with('', $context)->andReturn($description); |
| 158 | 158 | |
| 159 | 159 | $fixture = Method::create( |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | |
| 236 | 236 | $this->assertSame( |
| 237 | 237 | 'static void myMethod(string $argument1, object $argument2) My Description', |
| 238 | - (string)$fixture |
|
| 238 | + (string) $fixture |
|
| 239 | 239 | ); |
| 240 | 240 | } |
| 241 | 241 | |
@@ -254,10 +254,10 @@ discard block |
||
| 254 | 254 | $resolver = new TypeResolver(); |
| 255 | 255 | $context = new Context(''); |
| 256 | 256 | |
| 257 | - $description = new Description('My Description'); |
|
| 257 | + $description = new Description('My Description'); |
|
| 258 | 258 | $expectedArguments = [ |
| 259 | - [ 'name' => 'argument1', 'type' => new String_() ], |
|
| 260 | - [ 'name' => 'argument2', 'type' => new Void_() ] |
|
| 259 | + ['name' => 'argument1', 'type' => new String_()], |
|
| 260 | + ['name' => 'argument2', 'type' => new Void_()] |
|
| 261 | 261 | ]; |
| 262 | 262 | |
| 263 | 263 | $descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description); |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | $context |
| 270 | 270 | ); |
| 271 | 271 | |
| 272 | - $this->assertSame('static void myMethod(string $argument1, void $argument2) My Description', (string)$fixture); |
|
| 272 | + $this->assertSame('static void myMethod(string $argument1, void $argument2) My Description', (string) $fixture); |
|
| 273 | 273 | $this->assertSame('myMethod', $fixture->getMethodName()); |
| 274 | 274 | $this->assertEquals($expectedArguments, $fixture->getArguments()); |
| 275 | 275 | $this->assertInstanceOf(Void_::class, $fixture->getReturnType()); |
@@ -279,10 +279,10 @@ discard block |
||
| 279 | 279 | public function collectionReturnTypesProvider() |
| 280 | 280 | { |
| 281 | 281 | return [ |
| 282 | - ['int[]', Array_::class, Integer::class, Compound::class], |
|
| 283 | - ['int[][]', Array_::class, Array_::class, Compound::class], |
|
| 282 | + ['int[]', Array_::class, Integer::class, Compound::class], |
|
| 283 | + ['int[][]', Array_::class, Array_::class, Compound::class], |
|
| 284 | 284 | ['Object[]', Array_::class, Object_::class, Compound::class], |
| 285 | - ['array[]', Array_::class, Array_::class, Compound::class], |
|
| 285 | + ['array[]', Array_::class, Array_::class, Compound::class], |
|
| 286 | 286 | ]; |
| 287 | 287 | } |
| 288 | 288 | |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | */ |
| 400 | 400 | public function testCreationFailsIfArgumentRecordContainsInvalidEntry() |
| 401 | 401 | { |
| 402 | - new Method('body', [ [ 'name' => 'myName', 'unknown' => 'nah' ] ]); |
|
| 402 | + new Method('body', [['name' => 'myName', 'unknown' => 'nah']]); |
|
| 403 | 403 | } |
| 404 | 404 | |
| 405 | 405 | /** |
@@ -417,7 +417,7 @@ discard block |
||
| 417 | 417 | $resolver = new TypeResolver(); |
| 418 | 418 | $context = new Context(''); |
| 419 | 419 | |
| 420 | - $description = new Description('My Description'); |
|
| 420 | + $description = new Description('My Description'); |
|
| 421 | 421 | |
| 422 | 422 | $descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description); |
| 423 | 423 | |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | $context |
| 429 | 429 | ); |
| 430 | 430 | |
| 431 | - $this->assertSame('static void myMethod() My Description', (string)$fixture); |
|
| 431 | + $this->assertSame('static void myMethod() My Description', (string) $fixture); |
|
| 432 | 432 | $this->assertSame('myMethod', $fixture->getMethodName()); |
| 433 | 433 | $this->assertEquals([], $fixture->getArguments()); |
| 434 | 434 | $this->assertInstanceOf(Void_::class, $fixture->getReturnType()); |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | { |
| 122 | 122 | $fixture = new Property('myProperty', new String_(), new Description('Description')); |
| 123 | 123 | |
| 124 | - $this->assertSame('string $myProperty Description', (string)$fixture); |
|
| 124 | + $this->assertSame('string $myProperty Description', (string) $fixture); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | /** |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | $fixture = Property::create('string $myProperty My Description', $typeResolver, $descriptionFactory, $context); |
| 144 | 144 | |
| 145 | - $this->assertSame('string $myProperty My Description', (string)$fixture); |
|
| 145 | + $this->assertSame('string $myProperty My Description', (string) $fixture); |
|
| 146 | 146 | $this->assertSame('myProperty', $fixture->getVariableName()); |
| 147 | 147 | $this->assertInstanceOf(String_::class, $fixture->getType()); |
| 148 | 148 | $this->assertSame($description, $fixture->getDescription()); |