1
0
Fork 0

phpstan level 6 in src/Composer/Package/Comparer (refs #10159) (#10196)

pull/10206/head
pistej 2021-10-20 22:20:33 +02:00 committed by GitHub
parent db9e9a544e
commit b99e21259c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 25 additions and 0 deletions

View File

@ -26,16 +26,32 @@ class Comparer
/** @var array{changed?: string[], removed?: string[], added?: string[]} */ /** @var array{changed?: string[], removed?: string[], added?: string[]} */
private $changed; private $changed;
/**
* @param string $source
*
* @return void
*/
public function setSource($source) public function setSource($source)
{ {
$this->source = $source; $this->source = $source;
} }
/**
* @param string $update
*
* @return void
*/
public function setUpdate($update) public function setUpdate($update)
{ {
$this->update = $update; $this->update = $update;
} }
/**
* @param bool $toString
* @param bool $explicated
*
* @return array{changed?: string[], removed?: string[], added?: string[]}|string|false false if no change, string only if $toString is true
*/
public function getChanged($toString = false, $explicated = false) public function getChanged($toString = false, $explicated = false)
{ {
$changed = $this->changed; $changed = $this->changed;
@ -62,6 +78,9 @@ class Comparer
return $changed; return $changed;
} }
/**
* @return void
*/
public function doCompare() public function doCompare()
{ {
$source = array(); $source = array();
@ -100,6 +119,12 @@ class Comparer
} }
} }
/**
* @param string $dir
* @param mixed $array
*
* @return array<string, array<string, string|false>>|false
*/
private function doTree($dir, &$array) private function doTree($dir, &$array)
{ {
if ($dh = opendir($dir)) { if ($dh = opendir($dir)) {