Skip to content

Commit

Permalink
Merge pull request #1474 from nunomaduro/analysis-4wamke
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI

[ci skip] [skip ci]
  • Loading branch information
nunomaduro committed Dec 9, 2022
2 parents 06589ac + 1320a01 commit f8d379d
Show file tree
Hide file tree
Showing 14 changed files with 11 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/Methods/HigherOrderTapProxyExtension.php
Expand Up @@ -24,7 +24,7 @@ public function hasMethod(ClassReflection $classReflection, string $methodName):

$templateType = $templateTypeMap->getType('TClass');

if (!$templateType instanceof TypeWithClassName) {
if (! $templateType instanceof TypeWithClassName) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/ReturnTypes/BuilderModelFindExtension.php
Expand Up @@ -62,7 +62,7 @@ public function isMethodSupported(MethodReflection $methodReflection): bool

$model = $methodReflection->getDeclaringClass()->getActiveTemplateTypeMap()->getType('TModelClass');

if (!$model instanceof TypeWithClassName) {
if (! $model instanceof TypeWithClassName) {
return false;
}

Expand Down
Expand Up @@ -63,7 +63,7 @@ public function getTypeFromMethodCall(

$calledOnType = $scope->getType($methodCall->var);

if (!$calledOnType instanceof TypeWithClassName) {
if (! $calledOnType instanceof TypeWithClassName) {
return $returnType;
}

Expand Down
2 changes: 1 addition & 1 deletion src/ReturnTypes/EloquentBuilderExtension.php
Expand Up @@ -59,7 +59,7 @@ public function isMethodSupported(MethodReflection $methodReflection): bool

$templateTypeMap = $methodReflection->getDeclaringClass()->getActiveTemplateTypeMap();

if (!$templateTypeMap->getType('TModelClass') instanceof TypeWithClassName) {
if (! $templateTypeMap->getType('TModelClass') instanceof TypeWithClassName) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/ReturnTypes/RelationCollectionExtension.php
Expand Up @@ -51,7 +51,7 @@ public function isMethodSupported(MethodReflection $methodReflection): bool

$modelType = $methodReflection->getDeclaringClass()->getActiveTemplateTypeMap()->getType('TRelatedModel');

if (!$modelType instanceof TypeWithClassName) {
if (! $modelType instanceof TypeWithClassName) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/ReturnTypes/RelationFindExtension.php
Expand Up @@ -60,7 +60,7 @@ public function isMethodSupported(MethodReflection $methodReflection): bool

$modelType = $methodReflection->getDeclaringClass()->getActiveTemplateTypeMap()->getType('TRelatedModel');

if (!$modelType instanceof TypeWithClassName) {
if (! $modelType instanceof TypeWithClassName) {
return false;
}

Expand Down
2 changes: 0 additions & 2 deletions src/Rules/ModelProperties/ModelPropertiesRuleHelper.php
Expand Up @@ -14,8 +14,6 @@
use PHPStan\Reflection\MethodReflection;
use PHPStan\Reflection\ParametersAcceptorSelector;
use PHPStan\ShouldNotHappenException;
use PHPStan\Type\ArrayType;
use PHPStan\Type\Constant\ConstantArrayType;
use PHPStan\Type\GeneralizePrecision;
use PHPStan\Type\ObjectType;
use PHPStan\Type\Type;
Expand Down
1 change: 0 additions & 1 deletion src/Rules/ModelProperties/ModelPropertyStaticCallRule.php
Expand Up @@ -13,7 +13,6 @@
use PHPStan\Reflection\ReflectionProvider;
use PHPStan\Rules\Rule;
use PHPStan\Rules\RuleLevelHelper;
use PHPStan\Type\Constant\ConstantStringType;
use PHPStan\Type\ErrorType;
use PHPStan\Type\Type;
use PHPStan\Type\TypeUtils;
Expand Down
2 changes: 1 addition & 1 deletion src/Rules/ModelRuleHelper.php
Expand Up @@ -40,7 +40,7 @@ public function findModelReflectionFromType(Type $type): ?ClassReflection

$modelType = TypeCombinator::removeNull($modelType);

if (!$modelType instanceof TypeWithClassName) {
if (! $modelType instanceof TypeWithClassName) {
return null;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Rules/OctaneCompatibilityRule.php
Expand Up @@ -44,7 +44,7 @@ public function processNode(Node $node, Scope $scope): array

$calledOnType = $scope->getType($node->var);

if (!$calledOnType instanceof TypeWithClassName) {
if (! $calledOnType instanceof TypeWithClassName) {
return [];
}

Expand Down
1 change: 0 additions & 1 deletion src/Types/ModelProperty/GenericModelPropertyType.php
Expand Up @@ -5,7 +5,6 @@
namespace NunoMaduro\Larastan\Types\ModelProperty;

use PHPStan\TrinaryLogic;
use PHPStan\Type\ClassStringType;
use PHPStan\Type\CompoundType;
use PHPStan\Type\Constant\ConstantStringType;
use PHPStan\Type\Generic\TemplateType;
Expand Down
Expand Up @@ -42,7 +42,7 @@ public function isMethodSupported(MethodReflection $methodReflection): bool

$returnType = $variants->getReturnType();

if (!$returnType instanceof TypeWithClassName) {
if (! $returnType instanceof TypeWithClassName) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Types/RelationDynamicMethodReturnTypeExtension.php
Expand Up @@ -57,7 +57,7 @@ public function getTypeFromMethodCall(
$functionVariant = ParametersAcceptorSelector::selectSingle($methodReflection->getVariants());
$returnType = $functionVariant->getReturnType();

if (!$returnType instanceof TypeWithClassName) {
if (! $returnType instanceof TypeWithClassName) {
return $returnType;
}

Expand Down
3 changes: 1 addition & 2 deletions src/Types/RelationParserHelper.php
Expand Up @@ -12,7 +12,6 @@
use PHPStan\Parser\Parser;
use PHPStan\Reflection\MethodReflection;
use PHPStan\Reflection\ReflectionProvider;
use PHPStan\Type\Constant\ConstantStringType;
use PHPStan\Type\Generic\GenericClassStringType;
use PHPStan\Type\Generic\TemplateTypeMap;
use PHPStan\Type\TypeUtils;
Expand Down Expand Up @@ -97,7 +96,7 @@ public function findRelatedModelInRelationMethod(
if ($argType instanceof GenericClassStringType) {
$modelType = $argType->getGenericType();

if (!$modelType instanceof TypeWithClassName) {
if (! $modelType instanceof TypeWithClassName) {
return null;
}

Expand Down

0 comments on commit f8d379d

Please sign in to comment.