Skip to content

Commit

Permalink
Merge pull request #6806 from getkirby/v5/feature/php-84
Browse files Browse the repository at this point in the history
[v5] PHP 8.4 support
  • Loading branch information
distantnative authored Dec 7, 2024
2 parents 8fe90cc + 9580013 commit cb83501
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 45 deletions.
8 changes: 4 additions & 4 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"]
php: ["8.2", "8.3", "8.4"]
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.5, psalm:5.20.0
tools: phpunit:10.5.38, psalm:5.26.1

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

- name: Statically analyze using Psalm
if: always() && steps.finishPrepare.outcome == 'success'
if: always() && steps.finishPrepare.outcome == 'success' && matrix.php != '8.4'
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'
if: always() && steps.finishPrepare.outcome == 'success' && github.repository == 'getkirby/kirby' && matrix.php != '8.4'
uses: github/codeql-action/upload-sarif@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # pin@v3
with:
sarif_file: sarif
Expand Down
2 changes: 1 addition & 1 deletion bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
if (
version_compare(PHP_VERSION, '8.2.0', '>=') === false ||
version_compare(PHP_VERSION, '8.4.0', '<') === false
version_compare(PHP_VERSION, '8.5.0', '<') === false
) {
die(include __DIR__ . '/views/php.php');
}
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"source": "https://github.com/getkirby/kirby"
},
"require": {
"php": "~8.2.0 || ~8.3.0",
"php": "~8.2.0 || ~8.3.0 || ~8.4.0",
"ext-SimpleXML": "*",
"ext-ctype": "*",
"ext-curl": "*",
Expand All @@ -37,7 +37,7 @@
"ext-mbstring": "*",
"ext-openssl": "*",
"christian-riesen/base32": "1.6.0",
"claviska/simpleimage": "4.2.0",
"claviska/simpleimage": "4.2.1",
"composer/semver": "3.4.3",
"filp/whoops": "2.16.0",
"getkirby/composer-installer": "^1.2.1",
Expand Down
16 changes: 8 additions & 8 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/parsedown-extra/ParsedownExtra.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ParsedownExtra extends Parsedown
{
# ~

public const version = '0.8.0-beta-1';
public const version = '0.8.0-beta-2';

# ~

Expand Down Expand Up @@ -297,7 +297,7 @@ protected function blockMarkupComplete($Block)
#
# Setext

protected function blockSetextHeader($Line, array $Block = null)
protected function blockSetextHeader($Line, array|null $Block = null)
{
$Block = parent::blockSetextHeader($Line, $Block);

Expand Down
8 changes: 4 additions & 4 deletions dependencies/parsedown/Parsedown.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Parsedown
{
# ~

public const version = '1.8.0-beta-7';
public const version = '1.8.0-beta-8';

# ~

Expand Down Expand Up @@ -526,7 +526,7 @@ protected function blockHeader($Line)
#
# List

protected function blockList($Line, array $CurrentBlock = null)
protected function blockList($Line, array|null $CurrentBlock = null)
{
list($name, $pattern) = $Line['text'][0] <= '-' ? array('ul', '[*+-]') : array('ol', '[0-9]{1,9}+[.\)]');

Expand Down Expand Up @@ -741,7 +741,7 @@ protected function blockRule($Line)
#
# Setext

protected function blockSetextHeader($Line, array $Block = null)
protected function blockSetextHeader($Line, array|null $Block = null)
{
if (! isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) {
return;
Expand Down Expand Up @@ -821,7 +821,7 @@ protected function blockReference($Line)
#
# Table

protected function blockTable($Line, array $Block = null)
protected function blockTable($Line, array|null $Block = null)
{
if (! isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/Cms/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public function php(): bool
{
return
version_compare(PHP_VERSION, '8.2.0', '>=') === true &&
version_compare(PHP_VERSION, '8.4.0', '<') === true;
version_compare(PHP_VERSION, '8.5.0', '<') === true;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Cms/System/UpdateStatusTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function testLoadData()
'8.0' => '2023-11-26',
'8.1' => '2024-11-25',
'8.2' => '2025-12-08',
'8.3' => '2026-11-23'
'8.3' => '2026-11-23',
],
'incidents' => [],
'messages' => [],
Expand Down
20 changes: 10 additions & 10 deletions vendor/claviska/simpleimage/src/claviska/SimpleImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public function fromString(string $string): SimpleImage|static
*
* @throws Exception Thrown when WEBP support is not enabled or unsupported format.
*/
public function generate(string $mimeType = null, array|int $options = 100): array
public function generate(string|null $mimeType = null, array|int $options = 100): array
{
// Format defaults to the original mime type
$mimeType = $mimeType ?: $this->mimeType;
Expand Down Expand Up @@ -473,7 +473,7 @@ public function generate(string $mimeType = null, array|int $options = 100): arr
*
* @throws Exception
*/
public function toDataUri(string $mimeType = null, array|int $options = 100): string
public function toDataUri(string|null $mimeType = null, array|int $options = 100): string
{
$image = $this->generate($mimeType, $options);

Expand All @@ -490,7 +490,7 @@ public function toDataUri(string $mimeType = null, array|int $options = 100): st
*
* @throws Exception
*/
public function toDownload(string $filename, string $mimeType = null, array|int $options = 100): static
public function toDownload(string $filename, string|null $mimeType = null, array|int $options = 100): static
{
$image = $this->generate($mimeType, $options);

Expand All @@ -517,7 +517,7 @@ public function toDownload(string $filename, string $mimeType = null, array|int
*
* @throws Exception Thrown if failed write to file.
*/
public function toFile(string $file, string $mimeType = null, array|int $options = 100): static
public function toFile(string $file, string|null $mimeType = null, array|int $options = 100): static
{
$image = $this->generate($mimeType, $options);

Expand All @@ -538,7 +538,7 @@ public function toFile(string $file, string $mimeType = null, array|int $options
*
* @throws Exception
*/
public function toScreen(string $mimeType = null, array|int $options = 100): static
public function toScreen(string|null $mimeType = null, array|int $options = 100): static
{
$image = $this->generate($mimeType, $options);

Expand All @@ -557,7 +557,7 @@ public function toScreen(string $mimeType = null, array|int $options = 100): sta
*
* @throws Exception
*/
public function toString(string $mimeType = null, array|int $options = 100): string
public function toString(string|null $mimeType = null, array|int $options = 100): string
{
return $this->generate($mimeType, $options)['data'];
}
Expand Down Expand Up @@ -975,7 +975,7 @@ public function overlay(string|SimpleImage $overlay, string $anchor = 'center',
* @param int|null $height The new image height.
* @return SimpleImage
*/
public function resize(int $width = null, int $height = null): static
public function resize(int|null $width = null, int|null $height = null): static
{
// No dimensions specified
if (! $width && ! $height) {
Expand Down Expand Up @@ -1027,7 +1027,7 @@ public function resize(int $width = null, int $height = null): static
* @param int|null $res_y The vertical resolution in DPI
* @return SimpleImage
*/
public function resolution(int $res_x, int $res_y = null): static
public function resolution(int $res_x, int|null $res_y = null): static
{
if (is_null($res_y)) {
imageresolution($this->image, $res_x);
Expand Down Expand Up @@ -1087,7 +1087,7 @@ public function rotate(int $angle, string|array $backgroundColor = 'transparent'
*
* @throws Exception
*/
public function text(string $text, array $options, array &$boundary = null): static
public function text(string $text, array $options, array|null &$boundary = null): static
{
// Check for freetype support
if (! function_exists('imagettftext')) {
Expand Down Expand Up @@ -2196,7 +2196,7 @@ public static function darkenColor(string|array $color, int $amount): array
*
* @throws Exception Thrown if library \League\ColorExtractor is missing.
*/
public function extractColors(int $count = 5, string|array $backgroundColor = null): array
public function extractColors(int $count = 5, string|array|null $backgroundColor = null): array
{
// Check for required library
if (! class_exists('\\'.ColorExtractor::class)) {
Expand Down
14 changes: 7 additions & 7 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,17 @@
},
{
"name": "claviska/simpleimage",
"version": "4.2.0",
"version_normalized": "4.2.0.0",
"version": "4.2.1",
"version_normalized": "4.2.1.0",
"source": {
"type": "git",
"url": "https://github.com/claviska/SimpleImage.git",
"reference": "dfbe53c01dae8467468ef2b817c09b786a7839d2"
"reference": "ec6d5021e5a7153a2520d64c59b86b6f3c4157c5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/claviska/SimpleImage/zipball/dfbe53c01dae8467468ef2b817c09b786a7839d2",
"reference": "dfbe53c01dae8467468ef2b817c09b786a7839d2",
"url": "https://api.github.com/repos/claviska/SimpleImage/zipball/ec6d5021e5a7153a2520d64c59b86b6f3c4157c5",
"reference": "ec6d5021e5a7153a2520d64c59b86b6f3c4157c5",
"shasum": ""
},
"require": {
Expand All @@ -86,7 +86,7 @@
"laravel/pint": "^1.5",
"phpstan/phpstan": "^1.10"
},
"time": "2024-04-15T16:07:16+00:00",
"time": "2024-11-22T13:25:03+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
Expand All @@ -108,7 +108,7 @@
"description": "A PHP class that makes working with images as simple as possible.",
"support": {
"issues": "https://github.com/claviska/SimpleImage/issues",
"source": "https://github.com/claviska/SimpleImage/tree/4.2.0"
"source": "https://github.com/claviska/SimpleImage/tree/4.2.1"
},
"funding": [
{
Expand Down
10 changes: 5 additions & 5 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => 'getkirby/cms',
'pretty_version' => '5.0.0-alpha.4',
'version' => '5.0.0.0-alpha4',
'reference' => null,
'reference' => NULL,
'type' => 'kirby-cms',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -20,9 +20,9 @@
'dev_requirement' => false,
),
'claviska/simpleimage' => array(
'pretty_version' => '4.2.0',
'version' => '4.2.0.0',
'reference' => 'dfbe53c01dae8467468ef2b817c09b786a7839d2',
'pretty_version' => '4.2.1',
'version' => '4.2.1.0',
'reference' => 'ec6d5021e5a7153a2520d64c59b86b6f3c4157c5',
'type' => 'library',
'install_path' => __DIR__ . '/../claviska/simpleimage',
'aliases' => array(),
Expand All @@ -49,7 +49,7 @@
'getkirby/cms' => array(
'pretty_version' => '5.0.0-alpha.4',
'version' => '5.0.0.0-alpha4',
'reference' => null,
'reference' => NULL,
'type' => 'kirby-cms',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand Down

0 comments on commit cb83501

Please sign in to comment.