Skip to content

Commit

Permalink
fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed May 31, 2024
1 parent 53cd8d4 commit c91de93
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 16 deletions.
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
"thecodingmachine/safe": "<1.1.3"
},
"scripts": {
"cs": "tools/vendor/bin/phpcs",
"csfix": "tools/vendor/bin/phpcbf",
"psalm": "tools/vendor/bin/psalm",
"psalm-baseline": "tools/vendor/bin/psalm --set-baseline=psalm-baseline.xml"
},
Expand Down
16 changes: 5 additions & 11 deletions src/Reflection/ReflectionConstant.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,12 @@ class ReflectionConstant implements Reflection
/** @psalm-allow-private-mutation */
private CompiledValue|null $compiledValue = null;

/**
* @param non-empty-string|null $namespace
*/
/** @param non-empty-string|null $namespace */
private function __construct(
private Reflector $reflector,
Node\Stmt\Const_|Node\Expr\FuncCall $node,
private LocatedSource $locatedSource,
/**
* @psalm-allow-private-mutation
*/
/** @psalm-allow-private-mutation */
private string|null $namespace = null,
int|null $positionInNode = null,
) {
Expand Down Expand Up @@ -113,8 +109,8 @@ public static function createFromName(string $constantName): self
*
* @internal
*
* @param Node\Stmt\Const_|Node\Expr\FuncCall $node Node has to be processed by the PhpParser\NodeVisitor\NameResolver
* @param non-empty-string|null $namespace
* @param Node\Stmt\Const_|Node\Expr\FuncCall $node Node has to be processed by the PhpParser\NodeVisitor\NameResolver
* @param non-empty-string|null $namespace
*/
public static function createFromNode(
Reflector $reflector,
Expand All @@ -132,9 +128,7 @@ public static function createFromNode(
return self::createFromDefineFunctionCall($reflector, $node, $locatedSource);
}

/**
* @param non-empty-string|null $namespace
*/
/** @param non-empty-string|null $namespace */
private static function createFromConstKeyword(
Reflector $reflector,
Node\Stmt\Const_ $node,
Expand Down
2 changes: 1 addition & 1 deletion src/Reflection/ReflectionEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private function __construct(
/**
* @internal
*
* @param EnumNode $node
* @param EnumNode $node
* @param non-empty-string|null $namespace
*
* @psalm-suppress MoreSpecificImplementedParamType
Expand Down
4 changes: 1 addition & 3 deletions src/Reflection/ReflectionFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ class ReflectionFunction implements Reflection

private bool $isStatic;

/**
* @param non-empty-string|null $namespace
*/
/** @param non-empty-string|null $namespace */
private function __construct(
private Reflector $reflector,
Node\Stmt\ClassMethod|Node\Stmt\Function_|Node\Expr\Closure|Node\Expr\ArrowFunction $node,
Expand Down
3 changes: 2 additions & 1 deletion src/SourceLocator/Ast/Strategy/NodeToReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Roave\BetterReflection\SourceLocator\Ast\Strategy;

use LogicException;
use PhpParser\Node;
use Roave\BetterReflection\Reflection\ReflectionClass;
use Roave\BetterReflection\Reflection\ReflectionConstant;
Expand All @@ -29,7 +30,7 @@ public function __invoke(
$namespaceName = $namespace?->name?->name;

if ($namespaceName === '') {
throw new \LogicException('Namespace name should never be empty');
throw new LogicException('Namespace name should never be empty');
}

if ($node instanceof Node\Stmt\Enum_) {
Expand Down

0 comments on commit c91de93

Please sign in to comment.