Skip to content

Commit 3c079f5

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.8
# Conflicts: # system/CodeIgniter.php # user_guide_src/source/changelogs/index.rst # user_guide_src/source/installation/upgrading.rst # utils/phpstan-baseline/loader.neon
2 parents 78256e2 + d6cc89f commit 3c079f5

11 files changed

Lines changed: 124 additions & 38 deletions

File tree

‎composer.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@
1717
"psr/log": "^3.0"
1818
},
1919
"require-dev": {
20-
"boundwize/structarmed": "0.6.15",
20+
"boundwize/structarmed": "0.8.1",
2121
"codeigniter/phpstan-codeigniter": "^1.5",
2222
"fakerphp/faker": "^1.24",
2323
"kint-php/kint": "^6.1",
2424
"mikey179/vfsstream": "^1.6.12",
2525
"nexusphp/tachycardia": "^2.0",
2626
"phpstan/extension-installer": "^1.4",
27-
"phpstan/phpstan": "^2.1.55",
27+
"phpstan/phpstan": "^2.2.1",
2828
"phpstan/phpstan-strict-rules": "^2.0",
2929
"phpunit/phpcov": "^9.0.2 || ^10.0",
3030
"phpunit/phpunit": "^10.5.16 || ^11.2",
3131
"predis/predis": "^3.0",
32-
"rector/rector": "2.4.4",
32+
"rector/rector": "2.4.5",
3333
"shipmonk/phpstan-baseline-per-identifier": "^2.0"
3434
},
3535
"replace": {

‎system/Database/BaseBuilder.php‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3049,6 +3049,13 @@ protected function validateUpdate(): bool
30493049
*/
30503050
public function updateBatch($set = null, $constraints = null, int $batchSize = 100)
30513051
{
3052+
if ($this->QBWhere !== []) {
3053+
throw new DatabaseException(
3054+
'updateBatch() cannot be safely combined with existing Query Builder WHERE conditions. '
3055+
. 'Use updateBatch($data, $constraints), onConstraint(), or include all required constraint fields in the batch data.',
3056+
);
3057+
}
3058+
30523059
$this->onConstraint($constraints);
30533060

30543061
if (isset($this->QBOptions['setQueryAsData'])) {

‎tests/system/Database/Builder/UpdateTest.php‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,24 @@ public function testUpdateBatchThrowsExceptionWithNoData(): void
297297
$builder->updateBatch(null, 'id');
298298
}
299299

300+
public function testUpdateBatchThrowsExceptionWithWhere(): void
301+
{
302+
$builder = new BaseBuilder('jobs', $this->db);
303+
304+
$this->expectException(DatabaseException::class);
305+
$this->expectExceptionMessage(
306+
'updateBatch() cannot be safely combined with existing Query Builder WHERE conditions. '
307+
. 'Use updateBatch($data, $constraints), onConstraint(), or include all required constraint fields in the batch data.',
308+
);
309+
310+
$builder->where('description', 'old')->updateBatch([
311+
[
312+
'id' => 2,
313+
'name' => 'Comedian',
314+
],
315+
], 'id');
316+
}
317+
300318
public function testUpdateBatchThrowsExceptionWithNoID(): void
301319
{
302320
$builder = new BaseBuilder('jobs', $this->db);

‎user_guide_src/source/changelogs/index.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ See all the changes.
1313
:titlesonly:
1414

1515
v4.8.0
16+
v4.7.4
1617
v4.7.3
1718
v4.7.2
1819
v4.7.1
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#############
2+
Version 4.7.4
3+
#############
4+
5+
Release Date: Unreleased
6+
7+
**4.7.4 release of CodeIgniter4**
8+
9+
.. contents::
10+
:local:
11+
:depth: 3
12+
13+
********
14+
BREAKING
15+
********
16+
17+
***************
18+
Message Changes
19+
***************
20+
21+
*******
22+
Changes
23+
*******
24+
25+
************
26+
Deprecations
27+
************
28+
29+
**********
30+
Bugs Fixed
31+
**********
32+
33+
- **Database:** Fixed a bug where ``updateBatch()`` could be called after Query Builder ``where()`` conditions, even though it's not supported. In this situation, now the ``DatabaseException`` is thrown.
34+
35+
See the repo's
36+
`CHANGELOG.md <https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md>`_
37+
for a complete list of bugs fixed.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#############################
2+
Upgrading from 4.7.3 to 4.7.4
3+
#############################
4+
5+
Please refer to the upgrade instructions corresponding to your installation method.
6+
7+
- :ref:`Composer Installation App Starter Upgrading <app-starter-upgrading>`
8+
- :ref:`Composer Installation Adding CodeIgniter4 to an Existing Project Upgrading <adding-codeigniter4-upgrading>`
9+
- :ref:`Manual Installation Upgrading <installing-manual-upgrading>`
10+
11+
.. contents::
12+
:local:
13+
:depth: 2
14+
15+
**********************
16+
Mandatory File Changes
17+
**********************
18+
19+
****************
20+
Breaking Changes
21+
****************
22+
23+
*********************
24+
Breaking Enhancements
25+
*********************
26+
27+
*************
28+
Project Files
29+
*************
30+
31+
Some files in the **project space** (root, app, public, writable) received updates. Due to
32+
these files being outside of the **system** scope they will not be changed without your intervention.
33+
34+
.. note:: There are some third-party CodeIgniter modules available to assist
35+
with merging changes to the project space:
36+
`Explore on Packagist <https://packagist.org/explore/?query=codeigniter4%20updates>`_.
37+
38+
Content Changes
39+
===============
40+
41+
The following files received significant changes (including deprecations or visual adjustments)
42+
and it is recommended that you merge the updated versions with your application:
43+
44+
Config
45+
------
46+
47+
- @TODO
48+
49+
All Changes
50+
===========
51+
52+
This is a list of all files in the **project space** that received changes;
53+
many will be simple comments or formatting that have no effect on the runtime:
54+
55+
- @TODO

‎user_guide_src/source/installation/upgrading.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Alternatively, replace it with a new file and add your previous lines.
2323
backward_compatibility_notes
2424

2525
upgrade_480
26+
upgrade_474
2627
upgrade_473
2728
upgrade_472
2829
upgrade_471

‎utils/phpstan-baseline/empty.notAllowed.neon‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# total 214 errors
1+
# total 210 errors
22

33
parameters:
44
ignoreErrors:

‎utils/phpstan-baseline/function.alreadyNarrowedType.neon‎

Lines changed: 0 additions & 13 deletions
This file was deleted.

‎utils/phpstan-baseline/function.impossibleType.neon‎

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)