Skip to content

Commit 6d5ac03

Browse files
committed
fix phpcs-fix
1 parent 983ad12 commit 6d5ac03

File tree

4 files changed

+40
-39
lines changed

4 files changed

+40
-39
lines changed

src/PseudoTypes/Conditional.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ public function getSubject(): Type
4040
public function __toString(): string
4141
{
4242
return sprintf(
43-
'(%s %s %s ? %s : %s)',
44-
$this->subject,
45-
$this->negated ? 'is not' : 'is',
46-
$this->target,
47-
$this->if,
48-
$this->else
49-
);
50-
}
43+
'(%s %s %s ? %s : %s)',
44+
$this->subject,
45+
$this->negated ? 'is not' : 'is',
46+
$this->target,
47+
$this->if,
48+
$this->else
49+
);
50+
}
5151
}

src/PseudoTypes/ConditionalParameter.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ public function getParameterName(): string
4040
public function __toString(): string
4141
{
4242
return sprintf(
43-
'(%s %s %s ? %s : %s)',
44-
$this->parameter,
45-
$this->negated ? 'is not' : 'is',
46-
$this->target,
47-
$this->if,
48-
$this->else
49-
);
50-
}
43+
'(%s %s %s ? %s : %s)',
44+
$this->parameter,
45+
$this->negated ? 'is not' : 'is',
46+
$this->target,
47+
$this->if,
48+
$this->else
49+
);
50+
}
5151
}

src/PseudoTypes/OffsetAccess.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ public function underlyingType(): Type
5454
*/
5555
public function __toString(): string
5656
{
57-
if (
58-
$this->valueType instanceof Callable_
59-
|| $this->valueType instanceof Nullable
60-
) {
61-
return '(' . $this->valueType . ')[' . $this->offsetType . ']';
62-
}
57+
if (
58+
$this->valueType instanceof Callable_
59+
|| $this->valueType instanceof Nullable
60+
) {
61+
return '(' . $this->valueType . ')[' . $this->offsetType . ']';
62+
}
6363

64-
return $this->valueType . '[' . $this->offsetType . ']';
64+
return $this->valueType . '[' . $this->offsetType . ']';
6565
}
6666
}

src/TypeResolver.php

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,8 @@
2222
use phpDocumentor\Reflection\PseudoTypes\ProtectedPropertiesOf;
2323
use phpDocumentor\Reflection\PseudoTypes\PublicPropertiesOf;
2424
use phpDocumentor\Reflection\PseudoTypes\ValueOf;
25-
use function trim;
26-
use function strpos;
27-
use function sprintf;
2825
use RuntimeException;
29-
use function in_array;
30-
use function array_map;
31-
use function get_class;
32-
use function strtolower;
33-
use function array_filter;
34-
use function class_exists;
35-
use function array_reverse;
3626
use InvalidArgumentException;
37-
use function array_key_exists;
38-
use function class_implements;
3927
use phpDocumentor\Reflection\Type;
4028
use PHPStan\PhpDocParser\Lexer\Lexer;
4129
use Doctrine\Deprecations\Deprecation;
@@ -112,7 +100,6 @@
112100
use phpDocumentor\Reflection\PseudoTypes\ArrayShapeItem;
113101
use phpDocumentor\Reflection\PseudoTypes\CallableString;
114102
use phpDocumentor\Reflection\PseudoTypes\NonEmptyString;
115-
116103
use phpDocumentor\Reflection\PseudoTypes\ConstExpression;
117104
use phpDocumentor\Reflection\PseudoTypes\LowercaseString;
118105
use phpDocumentor\Reflection\PseudoTypes\NegativeInteger;
@@ -125,7 +112,20 @@
125112
use PHPStan\PhpDocParser\Ast\Type\CallableTypeParameterNode;
126113
use phpDocumentor\Reflection\PseudoTypes\ConditionalParameter;
127114
use phpDocumentor\Reflection\PseudoTypes\NonEmptyLowercaseString;
115+
128116
use PHPStan\PhpDocParser\Ast\Type\ConditionalTypeForParameterNode;
117+
use function trim;
118+
use function strpos;
119+
use function sprintf;
120+
use function in_array;
121+
use function array_map;
122+
use function get_class;
123+
use function strtolower;
124+
use function array_filter;
125+
use function class_exists;
126+
use function array_reverse;
127+
use function array_key_exists;
128+
use function class_implements;
129129

130130
final class TypeResolver
131131
{
@@ -290,6 +290,7 @@ function (ArrayShapeItemNode $item) use ($context): ListShapeItem {
290290
default:
291291
throw new RuntimeException('Unsupported array shape kind');
292292
}
293+
// no break
293294
case ObjectShapeNode::class:
294295
return new ObjectShape(
295296
...array_map(
@@ -464,7 +465,7 @@ private function createFromGeneric(GenericTypeNode $type, Context $context): Typ
464465
return new PrivatePropertiesOf(
465466
$subType->getFqsen()
466467
);
467-
468+
468469
case 'list':
469470
return new List_(
470471
$this->createType($type->genericTypes[0], $context)
@@ -474,12 +475,12 @@ private function createFromGeneric(GenericTypeNode $type, Context $context): Typ
474475
return new NonEmptyList(
475476
$this->createType($type->genericTypes[0], $context)
476477
);
477-
478+
478479
case 'key-of':
479480
return new KeyOf(
480481
$this->createType($type->genericTypes[0], $context)
481482
);
482-
483+
483484
case 'value-of':
484485
return new ValueOf(
485486
$this->createType($type->genericTypes[0], $context)

0 commit comments

Comments
 (0)