fix:更新已知bug,优化代码

This commit is contained in:
Ying
2022-11-28 19:11:12 +08:00
parent f6aee95cfc
commit 9445b206a2
1378 changed files with 53759 additions and 20789 deletions

View File

@@ -37,13 +37,10 @@ class NullOutput implements OutputInterface
/**
* {@inheritdoc}
*/
public function getFormatter()
public function getFormatter(): OutputFormatterInterface
{
if ($this->formatter) {
return $this->formatter;
}
// to comply with the interface we must return a OutputFormatterInterface
return $this->formatter = new NullOutputFormatter();
return $this->formatter ??= new NullOutputFormatter();
}
/**
@@ -57,7 +54,7 @@ class NullOutput implements OutputInterface
/**
* {@inheritdoc}
*/
public function isDecorated()
public function isDecorated(): bool
{
return false;
}
@@ -73,7 +70,7 @@ class NullOutput implements OutputInterface
/**
* {@inheritdoc}
*/
public function getVerbosity()
public function getVerbosity(): int
{
return self::VERBOSITY_QUIET;
}
@@ -81,7 +78,7 @@ class NullOutput implements OutputInterface
/**
* {@inheritdoc}
*/
public function isQuiet()
public function isQuiet(): bool
{
return true;
}
@@ -89,7 +86,7 @@ class NullOutput implements OutputInterface
/**
* {@inheritdoc}
*/
public function isVerbose()
public function isVerbose(): bool
{
return false;
}
@@ -97,7 +94,7 @@ class NullOutput implements OutputInterface
/**
* {@inheritdoc}
*/
public function isVeryVerbose()
public function isVeryVerbose(): bool
{
return false;
}
@@ -105,7 +102,7 @@ class NullOutput implements OutputInterface
/**
* {@inheritdoc}
*/
public function isDebug()
public function isDebug(): bool
{
return false;
}
@@ -113,7 +110,7 @@ class NullOutput implements OutputInterface
/**
* {@inheritdoc}
*/
public function writeln($messages, int $options = self::OUTPUT_NORMAL)
public function writeln(string|iterable $messages, int $options = self::OUTPUT_NORMAL)
{
// do nothing
}
@@ -121,7 +118,7 @@ class NullOutput implements OutputInterface
/**
* {@inheritdoc}
*/
public function write($messages, bool $newline = false, int $options = self::OUTPUT_NORMAL)
public function write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT_NORMAL)
{
// do nothing
}