Skip to content

Commit

Permalink
Merge pull request #8675 from codeigniter4/develop
Browse files Browse the repository at this point in the history
4.4.7 Ready code
  • Loading branch information
kenjis authored Mar 29, 2024
2 parents 3d4e20d + e73db00 commit fd3da67
Show file tree
Hide file tree
Showing 163 changed files with 17,950 additions and 2,223 deletions.
4 changes: 2 additions & 2 deletions .github/prlint.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": [
{
"pattern": "^(\\[\\d+\\.\\d+\\]\\s{1})?(feat|fix|chore|docs|perf|refactor|style|test)(\\([\\-.@:`a-zA-Z0-9]+\\))?!?:\\s{1}\\S.+\\S|Prep for \\d\\.\\d\\.\\d release|\\d\\.\\d\\.\\d Ready code$",
"message": "PR title must include the type (feat, fix, chore, docs, perf, refactor, style, test) of the commit per Conventional Commits specification. See https://www.conventionalcommits.org/en/v1.0.0/ for the discussion."
"pattern": "^(\\[\\d+\\.\\d+\\]\\s{1})?(feat|fix|chore|docs|perf|refactor|style|test|config|revert)(\\([\\-.@:`a-zA-Z0-9]+\\))?!?:\\s{1}\\S.+\\S|Prep for \\d\\.\\d\\.\\d release|\\d\\.\\d\\.\\d Ready code$",
"message": "PR title must include the type (feat, fix, chore, docs, perf, refactor, style, test, config, revert) of the commit per Conventional Commits specification. See https://www.conventionalcommits.org/en/v1.0.0/ for the discussion."
}
]
}
6 changes: 3 additions & 3 deletions .github/workflows/test-deptrac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: composer, phive
tools: composer
extensions: intl, json, mbstring, gd, mysqlnd, xdebug, xml, sqlite3

- name: Validate composer.json
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:

- name: Run architectural inspection
run: |
sudo phive --no-progress install --global qossmic/deptrac --trust-gpg-keys B8F640134AB1782E
deptrac analyze --cache-file=build/deptrac.cache
composer require --dev qossmic/deptrac-shim
vendor/bin/deptrac analyze --cache-file=build/deptrac.cache
env:
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 11 additions & 7 deletions .github/workflows/test-rector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,12 @@ permissions:

jobs:
build:
name: PHP ${{ matrix.php-versions }} Analyze code (Rector) on ${{ matrix.paths }}
name: PHP ${{ matrix.php-versions }} Analyze code (Rector)
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
php-versions: ['7.4', '8.0']
paths:
- app
- system
- tests
- utils
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -80,5 +75,14 @@ jobs:
- name: Install dependencies
run: composer update --ansi --no-interaction

- name: Rector Cache
uses: actions/cache@v4
with:
path: /tmp/rector
key: ${{ runner.os }}-rector-${{ github.run_id }}
restore-keys: ${{ runner.os }}-rector-

- run: mkdir -p /tmp/rector

- name: Run static analysis
run: vendor/bin/rector process ${{ matrix.paths }} --dry-run --no-progress-bar
run: vendor/bin/rector process --dry-run --no-progress-bar
30 changes: 1 addition & 29 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,35 +43,7 @@
__DIR__ . '/spark',
]);

$overrides = [
'phpdoc_no_alias_tag' => [
'replacements' => [
'type' => 'var',
'link' => 'see',
],
],
'phpdoc_align' => [
'align' => 'vertical',
'spacing' => 1,
'tags' => [
'method',
'param',
'phpstan-assert',
'phpstan-assert-if-true',
'phpstan-assert-if-false',
'phpstan-param',
'phpstan-property',
'phpstan-return',
'property',
'property-read',
'property-write',
'return',
'throws',
'type',
'var',
],
],
];
$overrides = [];

$options = [
'cacheFile' => 'build/.php-cs-fixer.cache',
Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## [v4.4.7](https://github.com/codeigniter4/CodeIgniter4/tree/v4.4.7) (2024-03-29)
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.4.6...v4.4.7)

### Breaking Changes
* fix: Time::difference() DST bug by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8661

### Fixed Bugs
* fix: [Validation] FileRules cause error if getimagesize() returns false by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8592
* fix: isWriteType() to recognize CTE; always excluding RETURNING by @markconnellypro in https://github.com/codeigniter4/CodeIgniter4/pull/8599
* fix: duplicate Cache-Control header with Session by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8601
* fix: [DebugBar] scroll to top by @ddevsr in https://github.com/codeigniter4/CodeIgniter4/pull/8595
* fix: Model::shouldUpdate() logic by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8614
* fix: esc() for 'raw' context by @Cleric-K in https://github.com/codeigniter4/CodeIgniter4/pull/8633
* docs: fix incorrect CURLRequest allow_redirects description by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8653
* fix: Model::set() does not accept object by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8670

### Refactoring
* refactor: replace PHP_VERSION by PHP_VERSION_ID by @justbyitself in https://github.com/codeigniter4/CodeIgniter4/pull/8618
* refactor: apply early return pattern by @justbyitself in https://github.com/codeigniter4/CodeIgniter4/pull/8621
* refactor: move footer info to top in error_exception.php by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/8626

## [v4.4.6](https://github.com/codeigniter4/CodeIgniter4/tree/v4.4.6) (2024-02-24)
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.4.5...v4.4.6)

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The MIT License (MIT)

Copyright (c) 2014-2019 British Columbia Institute of Technology
Copyright (c) 2019-2023 CodeIgniter Foundation
Copyright (c) 2019-2024 CodeIgniter Foundation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
41 changes: 23 additions & 18 deletions admin/css/debug-toolbar/toolbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
@import '_mixins';
@import '_settings';


// DEBUG ICON
// ========================================================================== */

Expand All @@ -36,6 +35,8 @@
clear: both;
text-align: center;

cursor: pointer;

a svg {
margin: 8px;
max-width: 20px;
Expand All @@ -56,6 +57,10 @@
// DEBUG BAR
// ========================================================================== */

.debug-bar-vars {
cursor: pointer;
}

#debug-bar {
// Position
bottom: 0;
Expand Down Expand Up @@ -227,21 +232,21 @@
// The toolbar preferences
#toolbar-position,
#toolbar-theme {
a {
padding: 0 6px;
display: inline-flex;
vertical-align: top;
padding: 0 6px;
display: inline-flex;
vertical-align: top;
cursor: pointer;

&:hover {
text-decoration: none;
}
&:hover {
text-decoration: none;
}
}

// The "Open/Close" toggle
#debug-bar-link {
display: flex;
padding: 6px;
cursor: pointer;
}

// The toolbar menus
Expand Down Expand Up @@ -518,43 +523,43 @@
.debug-bar-dtableRow {
display: table-row;
}

.debug-bar-dinlineBlock {
display: inline-block;
}

.debug-bar-pointer {
cursor: pointer;
}

.debug-bar-mleft4 {
margin-left: 4px;
}

.debug-bar-level-0 {
--level: 0;
}

.debug-bar-level-1 {
--level: 1;
}

.debug-bar-level-2 {
--level: 2;
}

.debug-bar-level-3 {
--level: 3;
}

.debug-bar-level-4 {
--level: 4;
}

.debug-bar-level-5 {
--level: 5;
}

.debug-bar-level-6 {
--level: 6;
}
1 change: 0 additions & 1 deletion admin/prepare-release.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ function replace_file_content(string $path, string $pattern, string $replace): v
// Creates a branch for release.
system('git switch develop');
system('git switch -c release-' . $version);
system('git switch docs-changelog-' . $version);

// Updates version number in "CodeIgniter.php".
replace_file_content(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ExampleMigration extends Migration
{
protected $DBGroup = 'tests';

public function up()
public function up(): void
{
$this->forge->addField('id');
$this->forge->addField([
Expand All @@ -30,7 +30,7 @@ public function up()
$this->forge->createTable('factories');
}

public function down()
public function down(): void
{
$this->forge->dropTable('factories');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class ExampleSeeder extends Seeder
{
public function run()
public function run(): void
{
$factories = [
[
Expand Down
4 changes: 2 additions & 2 deletions admin/starter/tests/database/ExampleDatabaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class ExampleDatabaseTest extends CIUnitTestCase

protected $seed = ExampleSeeder::class;

public function testModelFindAll()
public function testModelFindAll(): void
{
$model = new ExampleModel();

Expand All @@ -25,7 +25,7 @@ public function testModelFindAll()
$this->assertCount(3, $objects);
}

public function testSoftDeleteLeavesRow()
public function testSoftDeleteLeavesRow(): void
{
$model = new ExampleModel();
$this->setPrivateProperty($model, 'useSoftDeletes', true);
Expand Down
2 changes: 1 addition & 1 deletion admin/starter/tests/session/ExampleSessionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
final class ExampleSessionTest extends CIUnitTestCase
{
public function testSessionSimple()
public function testSessionSimple(): void
{
$session = Services::session();

Expand Down
4 changes: 2 additions & 2 deletions admin/starter/tests/unit/HealthTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
*/
final class HealthTest extends CIUnitTestCase
{
public function testIsDefinedAppPath()
public function testIsDefinedAppPath(): void
{
$this->assertTrue(defined('APPPATH'));
}

public function testBaseUrlHasBeenSet()
public function testBaseUrlHasBeenSet(): void
{
$validation = Services::validation();

Expand Down
24 changes: 24 additions & 0 deletions app/Config/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,30 @@ class App extends BaseConfig
*/
public string $uriProtocol = 'REQUEST_URI';

/*
|--------------------------------------------------------------------------
| Allowed URL Characters
|--------------------------------------------------------------------------
|
| This lets you specify which characters are permitted within your URLs.
| When someone tries to submit a URL with disallowed characters they will
| get a warning message.
|
| As a security measure you are STRONGLY encouraged to restrict URLs to
| as few characters as possible.
|
| By default, only these are allowed: `a-z 0-9~%.:_-`
|
| Set an empty string to allow all characters -- but only if you are insane.
|
| The configured value is actually a regular expression character group
| and it will be used as: '/\A[<permittedURIChars>]+\z/iu'
|
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
*/
public string $permittedURIChars = 'a-z 0-9~%.:_\-';

/**
* --------------------------------------------------------------------------
* Default Locale
Expand Down
2 changes: 1 addition & 1 deletion app/Config/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Cache extends BaseConfig
* ['q'] = Enabled, but only take into account the specified list
* of query parameters.
*
* @var bool|string[]
* @var bool|list<string>
*/
public $cacheQueryString = false;

Expand Down
Loading

0 comments on commit fd3da67

Please sign in to comment.