Skip to content

Commit 5bf3a98

Browse files
authored
Merge pull request #854 from Jah-yee/fix/occured-to-occurred-typo
fix: correct occured to occurred typo in error messages
2 parents 69a809e + e58f3a6 commit 5bf3a98

8 files changed

Lines changed: 31 additions & 31 deletions

File tree

src/BrowscapUpdater.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function convertFile(string $iniFile): void
100100
$iniString = file_get_contents($iniFile);
101101

102102
if ($iniString === false) {
103-
throw new ErrorReadingFileException('an error occured while converting the local file into the cache');
103+
throw new ErrorReadingFileException('an error occurred while converting the local file into the cache');
104104
}
105105

106106
$this->convertString($iniString);
@@ -116,7 +116,7 @@ public function convertString(string $iniString): void
116116
try {
117117
$cachedVersion = $this->cache->getItem('browscap.version', false, $success);
118118
} catch (InvalidArgumentException $e) {
119-
$this->logger->error(new \InvalidArgumentException('an error occured while reading the data version from the cache', 0, $e));
119+
$this->logger->error(new \InvalidArgumentException('an error occurred while reading the data version from the cache', 0, $e));
120120

121121
return;
122122
}
@@ -161,7 +161,7 @@ public function fetch(string $file, string $remoteFile = IniLoaderInterface::PHP
161161
} catch (GuzzleException $e) {
162162
throw new FetcherException(
163163
sprintf(
164-
'an error occured while fetching remote data from URI %s',
164+
'an error occurred while fetching remote data from URI %s',
165165
$uri,
166166
),
167167
0,
@@ -172,7 +172,7 @@ public function fetch(string $file, string $remoteFile = IniLoaderInterface::PHP
172172
if ($response->getStatusCode() !== 200) {
173173
throw new FetcherException(
174174
sprintf(
175-
'an error occured while fetching remote data from URI %s: StatusCode was %d',
175+
'an error occurred while fetching remote data from URI %s: StatusCode was %d',
176176
$uri,
177177
$response->getStatusCode(),
178178
),
@@ -182,7 +182,7 @@ public function fetch(string $file, string $remoteFile = IniLoaderInterface::PHP
182182
try {
183183
$content = $response->getBody()->getContents();
184184
} catch (Throwable $e) {
185-
throw new FetcherException('an error occured while fetching remote data', 0, $e);
185+
throw new FetcherException('an error occurred while fetching remote data', 0, $e);
186186
}
187187

188188
if (empty($content)) {
@@ -194,7 +194,7 @@ public function fetch(string $file, string $remoteFile = IniLoaderInterface::PHP
194194

195195
throw FetcherException::httpError(
196196
$uri,
197-
'an error occured while fetching remote data, but no error was raised',
197+
'an error occurred while fetching remote data, but no error was raised',
198198
);
199199
}
200200

@@ -212,7 +212,7 @@ public function fetch(string $file, string $remoteFile = IniLoaderInterface::PHP
212212
try {
213213
$fs->dumpFile($file, $content);
214214
} catch (IOException $exception) {
215-
throw new FetcherException('an error occured while writing fetched data to local file', 0, $exception);
215+
throw new FetcherException('an error occurred while writing fetched data to local file', 0, $exception);
216216
}
217217
}
218218

@@ -253,7 +253,7 @@ public function update(string $remoteFile = IniLoaderInterface::PHP_INI): void
253253
} catch (GuzzleException $e) {
254254
throw new FetcherException(
255255
sprintf(
256-
'an error occured while fetching remote data from URI %s',
256+
'an error occurred while fetching remote data from URI %s',
257257
$uri,
258258
),
259259
0,
@@ -264,7 +264,7 @@ public function update(string $remoteFile = IniLoaderInterface::PHP_INI): void
264264
if ($response->getStatusCode() !== 200) {
265265
throw new FetcherException(
266266
sprintf(
267-
'an error occured while fetching remote data from URI %s: StatusCode was %d',
267+
'an error occurred while fetching remote data from URI %s: StatusCode was %d',
268268
$uri,
269269
$response->getStatusCode(),
270270
),
@@ -274,7 +274,7 @@ public function update(string $remoteFile = IniLoaderInterface::PHP_INI): void
274274
try {
275275
$content = $response->getBody()->getContents();
276276
} catch (Throwable $e) {
277-
throw new FetcherException('an error occured while fetching remote data', 0, $e);
277+
throw new FetcherException('an error occurred while fetching remote data', 0, $e);
278278
}
279279

280280
if (empty($content)) {
@@ -309,7 +309,7 @@ public function checkUpdate(): ?int
309309
try {
310310
$cachedVersion = $this->cache->getItem('browscap.version', false, $success);
311311
} catch (InvalidArgumentException $e) {
312-
throw new ErrorCachedVersionException('an error occured while reading the data version from the cache', 0, $e);
312+
throw new ErrorCachedVersionException('an error occurred while reading the data version from the cache', 0, $e);
313313
}
314314

315315
assert($cachedVersion === null || is_int($cachedVersion));
@@ -327,7 +327,7 @@ public function checkUpdate(): ?int
327327
} catch (GuzzleException $e) {
328328
throw new FetcherException(
329329
sprintf(
330-
'an error occured while fetching version data from URI %s',
330+
'an error occurred while fetching version data from URI %s',
331331
$uri,
332332
),
333333
0,
@@ -338,7 +338,7 @@ public function checkUpdate(): ?int
338338
if ($response->getStatusCode() !== 200) {
339339
throw new FetcherException(
340340
sprintf(
341-
'an error occured while fetching version data from URI %s: StatusCode was %d',
341+
'an error occurred while fetching version data from URI %s: StatusCode was %d',
342342
$uri,
343343
$response->getStatusCode(),
344344
),
@@ -350,7 +350,7 @@ public function checkUpdate(): ?int
350350
} catch (Throwable $e) {
351351
throw new FetcherException(
352352
sprintf(
353-
'an error occured while fetching version data from URI %s: StatusCode was %d',
353+
'an error occurred while fetching version data from URI %s: StatusCode was %d',
354354
$uri,
355355
$response->getStatusCode(),
356356
),

src/Cache/BrowscapCache.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function getVersion(): ?int
6868
try {
6969
$cachedVersion = $this->getItem('browscap.version', false, $success);
7070
} catch (InvalidArgumentException $e) {
71-
$this->logger->error(new \InvalidArgumentException('an error occured while reading the data version from the cache', 0, $e));
71+
$this->logger->error(new \InvalidArgumentException('an error occurred while reading the data version from the cache', 0, $e));
7272
$cachedVersion = null;
7373
}
7474

@@ -95,7 +95,7 @@ public function getReleaseDate(): ?string
9595
try {
9696
$releaseDate = $this->getItem('browscap.releaseDate', false, $success);
9797
} catch (InvalidArgumentException $e) {
98-
$this->logger->error(new \InvalidArgumentException('an error occured while reading the data release date from the cache', 0, $e));
98+
$this->logger->error(new \InvalidArgumentException('an error occurred while reading the data release date from the cache', 0, $e));
9999
$releaseDate = null;
100100
}
101101

@@ -122,7 +122,7 @@ public function getType(): ?string
122122
try {
123123
$type = $this->getItem('browscap.type', false, $success);
124124
} catch (InvalidArgumentException $e) {
125-
$this->logger->error(new \InvalidArgumentException('an error occured while reading the data type from the cache', 0, $e));
125+
$this->logger->error(new \InvalidArgumentException('an error occurred while reading the data type from the cache', 0, $e));
126126
$type = null;
127127
}
128128

src/Helper/Converter.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function convertString(string $iniString): void
110110
$this->logger->error('could not write pattern data "' . $subkey . '" to the cache');
111111
}
112112
} catch (InvalidArgumentException $e) {
113-
$this->logger->error(new \InvalidArgumentException('an error occured while writing pattern data into the cache', 0, $e));
113+
$this->logger->error(new \InvalidArgumentException('an error occurred while writing pattern data into the cache', 0, $e));
114114
}
115115
}
116116

@@ -129,23 +129,23 @@ public function convertString(string $iniString): void
129129
$this->logger->error('could not write property data "' . $subkey . '" to the cache');
130130
}
131131
} catch (InvalidArgumentException $e) {
132-
$this->logger->error(new \InvalidArgumentException('an error occured while writing property data into the cache', 0, $e));
132+
$this->logger->error(new \InvalidArgumentException('an error occurred while writing property data into the cache', 0, $e));
133133
}
134134
}
135135
} catch (OutOfRangeException | UnexpectedValueException | JsonException | \InvalidArgumentException $e) {
136-
$this->logger->error(new \InvalidArgumentException('an error occured while writing property data into the cache', 0, $e));
136+
$this->logger->error(new \InvalidArgumentException('an error occurred while writing property data into the cache', 0, $e));
137137
}
138138

139139
try {
140140
$this->cache->setItem('browscap.releaseDate', $this->getIniReleaseDate($iniString), false);
141141
} catch (InvalidArgumentException $e) {
142-
$this->logger->error(new \InvalidArgumentException('an error occured while writing data release date into the cache', 0, $e));
142+
$this->logger->error(new \InvalidArgumentException('an error occurred while writing data release date into the cache', 0, $e));
143143
}
144144

145145
try {
146146
$this->cache->setItem('browscap.type', $this->getIniType($iniString), false);
147147
} catch (InvalidArgumentException $e) {
148-
$this->logger->error(new \InvalidArgumentException('an error occured while writing the data type into the cache', 0, $e));
148+
$this->logger->error(new \InvalidArgumentException('an error occurred while writing the data type into the cache', 0, $e));
149149
}
150150

151151
$this->logger->info('finished creating data from the ini data');
@@ -192,7 +192,7 @@ public function storeVersion(): void
192192
try {
193193
$this->cache->setItem('browscap.version', $this->iniVersion, false);
194194
} catch (InvalidArgumentException $e) {
195-
$this->logger->error(new \InvalidArgumentException('an error occured while writing the data version into the cache', 0, $e));
195+
$this->logger->error(new \InvalidArgumentException('an error occurred while writing the data version into the cache', 0, $e));
196196
}
197197
}
198198

src/Helper/Quoter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function pregUnQuote(string $pattern): string
5454

5555
if ($pattern === null) {
5656
throw new UnexpectedValueException(
57-
sprintf('an error occured while handling pattern %s', $origPattern),
57+
sprintf('an error occurred while handling pattern %s', $origPattern),
5858
);
5959
}
6060

src/IniParser/IniParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function createIniParts(string $content): Generator
7474
// pattern (filtered in the previous step)
7575
$iniParts = preg_split('/\[[^\r\n]+\]/', $content);
7676
if ($iniParts === false) {
77-
throw new UnexpectedValueException('an error occured while splitting content into parts');
77+
throw new UnexpectedValueException('an error occurred while splitting content into parts');
7878
}
7979

8080
$contents = [];

src/Parser/Helper/GetData.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ private function getIniPart(string $pattern): array
132132
$this->logger->error(
133133
new \InvalidArgumentException(
134134
sprintf(
135-
'an error occured while checking inipart "browscap.iniparts.%s" in the cache',
135+
'an error occurred while checking inipart "browscap.iniparts.%s" in the cache',
136136
$subkey,
137137
),
138138
0,
@@ -151,7 +151,7 @@ private function getIniPart(string $pattern): array
151151
$this->logger->error(
152152
new \InvalidArgumentException(
153153
sprintf(
154-
'an error occured while reading inipart "browscap.iniparts.%s" from the cache',
154+
'an error occurred while reading inipart "browscap.iniparts.%s" from the cache',
155155
$subkey,
156156
),
157157
0,

src/Parser/Helper/GetPattern.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function getPatterns(string $userAgent): Generator
7979
$this->logger->error(
8080
new \InvalidArgumentException(
8181
sprintf(
82-
'an error occured while checking pattern "browscap.patterns.%s" in the cache',
82+
'an error occurred while checking pattern "browscap.patterns.%s" in the cache',
8383
$tmpSubkey,
8484
),
8585
0,
@@ -98,7 +98,7 @@ public function getPatterns(string $userAgent): Generator
9898
$this->logger->error(
9999
new \InvalidArgumentException(
100100
sprintf(
101-
'an error occured while reading pattern "browscap.patterns.%s" from the cache',
101+
'an error occurred while reading pattern "browscap.patterns.%s" from the cache',
102102
$tmpSubkey,
103103
),
104104
0,

tests/BrowscapUpdaterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ public function testFetchFail(): void
372372

373373
$this->expectException(BrowscapException\FetcherException::class);
374374
$this->expectExceptionMessage(
375-
'an error occured while fetching version data from URI http://browscap.org/version-number: StatusCode was 500',
375+
'an error occurred while fetching version data from URI http://browscap.org/version-number: StatusCode was 500',
376376
);
377377
$this->object->fetch(IniLoaderInterface::PHP_INI);
378378
}
@@ -1099,7 +1099,7 @@ public function testCheckUpdateWithException(): void
10991099

11001100
$this->expectException(BrowscapException\FetcherException::class);
11011101
$this->expectExceptionMessage(
1102-
'an error occured while fetching version data from URI http://browscap.org/version-number: StatusCode was 200',
1102+
'an error occurred while fetching version data from URI http://browscap.org/version-number: StatusCode was 200',
11031103
);
11041104
$this->object->checkUpdate();
11051105
}

0 commit comments

Comments
 (0)