File tree Expand file tree Collapse file tree 4 files changed +17
-14
lines changed Expand file tree Collapse file tree 4 files changed +17
-14
lines changed Original file line number Diff line number Diff line change @@ -35,14 +35,14 @@ public function underlyingType(): Type
3535 */
3636 public function __toString (): string
3737 {
38- if ($ this ->keyType ) {
39- return 'non-empty-array< ' . $ this ->keyType . ', ' . $ this ->valueType . '> ' ;
40- }
41-
4238 if ($ this ->valueType === null ) {
4339 return 'non-empty-array ' ;
4440 }
4541
42+ if ($ this ->keyType ) {
43+ return 'non-empty-array< ' . $ this ->keyType . ', ' . $ this ->valueType . '> ' ;
44+ }
45+
4646 return 'non-empty-array< ' . $ this ->valueType . '> ' ;
4747 }
4848}
Original file line number Diff line number Diff line change @@ -76,14 +76,14 @@ public function getValueType(): Type
7676 */
7777 public function __toString (): string
7878 {
79- if ($ this ->keyType ) {
80- return 'array< ' . $ this ->keyType . ', ' . $ this ->valueType . '> ' ;
81- }
82-
8379 if ($ this ->valueType === null ) {
8480 return 'array ' ;
8581 }
8682
83+ if ($ this ->keyType ) {
84+ return 'array< ' . $ this ->keyType . ', ' . $ this ->valueType . '> ' ;
85+ }
86+
8787 if ($ this ->valueType instanceof Compound) {
8888 return '( ' . $ this ->valueType . ')[] ' ;
8989 }
Original file line number Diff line number Diff line change @@ -59,10 +59,13 @@ public function __toString(): string
5959 {
6060 $ objectType = (string ) ($ this ->fqsen ?? 'object ' );
6161
62+ /** @var string */
63+ $ valueType = $ this ->valueType ;
64+
6265 if ($ this ->keyType === null ) {
63- return $ objectType . '< ' . $ this -> valueType . '> ' ;
66+ return $ objectType . '< ' . $ valueType . '> ' ;
6467 }
6568
66- return $ objectType . '< ' . $ this ->keyType . ', ' . $ this -> valueType . '> ' ;
69+ return $ objectType . '< ' . $ this ->keyType . ', ' . $ valueType . '> ' ;
6770 }
6871}
Original file line number Diff line number Diff line change @@ -25,14 +25,14 @@ final class Iterable_ extends AbstractList
2525 */
2626 public function __toString (): string
2727 {
28- if ($ this ->keyType ) {
29- return 'iterable< ' . $ this ->keyType . ', ' . $ this ->valueType . '> ' ;
30- }
31-
3228 if ($ this ->valueType === null ) {
3329 return 'iterable ' ;
3430 }
3531
32+ if ($ this ->keyType ) {
33+ return 'iterable< ' . $ this ->keyType . ', ' . $ this ->valueType . '> ' ;
34+ }
35+
3636 return 'iterable< ' . $ this ->valueType . '> ' ;
3737 }
3838}
You can’t perform that action at this time.
0 commit comments