Skip to content

Commit 376b34a

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.3
Conflicts: composer.json user_guide_src/source/models/model.rst
2 parents 1a82717 + 7a631a1 commit 376b34a

File tree

14 files changed

+37
-41
lines changed

14 files changed

+37
-41
lines changed

.github/workflows/test-autoreview.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,12 @@ jobs:
3030
coverage: none
3131

3232
- name: Get composer cache directory
33-
id: composercache
34-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
33+
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
3534

3635
- name: Cache dependencies
3736
uses: actions/cache@v3
3837
with:
39-
path: ${{ steps.composercache.outputs.dir }}
38+
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
4039
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
4140
restore-keys: ${{ runner.os }}-composer-
4241

.github/workflows/test-coding-standards.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,12 @@ jobs:
3636
coverage: none
3737

3838
- name: Get composer cache directory
39-
id: composer-cache
40-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
39+
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
4140

4241
- name: Cache dependencies
4342
uses: actions/cache@v3
4443
with:
45-
path: ${{ steps.composer-cache.outputs.dir }}
44+
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
4645
key: ${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
4746
restore-keys: |
4847
${{ runner.os }}-${{ matrix.php-version }}-

.github/workflows/test-deptrac.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,12 @@ jobs:
4343
run: composer validate --strict
4444

4545
- name: Get composer cache directory
46-
id: composer-cache
47-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
46+
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
4847

49-
- name: Create composer cache directory
50-
run: mkdir -p ${{ steps.composer-cache.outputs.dir }}
51-
52-
- name: Cache composer dependencies
48+
- name: Cache dependencies
5349
uses: actions/cache@v3
5450
with:
55-
path: ${{ steps.composer-cache.outputs.dir }}
51+
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
5652
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
5753
restore-keys: ${{ runner.os }}-composer-
5854

.github/workflows/test-phpstan.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,12 @@ jobs:
5050
run: composer validate --strict
5151

5252
- name: Get composer cache directory
53-
id: composer-cache
54-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
53+
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
5554

56-
- name: Create composer cache directory
57-
run: mkdir -p ${{ steps.composer-cache.outputs.dir }}
58-
59-
- name: Cache composer dependencies
55+
- name: Cache dependencies
6056
uses: actions/cache@v3
6157
with:
62-
path: ${{ steps.composer-cache.outputs.dir }}
58+
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
6359
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
6460
restore-keys: ${{ runner.os }}-composer-
6561

.github/workflows/test-phpunit.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,12 @@ jobs:
141141
sudo apt-get install --fix-broken
142142
143143
- name: Get composer cache directory
144-
id: composercache
145-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
144+
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
146145

147146
- name: Cache dependencies
148147
uses: actions/cache@v3
149148
with:
150-
path: ${{ steps.composercache.outputs.dir }}
149+
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
151150
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
152151
restore-keys: ${{ runner.os }}-composer-
153152

.github/workflows/test-rector.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,12 @@ jobs:
5959
run: composer validate --strict
6060

6161
- name: Get composer cache directory
62-
id: composer-cache
63-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
62+
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
6463

65-
- name: Create composer cache directory
66-
run: mkdir -p ${{ steps.composer-cache.outputs.dir }}
67-
68-
- name: Cache composer dependencies
64+
- name: Cache dependencies
6965
uses: actions/cache@v3
7066
with:
71-
path: ${{ steps.composer-cache.outputs.dir }}
67+
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
7268
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
7369
restore-keys: ${{ runner.os }}-composer-
7470

app/Views/errors/html/error_exception.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@
270270

271271
<?php endif; ?>
272272

273-
<?php $headers = $request->getHeaders(); ?>
273+
<?php $headers = $request->headers(); ?>
274274
<?php if (! empty($headers)) : ?>
275275

276276
<h3>Headers</h3>
@@ -318,7 +318,7 @@
318318
</tr>
319319
</table>
320320

321-
<?php $headers = $response->getHeaders(); ?>
321+
<?php $headers = $response->headers(); ?>
322322
<?php if (! empty($headers)) : ?>
323323
<?php natsort($headers) ?>
324324

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"phpstan/phpstan": "^1.7.1",
2525
"phpunit/phpunit": "^9.1",
2626
"predis/predis": "^1.1 || ^2.0",
27-
"rector/rector": "0.14.5",
27+
"rector/rector": "0.14.6",
2828
"vimeo/psalm": "^4.26"
2929
},
3030
"suggest": {

system/HTTP/ResponseTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ public function sendHeaders()
473473
header(sprintf('HTTP/%s %s %s', $this->getProtocolVersion(), $this->getStatusCode(), $this->getReasonPhrase()), true, $this->getStatusCode());
474474

475475
// Send all of our headers
476-
foreach (array_keys($this->getHeaders()) as $name) {
476+
foreach (array_keys($this->headers()) as $name) {
477477
header($name . ': ' . $this->getHeaderLine($name), false, $this->getStatusCode());
478478
}
479479

user_guide_src/source/libraries/curlrequest/006.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
echo $response->getStatusCode();
44
echo $response->getBody();
5-
echo $response->getHeader('Content-Type');
5+
echo $response->header('Content-Type');
66
$language = $response->negotiateLanguage(['en', 'fr']);

user_guide_src/source/libraries/curlrequest/010.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
echo $response->getHeaderLine('Content-Type');
55

66
// Get all headers
7-
foreach ($response->getHeaders() as $name => $value) {
7+
foreach ($response->headers() as $name => $value) {
88
echo $name . ': ' . $response->getHeaderLine($name) . "\n";
99
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
22

3-
if (strpos($response->getHeader('content-type'), 'application/json') !== false) {
3+
if (strpos($response->header('content-type'), 'application/json') !== false) {
44
$body = json_decode($body);
55
}

user_guide_src/source/models/model.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,14 +319,18 @@ Saving Data
319319
insert()
320320
--------
321321

322-
An associative array of data is passed into this method as the only parameter to create a new
323-
row of data in the database. The array's keys must match the name of the columns in a ``$table``, while
324-
the array's values are the values to save for that key:
322+
The first parametre is an associative array of data to create a new row of data in the database.
323+
If an object is passed instead of an array, it will attempt to convert it to an array.
325324

326-
.. literalinclude:: model/015.php
325+
The array's keys must match the name of the columns in the ``$table``, while the array's values are the values to save for that key.
326+
327+
The optional second parameter is of type boolean, and if it is set to false, the method will return a boolean value,
328+
which indicates the success or failure of the query.
327329

328330
You can retrieve the last inserted row's primary key using the ``getInsertID()`` method.
329331

332+
.. literalinclude:: model/015.php
333+
330334
.. _model-allow-empty-inserts:
331335

332336
allowEmptyInserts()

user_guide_src/source/models/model/015.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,11 @@
55
'email' => '[email protected]',
66
];
77

8+
// Inserts data and returns inserted row's primary key
89
$userModel->insert($data);
10+
11+
// Inserts data and returns true on success and false on failure
12+
$userModel->insert($data, false);
13+
14+
// Returns inserted row's primary key
15+
$userModel->getInsertID();

0 commit comments

Comments
 (0)