chore: Типы для параметров
This commit is contained in:
parent
6ef65fc826
commit
36c81135f3
7 changed files with 55 additions and 95 deletions
|
|
@ -8,17 +8,18 @@ use ZipArchive;
|
|||
|
||||
class ZipFile extends ZipArchive
|
||||
{
|
||||
private $ignore = array('.', '..');
|
||||
/**
|
||||
* @var list<string>
|
||||
*/
|
||||
private $ignore = ['.', '..'];
|
||||
|
||||
public function addIgnore($name)
|
||||
public function addIgnore(string $name): void
|
||||
{
|
||||
$this->ignore [] = $name;
|
||||
}
|
||||
|
||||
private function addDirDo($location, $name)
|
||||
private function addDirDo(string $location, string $name): void
|
||||
{
|
||||
assert(is_string($location) && is_string($name));
|
||||
|
||||
$name .= '/';
|
||||
$location .= '/';
|
||||
$file = null;
|
||||
|
|
@ -34,10 +35,8 @@ class ZipFile extends ZipArchive
|
|||
}
|
||||
}
|
||||
|
||||
public function addDir($location, $name)
|
||||
public function addDir(string $location, string $name): void
|
||||
{
|
||||
assert(is_string($location) && is_string($name));
|
||||
|
||||
$this->addEmptyDir($name);
|
||||
$this->addDirDo($location, $name);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue