Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge release 5.9.0 into 6.0.x #1180

Merged
merged 6 commits into from
Aug 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

],
"require-dev": {
"doctrine/coding-standard": "^9.0.0",
"doctrine/coding-standard": "^10.0.0",
"phpstan/phpstan": "^1.8.2",
"phpstan/phpstan-phpunit": "^1.1.1",
"phpunit/phpunit": "^9.5.23",
Expand Down
94 changes: 47 additions & 47 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 0 additions & 17 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
<exclude name="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming.SuperfluousSuffix"/>
</rule>

<rule ref="SlevomatCodingStandard.Classes.RequireConstructorPropertyPromotion"/>
<rule ref="SlevomatCodingStandard.Exceptions.RequireNonCapturingCatch"/>
<rule ref="SlevomatCodingStandard.Functions.ArrowFunctionDeclaration">
<properties>
<property name="allowMultiLine" value="true"/>
Expand All @@ -31,25 +29,10 @@
<property name="allowNested" value="false"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInCall"/>
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration"/>
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint"/>
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingParameterTypeHint">
<exclude-pattern>src/Reflection/Adapter/*</exclude-pattern>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint"/>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint"/>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingAnyTypeHint">
<exclude-pattern>src/Reflection/Adapter/*</exclude-pattern>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification">
<!-- Useless for data providers -->
<exclude-pattern>test/unit/</exclude-pattern>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.UnionTypeHintFormat">
<properties>
<property name="shortNullable" value="yes"/>
<property name="nullPosition" value="last"/>
</properties>
</rule>
</ruleset>
12 changes: 6 additions & 6 deletions src/BetterReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@

final class BetterReflection
{
private ?SourceLocator $sourceLocator = null;
private SourceLocator|null $sourceLocator = null;

private ?Reflector $reflector = null;
private Reflector|null $reflector = null;

private ?Parser $phpParser = null;
private Parser|null $phpParser = null;

private ?AstLocator $astLocator = null;
private AstLocator|null $astLocator = null;

private ?FindReflectionOnLine $findReflectionOnLine = null;
private FindReflectionOnLine|null $findReflectionOnLine = null;

private ?SourceStubber $sourceStubber = null;
private SourceStubber|null $sourceStubber = null;

public function sourceLocator(): SourceLocator
{
Expand Down
4 changes: 1 addition & 3 deletions src/Identifier/Identifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ class Identifier

private string $name;

/**
* @throws InvalidIdentifierName
*/
/** @throws InvalidIdentifierName */
public function __construct(string $name, private IdentifierType $type)
{
if (
Expand Down
8 changes: 3 additions & 5 deletions src/NodeCompiler/CompileNodeToValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
use function in_array;
use function sprintf;

/**
* @internal
*/
/** @internal */
class CompileNodeToValue
{
private const TRUE_FALSE_NULL = ['true', 'false', 'null'];
Expand Down Expand Up @@ -167,7 +165,7 @@ private function constantExists(string $constantName, CompilerContext $context):
}
}

private function getConstantValue(Node\Expr\ConstFetch $node, ?string $constantName, CompilerContext $context): mixed
private function getConstantValue(Node\Expr\ConstFetch $node, string|null $constantName, CompilerContext $context): mixed
{
// It's not resolved when constant value is expression
$constantName ??= $this->resolveConstantName($node, $context);
Expand All @@ -189,7 +187,7 @@ private function resolveClassConstantName(Node\Expr\ClassConstFetch $node, Compi
return sprintf('%s::%s', $this->resolveClassName($className, $context), $constantName);
}

private function getClassConstantValue(Node\Expr\ClassConstFetch $node, ?string $classConstantName, CompilerContext $context): mixed
private function getClassConstantValue(Node\Expr\ClassConstFetch $node, string|null $classConstantName, CompilerContext $context): mixed
{
// It's not resolved when constant value is expression
$classConstantName ??= $this->resolveClassConstantName($node, $context);
Expand Down
6 changes: 2 additions & 4 deletions src/NodeCompiler/CompiledValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@

namespace Roave\BetterReflection\NodeCompiler;

/**
* @internal
*/
/** @internal */
class CompiledValue
{
public function __construct(public mixed $value, public ?string $constantName = null)
public function __construct(public mixed $value, public string|null $constantName = null)
{
}
}
Loading