Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
php-version: '8.5'
coverage: none

- name: Install composer dependencies
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ jobs:
matrix:
os: [ubuntu-latest]
php: [8.4, 8.5]
laravel: [12.*]
laravel: [13.*, 12.*]
stability: [prefer-stable]
include:
- laravel: 13.*
testbench: 11.*
- laravel: 12.*
testbench: 10.*

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
"require": {
"php": "^8.4",
"spatie/laravel-package-tools": "^1.92",
"illuminate/contracts": "^12.0"
"illuminate/contracts": "^13.0|^12.0"
},
"require-dev": {
"larastan/larastan": "^3.7",
"laravel/pint": "^1.25",
"nunomaduro/collision": "^8.8.2",
"orchestra/testbench": "^10.1.0",
"orchestra/testbench": "^11.0.0|^10.1.0",
"pestphp/pest": "^4.0",
"pestphp/pest-plugin-laravel": "^4.0",
"pestphp/pest-plugin-profanity": "^4.1",
Expand Down
30 changes: 15 additions & 15 deletions src/FixedArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -669,27 +669,27 @@ public static function toCollection(SplFixedArray $array): Collection
public static function unique(SplFixedArray $array, bool $strict = true): SplFixedArray
{
$values = self::toArray($array);
$unique = [];

if ($strict) {
$unique = [];
foreach ($values as $v) {
$found = false;

foreach ($values as $v) {
$found = false;
foreach ($unique as $u) {
if ($v === $u) {
$found = true;

foreach ($unique as $u) {
if ($v === $u) {
$found = true;

break;
}
break;
}
}

if (!$found) {
$unique[] = $v;
}
if (!$found) {
$unique[] = $v;
}
} else {
$unique = array_unique($values);
}

if (!$strict) {
/** @var array<int, mixed> $unique */
$unique = array_values(array_unique($unique, SORT_REGULAR));
}

return self::fromArray($unique, false);
Expand Down