Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
timeout-minutes: 5
strategy:
matrix:
php: ["8.2", "8.3", "8.4"]
php: ["8.2", "8.3", "8.4", "8.5"]
env:
extensions: mbstring, ctype, curl, gd, apcu, memcached, redis
ini: apc.enabled=1, apc.enable_cli=1, pcov.directory=., "pcov.exclude=\"~(vendor|tests)~\""
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
extensions: ${{ env.extensions }}
ini-values: ${{ env.ini }}
coverage: pcov
tools: phpunit:10.5.38, psalm:5.26.1
tools: phpunit:11.5.44, psalm:5.26.1

- name: Setup problem matchers
run: |
Expand All @@ -127,7 +127,7 @@ jobs:
run: phpunit -c phpunit.ci.xml --coverage-clover ${{ github.workspace }}/clover.xml

- name: Statically analyze using Psalm
if: always() && steps.finishPrepare.outcome == 'success' && matrix.php != '8.4'
if: always() && steps.finishPrepare.outcome == 'success' && matrix.php != '8.4' && matrix.php != '8.5'
run: psalm --output-format=github --php-version=${{ matrix.php }} --report=sarif/psalm.sarif --report-show-info=false

- name: Upload coverage results to Codecov
Expand All @@ -144,7 +144,7 @@ jobs:
env_vars: PHP

- name: Upload code scanning results to GitHub
if: always() && steps.finishPrepare.outcome == 'success' && github.repository == 'getkirby/kirby' && matrix.php != '8.4'
if: always() && steps.finishPrepare.outcome == 'success' && github.repository == 'getkirby/kirby' && matrix.php != '8.4' && matrix.php != '8.5'
uses: github/codeql-action/upload-sarif@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # pin@v3
with:
sarif_file: sarif
Expand Down Expand Up @@ -205,8 +205,8 @@ jobs:
extensions: ${{ env.extensions }}
coverage: none
tools: |
composer:2.4.4, composer-normalize:2.28.3, composer-require-checker:4.1.0,
composer-unused:0.7.12, phpmd:2.13.0
composer:2.9.1, composer-normalize:2.48.2, composer-require-checker:4.18.0,
composer-unused:0.9.5, phpmd:2.15.0

- name: Validate composer.json/composer.lock
if: always() && steps.finishPrepare.outcome == 'success'
Expand Down Expand Up @@ -264,7 +264,7 @@ jobs:
with:
php-version: ${{ env.php }}
coverage: none
tools: php-cs-fixer:3.65.0
tools: php-cs-fixer:3.90.0

- name: Cache analysis data
id: finishPrepare
Expand Down
15 changes: 5 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
"source": "https://github.com/getkirby/kirby"
},
"require": {
"php": "~8.2.0 || ~8.3.0 || ~8.4.0",
"ext-SimpleXML": "*",
"php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
"ext-ctype": "*",
"ext-curl": "*",
"ext-dom": "*",
Expand All @@ -36,8 +35,9 @@
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-openssl": "*",
"ext-simplexml": "*",
"christian-riesen/base32": "1.6.0",
"claviska/simpleimage": "4.2.1",
"claviska/simpleimage": "4.4.0",
"composer/semver": "3.4.4",
"filp/whoops": "2.18.4",
"getkirby/composer-installer": "^1.2.1",
Expand All @@ -52,13 +52,13 @@
"symfony/polyfill-php72": "*"
},
"suggest": {
"ext-PDO": "Support for using databases",
"ext-apcu": "Support for the Apcu cache driver",
"ext-exif": "Support for exif information from images",
"ext-fileinfo": "Improved mime type detection for files",
"ext-imagick": "Improved thumbnail generation",
"ext-intl": "Improved i18n number formatting",
"ext-memcached": "Support for the Memcached cache driver",
"ext-pdo": "Support for using databases",
"ext-redis": "Support for the Redis cache driver",
"ext-sodium": "Support for the crypto class and more robust session handling",
"ext-zip": "Support for ZIP archive file functions",
Expand All @@ -82,15 +82,10 @@
},
"optimize-autoloader": true,
"platform": {
"php": "8.2.0"
"php": "8.3.0"
},
"platform-check": false
},
"extra": {
"unused": [
"symfony/polyfill-intl-idn"
]
},
"scripts": {
"post-update-cmd": "curl -o cacert.pem https://curl.se/ca/cacert.pem",
"analyze": [
Expand Down
24 changes: 12 additions & 12 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dependencies/spyc/Spyc.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* into a PHP array. It currently supports a very limited subsection of
* the YAML spec.
*
* @version 0.6.3 (Kirby fork for PHP 8.1+)
* @version 0.6.4 (Kirby fork for PHP 8.5+)
* @author Vlad Andersen <[email protected]>
* @author Chris Wanstrath <[email protected]>
* @link https://github.com/mustangostang/spyc/
Expand Down Expand Up @@ -877,7 +877,7 @@ private function addArray($incoming_data, $incoming_indent)
return $this->addArrayInline($incoming_data, $incoming_indent);

$key = key($incoming_data);
$value = isset($incoming_data[$key]) ? $incoming_data[$key] : null;
$value = $key !== null && isset($incoming_data[$key]) ? $incoming_data[$key] : null;
if ($key === '__!YAMLZero') $key = '0';

if ($incoming_indent == 0 && !$this->_containsGroupAlias && !$this->_containsGroupAnchor) { // Shortcut for root-level values.
Expand Down
2 changes: 1 addition & 1 deletion src/Cms/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ protected function transformUserSingle(
$result = $this->transformModel($addressProp, User::class, 'name', 'email');

$address = array_keys($result)[0] ?? null;
$name = $result[$address] ?? null;
$name = $result[$address ?? ''] ?? null;

// if the array is non-associative, the value is the address
if (is_int($address) === true) {
Expand Down
10 changes: 8 additions & 2 deletions src/Cms/PageActions.php
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,14 @@ public function createChild(array $props): Page
'site' => $this->site(),
];

$modelClass = static::$models[$props['template'] ?? null] ?? static::class;
return $modelClass::create($props);
if (
($template = $props['template'] ?? null) &&
($model = static::$models[$template] ?? null)
) {
return $model::create($props);
}

return static::create($props);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Cms/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ public function php(): bool
{
return
version_compare(PHP_VERSION, '8.2.0', '>=') === true &&
version_compare(PHP_VERSION, '8.5.0', '<') === true;
version_compare(PHP_VERSION, '8.6.0', '<') === true;
}

/**
Expand Down
4 changes: 4 additions & 0 deletions src/Filesystem/Mime.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ public static function fix(
string|null $mime = null,
string|null $extension = null
): string|null {
if ($mime === null || $extension === null) {
return $mime;
}

// fixing map
$map = [
'text/html' => [
Expand Down
2 changes: 1 addition & 1 deletion src/Panel/Lab/Example.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct(

public function collectTab(string|null $tab): string|null
{
if ($this->tabs === []) {
if ($this->tabs === [] || $tab === null) {
return null;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Panel/Panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ public static function router(string|null $path = null): Response|null
$auth = $route->attributes()['auth'] ?? true;
$areaId = $route->attributes()['area'] ?? null;
$type = $route->attributes()['type'] ?? 'view';
$area = $areas[$areaId] ?? null;
$area = $areas[$areaId ?? ''] ?? null;

// call the route action to check the result
try {
Expand Down
2 changes: 1 addition & 1 deletion src/Plugin/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ public function version(): string|null
try {
// try to get version from "vendor/composer/installed.php",
// this is the most reliable source for the version
$version = InstalledVersions::getPrettyVersion($name);
$version = $name !== null ? InstalledVersions::getPrettyVersion($name) : null;
} catch (Throwable) {
$version = null;
}
Expand Down
6 changes: 6 additions & 0 deletions tests/Filesystem/MimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ public function testFixSvg(): void
$this->assertSame('image/svg+xml', Mime::fix(static::FIXTURES . '/unoptimized.svg', 'text/html', 'svg'));
}

public function testFixNull(): void
{
$this->assertSame('text/css', Mime::fix('something.css', 'text/css', null));
$this->assertSame(null, Mime::fix('something.css', null, null));
}

public function testFromExtension(): void
{
$mime = Mime::fromExtension('jpg');
Expand Down
Loading