@@ -35,7 +35,7 @@ |
||
35 | 35 | public function load(): void |
36 | 36 | { |
37 | 37 | $this->tempDir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid('epub_', true); |
38 | - if (! mkdir($this->tempDir) && ! is_dir($this->tempDir)) { |
|
38 | + if (!mkdir($this->tempDir) && !is_dir($this->tempDir)) { |
|
39 | 39 | throw new Exception("Failed to create temporary directory: {$this->tempDir}"); |
40 | 40 | } |
41 | 41 |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | */ |
21 | 21 | public function extract(string $zipFilePath, string $destination): void |
22 | 22 | { |
23 | - if (! file_exists($zipFilePath)) { |
|
23 | + if (!file_exists($zipFilePath)) { |
|
24 | 24 | throw new Exception("ZIP file does not exist: {$zipFilePath}"); |
25 | 25 | } |
26 | 26 | |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | throw new Exception("Failed to open ZIP file: {$zipFilePath}"); |
30 | 30 | } |
31 | 31 | |
32 | - if (! $zip->extractTo($destination)) { |
|
32 | + if (!$zip->extractTo($destination)) { |
|
33 | 33 | $zip->close(); |
34 | 34 | throw new Exception("Failed to extract ZIP file to: {$destination}"); |
35 | 35 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | } |
79 | 79 | } |
80 | 80 | |
81 | - if (! $zip->close()) { |
|
81 | + if (!$zip->close()) { |
|
82 | 82 | throw new Exception("Failed to finalize ZIP file: {$zipFilePath}"); |
83 | 83 | } |
84 | 84 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | exec($command, $output, $returnVar); |
20 | 20 | } |
21 | 21 | |
22 | - public function fileSize(string $path): int|false |
|
22 | + public function fileSize(string $path): int | false |
|
23 | 23 | { |
24 | 24 | return filesize($path); |
25 | 25 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function deleteDirectory(string $dir): bool |
31 | 31 | { |
32 | - if (! is_dir($dir)) { |
|
32 | + if (!is_dir($dir)) { |
|
33 | 33 | return true; |
34 | 34 | } |
35 | 35 |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function __construct(string $epubDirectory, private array $adapters) |
20 | 20 | { |
21 | - if (! is_dir($epubDirectory)) { |
|
21 | + if (!is_dir($epubDirectory)) { |
|
22 | 22 | throw new Exception("EPUB directory does not exist: {$epubDirectory}"); |
23 | 23 | } |
24 | 24 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function convert(string $format, string $outputPath): void |
37 | 37 | { |
38 | - if (! isset($this->adapters[$format])) { |
|
38 | + if (!isset($this->adapters[$format])) { |
|
39 | 39 | throw new Exception("Conversion format not supported: {$format}"); |
40 | 40 | } |
41 | 41 |
@@ -44,7 +44,7 @@ |
||
44 | 44 | |
45 | 45 | $creatorNodes = $this->opfXml->xpath('//dc:creator'); |
46 | 46 | |
47 | - if (! $this->isAuthorsNodeEmpty($creatorNodes)) { |
|
47 | + if (!$this->isAuthorsNodeEmpty($creatorNodes)) { |
|
48 | 48 | foreach ($creatorNodes as $key => $creatorNode) { |
49 | 49 | unset($creatorNodes[$key][0]); |
50 | 50 | } |
@@ -17,7 +17,7 @@ |
||
17 | 17 | */ |
18 | 18 | public function parse(string $filePath): SimpleXMLElement |
19 | 19 | { |
20 | - if (! file_exists($filePath)) { |
|
20 | + if (!file_exists($filePath)) { |
|
21 | 21 | throw new Exception("XML file not found: {$filePath}"); |
22 | 22 | } |
23 | 23 |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | */ |
16 | 16 | public function __construct(string $contentDirectory) |
17 | 17 | { |
18 | - if (! is_dir($contentDirectory)) { |
|
18 | + if (!is_dir($contentDirectory)) { |
|
19 | 19 | throw new Exception("Content directory does not exist: {$contentDirectory}"); |
20 | 20 | } |
21 | 21 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | public function updateContent(string $filePath, string $newContent): void |
72 | 72 | { |
73 | 73 | $fullPath = $this->contentDirectory . DIRECTORY_SEPARATOR . $filePath; |
74 | - if (! file_exists($fullPath)) { |
|
74 | + if (!file_exists($fullPath)) { |
|
75 | 75 | throw new Exception("Content file does not exist: {$fullPath}"); |
76 | 76 | } |
77 | 77 | |
@@ -90,11 +90,11 @@ discard block |
||
90 | 90 | public function deleteContent(string $filePath): void |
91 | 91 | { |
92 | 92 | $fullPath = $this->contentDirectory . DIRECTORY_SEPARATOR . $filePath; |
93 | - if (! file_exists($fullPath)) { |
|
93 | + if (!file_exists($fullPath)) { |
|
94 | 94 | throw new Exception("Content file does not exist: {$fullPath}"); |
95 | 95 | } |
96 | 96 | |
97 | - if (! unlink($fullPath)) { |
|
97 | + if (!unlink($fullPath)) { |
|
98 | 98 | throw new Exception("Failed to delete content from: {$fullPath}"); |
99 | 99 | } |
100 | 100 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | public function getContent(string $filePath): string |
112 | 112 | { |
113 | 113 | $fullPath = $this->contentDirectory . DIRECTORY_SEPARATOR . $filePath; |
114 | - if (! file_exists($fullPath)) { |
|
114 | + if (!file_exists($fullPath)) { |
|
115 | 115 | throw new Exception("Content file does not exist: {$fullPath}"); |
116 | 116 | } |
117 | 117 |
@@ -26,7 +26,7 @@ |
||
26 | 26 | { |
27 | 27 | $namespaces = $this->opfXml->getNamespaces(true); |
28 | 28 | |
29 | - if (! isset($namespaces['dc'])) { |
|
29 | + if (!isset($namespaces['dc'])) { |
|
30 | 30 | throw new Exception('Failed to identify dc namespace'); |
31 | 31 | } |
32 | 32 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | { |
37 | 37 | $mimetypePath = $directory . DIRECTORY_SEPARATOR . 'mimetype'; |
38 | 38 | |
39 | - if (! file_exists($mimetypePath)) { |
|
39 | + if (!file_exists($mimetypePath)) { |
|
40 | 40 | throw new Exception('Missing mimetype file: ' . $mimetypePath); |
41 | 41 | } |
42 | 42 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | |
130 | 130 | $navMap = $xml->children($namespaces[''])->navMap; |
131 | 131 | |
132 | - if (! $navMap) { |
|
132 | + if (!$navMap) { |
|
133 | 133 | throw new Exception('Missing navMap in NCX file'); |
134 | 134 | } |
135 | 135 | } |