Skip to content

Commit

Permalink
fix: some missed attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Gemorroj committed Jul 5, 2022
1 parent 2abc276 commit 3b8d1a7
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions src/Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@
Version = 10
Volume Index = 0
Offset = 146577
p7zip: iso
Path = folder/subdoc
Folder = -
Size = 6
Packed Size = 6
Modified = 2018-06-17 19:22:27
p7zip: xz
Size = 3
Packed Size = 60
Method = LZMA2:23 CRC64
*/
class Entry
{
Expand All @@ -61,27 +73,27 @@ class Entry
*/
private $packedSize;
/**
* @var string
* @var string|null
*/
private $modified;
/**
* @var string|null
*/
private $created;
/**
* @var string
* @var string|null
*/
private $attributes;
/**
* @var string
* @var string|null
*/
private $crc;
/**
* @var string
* @var string|null
*/
private $encrypted;
/**
* @var string
* @var string|null
*/
private $method;
/**
Expand Down Expand Up @@ -186,7 +198,7 @@ private function setData(string $key, string $value): void

public function isDirectory(): bool
{
return '+' === $this->folder || false !== \strpos($this->attributes, 'D');
return '+' === $this->folder || false !== \strpos((string) $this->attributes, 'D');
}

public function isEncrypted(): bool
Expand Down Expand Up @@ -225,7 +237,7 @@ public function extractTo(string $directory): void
}
}

public function getAttributes(): string
public function getAttributes(): ?string
{
return $this->attributes;
}
Expand All @@ -235,25 +247,25 @@ public function getBlock(): ?string
return $this->block;
}

public function getCrc(): string
public function getCrc(): ?string
{
return $this->crc;
}

/**
* @deprecated use isEncrypted instead
*/
public function getEncrypted(): string
public function getEncrypted(): ?string
{
return $this->encrypted;
}

public function getMethod(): string
public function getMethod(): ?string
{
return $this->method;
}

public function getModified(): string
public function getModified(): ?string
{
return $this->modified;
}
Expand Down

0 comments on commit 3b8d1a7

Please sign in to comment.