Skip to content

Commit

Permalink
Fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
distantnative committed Dec 17, 2024
1 parent e352c68 commit 03462fa
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions config/components.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,15 +230,15 @@
$scoring['score'] += 16 * $score;
$scoring['hits'] += 1;

// check for exact beginning matches
// check for exact beginning matches
} elseif (
$options['words'] === false &&
Str::startsWith($lowerValue, $query) === true
) {
$scoring['score'] += 8 * $score;
$scoring['hits'] += 1;

// check for exact query matches
// check for exact query matches
} elseif ($matches = preg_match_all('!' . $exact . '!ui', $value, $r)) {
$scoring['score'] += 2 * $score;
$scoring['hits'] += $matches;
Expand Down
8 changes: 4 additions & 4 deletions src/Cms/Files.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@ public function add($object): static
if ($object instanceof self) {
$this->data = [...$this->data, ...$object->data];

// add a file by id
// add a file by id
} elseif (
is_string($object) === true &&
$file = App::instance()->file($object)
) {
$this->__set($file->id(), $file);

// add a file object
// add a file object
} elseif ($object instanceof File) {
$this->__set($object->id(), $object);

// give a useful error message on invalid input;
// silently ignore "empty" values for compatibility with existing setups
// give a useful error message on invalid input;
// silently ignore "empty" values for compatibility with existing setups
} elseif (in_array($object, [null, false, true], true) !== true) {
throw new InvalidArgumentException(
message: 'You must pass a Files or File object or an ID of an existing file to the Files collection'
Expand Down
8 changes: 4 additions & 4 deletions src/Cms/PagePicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ public function items(): Pages|null
if (empty($this->options['query']) === true) {
$items = $this->itemsForParent();

// when subpage navigation is enabled, a parent
// might be passed in addition to the query.
// The parent then takes priority.
// when subpage navigation is enabled, a parent
// might be passed in addition to the query.
// The parent then takes priority.
} elseif ($this->options['subpages'] === true && empty($this->options['parent']) === false) {
$items = $this->itemsForParent();

// search by query
// search by query
} else {
$items = $this->itemsForQuery();
}
Expand Down
8 changes: 4 additions & 4 deletions src/Cms/Pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,19 @@ public function add($object): static
if ($object instanceof self) {
$this->data = [...$this->data, ...$object->data];

// add a page by id
// add a page by id
} elseif (
is_string($object) === true &&
$page = $site->find($object)
) {
$this->__set($page->id(), $page);

// add a page object
// add a page object
} elseif ($object instanceof Page) {
$this->__set($object->id(), $object);

// give a useful error message on invalid input;
// silently ignore "empty" values for compatibility with existing setups
// give a useful error message on invalid input;
// silently ignore "empty" values for compatibility with existing setups
} elseif (in_array($object, [null, false, true], true) !== true) {
throw new InvalidArgumentException(
message: 'You must pass a Pages or Page object or an ID of an existing page to the Pages collection'
Expand Down
8 changes: 4 additions & 4 deletions src/Cms/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@ public function add($object): static
if ($object instanceof self) {
$this->data = [...$this->data, ...$object->data];

// add a user by id
// add a user by id
} elseif (
is_string($object) === true &&
$user = App::instance()->user($object)
) {
$this->__set($user->id(), $user);

// add a user object
// add a user object
} elseif ($object instanceof User) {
$this->__set($object->id(), $object);

// give a useful error message on invalid input;
// silently ignore "empty" values for compatibility with existing setups
// give a useful error message on invalid input;
// silently ignore "empty" values for compatibility with existing setups
} elseif (in_array($object, [null, false, true], true) !== true) {
throw new InvalidArgumentException(
message: 'You must pass a Users or User object or an ID of an existing user to the Users collection'
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,11 @@ public function detect(
if ($options['allowed'] === '*' || $options['allowed'] === ['*']) {
$this->detectAuto(true);

// fixed environments
// fixed environments
} elseif (empty($options['allowed']) === false) {
$this->detectAllowed($options['allowed']);

// secure auto-detection
// secure auto-detection
} else {
$this->detectAuto();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Panel/Panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public static function response($result, array $options = []): Response
message: 'The data could not be found'
);

// interpret strings as errors
// interpret strings as errors
} elseif (is_string($result) === true) {
$result = new Exception($result);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Parsley/Parsley.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public function mergeOrAppend(array $block): void
) {
$this->blocks[$lastIndex]['content']['text'] .= ' ' . $block['content']['text'];

// append
// append
} else {
$this->blocks[] = $block;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Toolkit/A.php
Original file line number Diff line number Diff line change
Expand Up @@ -510,15 +510,15 @@ public static function merge(array|int ...$arrays): array
) {
$merged[] = $value;

// recursively merge the two array values
// recursively merge the two array values
} elseif (
is_array($value) === true &&
isset($merged[$key]) === true &&
is_array($merged[$key]) === true
) {
$merged[$key] = static::merge($merged[$key], $value, $mode);

// simply overwrite with the value from the second array
// simply overwrite with the value from the second array
} else {
$merged[$key] = $value;
}
Expand Down

0 comments on commit 03462fa

Please sign in to comment.