@@ -81,12 +81,12 @@ |
||
81 | 81 | * |
82 | 82 | * @return array<int, FileDirectory>|false |
83 | 83 | */ |
84 | - public function loadExtents(IsoFile &$isoFile, int $blockSize, bool $supplementary = false, int $jolietLevel = 0): array|false |
|
84 | + public function loadExtents(IsoFile&$isoFile, int $blockSize, bool $supplementary = false, int $jolietLevel = 0): array|false |
|
85 | 85 | { |
86 | 86 | return FileDirectory::loadExtentsSt($isoFile, $blockSize, $this->location, $supplementary, $jolietLevel); |
87 | 87 | } |
88 | 88 | |
89 | - public function extractFile(IsoFile &$isoFile, int $blockSize, int $location, int $dataLength, string $destinationFile): void |
|
89 | + public function extractFile(IsoFile&$isoFile, int $blockSize, int $location, int $dataLength, string $destinationFile): void |
|
90 | 90 | { |
91 | 91 | $seekLocation = $location * $blockSize; |
92 | 92 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | $offset = 1; |
33 | 33 | |
34 | - if (! isset($bytes[$offset])) { |
|
34 | + if (!isset($bytes[$offset])) { |
|
35 | 35 | throw new Exception('Failed to read buffer entry ' . $offset); |
36 | 36 | } |
37 | 37 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $offset++; |
40 | 40 | $stdId = Buffer::getString($bytes, 5, $offset); |
41 | 41 | |
42 | - if (! isset($bytes[$offset])) { |
|
42 | + if (!isset($bytes[$offset])) { |
|
43 | 43 | throw new Exception('Failed to read buffer entry ' . $offset); |
44 | 44 | } |
45 | 45 |
@@ -97,7 +97,7 @@ |
||
97 | 97 | throw new Exception('Finished reading'); |
98 | 98 | } |
99 | 99 | |
100 | - if (isset($this->descriptors[$descriptor->getType()]) && ! ($descriptor instanceof UdfDescriptor)) { |
|
100 | + if (isset($this->descriptors[$descriptor->getType()]) && !($descriptor instanceof UdfDescriptor)) { |
|
101 | 101 | throw new Exception('Descriptor ' . $descriptor->getType() . ' already exists'); |
102 | 102 | } |
103 | 103 |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $file = $fileValue; |
38 | 38 | } |
39 | 39 | |
40 | - if (! is_string($file) || $file === '') { |
|
40 | + if (!is_string($file) || $file === '') { |
|
41 | 41 | $this->displayError('Invalid value for file received'); |
42 | 42 | exit(2); |
43 | 43 | } |
@@ -67,11 +67,11 @@ discard block |
||
67 | 67 | |
68 | 68 | protected function checkIsoFile(string $file): void |
69 | 69 | { |
70 | - if (! file_exists($file)) { |
|
70 | + if (!file_exists($file)) { |
|
71 | 71 | throw new Exception('ISO file does not exist.'); |
72 | 72 | } |
73 | 73 | |
74 | - if (! is_file($file)) { |
|
74 | + if (!is_file($file)) { |
|
75 | 75 | throw new Exception('Path is not a valid file.'); |
76 | 76 | } |
77 | 77 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | |
102 | 102 | protected function extractAction(string $file, string $extractPath): void |
103 | 103 | { |
104 | - if (! is_dir($extractPath)) { |
|
104 | + if (!is_dir($extractPath)) { |
|
105 | 105 | $mkdirResult = mkdir($extractPath, 0777, true); |
106 | 106 | |
107 | 107 | if ($mkdirResult === false) { |
@@ -142,19 +142,19 @@ discard block |
||
142 | 142 | foreach ($extents as $extentRecord) { |
143 | 143 | $path = $extentRecord->fileId; |
144 | 144 | |
145 | - if (! $extentRecord->isThis() && ! $extentRecord->isParent()) { |
|
145 | + if (!$extentRecord->isThis() && !$extentRecord->isParent()) { |
|
146 | 146 | $fullPath = $destinationDir . $pathRecord->getFullPath($pathTable) . $path; |
147 | 147 | if ($extentRecord->isDirectory()) { |
148 | 148 | $fullPath .= DIRECTORY_SEPARATOR; |
149 | 149 | } |
150 | 150 | |
151 | - if (! $extentRecord->isDirectory()) { |
|
151 | + if (!$extentRecord->isDirectory()) { |
|
152 | 152 | $location = $extentRecord->location; |
153 | 153 | $dataLength = $extentRecord->dataLength; |
154 | - echo $fullPath . ' (location: ' . $location . ') (length: ' . $dataLength . ')' . PHP_EOL; |
|
154 | + echo $fullPath . ' (location: ' . $location . ') (length: ' . $dataLength . ')' . PHP_EOL; |
|
155 | 155 | |
156 | 156 | $dirPath = dirname($fullPath); |
157 | - if (! is_dir($dirPath)) { |
|
157 | + if (!is_dir($dirPath)) { |
|
158 | 158 | if (mkdir($dirPath, 0777, true) === false) { |
159 | 159 | throw new Exception('Failed to create directory: ' . $dirPath); |
160 | 160 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | |
163 | 163 | $pathRecord->extractFile($isoFile, $volumeDescriptor->blockSize, $location, $dataLength, $fullPath); |
164 | 164 | } else { |
165 | - if (! is_dir($fullPath)) { |
|
165 | + if (!is_dir($fullPath)) { |
|
166 | 166 | if (mkdir($fullPath, 0777, true) === false) { |
167 | 167 | throw new Exception('Failed to create directory: ' . $fullPath); |
168 | 168 | } |
@@ -220,16 +220,16 @@ discard block |
||
220 | 220 | foreach ($extents as $extentRecord) { |
221 | 221 | $path = $extentRecord->fileId; |
222 | 222 | |
223 | - if (! $extentRecord->isThis() && ! $extentRecord->isParent()) { |
|
223 | + if (!$extentRecord->isThis() && !$extentRecord->isParent()) { |
|
224 | 224 | $fullPath = $pathRecord->getFullPath($pathTable) . $path; |
225 | 225 | if ($extentRecord->isDirectory()) { |
226 | 226 | $fullPath .= DIRECTORY_SEPARATOR; |
227 | 227 | } |
228 | 228 | |
229 | - if (! $extentRecord->isDirectory()) { |
|
229 | + if (!$extentRecord->isDirectory()) { |
|
230 | 230 | $location = $extentRecord->location; |
231 | 231 | $dataLength = $extentRecord->dataLength; |
232 | - echo $fullPath . ' (location: ' . $location . ') (length: ' . $dataLength . ')' . PHP_EOL; |
|
232 | + echo $fullPath . ' (location: ' . $location . ') (length: ' . $dataLength . ')' . PHP_EOL; |
|
233 | 233 | } else { |
234 | 234 | echo $fullPath . PHP_EOL; |
235 | 235 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | { |
31 | 31 | $string = ''; |
32 | 32 | for ($i = $offset; $i < $offset + $length; $i++) { |
33 | - if (! isset($buffer[$i])) { |
|
33 | + if (!isset($buffer[$i])) { |
|
34 | 34 | throw new Exception('Failed to read buffer entry ' . $i); |
35 | 35 | } |
36 | 36 | if ($supplementary || $buffer[$i] !== 0) { |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | { |
76 | 76 | $datas = ''; |
77 | 77 | for ($i = $offset; $i < $offset + $length; $i++) { |
78 | - if (! isset($buffer[$i])) { |
|
78 | + if (!isset($buffer[$i])) { |
|
79 | 79 | throw new Exception('Failed to read buffer entry ' . $i); |
80 | 80 | } |
81 | 81 | $datas .= $buffer[$i]; |
@@ -99,10 +99,10 @@ discard block |
||
99 | 99 | $len = $length / 2; |
100 | 100 | |
101 | 101 | for ($i = 0; $i < $len; $i++) { |
102 | - if (! isset($buffer[$offset + ($len - 1 - $i)])) { |
|
102 | + if (!isset($buffer[$offset + ($len - 1 - $i)])) { |
|
103 | 103 | throw new Exception('Failed to read buffer entry ' . ($offset + ($len - 1 - $i))); |
104 | 104 | } |
105 | - if (! isset($buffer[$offset + $len + $i])) { |
|
105 | + if (!isset($buffer[$offset + $len + $i])) { |
|
106 | 106 | throw new Exception('Failed to read buffer entry ' . ($offset + $len + $i)); |
107 | 107 | } |
108 | 108 | $n1 += $buffer[$offset + ($len - 1 - $i)]; |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | { |
132 | 132 | $lsb = 0; |
133 | 133 | for ($i = 0; $i < $length; $i++) { |
134 | - if (! isset($buffer[$offset + ($length - 1 - $i)])) { |
|
134 | + if (!isset($buffer[$offset + ($length - 1 - $i)])) { |
|
135 | 135 | throw new Exception('Failed to read buffer entry ' . ($offset + ($length - 1 - $i))); |
136 | 136 | } |
137 | 137 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | { |
156 | 156 | $msb = 0; |
157 | 157 | for ($i = 0; $i < $length; $i++) { |
158 | - if (! isset($buffer[$offset + $i])) { |
|
158 | + if (!isset($buffer[$offset + $i])) { |
|
159 | 159 | throw new Exception('Failed to read buffer entry ' . ($offset + $i)); |
160 | 160 | } |
161 | 161 | $msb += $buffer[$offset + $i]; |
@@ -178,11 +178,11 @@ discard block |
||
178 | 178 | { |
179 | 179 | $output = 0; |
180 | 180 | |
181 | - if (! isset($buffer[$offset + 0])) { |
|
181 | + if (!isset($buffer[$offset + 0])) { |
|
182 | 182 | throw new Exception('Failed to read buffer entry ' . ($offset + 0)); |
183 | 183 | } |
184 | 184 | |
185 | - if (! isset($buffer[$offset + 1])) { |
|
185 | + if (!isset($buffer[$offset + 1])) { |
|
186 | 186 | throw new Exception('Failed to read buffer entry ' . ($offset + 1)); |
187 | 187 | } |
188 | 188 | |
@@ -202,19 +202,19 @@ discard block |
||
202 | 202 | { |
203 | 203 | $output = 0; |
204 | 204 | |
205 | - if (! isset($buffer[$offset + 0])) { |
|
205 | + if (!isset($buffer[$offset + 0])) { |
|
206 | 206 | throw new Exception('Failed to read buffer entry ' . ($offset + 0)); |
207 | 207 | } |
208 | 208 | |
209 | - if (! isset($buffer[$offset + 1])) { |
|
209 | + if (!isset($buffer[$offset + 1])) { |
|
210 | 210 | throw new Exception('Failed to read buffer entry ' . ($offset + 1)); |
211 | 211 | } |
212 | 212 | |
213 | - if (! isset($buffer[$offset + 2])) { |
|
213 | + if (!isset($buffer[$offset + 2])) { |
|
214 | 214 | throw new Exception('Failed to read buffer entry ' . ($offset + 2)); |
215 | 215 | } |
216 | 216 | |
217 | - if (! isset($buffer[$offset + 3])) { |
|
217 | + if (!isset($buffer[$offset + 3])) { |
|
218 | 218 | throw new Exception('Failed to read buffer entry ' . ($offset + 3)); |
219 | 219 | } |
220 | 220 |