diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0a563d37c..880a4ec8e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: matrix: php-version: [ '7.4', '8.2' ] db-type: [ sqlite, mysql, pgsql, agnostic ] - symfony-version: [ '4-min', '4-max', '5-min', '5-max', '6-min', '6-max' ] + symfony-version: [ '4-min', '4-max', '5-min', '5-max', '6-min', '6-max', '7-min', '7-max'] exclude: - symfony-version: '4-min' php-version: '8.2' @@ -24,6 +24,10 @@ jobs: php-version: '7.4' - symfony-version: '6-max' php-version: '7.4' + - symfony-version: '7-min' + php-version: '7.4' + - symfony-version: '7-max' + php-version: '7.4' env: DB_NAME: 'propel_tests' DB_USER: 'propel' @@ -125,6 +129,8 @@ jobs: else vendor/bin/phpunit -c tests/${{ matrix.db-type }}.phpunit.xml fi + env: + SYMFONY_VERSION: ${{ matrix.symfony-version }} - name: Code Coverage Report if: success() && matrix.php-version == '7.4' && matrix.symfony-version == '5-max' @@ -166,6 +172,8 @@ jobs: run: composer install --prefer-dist --no-interaction - name: PHPStan + env: + PHPSTAN: 1 run: composer stan - name: Psalm diff --git a/composer.json b/composer.json index 04ce929d84..7b0f6b10d4 100644 --- a/composer.json +++ b/composer.json @@ -18,13 +18,13 @@ "require": { "php": ">=7.4", "psr/log": "^1.0 || ^2.0 || ^3.0", - "symfony/yaml": "^4.4.0 || ^5.0.0 || ^6.0.0", - "symfony/config": "^4.4.0 || ^5.0.0 || ^6.0.0", - "symfony/console": "^4.4.0 || ^5.0.0 || ^6.0.0", - "symfony/filesystem": "^4.4.0 || ^5.0.0 || ^6.0.0", - "symfony/finder": "^4.4.0 || ^5.0.0 || ^6.0.0", - "symfony/translation": "^4.4.0 || ^5.0.0 || ^6.0.0", - "symfony/validator": "^4.4.0 || ^5.0.0 || ^6.0.0" + "symfony/yaml": "^4.4.0 || ^5.0.0 || ^6.0.0 || ^7.0.0", + "symfony/config": "^4.4.0 || ^5.0.0 || ^6.0.0 || ^7.0.0", + "symfony/console": "^4.4.0 || ^5.0.0 || ^6.0.0 || ^7.0.0", + "symfony/filesystem": "^4.4.0 || ^5.0.0 || ^6.0.0 || ^7.0.0", + "symfony/finder": "^4.4.0 || ^5.0.0 || ^6.0.0 || ^7.0.0", + "symfony/translation": "^4.4.0 || ^5.0.0 || ^6.0.0 || ^7.0.0", + "symfony/validator": "^4.4.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" }, "require-dev": { "ext-pdo": "*", diff --git a/src/Propel/Generator/Command/MigrationUpCommand.php b/src/Propel/Generator/Command/MigrationUpCommand.php index cc79558bd5..daea8a44e5 100644 --- a/src/Propel/Generator/Command/MigrationUpCommand.php +++ b/src/Propel/Generator/Command/MigrationUpCommand.php @@ -44,7 +44,7 @@ protected function configure() * * @throws \Propel\Runtime\Exception\RuntimeException */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $configOptions = []; diff --git a/src/Propel/Runtime/Validator/Constraints/Date.php b/src/Propel/Runtime/Validator/Constraints/Date.php index 35c78fc31a..5c1da3714b 100644 --- a/src/Propel/Runtime/Validator/Constraints/Date.php +++ b/src/Propel/Runtime/Validator/Constraints/Date.php @@ -12,11 +12,6 @@ class Date extends SymfonyDateConstraint { - /** - * @var string - */ - public $message = 'This value is not a valid date.'; - /** * @var string */ diff --git a/tests/Propel/Tests/Common/Config/Loader/FileLoaderTest.php b/tests/Propel/Tests/Common/Config/Loader/FileLoaderTest.php index 309c2ff922..efeaba7ba6 100644 --- a/tests/Propel/Tests/Common/Config/Loader/FileLoaderTest.php +++ b/tests/Propel/Tests/Common/Config/Loader/FileLoaderTest.php @@ -362,18 +362,14 @@ public function testCallResolveParamTwiceReturnsEmpty() class TestableFileLoader extends BaseFileLoader { - /** - * @return void - */ - public function load($resource, $type = null) + public function load($resource, $type = null): ?array { + return null; } - /** - * @return void - */ - public function supports($resource, $type = null) + public function supports($resource, $type = null): bool { + return false; } /** diff --git a/tests/Propel/Tests/Runtime/Connection/PropelPDOTest.php b/tests/Propel/Tests/Runtime/Connection/PropelPDOTest.php index 4ec4ec52d3..31d299753d 100644 --- a/tests/Propel/Tests/Runtime/Connection/PropelPDOTest.php +++ b/tests/Propel/Tests/Runtime/Connection/PropelPDOTest.php @@ -564,7 +564,7 @@ class LastMessageHandler extends AbstractHandler * * @return bool */ - public function handle(array $record): bool + public function handle($record): bool { $this->latestMessage = (string)$record['message']; diff --git a/tests/composer/composer-symfony7-max.json b/tests/composer/composer-symfony7-max.json new file mode 100644 index 0000000000..3aef25cc10 --- /dev/null +++ b/tests/composer/composer-symfony7-max.json @@ -0,0 +1,66 @@ +{ + "name": "propel/propel", + "type": "library", + "description": "Propel2 is an open-source Object-Relational Mapping (ORM) for PHP 5.5 and up.", + "keywords": [ + "ORM", + "persistence", + "Active Record" + ], + "homepage": "http://www.propelorm.org/", + "license": "MIT", + "authors": [ + { + "name": "William Durand", + "email": "william.durand1@gmail.com" + } + ], + "require": { + "php": ">=8.2", + "symfony/yaml": "^7.0.0", + "symfony/config": "^7.0.0", + "symfony/console": "^7.0.0", + "symfony/filesystem": "^7.0.0", + "symfony/finder": "^7.0.0", + "symfony/translation": "^7.0.0", + "symfony/validator": "^7.0.0", + "psr/log": "^1.0 || ^2.0 || ^3.0" + }, + "require-dev": { + "ext-pdo": "*", + "ext-json": "*", + "ext-xml": "*", + "monolog/monolog": "^1.3 || ^2.3 || ^3.0", + "phpstan/phpstan": "^1.2", + "phpunit/phpunit": "^9.5.0", + "spryker/code-sniffer": "^0.17.2", + "psalm/phar": "^4.23", + "mikey179/vfsstream": "^1.6" + }, + "suggest": { + "monolog/monolog": "The recommended logging library to use with Propel." + }, + "autoload": { + "psr-4": { + "Propel\\": "src/Propel/" + } + }, + "bin": [ + "bin/propel" + ], + "scripts": { + "stan": [ + "vendor/bin/phpstan analyze -l 1 -c tests/phpstan.neon src/" + ] + }, + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } + } +} diff --git a/tests/composer/composer-symfony7-min.json b/tests/composer/composer-symfony7-min.json new file mode 100644 index 0000000000..400da1df29 --- /dev/null +++ b/tests/composer/composer-symfony7-min.json @@ -0,0 +1,66 @@ +{ + "name": "propel/propel", + "type": "library", + "description": "Propel2 is an open-source Object-Relational Mapping (ORM) for PHP 5.5 and up.", + "keywords": [ + "ORM", + "persistence", + "Active Record" + ], + "homepage": "http://www.propelorm.org/", + "license": "MIT", + "authors": [ + { + "name": "William Durand", + "email": "william.durand1@gmail.com" + } + ], + "require": { + "php": ">=8.2", + "symfony/yaml": "~7.0.0", + "symfony/config": "~7.0.0", + "symfony/console": "~7.0.0", + "symfony/filesystem": "~7.0.0", + "symfony/finder": "~7.0.0", + "symfony/translation": "~7.0.0", + "symfony/validator": "~7.0.0", + "psr/log": "^1.0 || ^2.0 || ^3.0" + }, + "require-dev": { + "ext-pdo": "*", + "ext-json": "*", + "ext-xml": "*", + "monolog/monolog": "^1.3 || ^2.3 || ^3.0", + "phpstan/phpstan": "^1.2", + "phpunit/phpunit": "^9.5.0", + "spryker/code-sniffer": "^0.17.2", + "psalm/phar": "^4.23", + "mikey179/vfsstream": "^1.6" + }, + "suggest": { + "monolog/monolog": "The recommended logging library to use with Propel." + }, + "autoload": { + "psr-4": { + "Propel\\": "src/Propel/" + } + }, + "bin": [ + "bin/propel" + ], + "scripts": { + "stan": [ + "vendor/bin/phpstan analyze -l 1 -c tests/phpstan.neon src/" + ] + }, + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } + } +}