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

[Rector] Apply Rector: RemoveUnusedPrivateMethodRector #4455

Closed
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
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"phpunit/phpunit": "^9.1",
"predis/predis": "^1.1",
"rector/rector": "^0.9",
"squizlabs/php_codesniffer": "^3.3"
"squizlabs/php_codesniffer": "^3.3",
"symplify/rule-doc-generator": "9.2.11"
},
"suggest": {
"ext-fileinfo": "Improves mime type detection for files"
Expand Down
3 changes: 3 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector;
use Rector\Core\Configuration\Option;
use Rector\Core\ValueObject\PhpVersion;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodRector;
use Rector\DeadCode\Rector\Foreach_\RemoveUnusedForeachKeyRector;
use Rector\DeadCode\Rector\Switch_\RemoveDuplicatedCaseInSwitchRector;
use Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRector;
Expand All @@ -38,6 +39,7 @@
__DIR__ . '/tests/system/Models',
__DIR__ . '/tests/_support',
PassStrictParameterToFunctionParameterRector::class => [__DIR__ . '/tests/system/Database/Live/SelectTest.php'],
RemoveUnusedPrivateMethodRector::class => [__DIR__ . '/tests/system/Test/ReflectionHelperTest.php'],
]);

// Rector relies on autoload setup of your project; Composer autoload is included by default; to add more:
Expand Down Expand Up @@ -72,4 +74,5 @@
$services->set(RemoveUnusedForeachKeyRector::class);
$services->set(SimplifyIfElseToTernaryRector::class);
$services->set(UnusedForeachValueToArrayKeysRector::class);
$services->set(RemoveUnusedPrivateMethodRector::class);
};
16 changes: 0 additions & 16 deletions system/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -577,22 +577,6 @@ protected function castAs($value, string $attribute, string $method = 'get')
return $handlers[$type]::$method($value, $params);
}

//--------------------------------------------------------------------

/**
* Cast as JSON
*
* @param mixed $value
* @param boolean $asArray
*
* @return mixed
* @throws CastException
*/
private function castAsJson($value, bool $asArray = false)
{
return CastAsJson::get($value, $asArray ? ['array'] : []);
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, seems it is actually used magically.


/**
* Support for json_encode()
*
Expand Down