@@ -10,4 +10,4 @@ |
||
10 | 10 | var_export($typeResolver->resolve('string|integer')); |
11 | 11 | |
12 | 12 | // Will return the string "string|int" |
13 | -var_dump((string)$typeResolver->resolve('string|integer')); |
|
13 | +var_dump((string) $typeResolver->resolve('string|integer')); |
@@ -14,17 +14,17 @@ |
||
14 | 14 | $context = $contextFactory->createFromReflector(new ReflectionMethod('My\\Example\\Classy', '__construct')); |
15 | 15 | |
16 | 16 | // Class named: \phpDocumentor\Reflection\Types\Resolver |
17 | -var_dump((string)$typeResolver->resolve('Types\Resolver', $context)); |
|
17 | +var_dump((string) $typeResolver->resolve('Types\Resolver', $context)); |
|
18 | 18 | |
19 | 19 | // String |
20 | -var_dump((string)$typeResolver->resolve('string', $context)); |
|
20 | +var_dump((string) $typeResolver->resolve('string', $context)); |
|
21 | 21 | |
22 | 22 | // Property named: \phpDocumentor\Reflection\Types\Resolver::$keyWords |
23 | -var_dump((string)$fqsenResolver->resolve('Types\Resolver::$keyWords', $context)); |
|
23 | +var_dump((string) $fqsenResolver->resolve('Types\Resolver::$keyWords', $context)); |
|
24 | 24 | |
25 | 25 | // Class named: \My\Example\string |
26 | 26 | // - Shows the difference between the FqsenResolver and TypeResolver; the FqsenResolver will assume |
27 | 27 | // that the given value is not a type but most definitely a reference to another element. This is |
28 | 28 | // because conflicts between type keywords and class names can exist and if you know a reference |
29 | 29 | // is not a type but an element you can force that keywords are resolved. |
30 | -var_dump((string)$fqsenResolver->resolve('string', $context)); |
|
30 | +var_dump((string) $fqsenResolver->resolve('string', $context)); |
@@ -14,17 +14,17 @@ |
||
14 | 14 | $context = $contextFactory->createFromReflector(new ReflectionClass('My\\Example\\Classy')); |
15 | 15 | |
16 | 16 | // Class named: \phpDocumentor\Reflection\Types\Resolver |
17 | -var_dump((string)$typeResolver->resolve('Types\Resolver', $context)); |
|
17 | +var_dump((string) $typeResolver->resolve('Types\Resolver', $context)); |
|
18 | 18 | |
19 | 19 | // String |
20 | -var_dump((string)$typeResolver->resolve('string', $context)); |
|
20 | +var_dump((string) $typeResolver->resolve('string', $context)); |
|
21 | 21 | |
22 | 22 | // Property named: \phpDocumentor\Reflection\Types\Resolver::$keyWords |
23 | -var_dump((string)$fqsenResolver->resolve('Types\Resolver::$keyWords', $context)); |
|
23 | +var_dump((string) $fqsenResolver->resolve('Types\Resolver::$keyWords', $context)); |
|
24 | 24 | |
25 | 25 | // Class named: \My\Example\string |
26 | 26 | // - Shows the difference between the FqsenResolver and TypeResolver; the FqsenResolver will assume |
27 | 27 | // that the given value is not a type but most definitely a reference to another element. This is |
28 | 28 | // because conflicts between type keywords and class names can exist and if you know a reference |
29 | 29 | // is not a type but an element you can force that keywords are resolved. |
30 | -var_dump((string)$fqsenResolver->resolve('string', $context)); |
|
30 | +var_dump((string) $fqsenResolver->resolve('string', $context)); |
@@ -11,7 +11,7 @@ |
||
11 | 11 | $context = new Context('\phpDocumentor\Types'); |
12 | 12 | |
13 | 13 | // Method named: \phpDocumentor\Types\Types\Resolver::resolveFqsen() |
14 | -var_dump((string)$fqsenResolver->resolve('Types\Resolver::resolveFqsen()', $context)); |
|
14 | +var_dump((string) $fqsenResolver->resolve('Types\Resolver::resolveFqsen()', $context)); |
|
15 | 15 | |
16 | 16 | // Property named: \phpDocumentor\Types\Types\Resolver::$keyWords |
17 | -var_dump((string)$fqsenResolver->resolve('Types\Resolver::$keyWords', $context)); |
|
17 | +var_dump((string) $fqsenResolver->resolve('Types\Resolver::$keyWords', $context)); |
@@ -66,11 +66,11 @@ |
||
66 | 66 | $namespace .= self::OPERATOR_NAMESPACE; |
67 | 67 | } |
68 | 68 | |
69 | - return new Fqsen(self::OPERATOR_NAMESPACE . $namespace . $type); |
|
69 | + return new Fqsen(self::OPERATOR_NAMESPACE.$namespace.$type); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | $typeParts[0] = $namespaceAliases[$typeParts[0]]; |
73 | 73 | |
74 | - return new Fqsen(self::OPERATOR_NAMESPACE . implode(self::OPERATOR_NAMESPACE, $typeParts)); |
|
74 | + return new Fqsen(self::OPERATOR_NAMESPACE.implode(self::OPERATOR_NAMESPACE, $typeParts)); |
|
75 | 75 | } |
76 | 76 | } |
@@ -86,13 +86,13 @@ discard block |
||
86 | 86 | { |
87 | 87 | if (!is_string($type)) { |
88 | 88 | throw new \InvalidArgumentException( |
89 | - 'Attempted to resolve type but it appeared not to be a string, received: ' . var_export($type, true) |
|
89 | + 'Attempted to resolve type but it appeared not to be a string, received: '.var_export($type, true) |
|
90 | 90 | ); |
91 | 91 | } |
92 | 92 | |
93 | 93 | $type = trim($type); |
94 | 94 | if (!$type) { |
95 | - throw new \InvalidArgumentException('Attempted to resolve "' . $type . '" but it appears to be empty'); |
|
95 | + throw new \InvalidArgumentException('Attempted to resolve "'.$type.'" but it appears to be empty'); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | if ($context === null) { |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | default: |
115 | 115 | // I haven't got the foggiest how the logic would come here but added this as a defense. |
116 | 116 | throw new \RuntimeException( |
117 | - 'Unable to resolve type "' . $type . '", there is no known method to resolve it' |
|
117 | + 'Unable to resolve type "'.$type.'", there is no known method to resolve it' |
|
118 | 118 | ); |
119 | 119 | } |
120 | 120 | // @codeCoverageIgnoreEnd |
@@ -132,14 +132,14 @@ discard block |
||
132 | 132 | { |
133 | 133 | if (!class_exists($typeClassName)) { |
134 | 134 | throw new \InvalidArgumentException( |
135 | - 'The Value Object that needs to be created with a keyword "' . $keyword . '" must be an existing class' |
|
136 | - . ' but we could not find the class ' . $typeClassName |
|
135 | + 'The Value Object that needs to be created with a keyword "'.$keyword.'" must be an existing class' |
|
136 | + . ' but we could not find the class '.$typeClassName |
|
137 | 137 | ); |
138 | 138 | } |
139 | 139 | |
140 | 140 | if (!in_array(Type::class, class_implements($typeClassName))) { |
141 | 141 | throw new \InvalidArgumentException( |
142 | - 'The class "' . $typeClassName . '" must implement the interface "phpDocumentor\Reflection\Type"' |
|
142 | + 'The class "'.$typeClassName.'" must implement the interface "phpDocumentor\Reflection\Type"' |
|
143 | 143 | ); |
144 | 144 | } |
145 | 145 |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | public function __construct(Type $valueType = null, Type $keyType = null) |
42 | 42 | { |
43 | 43 | if ($keyType === null) { |
44 | - $keyType = new Compound([ new String_(), new Integer() ]); |
|
44 | + $keyType = new Compound([new String_(), new Integer()]); |
|
45 | 45 | } |
46 | 46 | if ($valueType === null) { |
47 | 47 | $valueType = new Mixed(); |
@@ -82,6 +82,6 @@ discard block |
||
82 | 82 | return 'array'; |
83 | 83 | } |
84 | 84 | |
85 | - return $this->valueType . '[]'; |
|
85 | + return $this->valueType.'[]'; |
|
86 | 86 | } |
87 | 87 | } |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function __construct(Fqsen $fqsen = null) |
36 | 36 | { |
37 | - if (strpos((string)$fqsen, '::') !== false || strpos((string)$fqsen, '()') !== false) { |
|
37 | + if (strpos((string) $fqsen, '::') !== false || strpos((string) $fqsen, '()') !== false) { |
|
38 | 38 | throw new \InvalidArgumentException( |
39 | 39 | 'Object types can only refer to a class, interface or trait but a method, function, constant or ' |
40 | - . 'property was received: ' . (string)$fqsen |
|
40 | + . 'property was received: '.(string) $fqsen |
|
41 | 41 | ); |
42 | 42 | } |
43 | 43 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | public function __toString() |
63 | 63 | { |
64 | 64 | if ($this->fqsen) { |
65 | - return (string)$this->fqsen; |
|
65 | + return (string) $this->fqsen; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | return 'object'; |
@@ -44,7 +44,7 @@ |
||
44 | 44 | public function __construct($namespace, array $namespaceAliases = []) |
45 | 45 | { |
46 | 46 | $this->namespace = ('global' !== $namespace && 'default' !== $namespace) |
47 | - ? trim((string)$namespace, '\\') |
|
47 | + ? trim((string) $namespace, '\\') |
|
48 | 48 | : ''; |
49 | 49 | |
50 | 50 | foreach ($namespaceAliases as $alias => $fqnn) { |