PropertyFetchAnalyzer: simplify method names in consistent way

This commit is contained in:
TomasVotruba 2017-10-21 22:48:25 +02:00
parent d3a73a566c
commit 570d6a0978
4 changed files with 5 additions and 5 deletions

View File

@ -28,7 +28,7 @@ final class PropertyFetchAnalyzer
/**
* @param string[] $types
*/
public function isPropertyFetchOnTypes(Node $node, array $types, string $property): bool
public function isTypesAndProperty(Node $node, array $types, string $property): bool
{
if (! $node instanceof PropertyFetch) {
return false;
@ -45,7 +45,7 @@ final class PropertyFetchAnalyzer
return $nodePropertyName === $property;
}
public function isMagicPropertyFetchOnType(Node $node, string $type): bool
public function isMagicOnType(Node $node, string $type): bool
{
if (! $node instanceof PropertyFetch) {
return false;

View File

@ -39,7 +39,7 @@ final class ChoiceDefaultValueRector extends AbstractRector
return false;
}
return $this->propertyFetchAnalyzer->isPropertyFetchOnTypes(
return $this->propertyFetchAnalyzer->isTypesAndProperty(
$node->var,
['Nette\Forms\Controls\MultiChoiceControl', 'Nette\Forms\Controls\ChoiceControl'],
'checkAllowedValues'

View File

@ -34,7 +34,7 @@ final class IdentifierRector extends AbstractRector
{
$types = ['PhpParser\Node\Const_'];
if (! $this->propertyFetchAnalyzer->isPropertyFetchOnTypes($node, $types, 'name')) {
if (! $this->propertyFetchAnalyzer->isTypesAndProperty($node, $types, 'name')) {
return false;
}

View File

@ -77,7 +77,7 @@ final class GetAndSetToMethodCallRector extends AbstractRector
}
foreach ($this->typeToMethodCalls as $type => $transformation) {
if ($this->propertyFetchAnalyzer->isMagicPropertyFetchOnType($propertyFetchNode, $type)) {
if ($this->propertyFetchAnalyzer->isMagicOnType($propertyFetchNode, $type)) {
$this->activeTransformation = $transformation;
return true;