Skip to content

Commit

Permalink
typos, skip empty class
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Jul 1, 2020
1 parent e091457 commit 78a97fb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion rules/phpunit/src/Rector/MethodCall/composer.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
e{
{
"name": "vendor_name/MethodCall",
"description": "description",
"minimum-stability": "stable",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,12 @@ public function refactor(Node $node): ?Node
return null;
}

/** @var string $class */
$class = $node->getAttribute(AttributeKey::CLASS_NAME);

// Remember when we have already processed this constant recursively
$node->setAttribute(self::HAS_NEW_ACCESS_LEVEL, true);

/** @var string|null $class */
$class = $node->getAttribute(AttributeKey::CLASS_NAME);
if ($class === null) {
return null;
}

// 0. constants declared in interfaces have to be public
if ($this->classLikeParsedNodesFinder->findInterface($class) !== null) {
$this->makePublic($node);
Expand Down Expand Up @@ -150,7 +147,13 @@ private function shouldSkip(ClassConst $classConst): bool
return true;
}

return count($classConst->consts) !== 1;
if (count($classConst->consts) !== 1) {
return true;
}

/** @var string|null $class */
$class = $classConst->getAttribute(AttributeKey::CLASS_NAME);
return $class === null;
}

private function findParentClassConstantAndRefactorIfPossible(string $class, string $constant): ?ConstantVisibility
Expand Down
8 changes: 4 additions & 4 deletions utils/project-validator/src/Process/ParallelTaskRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ private function createProcessFromSetTask(SetTask $setTask): Process
'--set',
$setTask->getSetName(),
'--dry-run',
'--debug',
];

return new Process($command, $this->cwd);
Expand All @@ -203,15 +204,14 @@ private function evaluateProcess(Process $process): void

$fullOutput = array_filter([$process->getOutput(), $process->getErrorOutput()]);

$ouptput = implode("\n", $fullOutput);

$actualErrorHappened = Strings::match($ouptput, '#(Fatal error)|(\[ERROR\])#');
$output = implode("\n", $fullOutput);
$actualErrorHappened = Strings::match($output, '#(Fatal error)|(\[ERROR\])#');

if (! $actualErrorHappened) {
return;
}

throw new ProcessResultInvalidException($ouptput);
throw new ProcessResultInvalidException($output);
}

private function printSuccess(string $set, int $totalTasks): void
Expand Down

0 comments on commit 78a97fb

Please sign in to comment.