1
0
Fork 0

Reaching phpstan level 6 in Composer\IO (#10166)

pull/10169/head
immeëmosol 2021-10-16 10:36:02 +02:00 committed by GitHub
parent c3c6969cf5
commit 6d5f6eb090
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 6 deletions

View File

@ -30,7 +30,7 @@ abstract class BaseIO implements IOInterface
}
/**
* {@inheritDoc}
* @return void
*/
public function resetAuthentications()
{
@ -87,6 +87,8 @@ abstract class BaseIO implements IOInterface
* @param string $repositoryName The unique name of repository
* @param string $username The username
* @param string $password The password
*
* @return void
*/
protected function checkAndSetAuthentication($repositoryName, $username, $password = null)
{

View File

@ -46,6 +46,9 @@ class BufferIO extends ConsoleIO
)));
}
/**
* @return string output
*/
public function getOutput()
{
fseek($this->output->getStream(), 0);
@ -66,6 +69,13 @@ class BufferIO extends ConsoleIO
return $output;
}
/**
* @param string[] $inputs
*
* @see createStream
*
* @return void
*/
public function setUserInputs(array $inputs)
{
if (!$this->input instanceof StreamableInputInterface) {
@ -76,6 +86,11 @@ class BufferIO extends ConsoleIO
$this->input->setInteractive(true);
}
/**
* @param string[] $inputs
*
* @return false|resource stream
*/
private function createStream(array $inputs)
{
$stream = fopen('php://memory', 'r+');

View File

@ -68,6 +68,8 @@ class ConsoleIO extends BaseIO
/**
* @param float $startTime
*
* @return void
*/
public function enableDebugging($startTime)
{
@ -147,10 +149,13 @@ class ConsoleIO extends BaseIO
}
/**
* @param array|string $messages
* @param string[]|string $messages
* @param bool $newline
* @param bool $stderr
* @param int $verbosity
* @param bool $raw
*
* @return void
*/
private function doWrite($messages, $newline, $stderr, $verbosity, $raw = false)
{
@ -203,11 +208,13 @@ class ConsoleIO extends BaseIO
}
/**
* @param array|string $messages
* @param string[]|string $messages
* @param bool $newline
* @param int|null $size
* @param bool $stderr
* @param int $verbosity
*
* @return void
*/
private function doOverwrite($messages, $newline, $size, $stderr, $verbosity)
{