Skip to content

Commit

Permalink
CS
Browse files Browse the repository at this point in the history
  • Loading branch information
kukulich committed Mar 29, 2022
1 parent 9da58ae commit b521bd3
Show file tree
Hide file tree
Showing 180 changed files with 2 additions and 513 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class AnnotationConstantExpressionHelper
{

/**
* @param ConstExprNode $contantExpressionNode
* @return array<int, ConstFetchNode>
*/
public static function getConstantFetchNodes(ConstExprNode $contantExpressionNode): array
Expand Down
21 changes: 0 additions & 21 deletions SlevomatCodingStandard/Helpers/AnnotationHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,7 @@ public static function getAnnotationConstantExpressions(Annotation $annotation):

/**
* @internal
* @param File $phpcsFile
* @param VariableAnnotation|ParameterAnnotation|ReturnAnnotation|ThrowsAnnotation|PropertyAnnotation|MethodAnnotation|TemplateAnnotation|ExtendsAnnotation|ImplementsAnnotation|UseAnnotation|MixinAnnotation $annotation
* @param TypeNode $typeNode
* @param TypeNode $fixedTypeNode
* @return string
*/
public static function fixAnnotationType(File $phpcsFile, Annotation $annotation, TypeNode $typeNode, TypeNode $fixedTypeNode): string
{
Expand All @@ -140,11 +136,7 @@ public static function fixAnnotationType(File $phpcsFile, Annotation $annotation

/**
* @internal
* @param File $phpcsFile
* @param VariableAnnotation|ParameterAnnotation|ReturnAnnotation|ThrowsAnnotation|PropertyAnnotation|MethodAnnotation|TemplateAnnotation|ExtendsAnnotation|ImplementsAnnotation|UseAnnotation|MixinAnnotation $annotation
* @param ConstFetchNode $node
* @param ConstFetchNode $fixedNode
* @return string
*/
public static function fixAnnotationConstantFetchNode(
File $phpcsFile,
Expand Down Expand Up @@ -200,9 +192,6 @@ public static function fixAnnotationConstantFetchNode(
}

/**
* @param File $phpcsFile
* @param int $pointer
* @param string $annotationName
* @return (VariableAnnotation|ParameterAnnotation|ReturnAnnotation|ThrowsAnnotation|PropertyAnnotation|MethodAnnotation|TemplateAnnotation|ExtendsAnnotation|ImplementsAnnotation|UseAnnotation|MixinAnnotation|GenericAnnotation)[]
*/
public static function getAnnotationsByName(File $phpcsFile, int $pointer, string $annotationName): array
Expand All @@ -213,8 +202,6 @@ public static function getAnnotationsByName(File $phpcsFile, int $pointer, strin
}

/**
* @param File $phpcsFile
* @param int $pointer
* @return (VariableAnnotation|ParameterAnnotation|ReturnAnnotation|ThrowsAnnotation|PropertyAnnotation|MethodAnnotation|TemplateAnnotation|ExtendsAnnotation|ImplementsAnnotation|UseAnnotation|MixinAnnotation|GenericAnnotation)[][]
*/
public static function getAnnotations(File $phpcsFile, int $pointer): array
Expand Down Expand Up @@ -380,13 +367,8 @@ static function () use ($phpcsFile, $pointer): array {
}

/**
* @param File $phpcsFile
* @param int $functionPointer
* @param TypeHint|null $typeHint
* @param ReturnAnnotation|ParameterAnnotation|VariableAnnotation $annotation
* @param array<int, string> $traversableTypeHints
* @param bool $enableUnionTypeHint
* @return bool
*/
public static function isAnnotationUseless(
File $phpcsFile,
Expand Down Expand Up @@ -487,9 +469,6 @@ public static function isAnnotationUseless(

/**
* @param VariableAnnotation|ParameterAnnotation|ReturnAnnotation|ThrowsAnnotation|PropertyAnnotation|MethodAnnotation|TemplateAnnotation|ExtendsAnnotation|ImplementsAnnotation|UseAnnotation|MixinAnnotation|TypeAliasAnnotation|TypeImportAnnotation $annotation
* @param TypeNode $typeNode
* @param TypeNode $fixedTypeNode
* @return Annotation
*/
private static function fixAnnotation(Annotation $annotation, TypeNode $typeNode, TypeNode $fixedTypeNode): Annotation
{
Expand Down
20 changes: 0 additions & 20 deletions SlevomatCodingStandard/Helpers/AnnotationTypeHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class AnnotationTypeHelper
{

/**
* @param TypeNode $typeNode
* @return IdentifierTypeNode[]|ThisTypeNode[]
*/
public static function getIdentifierTypeNodes(TypeNode $typeNode): array
Expand Down Expand Up @@ -111,7 +110,6 @@ public static function getIdentifierTypeNodes(TypeNode $typeNode): array
}

/**
* @param TypeNode $typeNode
* @return ConstTypeNode[]
*/
public static function getConstantTypeNodes(TypeNode $typeNode): array
Expand Down Expand Up @@ -184,7 +182,6 @@ public static function getConstantTypeNodes(TypeNode $typeNode): array
}

/**
* @param TypeNode $typeNode
* @return UnionTypeNode[]
*/
public static function getUnionTypeNodes(TypeNode $typeNode): array
Expand Down Expand Up @@ -254,7 +251,6 @@ public static function getUnionTypeNodes(TypeNode $typeNode): array
}

/**
* @param TypeNode $typeNode
* @return ArrayTypeNode[]
*/
public static function getArrayTypeNodes(TypeNode $typeNode): array
Expand Down Expand Up @@ -324,7 +320,6 @@ public static function getArrayTypeNodes(TypeNode $typeNode): array

/**
* @param IdentifierTypeNode|ThisTypeNode $typeNode
* @return string
*/
public static function getTypeHintFromNode(TypeNode $typeNode): string
{
Expand Down Expand Up @@ -539,11 +534,7 @@ public static function containsJustTwoTypes(TypeNode $typeNode): bool
}

/**
* @param TypeNode $typeNode
* @param File $phpcsFile
* @param int $pointer
* @param array<int, string> $traversableTypeHints
* @return bool
*/
public static function containsTraversableType(TypeNode $typeNode, File $phpcsFile, int $pointer, array $traversableTypeHints): bool
{
Expand Down Expand Up @@ -586,12 +577,7 @@ public static function containsTraversableType(TypeNode $typeNode, File $phpcsFi
}

/**
* @param TypeNode $typeNode
* @param File $phpcsFile
* @param int $pointer
* @param array<int, string> $traversableTypeHints
* @param bool $inTraversable
* @return bool
*/
public static function containsItemsSpecificationForTraversable(
TypeNode $typeNode,
Expand Down Expand Up @@ -701,8 +687,6 @@ public static function containsItemsSpecificationForTraversable(

/**
* @param CallableTypeNode|GenericTypeNode|IdentifierTypeNode|ThisTypeNode|ArrayTypeNode|ArrayShapeNode|ConstTypeNode $typeNode
* @param bool $enableUnionTypeHint
* @return string
*/
public static function getTypeHintFromOneType(TypeNode $typeNode, bool $enableUnionTypeHint = false): string
{
Expand Down Expand Up @@ -757,10 +741,7 @@ public static function getTypeHintFromOneType(TypeNode $typeNode, bool $enableUn

/**
* @param UnionTypeNode|IntersectionTypeNode $typeNode
* @param File $phpcsFile
* @param int $pointer
* @param array<int, string> $traversableTypeHints
* @param bool $enableUnionTypeHint
* @return string[]
*/
public static function getTraversableTypeHintsFromType(
Expand Down Expand Up @@ -801,7 +782,6 @@ public static function getTraversableTypeHintsFromType(

/**
* @param UnionTypeNode|IntersectionTypeNode $typeNode
* @return ?TypeNode
*/
public static function getItemsSpecificationTypeFromType(TypeNode $typeNode): ?TypeNode
{
Expand Down
1 change: 0 additions & 1 deletion SlevomatCodingStandard/Helpers/CatchHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public static function getTryEndPointer(File $phpcsFile, int $catchPointer): int
}

/**
* @param File $phpcsFile
* @param array<string, array<int, int|string>|int|string> $catchToken
* @return string[]
*/
Expand Down
4 changes: 0 additions & 4 deletions SlevomatCodingStandard/Helpers/ClassHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ public static function getName(File $phpcsFile, int $classPointer): string
}

/**
* @param File $phpcsFile
* @return array<int, string>
*/
public static function getAllNames(File $phpcsFile): array
Expand All @@ -81,8 +80,6 @@ public static function getAllNames(File $phpcsFile): array
}

/**
* @param File $phpcsFile
* @param int $classPointer
* @return int[]
*/
public static function getTraitUsePointers(File $phpcsFile, int $classPointer): array
Expand All @@ -108,7 +105,6 @@ public static function getTraitUsePointers(File $phpcsFile, int $classPointer):
}

/**
* @param File $phpcsFile
* @return array<int>
*/
private static function getAllClassPointers(File $phpcsFile): array
Expand Down
3 changes: 0 additions & 3 deletions SlevomatCodingStandard/Helpers/ConstantHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public static function getFullyQualifiedName(File $phpcsFile, int $constantPoint
}

/**
* @param File $phpcsFile
* @return string[]
*/
public static function getAllNames(File $phpcsFile): array
Expand All @@ -61,8 +60,6 @@ static function (int $constantPointer) use ($phpcsFile): bool {
}

/**
* @param File $phpcsFile
* @param int $previousConstantPointer
* @return Generator<int>
*/
private static function getAllConstantPointers(File $phpcsFile, int &$previousConstantPointer): Generator
Expand Down
2 changes: 0 additions & 2 deletions SlevomatCodingStandard/Helpers/DocCommentHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ public static function getDocComment(File $phpcsFile, int $pointer): ?string
}

/**
* @param File $phpcsFile
* @param int $pointer
* @return Comment[]|null
*/
public static function getDocCommentDescription(File $phpcsFile, int $pointer): ?array
Expand Down
17 changes: 0 additions & 17 deletions SlevomatCodingStandard/Helpers/FunctionHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@ public static function findClassPointer(File $phpcsFile, int $functionPointer):
}

/**
* @param File $phpcsFile
* @param int $functionPointer
* @return string[]
*/
public static function getParametersNames(File $phpcsFile, int $functionPointer): array
Expand All @@ -188,8 +186,6 @@ public static function getParametersNames(File $phpcsFile, int $functionPointer)
}

/**
* @param File $phpcsFile
* @param int $functionPointer
* @return (TypeHint|null)[]
*/
public static function getParametersTypeHints(File $phpcsFile, int $functionPointer): array
Expand Down Expand Up @@ -317,8 +313,6 @@ public static function hasReturnTypeHint(File $phpcsFile, int $functionPointer):
}

/**
* @param File $phpcsFile
* @param int $functionPointer
* @return ParameterAnnotation[]
*/
public static function getParametersAnnotations(File $phpcsFile, int $functionPointer): array
Expand All @@ -329,8 +323,6 @@ public static function getParametersAnnotations(File $phpcsFile, int $functionPo
}

/**
* @param File $phpcsFile
* @param int $functionPointer
* @return array<string, ParameterAnnotation>
*/
public static function getValidParametersAnnotations(File $phpcsFile, int $functionPointer): array
Expand All @@ -352,8 +344,6 @@ public static function getValidParametersAnnotations(File $phpcsFile, int $funct
}

/**
* @param File $phpcsFile
* @param int $functionPointer
* @return array<string, ParameterAnnotation>
*/
public static function getValidPrefixedParametersAnnotations(File $phpcsFile, int $functionPointer): array
Expand Down Expand Up @@ -391,8 +381,6 @@ public static function findReturnAnnotation(File $phpcsFile, int $functionPointe
}

/**
* @param File $phpcsFile
* @param int $functionPointer
* @return ReturnAnnotation[]
*/
public static function getValidPrefixedReturnAnnotations(File $phpcsFile, int $functionPointer): array
Expand All @@ -414,7 +402,6 @@ public static function getValidPrefixedReturnAnnotations(File $phpcsFile, int $f
}

/**
* @param File $phpcsFile
* @return string[]
*/
public static function getAllFunctionNames(File $phpcsFile): array
Expand All @@ -435,8 +422,6 @@ static function (int $functionOrMethodPointer) use ($phpcsFile): bool {
}

/**
* @param File $file
* @param int $functionPosition
* @param int $flags optional bitmask of self::LINE_INCLUDE_* constants
*/
public static function getFunctionLengthInLines(File $file, int $functionPosition, int $flags = 0): int
Expand Down Expand Up @@ -519,8 +504,6 @@ public static function getFunctionLengthInLines(File $file, int $functionPositio
}

/**
* @param File $phpcsFile
* @param int $previousFunctionPointer
* @return Generator<int>
*/
private static function getAllFunctionOrMethodPointers(File $phpcsFile, int &$previousFunctionPointer): Generator
Expand Down
3 changes: 0 additions & 3 deletions SlevomatCodingStandard/Helpers/IndentationHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ public static function getOneIndentationLevel(string $identation): string
}

/**
* @param File $phpcsFile
* @param int[] $codePointers
* @param string $defaultIndentation
* @return string
*/
public static function fixIndentation(File $phpcsFile, array $codePointers, string $defaultIndentation): string
{
Expand Down
2 changes: 0 additions & 2 deletions SlevomatCodingStandard/Helpers/NamespaceHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class NamespaceHelper
public const NAMESPACE_SEPARATOR = '\\';

/**
* @param File $phpcsFile
* @return int[]
*/
public static function getAllNamespacesPointers(File $phpcsFile): array
Expand Down Expand Up @@ -69,7 +68,6 @@ public static function hasNamespace(string $typeName): bool
}

/**
* @param string $name
* @return string[]
*/
public static function getNameParts(string $name): array
Expand Down
10 changes: 0 additions & 10 deletions SlevomatCodingStandard/Helpers/ReferencedNameHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ class ReferencedNameHelper
{

/**
* @param File $phpcsFile
* @param int $openTagPointer
* @return ReferencedName[]
*/
public static function getAllReferencedNames(File $phpcsFile, int $openTagPointer): array
Expand All @@ -70,8 +68,6 @@ public static function getAllReferencedNames(File $phpcsFile, int $openTagPointe
}

/**
* @param File $phpcsFile
* @param int $openTagPointer
* @return ReferencedName[]
*/
public static function getAllReferencedNamesInAttributes(File $phpcsFile, int $openTagPointer): array
Expand Down Expand Up @@ -124,8 +120,6 @@ public static function getReferencedNameEndPointer(File $phpcsFile, int $startPo
}

/**
* @param File $phpcsFile
* @param int $openTagPointer
* @return ReferencedName[]
*/
private static function createAllReferencedNames(File $phpcsFile, int $openTagPointer): array
Expand Down Expand Up @@ -390,8 +384,6 @@ private static function isReferencedName(File $phpcsFile, int $startPointer): bo
}

/**
* @param File $phpcsFile
* @param int $openTagPointer
* @return ReferencedName[]
*/
private static function createAllReferencedNamesInAttributes(File $phpcsFile, int $openTagPointer): array
Expand Down Expand Up @@ -462,15 +454,13 @@ private static function createAllReferencedNamesInAttributes(File $phpcsFile, in

/**
* @param int|string $code
* @return bool
*/
private static function isNeedParsedContent($code): bool
{
return in_array($code, [T_DOUBLE_QUOTED_STRING, T_HEREDOC], true);
}

/**
* @param string $content
* @return string[]
*/
private static function getReferencedNamesFromString(string $content): array
Expand Down
1 change: 0 additions & 1 deletion SlevomatCodingStandard/Helpers/ScopeHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public static function getRootPointer(File $phpcsFile, int $pointer): int
}

/**
* @param File $phpcsFile
* @return int[]
*/
public static function getAllRootPointers(File $phpcsFile): array
Expand Down
Loading

0 comments on commit b521bd3

Please sign in to comment.