@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | |
38 | 38 | // create default config |
39 | 39 | file_put_contents('/etc/phpdns.json', json_encode(getcwd())); |
40 | - } catch (\Symfony\Component\Filesystem\Exception\IOException $e){ |
|
41 | - die("An error occurred during installation\n".$e->getMessage()); |
|
40 | + } catch (\Symfony\Component\Filesystem\Exception\IOException $e) { |
|
41 | + die("An error occurred during installation\n" . $e->getMessage()); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | } else { |
@@ -54,12 +54,12 @@ discard block |
||
54 | 54 | try { |
55 | 55 | echo "Creating required directories and config files...\n"; |
56 | 56 | |
57 | - $filesystem->mkdir(getcwd().'\\zones'); |
|
58 | - $filesystem->mkdir(getcwd().'\\logs'); |
|
57 | + $filesystem->mkdir(getcwd() . '\\zones'); |
|
58 | + $filesystem->mkdir(getcwd() . '\\logs'); |
|
59 | 59 | |
60 | 60 | // create default config |
61 | - file_put_contents(getcwd().'\\phpdns.json', json_encode(getcwd())); |
|
62 | - } catch (\Symfony\Component\Filesystem\Exception\IOException $e){ |
|
63 | - die("An error occurred during installation\n".$e->getMessage()); |
|
61 | + file_put_contents(getcwd() . '\\phpdns.json', json_encode(getcwd())); |
|
62 | + } catch (\Symfony\Component\Filesystem\Exception\IOException $e) { |
|
63 | + die("An error occurred during installation\n" . $e->getMessage()); |
|
64 | 64 | } |
65 | 65 | } |
66 | 66 | \ No newline at end of file |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $this->filesystemManager = $filesystemManager; |
51 | 51 | $this->defaultTtl = $defaultTtl; |
52 | 52 | |
53 | - $zones = glob($filesystemManager->zonePath().'/*.json'); |
|
53 | + $zones = glob($filesystemManager->zonePath() . '/*.json'); |
|
54 | 54 | foreach ($zones as $file) { |
55 | 55 | $zone = json_decode(file_get_contents($file), true); |
56 | 56 | $resourceRecords = $this->isLegacyFormat($zone) ? $this->processLegacyZone($zone) : $this->processZone($zone); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | protected function processZone(array $zone): array |
97 | 97 | { |
98 | - $parent = rtrim($zone['domain'], '.').'.'; |
|
98 | + $parent = rtrim($zone['domain'], '.') . '.'; |
|
99 | 99 | $defaultTtl = $zone['default-ttl']; |
100 | 100 | $rrs = $zone['resource-records']; |
101 | 101 | $resourceRecords = []; |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | */ |
125 | 125 | protected function isLegacyFormat(array $zone): bool |
126 | 126 | { |
127 | - $keys = array_map(function ($value) { |
|
127 | + $keys = array_map(function($value) { |
|
128 | 128 | return strtolower($value); |
129 | 129 | }, array_keys($zone)); |
130 | 130 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | { |
143 | 143 | $resourceRecords = []; |
144 | 144 | foreach ($zones as $domain => $types) { |
145 | - $domain = rtrim($domain, '.').'.'; |
|
145 | + $domain = rtrim($domain, '.') . '.'; |
|
146 | 146 | foreach ($types as $type => $data) { |
147 | 147 | $data = (array) $data; |
148 | 148 | $type = RecordTypeEnum::getTypeFromName($type); |
@@ -28,6 +28,6 @@ |
||
28 | 28 | |
29 | 29 | protected function execute(InputInterface $input, OutputInterface $output) |
30 | 30 | { |
31 | - $output->writeln('PowerDnsServer version '.Server::VERSION); |
|
31 | + $output->writeln('PowerDnsServer version ' . Server::VERSION); |
|
32 | 32 | } |
33 | 33 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | public function zonePath() |
82 | 82 | { |
83 | - return $this->zonePath ?: $this->basePath.DIRECTORY_SEPARATOR.'zones'; |
|
83 | + return $this->zonePath ?: $this->basePath . DIRECTORY_SEPARATOR . 'zones'; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function getZone(string $zone) |
94 | 94 | { |
95 | - $zoneFile = $this->basePath().DIRECTORY_SEPARATOR.$zone.'.json'; |
|
95 | + $zoneFile = $this->basePath() . DIRECTORY_SEPARATOR . $zone . '.json'; |
|
96 | 96 | |
97 | 97 | return new JsonFileSystemResolver($zoneFile); |
98 | 98 | } |