Reduce common control flows

This commit is contained in:
Alexandre Daubois
2024-10-14 20:03:05 +02:00
parent a97129d215
commit 8f6d3ecb5a
2 changed files with 3 additions and 7 deletions

View File

@@ -123,13 +123,13 @@ final class CompletionInput extends ArgvInput
if ($this->currentIndex >= \count($this->tokens)) {
if (!isset($this->arguments[$argumentName]) || $this->definition->getArgument($argumentName)->isArray()) {
$this->completionName = $argumentName;
$this->completionValue = '';
} else {
// we've reached the end
$this->completionType = self::TYPE_NONE;
$this->completionName = null;
$this->completionValue = '';
}
$this->completionValue = '';
}
}

View File

@@ -151,11 +151,7 @@ class ConsoleLoggerTest extends TestCase
public function testObjectCastToString()
{
if (method_exists($this, 'createPartialMock')) {
$dummy = $this->createPartialMock(DummyTest::class, ['__toString']);
} else {
$dummy = $this->createPartialMock(DummyTest::class, ['__toString']);
}
$dummy = $this->createPartialMock(DummyTest::class, ['__toString']);
$dummy->method('__toString')->willReturn('DUMMY');
$this->getLogger()->warning($dummy);