Skip to content

Commit eeea8a3

Browse files
committed
Clean up inline comments and tighten wording
Inline comments should read as complete sentences and be easy to scan. Ending each comment with a full stop signals that the thought is complete and keeps the style consistent across the codebase. Where comments were verbose or imprecise, take the opportunity to tighten the wording without changing meaning.
1 parent 8f4af56 commit eeea8a3

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/Filter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,10 @@ protected function performEqualityMatch(mixed $value, mixed $rowValue, bool $ign
231231
{
232232
if ($ignoreCase && is_string($rowValue)) {
233233
$rowValue = strtolower($rowValue);
234-
/** @var string|string[] $value {@see self::normalizeTypes} ensures this is the case */
234+
/** @var string|string[] $value {@link self::normalizeTypes} ensures this is the case */
235235
$value = is_array($value)
236236
? array_map('strtolower', $value)
237-
: ($value === null ? null : strtolower($value)); // phpstan is wrong here
237+
: ($value === null ? null : strtolower($value)); // PHPStan incorrectly infers the type here.
238238
}
239239

240240
if (is_array($value)) {
@@ -257,10 +257,10 @@ protected function performSimilarityMatch(mixed $value, mixed $rowValue, bool $i
257257
{
258258
if ($ignoreCase && is_string($rowValue)) {
259259
$rowValue = strtolower($rowValue);
260-
/** @var string|string[] $value {@see self::normalizeTypes} ensures this is the case */
260+
/** @var string|string[] $value {@link self::normalizeTypes} ensures this is the case */
261261
$value = is_array($value)
262262
? array_map('strtolower', $value)
263-
: ($value === null ? null : strtolower($value)); // phpstan is wrong here
263+
: ($value === null ? null : strtolower($value)); // PHPStan incorrectly infers the type here.
264264
}
265265

266266
if (is_array($value)) {

src/PriorityQueue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function insert(mixed $value, mixed $priority): true
3737
*/
3838
public function yieldAll(): Generator
3939
{
40-
// Clone queue because the SplPriorityQueue acts as a heap and thus items are removed upon iteration
40+
// Clone the queue because SplPriorityQueue acts as a heap and removes items upon iteration.
4141
$queue = clone $this;
4242

4343
$queue->setExtractFlags(static::EXTR_BOTH);

src/functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function arrayval(iterable|stdClass $subject): array
4343
return (array) $subject;
4444
}
4545

46-
// Works for generators too
46+
// Also works for generators.
4747
return iterator_to_array($subject);
4848
}
4949

src/functions_include.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
// Don't redefine the functions if included multiple times
3+
// Do not redefine the functions if this file is included multiple times.
44
if (! function_exists('ipl\Stdlib\get_php_type')) {
55
require __DIR__ . '/functions.php';
66
}

0 commit comments

Comments
 (0)