Skip to content
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: 2 additions & 0 deletions config/set/code-quality.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Rector\CodeQuality\Rector\Catch_\ThrowWithPreviousExceptionRector;
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\CodeQuality\Rector\ClassConstFetch\ConvertStaticPrivateConstantToSelfRector;
use Rector\CodeQuality\Rector\ClassMethod\InlineArrayReturnAssignRector;
use Rector\CodeQuality\Rector\ClassMethod\OptionalParametersAfterRequiredRector;
use Rector\CodeQuality\Rector\ClassMethod\ReturnTypeFromStrictScalarReturnExprRector;
Expand Down Expand Up @@ -186,5 +187,6 @@
SwitchTrueToIfRector::class,
CleanupUnneededNullsafeOperatorRector::class,
DisallowedEmptyRuleFixerRector::class,
ConvertStaticPrivateConstantToSelfRector::class,
]);
};

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace Utils\Rector\Tests\Rector\UseDateTimeImmutableRector\Fixture;
namespace Rector\ClassConstFetch\ConvertStaticPrivateConstantToSelfRector\Fixture;

final class Foo
class Foo
{
private const BAR = 1;
public function baz(): void
Expand All @@ -14,9 +14,9 @@ final class Foo
-----
<?php

namespace Utils\Rector\Tests\Rector\UseDateTimeImmutableRector\Fixture;
namespace Rector\ClassConstFetch\ConvertStaticPrivateConstantToSelfRector\Fixture;

final class Foo
class Foo
{
private const BAR = 1;
public function baz(): void
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace Rector\ClassConstFetch\ConvertStaticPrivateConstantToSelfRector\Fixture;

final class PrivateConstantWithStatic
{
private const BAR = 1;

public function baz(): void
{
echo static::BAR;
}
}

?>
-----
<?php

namespace Rector\ClassConstFetch\ConvertStaticPrivateConstantToSelfRector\Fixture;

final class PrivateConstantWithStatic
{
private const BAR = 1;

public function baz(): void
{
echo self::BAR;
}
}

?>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Utils\Rector\Tests\Rector\UseDateTimeImmutableRector\Fixture;
namespace Rector\ClassConstFetch\ConvertStaticPrivateConstantToSelfRector\Fixture;

class Foo
{
Expand All @@ -14,7 +14,7 @@ class Foo
-----
<?php

namespace Utils\Rector\Tests\Rector\UseDateTimeImmutableRector\Fixture;
namespace Rector\ClassConstFetch\ConvertStaticPrivateConstantToSelfRector\Fixture;

class Foo
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Rector\ClassConstFetch\ConvertStaticPrivateConstantToSelfRector\Fixture;

final class SkipAlreadySelf
{
private const BAR = 1;

public function baz(): void
{
echo self::BAR;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace Rector\ClassConstFetch\ConvertStaticPrivateConstantToSelfRector\Fixture;

final class SkipConstantFromOtherClass
{
public function run(): void
{
echo \DateTimeInterface::ATOM;
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<?php

namespace Utils\Rector\Tests\Rector\UseDateTimeImmutableRector\Fixture;
namespace Rector\ClassConstFetch\ConvertStaticPrivateConstantToSelfRector\Fixture;

final class Foo
final class SkipOtherVisibility
{
protected const BAR = 1;

public const BAZ = 1;

public function run(): void
{
echo static::BAR;
echo static::BAZ;
}
}
?>

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading