@@ -33,9 +33,9 @@ discard block |
||
33 | 33 | |
34 | 34 | $check = $this->createMock(FunctionBased::class); |
35 | 35 | $check->expects(self::once()) |
36 | - ->method('__invoke') |
|
37 | - ->with($function, $function) |
|
38 | - ->willReturn(Changes::fromList(Change::removed('foo', true))); |
|
36 | + ->method('__invoke') |
|
37 | + ->with($function, $function) |
|
38 | + ->willReturn(Changes::fromList(Change::removed('foo', true))); |
|
39 | 39 | |
40 | 40 | self::assertEquals( |
41 | 41 | Changes::fromList(Change::removed('foo', true)), |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | $check = $this->createMock(FunctionBased::class); |
63 | 63 | $check->expects(self::never()) |
64 | - ->method('__invoke'); |
|
64 | + ->method('__invoke'); |
|
65 | 65 | |
66 | 66 | self::assertEquals( |
67 | 67 | Changes::empty(), |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | { |
20 | 20 | public function testNormalFunctionsAreNotExcluded() : void |
21 | 21 | { |
22 | - $source = new StringSourceLocator( |
|
22 | + $source = new StringSourceLocator( |
|
23 | 23 | <<<'PHP' |
24 | 24 | <?php |
25 | 25 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | public function testInternalFunctionsAreExcluded() : void |
48 | 48 | { |
49 | - $source = new StringSourceLocator( |
|
49 | + $source = new StringSourceLocator( |
|
50 | 50 | <<<'PHP' |
51 | 51 | <?php |
52 | 52 |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | |
37 | 37 | $check = $this->createMock(PropertyBased::class); |
38 | 38 | $check->expects(self::once()) |
39 | - ->method('__invoke') |
|
40 | - ->with($property, $property) |
|
41 | - ->willReturn(Changes::fromList(Change::removed('foo', true))); |
|
39 | + ->method('__invoke') |
|
40 | + ->with($property, $property) |
|
41 | + ->willReturn(Changes::fromList(Change::removed('foo', true))); |
|
42 | 42 | |
43 | 43 | self::assertEquals( |
44 | 44 | Changes::fromList(Change::removed('foo', true)), |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | $check = $this->createMock(PropertyBased::class); |
70 | 70 | $check->expects(self::never()) |
71 | - ->method('__invoke'); |
|
71 | + ->method('__invoke'); |
|
72 | 72 | |
73 | 73 | self::assertEquals( |
74 | 74 | Changes::empty(), |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | self::assertSame( |
38 | 38 | $expectedMessages, |
39 | - array_map(static function (Change $change) : string { |
|
39 | + array_map(static function(Change $change) : string { |
|
40 | 40 | return $change->__toString(); |
41 | 41 | }, iterator_to_array($changes)) |
42 | 42 | ); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | return array_combine( |
109 | 109 | array_keys($properties), |
110 | 110 | array_map( |
111 | - static function (string $property, array $errorMessages) use ($fromClass, $toClass) : array { |
|
111 | + static function(string $property, array $errorMessages) use ($fromClass, $toClass) : array { |
|
112 | 112 | return [ |
113 | 113 | $fromClass->getProperty($property), |
114 | 114 | $toClass->getProperty($property), |
@@ -34,9 +34,9 @@ discard block |
||
34 | 34 | |
35 | 35 | $check = $this->createMock(MethodBased::class); |
36 | 36 | $check->expects(self::once()) |
37 | - ->method('__invoke') |
|
38 | - ->with($method, $method) |
|
39 | - ->willReturn(Changes::fromList(Change::removed('foo', true))); |
|
37 | + ->method('__invoke') |
|
38 | + ->with($method, $method) |
|
39 | + ->willReturn(Changes::fromList(Change::removed('foo', true))); |
|
40 | 40 | |
41 | 41 | self::assertEquals( |
42 | 42 | Changes::fromList(Change::removed('foo', true)), |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | $check = $this->createMock(MethodBased::class); |
66 | 66 | $check->expects(self::never()) |
67 | - ->method('__invoke'); |
|
67 | + ->method('__invoke'); |
|
68 | 68 | |
69 | 69 | self::assertEquals( |
70 | 70 | Changes::empty(), |
@@ -46,13 +46,13 @@ |
||
46 | 46 | ClassReflector $newSourcesWithDependencies |
47 | 47 | ) : Changes { |
48 | 48 | $definedApiClassNames = array_map( |
49 | - static function (ReflectionClass $class) : string { |
|
49 | + static function(ReflectionClass $class) : string { |
|
50 | 50 | return $class->getName(); |
51 | 51 | }, |
52 | 52 | array_filter( |
53 | 53 | $definedSymbols->getAllClasses(), |
54 | - function (ReflectionClass $class) : bool { |
|
55 | - return ! ($class->isAnonymous() || $this->isInternalDocComment($class->getDocComment())); |
|
54 | + function(ReflectionClass $class) : bool { |
|
55 | + return !($class->isAnonymous() || $this->isInternalDocComment($class->getDocComment())); |
|
56 | 56 | } |
57 | 57 | ) |
58 | 58 | ); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | array_keys($this->accessibleProperties($toClass)) |
35 | 35 | ); |
36 | 36 | |
37 | - return Changes::fromList(...array_map(function (string $property) use ($fromProperties) : Change { |
|
37 | + return Changes::fromList(...array_map(function(string $property) use ($fromProperties) : Change { |
|
38 | 38 | return Change::removed( |
39 | 39 | sprintf('Property %s was removed', $this->formatProperty->__invoke($fromProperties[$property])), |
40 | 40 | true |
@@ -45,10 +45,10 @@ discard block |
||
45 | 45 | /** @return ReflectionProperty[] */ |
46 | 46 | private function accessibleProperties(ReflectionClass $class) : array |
47 | 47 | { |
48 | - return array_filter($class->getProperties(), function (ReflectionProperty $property) : bool { |
|
48 | + return array_filter($class->getProperties(), function(ReflectionProperty $property) : bool { |
|
49 | 49 | return ($property->isPublic() |
50 | 50 | || $property->isProtected()) |
51 | - && ! $this->isInternalDocComment($property->getDocComment()); |
|
51 | + && !$this->isInternalDocComment($property->getDocComment()); |
|
52 | 52 | }); |
53 | 53 | } |
54 | 54 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | array_change_key_case($this->accessibleMethods($toClass), CASE_UPPER) |
37 | 37 | ); |
38 | 38 | |
39 | - return Changes::fromList(...array_values(array_map(function (ReflectionMethod $method) : Change { |
|
39 | + return Changes::fromList(...array_values(array_map(function(ReflectionMethod $method) : Change { |
|
40 | 40 | return Change::removed( |
41 | 41 | sprintf('Method %s was removed', $this->formatFunction->__invoke($method)), |
42 | 42 | true |
@@ -47,14 +47,14 @@ discard block |
||
47 | 47 | /** @return ReflectionMethod[] */ |
48 | 48 | private function accessibleMethods(ReflectionClass $class) : array |
49 | 49 | { |
50 | - $methods = array_filter($class->getMethods(), function (ReflectionMethod $method) : bool { |
|
50 | + $methods = array_filter($class->getMethods(), function(ReflectionMethod $method) : bool { |
|
51 | 51 | return ($method->isPublic() |
52 | 52 | || $method->isProtected()) |
53 | - && ! $this->isInternalDocComment($method->getDocComment()); |
|
53 | + && !$this->isInternalDocComment($method->getDocComment()); |
|
54 | 54 | }); |
55 | 55 | |
56 | 56 | return array_combine( |
57 | - array_map(static function (ReflectionMethod $method) : string { |
|
57 | + array_map(static function(ReflectionMethod $method) : string { |
|
58 | 58 | return $method->getName(); |
59 | 59 | }, $methods), |
60 | 60 | $methods |
@@ -17,7 +17,7 @@ |
||
17 | 17 | { |
18 | 18 | public function __invoke(ReflectionClass $fromClass, ReflectionClass $toClass) : Changes |
19 | 19 | { |
20 | - if (! $this->isInternalDocComment($fromClass->getDocComment()) |
|
20 | + if (!$this->isInternalDocComment($fromClass->getDocComment()) |
|
21 | 21 | && $this->isInternalDocComment($toClass->getDocComment()) |
22 | 22 | ) { |
23 | 23 | return Changes::fromList(Change::changed( |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | { |
18 | 18 | public function __invoke(ReflectionClass $fromInterface, ReflectionClass $toInterface) : Changes |
19 | 19 | { |
20 | - if (! $this->isClass($toInterface) || ! $fromInterface->isInterface()) { |
|
20 | + if (!$this->isClass($toInterface) || !$fromInterface->isInterface()) { |
|
21 | 21 | // checking whether a class became an interface is done in `ClassBecameInterface` |
22 | 22 | return Changes::empty(); |
23 | 23 | } |
@@ -33,6 +33,6 @@ discard block |
||
33 | 33 | */ |
34 | 34 | private function isClass(ReflectionClass $class) : bool |
35 | 35 | { |
36 | - return ! ($class->isTrait() || $class->isInterface()); |
|
36 | + return !($class->isTrait() || $class->isInterface()); |
|
37 | 37 | } |
38 | 38 | } |