Skip to content

Commit 8833d22

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.3
2 parents ad65846 + 6b077b7 commit 8833d22

File tree

27 files changed

+291
-127
lines changed

27 files changed

+291
-127
lines changed

.github/workflows/test-rector.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- app
4040
- system
4141
- tests
42-
- utils/Rector
42+
- utils
4343
steps:
4444
- name: Checkout
4545
uses: actions/checkout@v3

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.13.7"
27+
"rector/rector": "0.13.8"
2828
},
2929
"suggest": {
3030
"ext-fileinfo": "Improves mime type detection for files"

contributing/pull_request.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,12 @@ The best way to contribute is to fork the CodeIgniter4 repository, and "clone" t
238238
- `> cd CodeIgniter4/`
239239
- `> composer update`
240240
6. Create a new [branch](https://help.github.com/en/articles/about-branches) in your project for each set of changes you want to make.
241-
- `> git checkout -b <new-branch-name>`
241+
- If your PR is for bug fixes:
242+
- `> git switch develop`
243+
- `> git switch -c <new-branch-name>`
244+
- If your PR has any enhancement, create new branch from next minor version branch, e.g. __"4.3"__:
245+
- `> git switch <next-minor-version-branch>`
246+
- `> git switch -c <new-branch-name>`
242247
7. Fix existing bugs on the [Issue tracker](https://github.com/codeigniter4/CodeIgniter4/issues) after confirming that no one else is working on them.
243248
8. [Commit](https://help.github.com/en/desktop/contributing-to-projects/committing-and-reviewing-changes-to-your-project) the changed files in your contribution branch.
244249
- `> git commit`

contributing/workflow.md

Lines changed: 71 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ ORIGIN\_URL.
6161

6262
Clone your repository, leaving a local folder for you to work with:
6363

64-
cd ALL_PROJECTS
65-
git clone ORIGIN_URL
64+
```console
65+
> cd ALL_PROJECTS
66+
> git clone ORIGIN_URL
67+
```
6668

6769
## Syncing your repository
6870

@@ -72,16 +74,20 @@ an alias for the shared repository as well, so that you can "synch" the
7274
two, making sure that your repository includes any other contributions
7375
that have been merged by us into the shared repo:
7476

75-
git remote add upstream UPSTREAM_URL
77+
```console
78+
> git remote add upstream UPSTREAM_URL
79+
```
7680

7781
Then synchronizing is done by pulling from us and pushing to you. This
7882
is normally done locally, so that you can resolve any merge conflicts.
7983
For instance, to synchronize **develop** branches:
8084

81-
git switch develop
82-
git fetch upstream
83-
git merge upstream/develop
84-
git push origin develop
85+
```console
86+
> git switch develop
87+
> git fetch upstream
88+
> git merge upstream/develop
89+
> git push origin develop
90+
```
8591

8692
You might get merge conflicts when you merge. It is your
8793
responsibility to resolve those locally, so that you can continue
@@ -105,12 +111,25 @@ This local branch should be named appropriately, for instance
105111
"fix/problem123" or "new/mind-reader". The slashes in these branch names
106112
is optional, and implies a sort of namespacing if used.
107113

108-
For instance, make sure you are in the *develop* branch, and create a
109-
new feature branch, based on *develop*, for a new feature you are
114+
- All bug fix PRs should be sent to the __"develop"__ branch, this is where the next bug fix version will be developed.
115+
- PRs with any enhancement should be sent to next minor version branch, e.g. __"4.3"__
116+
117+
For instance, if you send a PR to __"develop"__ branch, make sure you are in the *develop* branch, and create a
118+
new bugfix branch, based on *develop*, for a new feature you are
110119
creating:
111120

112-
git switch develop
113-
git switch -c new/mind-reader
121+
```console
122+
> git switch develop
123+
> git switch -c fix/problem123
124+
```
125+
126+
If you send a PR with an enhancement, make sure you are in the *next minor version* branch,
127+
and create a new feature branch, based on, e.g., *4.3*, for a new feature you are creating:
128+
129+
```console
130+
> git switch 4.3
131+
> git switch -c new/mind-reader
132+
```
114133

115134
Saving changes only updates your local working area.
116135

@@ -123,23 +142,27 @@ in.
123142
You can have as many commits in a branch as you need to "get it right".
124143
For instance, to commit your work from a debugging session:
125144

126-
git add .
127-
git commit -S -m "Find and fix the broken reference problem"
145+
```console
146+
> git add .
147+
> git commit -S -m "Find and fix the broken reference problem"
148+
```
128149

129150
Just make sure that your commits in a feature branch are all related.
130151

131152
If you are working on two features at a time, then you will want to
132153
switch between them to keep the contributions separate. For instance:
133154

134-
git switch new/mind-reader
135-
// work away
136-
git add .
137-
git commit -S -m "Added adapter for abc"
138-
git switch fix/issue-123
139-
// work away
140-
git add .
141-
git commit -S -m "Fixed problem in DEF\Something"
142-
git switch develop
155+
```console
156+
> git switch new/mind-reader
157+
> ## work away
158+
> git add .
159+
> git commit -S -m "Added adapter for abc"
160+
> git switch fix/issue-123
161+
> ## work away
162+
> git add .
163+
> git commit -S -m "Fixed problem in DEF\Something"
164+
> git switch develop
165+
```
143166

144167
The last checkout makes sure that you end up in your *develop* branch as
145168
a starting point for your next session working with your repository.
@@ -157,19 +180,25 @@ It is a lot easier to resolve conflicts at this stage.
157180

158181
Synchronize your repository:
159182

160-
git switch develop
161-
git fetch upstream
162-
git merge upstream/develop
163-
git push origin develop
183+
```console
184+
> git switch develop
185+
> git fetch upstream
186+
> git merge upstream/develop
187+
> git push origin develop
188+
```
164189

165190
Bring your feature branch up to date:
166191

167-
git switch new/mind-reader
168-
git rebase upstream/develop
192+
```console
193+
> git switch fix/issue-123
194+
> git rebase upstream/develop
195+
```
169196

170197
And finally push your local branch to your GitHub repository:
171198

172-
git push --force-with-lease origin new/mind-reader
199+
```console
200+
> git push --force-with-lease origin fix/issue-123
201+
```
173202

174203
## Pull Requests
175204

@@ -223,23 +252,29 @@ do the following:
223252

224253
Synchronize your repository:
225254

226-
git switch develop
227-
git fetch upstream
228-
git merge upstream/develop
229-
git push origin develop
255+
```console
256+
> git switch develop
257+
> git fetch upstream
258+
> git merge upstream/develop
259+
> git push origin develop
260+
```
230261

231262
Bring your feature branch up to date:
232263

233-
git switch new/mind-reader
234-
git rebase upstream/develop
264+
```console
265+
> git switch fix/problem123
266+
> git rebase upstream/develop
267+
```
235268

236269
You might get conflicts when you rebase. It is your
237270
responsibility to resolve those locally, so that you can continue
238271
collaborating with the shared repository.
239272

240273
And finally push your local branch to your GitHub repository:
241274

242-
git push --force-with-lease origin new/mind-reader
275+
```console
276+
> git push --force-with-lease origin fix/problem123
277+
```
243278

244279
## Cleanup
245280

rector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
$rectorConfig->parallel();
6565

6666
// paths to refactor; solid alternative to CLI arguments
67-
$rectorConfig->paths([__DIR__ . '/app', __DIR__ . '/system', __DIR__ . '/tests', __DIR__ . '/utils/Rector']);
67+
$rectorConfig->paths([__DIR__ . '/app', __DIR__ . '/system', __DIR__ . '/tests', __DIR__ . '/utils']);
6868

6969
// do you need to include constants, class aliases or custom autoloader? files listed will be executed
7070
$rectorConfig->bootstrapFiles([

system/Common.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,8 @@ function remove_invisible_characters(string $str, bool $urlEncoded = true): stri
905905
* NOTE: This requires the controller/method to
906906
* have a route defined in the routes Config file.
907907
*
908-
* @param mixed ...$params
908+
* @param string $method Named route or Controller::method
909+
* @param int|string ...$params One or more parameters to be passed to the route
909910
*
910911
* @return false|string
911912
*/

system/Database/BaseBuilder.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,11 +1870,13 @@ public function getCompiledInsert(bool $reset = true)
18701870
/**
18711871
* Compiles an insert string and runs the query
18721872
*
1873+
* @param array|object|null $set
1874+
*
18731875
* @throws DatabaseException
18741876
*
18751877
* @return bool|Query
18761878
*/
1877-
public function insert(?array $set = null, ?bool $escape = null)
1879+
public function insert($set = null, ?bool $escape = null)
18781880
{
18791881
if ($set !== null) {
18801882
$this->set($set, '', $escape);
@@ -2004,11 +2006,12 @@ public function getCompiledUpdate(bool $reset = true)
20042006
/**
20052007
* Compiles an update string and runs the query.
20062008
*
2007-
* @param mixed $where
2009+
* @param array|object|null $set
2010+
* @param array|RawSql|string|null $where
20082011
*
20092012
* @throws DatabaseException
20102013
*/
2011-
public function update(?array $set = null, $where = null, ?int $limit = null): bool
2014+
public function update($set = null, $where = null, ?int $limit = null): bool
20122015
{
20132016
if ($set !== null) {
20142017
$this->set($set);

system/HTTP/URI.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -661,10 +661,8 @@ public function setAuthority(string $str)
661661
*/
662662
public function setScheme(string $str)
663663
{
664-
$str = strtolower($str);
665-
$str = preg_replace('#:(//)?$#', '', $str);
666-
667-
$this->scheme = $str;
664+
$str = strtolower($str);
665+
$this->scheme = preg_replace('#:(//)?$#', '', $str);
668666

669667
return $this;
670668
}
@@ -932,8 +930,7 @@ protected function applyParts(array $parts)
932930
// Port
933931
if (isset($parts['port']) && $parts['port'] !== null) {
934932
// Valid port numbers are enforced by earlier parse_url or setPort()
935-
$port = $parts['port'];
936-
$this->port = $port;
933+
$this->port = $parts['port'];
937934
}
938935

939936
if (isset($parts['pass'])) {

system/Helpers/url_helper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,8 @@ function mb_url_title(string $str, string $separator = '-', bool $lowercase = fa
525525
* NOTE: This requires the controller/method to
526526
* have a route defined in the routes Config file.
527527
*
528-
* @param mixed ...$args
528+
* @param string $controller Named route or Controller::method
529+
* @param int|string ...$args One or more parameters to be passed to the route
529530
*
530531
* @throws RouterException
531532
*/

system/Router/RouteCollection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,8 @@ public function environment(string $env, Closure $callback): RouteCollectionInte
994994
* // Equals 'path/$param1/$param2'
995995
* reverseRoute('Controller::method', $param1, $param2);
996996
*
997-
* @param mixed ...$params
997+
* @param string $search Named route or Controller::method
998+
* @param int|string ...$params One or more parameters to be passed to the route
998999
*
9991000
* @return false|string
10001001
*/

0 commit comments

Comments
 (0)