@@ -5,7 +5,6 @@ |
||
5 | 5 | namespace Compolomus\IniObject; |
6 | 6 | |
7 | 7 | use InvalidArgumentException; |
8 | -use SplFileObject; |
|
9 | 8 | |
10 | 9 | class IniObject |
11 | 10 | { |
@@ -24,10 +24,10 @@ discard block |
||
24 | 24 | */ |
25 | 25 | public function __construct(?string $filename = null, array $data = [], array $config = []) |
26 | 26 | { |
27 | - if (! count($config)) { |
|
27 | + if (!count($config)) { |
|
28 | 28 | $this->initDefaultConfig(); |
29 | 29 | } |
30 | - if ($filename !== null && file_exists($filename) && ! count($data)) { |
|
30 | + if ($filename !== null && file_exists($filename) && !count($data)) { |
|
31 | 31 | $data = parse_ini_file( |
32 | 32 | $filename, |
33 | 33 | true, |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public function getSection(string $name): Section |
61 | 61 | { |
62 | - if (! isset($this->sections[$name])) { |
|
62 | + if (!isset($this->sections[$name])) { |
|
63 | 63 | throw new InvalidArgumentException('Section not found'); |
64 | 64 | } |
65 | 65 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function removeSection(string $name): void |
73 | 73 | { |
74 | - if (! isset($this->sections[$name])) { |
|
74 | + if (!isset($this->sections[$name])) { |
|
75 | 75 | throw new InvalidArgumentException('Section not found for remove'); |
76 | 76 | } |
77 | 77 | unset($this->sections[$name]); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | public function updateSection(string $name, array $section): void |
89 | 89 | { |
90 | - if (! isset($this->sections[$name])) { |
|
90 | + if (!isset($this->sections[$name])) { |
|
91 | 91 | throw new InvalidArgumentException('Section not found for update'); |
92 | 92 | } |
93 | 93 | $this->sections[$name] = new Section($name, $section); |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | */ |
144 | 144 | public function save(string $filename = null): bool |
145 | 145 | { |
146 | - if (! $this->config['overwrite'] && file_exists($filename)) { |
|
146 | + if (!$this->config['overwrite'] && file_exists($filename)) { |
|
147 | 147 | throw new InvalidArgumentException('Overwrite file protection'); |
148 | 148 | } |
149 | 149 | if ($filename !== null) { |