Skip to content

Commit bd6eb76

Browse files
authored
Reduce visibility of some methods to private
1 parent 806f1a1 commit bd6eb76

13 files changed

+14
-14
lines changed

build/PHPStan/Build/OrChainIdenticalComparisonToInArrayRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function processNode(Node $node, Scope $scope): array
6161
/**
6262
* @return list<IdentifierRuleError>
6363
*/
64-
public function processConditionNode(Expr $condNode, Scope $scope): array
64+
private function processConditionNode(Expr $condNode, Scope $scope): array
6565
{
6666
$comparisons = $this->unpackOrChain($condNode);
6767
if (count($comparisons) < 2) {

src/Analyser/NodeScopeResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5089,7 +5089,7 @@ private function processPropertyHooks(
50895089
/**
50905090
* @param FunctionReflection|MethodReflection|null $calleeReflection
50915091
*/
5092-
public function resolveClosureThisType(
5092+
private function resolveClosureThisType(
50935093
?CallLike $call,
50945094
$calleeReflection,
50955095
ParameterReflection $parameter,
@@ -7095,7 +7095,7 @@ private function getNextUnreachableStatements(array $nodes, bool $earlyBinding):
70957095
/**
70967096
* @param array<Expr> $conditions
70977097
*/
7098-
public function getFilteringExprForMatchArm(Expr\Match_ $expr, array $conditions): BinaryOp\Identical|FuncCall
7098+
private function getFilteringExprForMatchArm(Expr\Match_ $expr, array $conditions): BinaryOp\Identical|FuncCall
70997099
{
71007100
if (count($conditions) === 1) {
71017101
return new BinaryOp\Identical($expr->cond, $conditions[0]);

src/Analyser/TypeSpecifier.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1401,7 +1401,7 @@ private function specifyTypesFromConditionalReturnType(
14011401
/**
14021402
* @param array<string, Expr> $argsMap
14031403
*/
1404-
public function getConditionalSpecifiedTypes(
1404+
private function getConditionalSpecifiedTypes(
14051405
ConditionalTypeForParameter $conditionalType,
14061406
Type $leftType,
14071407
Type $rightType,

src/Parallel/Process.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
final class Process
1818
{
1919

20-
public \React\ChildProcess\Process $process;
20+
private \React\ChildProcess\Process $process;
2121

2222
private ?WritableStreamInterface $in = null;
2323

src/Reflection/ResolvedFunctionVariantWithOriginal.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function getReturnTypeWithUnresolvableTemplateTypes(): Type
145145
);
146146
}
147147

148-
public function getPhpDocReturnTypeWithUnresolvableTemplateTypes(): Type
148+
private function getPhpDocReturnTypeWithUnresolvableTemplateTypes(): Type
149149
{
150150
return $this->phpDocReturnTypeWithUnresolvableTemplateTypes ??=
151151
$this->resolveConditionalTypesForParameter(

src/Rules/Comparison/ConstantConditionRuleHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __construct(
2222
{
2323
}
2424

25-
public function shouldSkip(Scope $scope, Expr $expr): bool
25+
private function shouldSkip(Scope $scope, Expr $expr): bool
2626
{
2727
if (
2828
$expr instanceof Expr\BinaryOp\Equal

src/Rules/Methods/MethodParameterComparisonHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ public function compare(ExtendedMethodReflection $prototype, ClassReflection $pr
362362
return $messages;
363363
}
364364

365-
public function isParameterTypeCompatible(Type $methodParameterType, Type $prototypeParameterType, bool $supportsContravariance): bool
365+
private function isParameterTypeCompatible(Type $methodParameterType, Type $prototypeParameterType, bool $supportsContravariance): bool
366366
{
367367
return $this->isTypeCompatible($methodParameterType, $prototypeParameterType, $supportsContravariance, false);
368368
}

src/Type/OperatorTypeSpecifyingExtensionRegistry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __construct(
2222
/**
2323
* @return OperatorTypeSpecifyingExtension[]
2424
*/
25-
public function getOperatorTypeSpecifyingExtensions(string $operator, Type $leftType, Type $rightType): array
25+
private function getOperatorTypeSpecifyingExtensions(string $operator, Type $leftType, Type $rightType): array
2626
{
2727
return array_values(array_filter($this->extensions, static fn (OperatorTypeSpecifyingExtension $extension): bool => $extension->isOperatorSupported($operator, $leftType, $rightType)));
2828
}

src/Type/Php/DateFunctionReturnTypeHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function getTypeFromFormatType(Type $formatType, bool $useMicrosec): Type
4646
return $type;
4747
}
4848

49-
public function buildReturnTypeFromFormat(string $formatString, bool $useMicrosec): Type
49+
private function buildReturnTypeFromFormat(string $formatString, bool $useMicrosec): Type
5050
{
5151
// see see https://www.php.net/manual/en/datetime.format.php
5252
switch ($formatString) {

src/Type/Php/FilterFunctionReturnTypeHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function __construct(private ReflectionProvider $reflectionProvider, priv
5454
$this->flagsString = new ConstantStringType('flags');
5555
}
5656

57-
public function getOffsetValueType(Type $inputType, Type $offsetType, ?Type $filterType, ?Type $flagsType): Type
57+
private function getOffsetValueType(Type $inputType, Type $offsetType, ?Type $filterType, ?Type $flagsType): Type
5858
{
5959
$inexistentOffsetType = $this->hasFlag('FILTER_NULL_ON_FAILURE', $flagsType)
6060
? new ConstantBooleanType(false)

0 commit comments

Comments
 (0)