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[]} */
private $changed;
/**
* @param string $source
*
* @return void
*/
public function setSource($source)
{
$this->source = $source;
}
/**
* @param string $update
*
* @return void
*/
public function setUpdate($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)
{
$changed = $this->changed;
@ -62,6 +78,9 @@ class Comparer
return $changed;
}
/**
* @return void
*/
public function doCompare()
{
$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)
{
if ($dh = opendir($dir)) {