Skip to content

Commit c78f07d

Browse files
committed
Merge tag 'v4.1.1' into develop
Minor change to error iterator due to Laravel bug
2 parents 2c883a5 + 4fa2662 commit c78f07d

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
steps:
2121
- name: Checkout Code
22-
uses: actions/checkout@v3
22+
uses: actions/checkout@v4
2323

2424
- name: Setup PHP
2525
uses: shivammathur/setup-php@v2
@@ -34,7 +34,7 @@ jobs:
3434
run: composer require "illuminate/contracts:^${{ matrix.laravel }}" --no-update
3535

3636
- name: Install dependencies
37-
uses: nick-fields/retry@v2
37+
uses: nick-fields/retry@v3
3838
with:
3939
timeout_minutes: 5
4040
max_attempts: 5

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. This projec
55

66
## Unreleased
77

8+
## [4.1.1] - 2024-06-20
9+
10+
### Fixed
11+
12+
- [laravel#287](https://github.com/laravel-json-api/laravel/issues/287) Use `array_shift` to avoid potential problem
13+
introduced in Laravel.
14+
815
## [4.1.0] - 2024-03-23
916

1017
### Added
@@ -21,6 +28,13 @@ All notable changes to this project will be documented in this file. This projec
2128
- **BREAKING** Package now requires Laravel 11.
2229
- Minimum PHP version is now `8.2`.
2330

31+
## [3.0.1] - 2024-06-20
32+
33+
### Fixed
34+
35+
- [laravel#287](https://github.com/laravel-json-api/laravel/issues/287) Use `array_shift` to avoid potential problem
36+
introduced in Laravel.
37+
2438
## [3.0.0] - 2023-02-14
2539

2640
### Changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
]
5454
}
5555
},
56-
"minimum-stability": "dev",
56+
"minimum-stability": "stable",
5757
"prefer-stable": true,
5858
"config": {
5959
"sort-packages": true

src/ErrorIterator.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,15 @@ public function getIterator(): Traversable
106106
$failed = $this->failed();
107107

108108
foreach ($this->validator->errors()->messages() as $key => $messages) {
109-
$failures = $this->translator->validationFailures($failed[$key] ?? []);
109+
$failures = $this->translator
110+
->validationFailures($failed[$key] ?? [])
111+
->all();
110112

111113
foreach ($messages as $message) {
112114
yield $this->createError(
113115
$key,
114116
$message,
115-
$failures->shift() ?: []
117+
array_shift($failures) ?: [],
116118
);
117119
}
118120
}

0 commit comments

Comments
 (0)