@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | use function bin2hex; |
| 16 | 16 | |
| 17 | -final class File extends ItemAbstract{ |
|
| 17 | +final class File extends ItemAbstract { |
|
| 18 | 18 | |
| 19 | 19 | /** @var int */ |
| 20 | 20 | public $Flags; |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * @param array $data |
| 36 | 36 | * @param string $parent |
| 37 | 37 | */ |
| 38 | - public function __construct(array $data, string $parent){ |
|
| 38 | + public function __construct(array $data, string $parent) { |
|
| 39 | 39 | parent::__construct($data, $parent); |
| 40 | 40 | |
| 41 | 41 | $this->Hash = bin2hex($this->Hash); |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | /** |
| 21 | 21 | * @property array $blocktable |
| 22 | 22 | */ |
| 23 | -abstract class PACKReaderAbstract extends ReaderAbstract{ |
|
| 23 | +abstract class PACKReaderAbstract extends ReaderAbstract { |
|
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * 4+4+512+8+8+8+4+4+4+8 = 564 bytes |
@@ -57,14 +57,14 @@ discard block |
||
| 57 | 57 | $this->loadFile($filename); |
| 58 | 58 | $this->blocktable = []; |
| 59 | 59 | |
| 60 | - if($this->header['Signature'] !== "\x4b\x43\x41\x50"){ // KCAP |
|
| 60 | + if ($this->header['Signature'] !== "\x4b\x43\x41\x50") { // KCAP |
|
| 61 | 61 | throw new WSDBException('invalid PACK'); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | // read the block info table |
| 65 | 65 | fseek($this->fh, $this->header['BlockTableOffset']); |
| 66 | 66 | |
| 67 | - for($i = 0; $i < $this->header['BlockCount']; $i++){ |
|
| 67 | + for ($i = 0; $i < $this->header['BlockCount']; $i++) { |
|
| 68 | 68 | $this->blocktable[$i] = unpack('QOffset/QSize', fread($this->fh, 16)); |
| 69 | 69 | } |
| 70 | 70 | |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | use function bin2hex, fread, fseek, unpack; |
| 18 | 18 | |
| 19 | -final class AARCReader extends PACKReaderAbstract{ |
|
| 19 | +final class AARCReader extends PACKReaderAbstract { |
|
| 20 | 20 | |
| 21 | 21 | private const AARC_ROOT = 'a4ArchiveType/LVersion/LBlockcount/LIndex'; |
| 22 | 22 | private const AARC_DATA = 'LIndex/a20Hash/QSizeCompressed'; |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | // get the root info block of the AARC file (4+4+4+4 = 16 bytes) |
| 30 | 30 | $rootInfo = unpack($this::AARC_ROOT, fread($this->fh, 16)); |
| 31 | 31 | |
| 32 | - if($rootInfo['ArchiveType'] !== "\x43\x52\x41\x41"){ // CRAA |
|
| 32 | + if ($rootInfo['ArchiveType'] !== "\x43\x52\x41\x41") { // CRAA |
|
| 33 | 33 | throw new WSDBException('invalid AARC'); |
| 34 | 34 | } |
| 35 | 35 | |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | fseek($this->fh, $blockInfo['Offset']); |
| 40 | 40 | |
| 41 | 41 | // read the data block info (4+20+8 = 32 bytes) |
| 42 | - for($i = 0; $i < $rootInfo['Blockcount']; $i++){ |
|
| 42 | + for ($i = 0; $i < $rootInfo['Blockcount']; $i++) { |
|
| 43 | 43 | $data = unpack($this::AARC_DATA, fread($this->fh, 32)); |
| 44 | 44 | $hash = bin2hex($data['Hash']); |
| 45 | 45 | unset($data['Hash']); |