Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kukulich committed Sep 23, 2021
1 parent 60bbadb commit de0a34d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/Reflection/ReflectionClassConstant.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Roave\BetterReflection\Reflection;

use PhpParser\Node\Stmt\ClassConst;
use ReflectionProperty;
use ReflectionClassConstant as CoreReflectionClassConstant;
use Roave\BetterReflection\NodeCompiler\CompileNodeToValue;
use Roave\BetterReflection\NodeCompiler\CompilerContext;
use Roave\BetterReflection\Reflection\StringCast\ReflectionClassConstantStringCast;
Expand Down Expand Up @@ -114,9 +114,9 @@ public function isProtected(): bool
public function getModifiers(): int
{
$val = 0;
$val += $this->isPublic() ? ReflectionProperty::IS_PUBLIC : 0;
$val += $this->isProtected() ? ReflectionProperty::IS_PROTECTED : 0;
$val += $this->isPrivate() ? ReflectionProperty::IS_PRIVATE : 0;
$val += $this->isPublic() ? CoreReflectionClassConstant::IS_PUBLIC : 0;
$val += $this->isProtected() ? CoreReflectionClassConstant::IS_PROTECTED : 0;
$val += $this->isPrivate() ? CoreReflectionClassConstant::IS_PRIVATE : 0;

return $val;
}
Expand Down
10 changes: 5 additions & 5 deletions test/unit/Reflection/ReflectionClassConstantTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use PhpParser\Node\Stmt\ClassConst;
use PHPUnit\Framework\TestCase;
use ReflectionProperty;
use ReflectionClassConstant as CoreReflectionClassConstant;
use Roave\BetterReflection\Reflection\ReflectionClassConstant;
use Roave\BetterReflection\Reflector\ClassReflector;
use Roave\BetterReflection\SourceLocator\Type\ComposerSourceLocator;
Expand Down Expand Up @@ -72,10 +72,10 @@ public function testGetModifiers(string $const, int $expected): void
public function getModifiersProvider(): array
{
return [
['MY_CONST_1', ReflectionProperty::IS_PUBLIC],
['MY_CONST_3', ReflectionProperty::IS_PUBLIC],
['MY_CONST_4', ReflectionProperty::IS_PROTECTED],
['MY_CONST_5', ReflectionProperty::IS_PRIVATE],
['MY_CONST_1', CoreReflectionClassConstant::IS_PUBLIC],
['MY_CONST_3', CoreReflectionClassConstant::IS_PUBLIC],
['MY_CONST_4', CoreReflectionClassConstant::IS_PROTECTED],
['MY_CONST_5', CoreReflectionClassConstant::IS_PRIVATE],
];
}

Expand Down

0 comments on commit de0a34d

Please sign in to comment.