diff --git a/build/PHPStan/Build/OrChainIdenticalComparisonToInArrayRule.php b/build/PHPStan/Build/OrChainIdenticalComparisonToInArrayRule.php index 01762e05ca..ad6f81e43a 100644 --- a/build/PHPStan/Build/OrChainIdenticalComparisonToInArrayRule.php +++ b/build/PHPStan/Build/OrChainIdenticalComparisonToInArrayRule.php @@ -61,7 +61,7 @@ public function processNode(Node $node, Scope $scope): array /** * @return list */ - public function processConditionNode(Expr $condNode, Scope $scope): array + private function processConditionNode(Expr $condNode, Scope $scope): array { $comparisons = $this->unpackOrChain($condNode); if (count($comparisons) < 2) { diff --git a/src/Analyser/NodeScopeResolver.php b/src/Analyser/NodeScopeResolver.php index 012baa57ca..67f40cf608 100644 --- a/src/Analyser/NodeScopeResolver.php +++ b/src/Analyser/NodeScopeResolver.php @@ -5089,7 +5089,7 @@ private function processPropertyHooks( /** * @param FunctionReflection|MethodReflection|null $calleeReflection */ - public function resolveClosureThisType( + private function resolveClosureThisType( ?CallLike $call, $calleeReflection, ParameterReflection $parameter, @@ -7095,7 +7095,7 @@ private function getNextUnreachableStatements(array $nodes, bool $earlyBinding): /** * @param array $conditions */ - public function getFilteringExprForMatchArm(Expr\Match_ $expr, array $conditions): BinaryOp\Identical|FuncCall + private function getFilteringExprForMatchArm(Expr\Match_ $expr, array $conditions): BinaryOp\Identical|FuncCall { if (count($conditions) === 1) { return new BinaryOp\Identical($expr->cond, $conditions[0]); diff --git a/src/Analyser/TypeSpecifier.php b/src/Analyser/TypeSpecifier.php index ee8069e738..cc7fb05857 100644 --- a/src/Analyser/TypeSpecifier.php +++ b/src/Analyser/TypeSpecifier.php @@ -1401,7 +1401,7 @@ private function specifyTypesFromConditionalReturnType( /** * @param array $argsMap */ - public function getConditionalSpecifiedTypes( + private function getConditionalSpecifiedTypes( ConditionalTypeForParameter $conditionalType, Type $leftType, Type $rightType, diff --git a/src/Parallel/Process.php b/src/Parallel/Process.php index 36799c274d..94d1dacc67 100644 --- a/src/Parallel/Process.php +++ b/src/Parallel/Process.php @@ -17,7 +17,7 @@ final class Process { - public \React\ChildProcess\Process $process; + private \React\ChildProcess\Process $process; private ?WritableStreamInterface $in = null; diff --git a/src/Reflection/ResolvedFunctionVariantWithOriginal.php b/src/Reflection/ResolvedFunctionVariantWithOriginal.php index d7d2f09acc..21108d658e 100644 --- a/src/Reflection/ResolvedFunctionVariantWithOriginal.php +++ b/src/Reflection/ResolvedFunctionVariantWithOriginal.php @@ -145,7 +145,7 @@ public function getReturnTypeWithUnresolvableTemplateTypes(): Type ); } - public function getPhpDocReturnTypeWithUnresolvableTemplateTypes(): Type + private function getPhpDocReturnTypeWithUnresolvableTemplateTypes(): Type { return $this->phpDocReturnTypeWithUnresolvableTemplateTypes ??= $this->resolveConditionalTypesForParameter( diff --git a/src/Rules/Comparison/ConstantConditionRuleHelper.php b/src/Rules/Comparison/ConstantConditionRuleHelper.php index 7fc6692103..5717d43b63 100644 --- a/src/Rules/Comparison/ConstantConditionRuleHelper.php +++ b/src/Rules/Comparison/ConstantConditionRuleHelper.php @@ -22,7 +22,7 @@ public function __construct( { } - public function shouldSkip(Scope $scope, Expr $expr): bool + private function shouldSkip(Scope $scope, Expr $expr): bool { if ( $expr instanceof Expr\BinaryOp\Equal diff --git a/src/Rules/Methods/MethodParameterComparisonHelper.php b/src/Rules/Methods/MethodParameterComparisonHelper.php index a52dbe86f5..0e14ef528b 100644 --- a/src/Rules/Methods/MethodParameterComparisonHelper.php +++ b/src/Rules/Methods/MethodParameterComparisonHelper.php @@ -362,7 +362,7 @@ public function compare(ExtendedMethodReflection $prototype, ClassReflection $pr return $messages; } - public function isParameterTypeCompatible(Type $methodParameterType, Type $prototypeParameterType, bool $supportsContravariance): bool + private function isParameterTypeCompatible(Type $methodParameterType, Type $prototypeParameterType, bool $supportsContravariance): bool { return $this->isTypeCompatible($methodParameterType, $prototypeParameterType, $supportsContravariance, false); } diff --git a/src/Type/OperatorTypeSpecifyingExtensionRegistry.php b/src/Type/OperatorTypeSpecifyingExtensionRegistry.php index 11f65849b7..724956062a 100644 --- a/src/Type/OperatorTypeSpecifyingExtensionRegistry.php +++ b/src/Type/OperatorTypeSpecifyingExtensionRegistry.php @@ -22,7 +22,7 @@ public function __construct( /** * @return OperatorTypeSpecifyingExtension[] */ - public function getOperatorTypeSpecifyingExtensions(string $operator, Type $leftType, Type $rightType): array + private function getOperatorTypeSpecifyingExtensions(string $operator, Type $leftType, Type $rightType): array { return array_values(array_filter($this->extensions, static fn (OperatorTypeSpecifyingExtension $extension): bool => $extension->isOperatorSupported($operator, $leftType, $rightType))); } diff --git a/src/Type/Php/DateFunctionReturnTypeHelper.php b/src/Type/Php/DateFunctionReturnTypeHelper.php index bac485292b..3126efe41b 100644 --- a/src/Type/Php/DateFunctionReturnTypeHelper.php +++ b/src/Type/Php/DateFunctionReturnTypeHelper.php @@ -46,7 +46,7 @@ public function getTypeFromFormatType(Type $formatType, bool $useMicrosec): Type return $type; } - public function buildReturnTypeFromFormat(string $formatString, bool $useMicrosec): Type + private function buildReturnTypeFromFormat(string $formatString, bool $useMicrosec): Type { // see see https://www.php.net/manual/en/datetime.format.php switch ($formatString) { diff --git a/src/Type/Php/FilterFunctionReturnTypeHelper.php b/src/Type/Php/FilterFunctionReturnTypeHelper.php index cb2e93acdf..ca242a964e 100644 --- a/src/Type/Php/FilterFunctionReturnTypeHelper.php +++ b/src/Type/Php/FilterFunctionReturnTypeHelper.php @@ -54,7 +54,7 @@ public function __construct(private ReflectionProvider $reflectionProvider, priv $this->flagsString = new ConstantStringType('flags'); } - public function getOffsetValueType(Type $inputType, Type $offsetType, ?Type $filterType, ?Type $flagsType): Type + private function getOffsetValueType(Type $inputType, Type $offsetType, ?Type $filterType, ?Type $flagsType): Type { $inexistentOffsetType = $this->hasFlag('FILTER_NULL_ON_FAILURE', $flagsType) ? new ConstantBooleanType(false) diff --git a/src/Type/Php/FilterVarArrayDynamicReturnTypeExtension.php b/src/Type/Php/FilterVarArrayDynamicReturnTypeExtension.php index d92e4e5882..77da1d1096 100644 --- a/src/Type/Php/FilterVarArrayDynamicReturnTypeExtension.php +++ b/src/Type/Php/FilterVarArrayDynamicReturnTypeExtension.php @@ -176,7 +176,7 @@ public function getTypeFromFunctionCall(FunctionReflection $functionReflection, } /** @return array{?Type, ?Type} */ - public function fetchFilter(Type $type): array + private function fetchFilter(Type $type): array { if (!$type->isArray()->yes()) { return [$type, null]; diff --git a/src/Type/Php/IdateFunctionReturnTypeHelper.php b/src/Type/Php/IdateFunctionReturnTypeHelper.php index c9c0f90c6e..752fba17b9 100644 --- a/src/Type/Php/IdateFunctionReturnTypeHelper.php +++ b/src/Type/Php/IdateFunctionReturnTypeHelper.php @@ -27,7 +27,7 @@ public function getTypeFromFormatType(Type $formatType): ?Type return TypeCombinator::union(...$types); } - public function buildReturnTypeFromFormat(string $formatString): Type + private function buildReturnTypeFromFormat(string $formatString): Type { // see https://www.php.net/idate and https://www.php.net/manual/de/datetime.format switch ($formatString) { diff --git a/src/Type/Regex/RegexNonCapturingGroup.php b/src/Type/Regex/RegexNonCapturingGroup.php index 79b4d8bc08..7c55800ee5 100644 --- a/src/Type/Regex/RegexNonCapturingGroup.php +++ b/src/Type/Regex/RegexNonCapturingGroup.php @@ -15,7 +15,7 @@ public function __construct( } /** @phpstan-assert-if-true !null $this->getAlternationId() */ - public function inAlternation(): bool + private function inAlternation(): bool { return $this->alternation !== null; }