diff --git a/.env.example b/.env.example index 81e654e..8c26531 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,5 @@ APP_NAME="Quantum PHP Framework" -APP_VERSION=3.0.0 +APP_VERSION=3.0.3 DB_DRIVER=mysql DB_HOST=localhost DB_NAME= diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 0c5d3ed..f321450 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: operating-system: [ ubuntu-latest ] - php-versions: ['7.4', '8.0', '8.1' ] + php-versions: ['8.0', '8.1', '8.2' ] runs-on: ${{ matrix.operating-system }} diff --git a/.scrutinizer.yml b/.scrutinizer.yml new file mode 100644 index 0000000..3d703a6 --- /dev/null +++ b/.scrutinizer.yml @@ -0,0 +1,32 @@ +build: + environment: + php: + version: 8.1 + + dependencies: + before: + - composer self-update --2 || true + override: + - composer install --no-interaction --prefer-dist --no-progress --ignore-platform-req=ext-zip + + nodes: + analysis: + project_setup: + override: + - 'true' + tests: + override: + - php-scrutinizer-run + +filter: + excluded_paths: + - 'tests/*' + +checks: + php: true + +coding_style: + php: + spaces: + around_operators: + concatenation: true diff --git a/CHANGELOG.md b/CHANGELOG.md index e27c400..169c72d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on Keep a Changelog and this project adheres to Semantic Versioning. +## [Unreleased] + +### Changed +- Raised the project runtime baseline to PHP 8.0 and updated CI to exercise PHP 8.0, 8.1, and 8.2. +- Bumped the PHPStan parser baseline to PHP 8.0. + ## [3.0.0] - 2026-05-28 ### Changed diff --git a/README.md b/README.md index 26179b8..c489ea4 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,8 @@

Installation

+

Requirements: PHP 8.0 or newer.

+

1. Create new project

```bash diff --git a/composer.json b/composer.json index a378df2..d1c01f7 100644 --- a/composer.json +++ b/composer.json @@ -1,16 +1,37 @@ { "name": "quantum/project", "description": "Quantum Project", - "keywords": ["framework", "php", "quantum", "project"], + "homepage": "https://quantumphp.io", + "keywords": [ + "framework", + "php", + "quantum", + "project" + ], "license": "MIT", + "authors": [ + { + "name": "Arman Ag", + "email": "arman@quantumphp.io" + }, + { + "name": "Contributors", + "homepage": "https://github.com/quantum-php/framework/contributors" + } + ], + "support": { + "issues": "https://github.com/quantum-php/project/issues", + "source": "https://github.com/quantum-php/project" + }, "type": "project", "require": { - "php": "^7.4 || ^8.0", - "quantum/framework": "^3.0.0", + "php": "^8.0", + "quantum/framework": "dev-master", "fakerphp/faker": "^1.15", "bluemmb/faker-picsum-photos-provider": "^2.0", "ottaviano/faker-gravatar": "^0.3.0", - "symfony/process": "^5.4" + "symfony/process": "^5.4", + "symfony/yaml": "^5.4.52" }, "require-dev": { "phpunit/phpunit": "^9.0", @@ -45,10 +66,5 @@ "rector:fix": "vendor/bin/rector process", "phpstan": "vendor/bin/phpstan analyse --memory-limit=-1 --error-format=github", "test": "vendor/bin/phpunit --stderr --coverage-clover coverage.xml" - }, - "config": { - "audit": { - "block-insecure": false - } } } diff --git a/helpers/functions.php b/helpers/functions.php index e999f9a..78af19d 100644 --- a/helpers/functions.php +++ b/helpers/functions.php @@ -2,14 +2,8 @@ /** * Quantum PHP Framework - * - * An open source software development framework for PHP - * - * @package Quantum - * @author Arman Ag. - * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org) - * @link http://quantum.softberg.org/ - * @since 3.0.0 + * An open-source software development framework for PHP + * @link https://quantumphp.io */ use Quantum\HttpClient\Exceptions\HttpClientException; diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 89f3fda..8986f56 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,5 +1,5 @@ parameters: - phpVersion: 70400 + phpVersion: 80000 level: 5 paths: - shared diff --git a/rector.php b/rector.php index 05e9572..8ca81f6 100644 --- a/rector.php +++ b/rector.php @@ -3,6 +3,7 @@ declare(strict_types=1); use Rector\TypeDeclaration\Rector\StmtsAwareInterface\DeclareStrictTypesRector; +use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector; use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\SetList; use Rector\Config\RectorConfig; @@ -18,6 +19,7 @@ ]) ->withSkip([ __DIR__ . '/modules', + ClassPropertyAssignToConstructorPromotionRector::class, ]) ->withSets([ LevelSetList::UP_TO_PHP_80, diff --git a/shared/Commands/CommandValidationTrait.php b/shared/Commands/CommandValidationTrait.php index 8fb6817..6f9a2d0 100644 --- a/shared/Commands/CommandValidationTrait.php +++ b/shared/Commands/CommandValidationTrait.php @@ -4,14 +4,8 @@ /** * Quantum PHP Framework - * - * An open source software development framework for PHP - * - * @package Quantum - * @author Arman Ag. - * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org) - * @link http://quantum.softberg.org/ - * @since 3.0.0 + * An open-source software development framework for PHP + * @link https://quantumphp.io */ namespace Shared\Commands; diff --git a/shared/Commands/CommentCreateCommand.php b/shared/Commands/CommentCreateCommand.php index 6cd3b9d..2959a98 100644 --- a/shared/Commands/CommentCreateCommand.php +++ b/shared/Commands/CommentCreateCommand.php @@ -4,14 +4,8 @@ /** * Quantum PHP Framework - * - * An open source software development framework for PHP - * - * @package Quantum - * @author Arman Ag. - * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org) - * @link http://quantum.softberg.org/ - * @since 3.0.0 + * An open-source software development framework for PHP + * @link https://quantumphp.io */ namespace Shared\Commands; diff --git a/shared/Commands/CommentDeleteCommand.php b/shared/Commands/CommentDeleteCommand.php index 5592aec..aaade8f 100644 --- a/shared/Commands/CommentDeleteCommand.php +++ b/shared/Commands/CommentDeleteCommand.php @@ -4,14 +4,8 @@ /** * Quantum PHP Framework - * - * An open source software development framework for PHP - * - * @package Quantum - * @author Arman Ag. - * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org) - * @link http://quantum.softberg.org/ - * @since 3.0.0 + * An open-source software development framework for PHP + * @link https://quantumphp.io */ namespace Shared\Commands; diff --git a/shared/Commands/DemoCommand.php b/shared/Commands/DemoCommand.php index ef75d08..1b9bbbd 100644 --- a/shared/Commands/DemoCommand.php +++ b/shared/Commands/DemoCommand.php @@ -4,14 +4,8 @@ /** * Quantum PHP Framework - * - * An open source software development framework for PHP - * - * @package Quantum - * @author Arman Ag. - * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org) - * @link http://quantum.softberg.org/ - * @since 3.0.0 + * An open-source software development framework for PHP + * @link https://quantumphp.io */ namespace Shared\Commands; @@ -475,7 +469,7 @@ private function buildCommand(string $commandName, array $arguments): array $command = ['php', 'qt', $commandName]; foreach ($arguments as $key => $value) { - if (!is_int($key) && substr($key, 0, 2) !== '--') { + if (!is_int($key) && !str_starts_with($key, '--')) { $command[] = (string) $value; continue; } diff --git a/shared/Commands/PostCreateCommand.php b/shared/Commands/PostCreateCommand.php index efbcecd..6fdf482 100644 --- a/shared/Commands/PostCreateCommand.php +++ b/shared/Commands/PostCreateCommand.php @@ -4,14 +4,8 @@ /** * Quantum PHP Framework - * - * An open source software development framework for PHP - * - * @package Quantum - * @author Arman Ag. - * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org) - * @link http://quantum.softberg.org/ - * @since 3.0.0 + * An open-source software development framework for PHP + * @link https://quantumphp.io */ namespace Shared\Commands; diff --git a/shared/Commands/PostDeleteCommand.php b/shared/Commands/PostDeleteCommand.php index 51d4a03..6c0ef99 100644 --- a/shared/Commands/PostDeleteCommand.php +++ b/shared/Commands/PostDeleteCommand.php @@ -4,14 +4,8 @@ /** * Quantum PHP Framework - * - * An open source software development framework for PHP - * - * @package Quantum - * @author Arman Ag. - * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org) - * @link http://quantum.softberg.org/ - * @since 3.0.0 + * An open-source software development framework for PHP + * @link https://quantumphp.io */ namespace Shared\Commands; diff --git a/shared/Commands/PostShowCommand.php b/shared/Commands/PostShowCommand.php index c1c2ede..31c357b 100644 --- a/shared/Commands/PostShowCommand.php +++ b/shared/Commands/PostShowCommand.php @@ -4,14 +4,8 @@ /** * Quantum PHP Framework - * - * An open source software development framework for PHP - * - * @package Quantum - * @author Arman Ag. - * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org) - * @link http://quantum.softberg.org/ - * @since 3.0.0 + * An open-source software development framework for PHP + * @link https://quantumphp.io */ namespace Shared\Commands; diff --git a/shared/Commands/PostUpdateCommand.php b/shared/Commands/PostUpdateCommand.php index a1e6897..0ce8a58 100644 --- a/shared/Commands/PostUpdateCommand.php +++ b/shared/Commands/PostUpdateCommand.php @@ -4,14 +4,8 @@ /** * Quantum PHP Framework - * - * An open source software development framework for PHP - * - * @package Quantum - * @author Arman Ag. - * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org) - * @link http://quantum.softberg.org/ - * @since 3.0.0 + * An open-source software development framework for PHP + * @link https://quantumphp.io */ namespace Shared\Commands; diff --git a/shared/Commands/UserCreateCommand.php b/shared/Commands/UserCreateCommand.php index 529bfde..f7ff046 100644 --- a/shared/Commands/UserCreateCommand.php +++ b/shared/Commands/UserCreateCommand.php @@ -4,14 +4,8 @@ /** * Quantum PHP Framework - * - * An open source software development framework for PHP - * - * @package Quantum - * @author Arman Ag. - * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org) - * @link http://quantum.softberg.org/ - * @since 3.0.0 + * An open-source software development framework for PHP + * @link https://quantumphp.io */ namespace Shared\Commands; diff --git a/shared/Commands/UserDeleteCommand.php b/shared/Commands/UserDeleteCommand.php index 93afd90..0ef220c 100644 --- a/shared/Commands/UserDeleteCommand.php +++ b/shared/Commands/UserDeleteCommand.php @@ -4,14 +4,8 @@ /** * Quantum PHP Framework - * - * An open source software development framework for PHP - * - * @package Quantum - * @author Arman Ag. - * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org) - * @link http://quantum.softberg.org/ - * @since 3.0.0 + * An open-source software development framework for PHP + * @link https://quantumphp.io */ namespace Shared\Commands; diff --git a/shared/Commands/UserShowCommand.php b/shared/Commands/UserShowCommand.php index 21ff1ed..558e57e 100644 --- a/shared/Commands/UserShowCommand.php +++ b/shared/Commands/UserShowCommand.php @@ -4,14 +4,8 @@ /** * Quantum PHP Framework - * - * An open source software development framework for PHP - * - * @package Quantum - * @author Arman Ag. - * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org) - * @link http://quantum.softberg.org/ - * @since 3.0.0 + * An open-source software development framework for PHP + * @link https://quantumphp.io */ namespace Shared\Commands; diff --git a/shared/DTOs/CommentDTO.php b/shared/DTOs/CommentDTO.php index e0a82fe..edc50e2 100644 --- a/shared/DTOs/CommentDTO.php +++ b/shared/DTOs/CommentDTO.php @@ -4,14 +4,8 @@ /** * Quantum PHP Framework - * - * An open source software development framework for PHP - * - * @package Quantum - * @author Arman Ag. - * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org) - * @link http://quantum.softberg.org/ - * @since 3.0.0 + * An open-source software development framework for PHP + * @link https://quantumphp.io */ namespace Shared\DTOs; diff --git a/shared/DTOs/PostDTO.php b/shared/DTOs/PostDTO.php index aee5e05..cbe428c 100644 --- a/shared/DTOs/PostDTO.php +++ b/shared/DTOs/PostDTO.php @@ -4,14 +4,8 @@ /** * Quantum PHP Framework - * - * An open source software development framework for PHP - * - * @package Quantum - * @author Arman Ag. - * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org) - * @link http://quantum.softberg.org/ - * @since 3.0.0 + * An open-source software development framework for PHP + * @link https://quantumphp.io */ namespace Shared\DTOs; diff --git a/shared/DTOs/UserDTO.php b/shared/DTOs/UserDTO.php index 747433b..7dd9df4 100644 --- a/shared/DTOs/UserDTO.php +++ b/shared/DTOs/UserDTO.php @@ -4,14 +4,8 @@ /** * Quantum PHP Framework - * - * An open source software development framework for PHP - * - * @package Quantum - * @author Arman Ag. - * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org) - * @link http://quantum.softberg.org/ - * @since 3.0.0 + * An open-source software development framework for PHP + * @link https://quantumphp.io */ namespace Shared\DTOs; diff --git a/shared/Enums/Role.php b/shared/Enums/Role.php index 5701e33..78ac8e8 100644 --- a/shared/Enums/Role.php +++ b/shared/Enums/Role.php @@ -4,14 +4,8 @@ /** * Quantum PHP Framework - * - * An open source software development framework for PHP - * - * @package Quantum - * @author Arman Ag. - * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org) - * @link http://quantum.softberg.org/ - * @since 3.0.0 + * An open-source software development framework for PHP + * @link https://quantumphp.io */ namespace Shared\Enums; diff --git a/shared/Models/Comment.php b/shared/Models/Comment.php index cc31bca..5620505 100644 --- a/shared/Models/Comment.php +++ b/shared/Models/Comment.php @@ -4,14 +4,8 @@ /** * Quantum PHP Framework - * - * An open source software development framework for PHP - * - * @package Quantum - * @author Arman Ag. - * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org) - * @link http://quantum.softberg.org/ - * @since 3.0.0 + * An open-source software development framework for PHP + * @link https://quantumphp.io */ namespace Shared\Models; diff --git a/shared/Models/Post.php b/shared/Models/Post.php index f85dc6e..5d30df4 100644 --- a/shared/Models/Post.php +++ b/shared/Models/Post.php @@ -4,14 +4,8 @@ /** * Quantum PHP Framework - * - * An open source software development framework for PHP - * - * @package Quantum - * @author Arman Ag. - * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org) - * @link http://quantum.softberg.org/ - * @since 3.0.0 + * An open-source software development framework for PHP + * @link https://quantumphp.io */ namespace Shared\Models; diff --git a/shared/Models/User.php b/shared/Models/User.php index e2ca8da..9488ae9 100644 --- a/shared/Models/User.php +++ b/shared/Models/User.php @@ -4,14 +4,8 @@ /** * Quantum PHP Framework - * - * An open source software development framework for PHP - * - * @package Quantum - * @author Arman Ag. - * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org) - * @link http://quantum.softberg.org/ - * @since 3.0.0 + * An open-source software development framework for PHP + * @link https://quantumphp.io */ namespace Shared\Models; diff --git a/shared/Services/AuthService.php b/shared/Services/AuthService.php index b61b509..f4d04dc 100644 --- a/shared/Services/AuthService.php +++ b/shared/Services/AuthService.php @@ -4,14 +4,8 @@ /** * Quantum PHP Framework - * - * An open source software development framework for PHP - * - * @package Quantum - * @author Arman Ag. - * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org) - * @link http://quantum.softberg.org/ - * @since 3.0.0 + * An open-source software development framework for PHP + * @link https://quantumphp.io */ namespace Shared\Services; diff --git a/shared/Services/CommentService.php b/shared/Services/CommentService.php index 89067b1..14415f1 100644 --- a/shared/Services/CommentService.php +++ b/shared/Services/CommentService.php @@ -4,14 +4,8 @@ /** * Quantum PHP Framework - * - * An open source software development framework for PHP - * - * @package Quantum - * @author Arman Ag. - * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org) - * @link http://quantum.softberg.org/ - * @since 3.0.0 + * An open-source software development framework for PHP + * @link https://quantumphp.io */ namespace Shared\Services; diff --git a/shared/Services/PostService.php b/shared/Services/PostService.php index d2d331b..26a1509 100644 --- a/shared/Services/PostService.php +++ b/shared/Services/PostService.php @@ -4,14 +4,8 @@ /** * Quantum PHP Framework - * - * An open source software development framework for PHP - * - * @package Quantum - * @author Arman Ag. - * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org) - * @link http://quantum.softberg.org/ - * @since 3.0.0 + * An open-source software development framework for PHP + * @link https://quantumphp.io */ namespace Shared\Services; diff --git a/shared/Transformers/CommentTransformer.php b/shared/Transformers/CommentTransformer.php index b1542f6..88d3a5d 100644 --- a/shared/Transformers/CommentTransformer.php +++ b/shared/Transformers/CommentTransformer.php @@ -4,14 +4,8 @@ /** * Quantum PHP Framework - * - * An open source software development framework for PHP - * - * @package Quantum - * @author Arman Ag. - * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org) - * @link http://quantum.softberg.org/ - * @since 3.0.0 + * An open-source software development framework for PHP + * @link https://quantumphp.io */ namespace Shared\Transformers; diff --git a/shared/Transformers/PostTransformer.php b/shared/Transformers/PostTransformer.php index 44246ff..92f3de1 100644 --- a/shared/Transformers/PostTransformer.php +++ b/shared/Transformers/PostTransformer.php @@ -4,14 +4,8 @@ /** * Quantum PHP Framework - * - * An open source software development framework for PHP - * - * @package Quantum - * @author Arman Ag. - * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org) - * @link http://quantum.softberg.org/ - * @since 3.0.0 + * An open-source software development framework for PHP + * @link https://quantumphp.io */ namespace Shared\Transformers; diff --git a/tests/Unit/shared/Services/PostServiceTest.php b/tests/Unit/shared/Services/PostServiceTest.php index 8ebfdae..0a57a11 100644 --- a/tests/Unit/shared/Services/PostServiceTest.php +++ b/tests/Unit/shared/Services/PostServiceTest.php @@ -22,6 +22,8 @@ class PostServiceTest extends TestCase protected $postService; + protected $fileMeta; + public function setUp(): void { parent::setUp();