Skip to content

Commit

Permalink
Merge branch 'bugfix'
Browse files Browse the repository at this point in the history
  • Loading branch information
gharlan committed May 11, 2024
2 parents afc41bd + 0a70d56 commit 93c0bfb
Show file tree
Hide file tree
Showing 19 changed files with 192 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- php-version: '8.3'
db-image: 'mysql:8.0'
- php-version: '8.4'
db-image: 'mysql:latest'
db-image: 'mysql:8.3'
composer-flags: '--ignore-platform-req=php'
- php-version: '8.1'
db-image: 'mariadb:10.1'
Expand Down
2 changes: 1 addition & 1 deletion .tools/bin/update-tools
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

composer require --dev --ansi --fixed \
composer require --dev --ansi --fixed --with-all-dependencies \
friendsofredaxo/linter \
phpstan/extension-installer \
phpstan/phpstan \
Expand Down
5 changes: 0 additions & 5 deletions .tools/phpstan/baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2060,11 +2060,6 @@ parameters:
count: 1
path: ../../redaxo/src/core/tests/login/password_policy_test.php

-
message: "#^Method class@anonymous/core/tests/sql/sql_test\\.php\\:121\\:\\:__construct\\(\\) has parameter \\$DBID with no type specified\\.$#"
count: 1
path: ../../redaxo/src/core/tests/sql/sql_test.php

-
message: "#^Method rex_string_test\\:\\:buildQueryProvider\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
Expand Down
2 changes: 1 addition & 1 deletion .tools/psalm/baseline-taint.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.23.1@8471a896ccea3526b26d082f4461eeea467f10a4">
<files psalm-version="5.24.0@462c80e31c34e58cc4f750c656be3927e80e550e">
<file src="redaxo/src/addons/structure/plugins/history/fragments/history/layer.php">
<TaintedHtml>
<code><![CDATA[$this->getVar('content1iframe')]]></code>
Expand Down
2 changes: 1 addition & 1 deletion .tools/psalm/baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.23.1@8471a896ccea3526b26d082f4461eeea467f10a4">
<files psalm-version="5.24.0@462c80e31c34e58cc4f750c656be3927e80e550e">
<file src="redaxo/src/addons/backup/lib/backup.php">
<MixedArgument>
<code><![CDATA[$column]]></code>
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"phpunit/phpunit": "^10.5.20",
"psalm/plugin-phpunit": "0.19.0",
"psalm/plugin-symfony": "v5.1.0",
"rector/rector": "1.0.4",
"redaxo/php-cs-fixer-config": "2.9.0",
"rector/rector": "1.0.5",
"redaxo/php-cs-fixer-config": "2.10.0",
"redaxo/psalm-plugin": "2.0.0",
"vimeo/psalm": "5.23.1"
"vimeo/psalm": "5.24.0"
},
"replace": {
"erusev/parsedown": "1.7.4",
Expand All @@ -41,13 +41,13 @@
"scssphp/scssphp": "v1.12.1",
"splitbrain/php-archive": "1.3.1",
"symfony/console": "v6.4.7",
"symfony/deprecation-contracts": "v3.4.0",
"symfony/deprecation-contracts": "v3.5.0",
"symfony/http-foundation": "v6.4.7",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-php80": "*",
"symfony/polyfill-php81": "*",
"symfony/polyfill-php83": "v1.29.0",
"symfony/service-contracts": "v3.4.2",
"symfony/service-contracts": "v3.5.0",
"symfony/string": "v6.4.7",
"symfony/var-dumper": "v6.4.7",
"symfony/yaml": "v6.4.7",
Expand Down
31 changes: 16 additions & 15 deletions redaxo/src/core/composer.lock

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

13 changes: 11 additions & 2 deletions redaxo/src/core/lib/util/string.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,17 @@ public static function buildAttributes(array $attributes)
*/
public static function highlight($string)
{
$return = str_replace(["\r", "\n"], ['', ''], highlight_string($string, true));
return '<pre class="rex-code">' . $return . '</pre>';
$text = highlight_string($string, true);

if (str_starts_with($text, '<pre>')) {
$text = substr($text, 5, -6);
}

// php 8.3 fix
$text = preg_replace('@<span style="color:[^"]+">\n(<span style="color:[^"]+">)@', '$1', $text, 1);
$text = preg_replace('@<\/span>\n(<\/span>\n<\/code>)$@', '$1', $text, 1);

return '<pre class="rex-code">' . $text . '</pre>';
}

/**
Expand Down
6 changes: 3 additions & 3 deletions redaxo/src/core/tests/sql/sql_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ public static function provideDbVersion(): array
private function getVersionMock(string $version): rex_sql
{
return new class(version: $version) extends rex_sql {
public function __construct($DBID = 999, ?string $version = null)
public function __construct($db = 999, ?string $version = null)
{
parent::__construct($DBID);
parent::__construct($db);

self::$pdo[$DBID] = new class(rex_type::notNull($version)) extends PDO {
self::$pdo[$db] = new class(rex_type::notNull($version)) extends PDO {
public function __construct(
private readonly string $version,
) {}
Expand Down
2 changes: 2 additions & 0 deletions redaxo/src/core/vendor/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,9 @@
'Symfony\\Contracts\\Service\\Attribute\\Required' => $vendorDir . '/symfony/service-contracts/Attribute/Required.php',
'Symfony\\Contracts\\Service\\Attribute\\SubscribedService' => $vendorDir . '/symfony/service-contracts/Attribute/SubscribedService.php',
'Symfony\\Contracts\\Service\\ResetInterface' => $vendorDir . '/symfony/service-contracts/ResetInterface.php',
'Symfony\\Contracts\\Service\\ServiceCollectionInterface' => $vendorDir . '/symfony/service-contracts/ServiceCollectionInterface.php',
'Symfony\\Contracts\\Service\\ServiceLocatorTrait' => $vendorDir . '/symfony/service-contracts/ServiceLocatorTrait.php',
'Symfony\\Contracts\\Service\\ServiceMethodsSubscriberTrait' => $vendorDir . '/symfony/service-contracts/ServiceMethodsSubscriberTrait.php',
'Symfony\\Contracts\\Service\\ServiceProviderInterface' => $vendorDir . '/symfony/service-contracts/ServiceProviderInterface.php',
'Symfony\\Contracts\\Service\\ServiceSubscriberInterface' => $vendorDir . '/symfony/service-contracts/ServiceSubscriberInterface.php',
'Symfony\\Contracts\\Service\\ServiceSubscriberTrait' => $vendorDir . '/symfony/service-contracts/ServiceSubscriberTrait.php',
Expand Down
2 changes: 2 additions & 0 deletions redaxo/src/core/vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,9 @@ class ComposerStaticInitRedaxoCore
'Symfony\\Contracts\\Service\\Attribute\\Required' => __DIR__ . '/..' . '/symfony/service-contracts/Attribute/Required.php',
'Symfony\\Contracts\\Service\\Attribute\\SubscribedService' => __DIR__ . '/..' . '/symfony/service-contracts/Attribute/SubscribedService.php',
'Symfony\\Contracts\\Service\\ResetInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ResetInterface.php',
'Symfony\\Contracts\\Service\\ServiceCollectionInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceCollectionInterface.php',
'Symfony\\Contracts\\Service\\ServiceLocatorTrait' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceLocatorTrait.php',
'Symfony\\Contracts\\Service\\ServiceMethodsSubscriberTrait' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceMethodsSubscriberTrait.php',
'Symfony\\Contracts\\Service\\ServiceProviderInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceProviderInterface.php',
'Symfony\\Contracts\\Service\\ServiceSubscriberInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceSubscriberInterface.php',
'Symfony\\Contracts\\Service\\ServiceSubscriberTrait' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceSubscriberTrait.php',
Expand Down
35 changes: 18 additions & 17 deletions redaxo/src/core/vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -661,27 +661,27 @@
},
{
"name": "symfony/deprecation-contracts",
"version": "v3.4.0",
"version_normalized": "3.4.0.0",
"version": "v3.5.0",
"version_normalized": "3.5.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git",
"reference": "7c3aff79d10325257a001fcf92d991f24fc967cf"
"reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf",
"reference": "7c3aff79d10325257a001fcf92d991f24fc967cf",
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1",
"reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1",
"shasum": ""
},
"require": {
"php": ">=8.1"
},
"time": "2023-05-23T14:45:45+00:00",
"time": "2024-04-18T09:32:20+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "3.4-dev"
"dev-main": "3.5-dev"
},
"thanks": {
"name": "symfony/contracts",
Expand Down Expand Up @@ -711,7 +711,7 @@
"description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0"
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0"
},
"funding": [
{
Expand Down Expand Up @@ -891,31 +891,32 @@
},
{
"name": "symfony/service-contracts",
"version": "v3.4.2",
"version_normalized": "3.4.2.0",
"version": "v3.5.0",
"version_normalized": "3.5.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/service-contracts.git",
"reference": "11bbf19a0fb7b36345861e85c5768844c552906e"
"reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/11bbf19a0fb7b36345861e85c5768844c552906e",
"reference": "11bbf19a0fb7b36345861e85c5768844c552906e",
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f",
"reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f",
"shasum": ""
},
"require": {
"php": ">=8.1",
"psr/container": "^1.1|^2.0"
"psr/container": "^1.1|^2.0",
"symfony/deprecation-contracts": "^2.5|^3"
},
"conflict": {
"ext-psr": "<1.1|>=2"
},
"time": "2023-12-19T21:51:00+00:00",
"time": "2024-04-18T09:32:20+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "3.4-dev"
"dev-main": "3.5-dev"
},
"thanks": {
"name": "symfony/contracts",
Expand Down Expand Up @@ -956,7 +957,7 @@
"standards"
],
"support": {
"source": "https://github.com/symfony/service-contracts/tree/v3.4.2"
"source": "https://github.com/symfony/service-contracts/tree/v3.5.0"
},
"funding": [
{
Expand Down
16 changes: 8 additions & 8 deletions redaxo/src/core/vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => '__root__',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '193f2056d3fe3f6889a58a1a970e06e6608ec9f5',
'reference' => '0426dc1971287884788b91425bb890eee51c7b94',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -13,7 +13,7 @@
'__root__' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '193f2056d3fe3f6889a58a1a970e06e6608ec9f5',
'reference' => '0426dc1971287884788b91425bb890eee51c7b94',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand Down Expand Up @@ -116,9 +116,9 @@
'dev_requirement' => false,
),
'symfony/deprecation-contracts' => array(
'pretty_version' => 'v3.4.0',
'version' => '3.4.0.0',
'reference' => '7c3aff79d10325257a001fcf92d991f24fc967cf',
'pretty_version' => 'v3.5.0',
'version' => '3.5.0.0',
'reference' => '0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/deprecation-contracts',
'aliases' => array(),
Expand Down Expand Up @@ -203,9 +203,9 @@
'dev_requirement' => false,
),
'symfony/service-contracts' => array(
'pretty_version' => 'v3.4.2',
'version' => '3.4.2.0',
'reference' => '11bbf19a0fb7b36345861e85c5768844c552906e',
'pretty_version' => 'v3.5.0',
'version' => '3.5.0.0',
'reference' => 'bd1d9e59a81d8fa4acdcea3f617c581f7475a80f',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/service-contracts',
'aliases' => array(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-main": "3.4-dev"
"dev-main": "3.5-dev"
},
"thanks": {
"name": "symfony/contracts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@

namespace Symfony\Contracts\Service\Attribute;

use Symfony\Contracts\Service\ServiceMethodsSubscriberTrait;
use Symfony\Contracts\Service\ServiceSubscriberInterface;
use Symfony\Contracts\Service\ServiceSubscriberTrait;

/**
* For use as the return value for {@see ServiceSubscriberInterface}.
*
* @example new SubscribedService('http_client', HttpClientInterface::class, false, new Target('githubApi'))
*
* Use with {@see ServiceSubscriberTrait} to mark a method's return type
* Use with {@see ServiceMethodsSubscriberTrait} to mark a method's return type
* as a subscribed service.
*
* @author Kevin Bond <kevinbond@gmail.com>
Expand Down
Loading

0 comments on commit 93c0bfb

Please sign in to comment.