@@ -43,6 +43,6 @@ |
||
43 | 43 | */ |
44 | 44 | public function getDeprecationReason(): string |
45 | 45 | { |
46 | - return (string)$this->deprecation; |
|
46 | + return (string) $this->deprecation; |
|
47 | 47 | } |
48 | 48 | } |
@@ -48,7 +48,7 @@ |
||
48 | 48 | */ |
49 | 49 | public function getDescription(): string |
50 | 50 | { |
51 | - return (string)$this->description; |
|
51 | + return (string) $this->description; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -88,7 +88,7 @@ |
||
88 | 88 | * @param TypeDefinition $definition |
89 | 89 | * @return bool |
90 | 90 | */ |
91 | - public function instanceOf(TypeDefinition $definition): bool |
|
91 | + public function instanceof(TypeDefinition $definition): bool |
|
92 | 92 | { |
93 | 93 | if ($definition::getType()->is(Type::ANY)) { |
94 | 94 | return true; |
@@ -22,7 +22,7 @@ |
||
22 | 22 | { |
23 | 23 | $name = \ucwords(\mb_strtolower(\preg_replace('/\W+/u', ' ', $name))); |
24 | 24 | |
25 | - return (string)\str_replace(' ', '', $name); |
|
25 | + return (string) \str_replace(' ', '', $name); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -137,7 +137,7 @@ |
||
137 | 137 | */ |
138 | 138 | public function getDefinition(string $name): ?TypeDefinition |
139 | 139 | { |
140 | - if (! \in_array($name, $this->types, true)) { |
|
140 | + if (!\in_array($name, $this->types, true)) { |
|
141 | 141 | return null; |
142 | 142 | } |
143 | 143 |
@@ -30,15 +30,15 @@ |
||
30 | 30 | */ |
31 | 31 | public static function getType(): TypeInterface |
32 | 32 | { |
33 | - return Type::of(Type::INTERFACE); |
|
33 | + return Type::of(Type::interface); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
37 | 37 | * @param TypeDefinition $definition |
38 | 38 | * @return bool |
39 | 39 | */ |
40 | - public function instanceOf(TypeDefinition $definition): bool |
|
40 | + public function instanceof(TypeDefinition $definition): bool |
|
41 | 41 | { |
42 | - return $this->isImplementsDefinition($definition) || parent::instanceOf($definition); |
|
42 | + return $this->isImplementsDefinition($definition) || parent::instanceof($definition); |
|
43 | 43 | } |
44 | 44 | } |
@@ -50,8 +50,8 @@ |
||
50 | 50 | private function invoke(string $name, TypeDefinition $from = null): void |
51 | 51 | { |
52 | 52 | foreach ($this->callbacks as $callback) { |
53 | - if (! $this->has($name)) { |
|
54 | - $callback($name, $from, function (TypeDefinition $type): void { |
|
53 | + if (!$this->has($name)) { |
|
54 | + $callback($name, $from, function(TypeDefinition $type): void { |
|
55 | 55 | $this->add($type); |
56 | 56 | }); |
57 | 57 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | protected $parents = []; |
26 | 26 | |
27 | 27 | /** |
28 | - * @return iterable|TypeDefinition[] |
|
28 | + * @return \Generator |
|
29 | 29 | */ |
30 | 30 | public function getParents(): iterable |
31 | 31 | { |
@@ -54,7 +54,8 @@ discard block |
||
54 | 54 | |
55 | 55 | /** |
56 | 56 | * @param TypeDefinition ...$definitions |
57 | - * @return ProvidesInheritance|$this |
|
57 | + * @param TypeDefinition[] $definitions |
|
58 | + * @return TypeDefinition[] |
|
58 | 59 | * @throws TypeConflictException |
59 | 60 | */ |
60 | 61 | public function extends(TypeDefinition ...$definitions): ProvidesInheritance |
@@ -74,7 +74,7 @@ |
||
74 | 74 | */ |
75 | 75 | private function verifyExtensionType(TypeDefinition $def): void |
76 | 76 | { |
77 | - if (! $this::typeOf($def::getType())) { |
|
77 | + if (!$this::typeOf($def::getType())) { |
|
78 | 78 | $error = \sprintf('Type %s can extends only %s types, but %s given.', $this, static::getType(), $def); |
79 | 79 | throw new TypeConflictException($error); |
80 | 80 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
53 | - * @return iterable|InterfaceDefinition[] |
|
53 | + * @return \Generator |
|
54 | 54 | */ |
55 | 55 | public function getInterfaces(): iterable |
56 | 56 | { |
@@ -79,6 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | /** |
81 | 81 | * @param InterfaceDefinition ...$interfaces |
82 | + * @param InterfaceDefinition[] $interfaces |
|
82 | 83 | * @return ProvidesInterfaces|$this |
83 | 84 | */ |
84 | 85 | public function implements(InterfaceDefinition ...$interfaces): ProvidesInterfaces |
@@ -12,7 +12,6 @@ |
||
12 | 12 | use Railt\Reflection\Contracts\Definition\Behaviour\ProvidesInterfaces; |
13 | 13 | use Railt\Reflection\Contracts\Definition\InterfaceDefinition; |
14 | 14 | use Railt\Reflection\Contracts\Definition\TypeDefinition; |
15 | -use Railt\Reflection\Exception\TypeNotFoundException; |
|
16 | 15 | |
17 | 16 | /** |
18 | 17 | * Trait HasInterfaces |
@@ -67,6 +67,7 @@ |
||
67 | 67 | |
68 | 68 | /** |
69 | 69 | * @param int ...$values |
70 | + * @param integer[] $values |
|
70 | 71 | * @return ProvidesTypeIndication|$this |
71 | 72 | */ |
72 | 73 | public function withModifiers(int ...$values): ProvidesTypeIndication |