diff --git a/.github/workflows/PhpUnit-MacOs.yaml b/.github/workflows/PhpUnit-MacOs.yaml index 70d25f0..d15e217 100644 --- a/.github/workflows/PhpUnit-MacOs.yaml +++ b/.github/workflows/PhpUnit-MacOs.yaml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v2 - uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' extensions: bcmath coverage: xdebug tools: phpunit diff --git a/.github/workflows/PhpUnit-Win.yaml b/.github/workflows/PhpUnit-Win.yaml index 873b2fc..9adf0db 100644 --- a/.github/workflows/PhpUnit-Win.yaml +++ b/.github/workflows/PhpUnit-Win.yaml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v2 - uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' extensions: bcmath coverage: xdebug tools: phpunit diff --git a/.github/workflows/PhpUnit.yaml b/.github/workflows/PhpUnit.yaml index bef6228..10e714d 100644 --- a/.github/workflows/PhpUnit.yaml +++ b/.github/workflows/PhpUnit.yaml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v2 - uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' extensions: bcmath coverage: xdebug tools: phpunit diff --git a/.github/workflows/Psalm.yaml b/.github/workflows/Psalm.yaml index e7de9f8..b45f209 100644 --- a/.github/workflows/Psalm.yaml +++ b/.github/workflows/Psalm.yaml @@ -10,7 +10,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' - name: Checkout project uses: actions/checkout@v2 diff --git a/Attributes/AccessControl.php b/Attributes/AccessControl.php index 7dbf094..8460c44 100644 --- a/Attributes/AccessControl.php +++ b/Attributes/AccessControl.php @@ -23,7 +23,7 @@ use Attribute; #[Attribute(Attribute::TARGET_METHOD)] -class AccessControl +readonly class AccessControl { /** * AccessControl constructor. diff --git a/Attributes/Action.php b/Attributes/Action.php index 13f1579..7964d45 100644 --- a/Attributes/Action.php +++ b/Attributes/Action.php @@ -23,7 +23,7 @@ use Attribute; #[Attribute(Attribute::TARGET_METHOD)] -class Action +readonly class Action { public function __construct(public string $usage = '', public string $description = '') { diff --git a/Attributes/JsonItem.php b/Attributes/JsonItem.php index 0e5b5bb..6300c99 100644 --- a/Attributes/JsonItem.php +++ b/Attributes/JsonItem.php @@ -24,7 +24,7 @@ use Feast\Date; #[Attribute(Attribute::TARGET_PROPERTY)] -class JsonItem +readonly class JsonItem { /** * JsonItem constructor. diff --git a/Attributes/JsonParam.php b/Attributes/JsonParam.php index 3675f99..bb12c8b 100644 --- a/Attributes/JsonParam.php +++ b/Attributes/JsonParam.php @@ -23,7 +23,7 @@ use Attribute; #[Attribute(Attribute::TARGET_PARAMETER)] -class JsonParam +readonly class JsonParam { public function __construct(public string $key = '') { diff --git a/Attributes/Param.php b/Attributes/Param.php index c9d098f..141fb1f 100644 --- a/Attributes/Param.php +++ b/Attributes/Param.php @@ -25,7 +25,7 @@ use Feast\Terminal; #[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)] -class Param +readonly class Param { public function __construct( public string $type = '', diff --git a/Attributes/Path.php b/Attributes/Path.php index e9a809a..5e8f624 100644 --- a/Attributes/Path.php +++ b/Attributes/Path.php @@ -24,7 +24,7 @@ use Feast\Enums\RequestMethod; #[Attribute(Attribute::TARGET_METHOD)] -class Path +readonly class Path { final public const METHOD_GET = 1; final public const METHOD_POST = 2; diff --git a/Database/Database.php b/Database/Database.php index 23ac2ff..56c0f15 100644 --- a/Database/Database.php +++ b/Database/Database.php @@ -44,23 +44,21 @@ class Database implements DatabaseInterface private PDO $connection; private DatabaseType $databaseType; private string $queryClass; - private LoggerInterface $logger; private string $escapeCharacter; /** * @param stdClass $connectionDetails * @param string $pdoClass - * @param LoggerInterface|null $logger - * @throws DatabaseException + * @param LoggerInterface $logger * @throws InvalidOptionException * @throws ServerFailureException - * @throws \Feast\ServiceContainer\NotFoundException */ - public function __construct(stdClass $connectionDetails, string $pdoClass, ?LoggerInterface $logger) - { - $logger ??= di(LoggerInterface::INTERFACE_NAME); - $this->logger = $logger; - + public function __construct( + #[\SensitiveParameter] + stdClass $connectionDetails, + string $pdoClass, + private readonly LoggerInterface $logger + ) { $username = (string)$connectionDetails->user; $password = (string)$connectionDetails->pass; /** @var DatabaseType */ diff --git a/FeastTests/IdentityTest.php b/FeastTests/IdentityTest.php index a59ea90..21b900d 100644 --- a/FeastTests/IdentityTest.php +++ b/FeastTests/IdentityTest.php @@ -68,8 +68,7 @@ public function testSaveUser(): void $testUser = new MockUser(); $testUser->user = 'testUser'; - $identity = new Identity($config, $session); - + $identity = new Identity($config,$session); $user = $identity->getUser(); $this->assertEquals(null, $user); diff --git a/HttpRequest/HttpRequest.php b/HttpRequest/HttpRequest.php index 02cdaf9..8193040 100644 --- a/HttpRequest/HttpRequest.php +++ b/HttpRequest/HttpRequest.php @@ -329,8 +329,11 @@ public function getUserAgent(): string * @param string $password * @return HttpRequest */ - public function authenticate(string $username, string $password): HttpRequestInterface - { + public function authenticate( + string $username, + #[\SensitiveParameter] + string $password + ): HttpRequestInterface { $this->username = $username; $this->password = $password; diff --git a/README.md b/README.md index 3f7bac6..9385280 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,11 @@ # FEAST Framework -![PHPUnit](https://github.com/FeastFramework/framework/workflows/PHPUnit/badge.svg?branch=v2.x) -![Psalm Static analysis](https://github.com/FeastFramework/framework/workflows/Psalm%20Static%20analysis/badge.svg?branch=v2.x) -[![codecov](https://codecov.io/gh/FeastFramework/framework/branch/v2.x/graph/badge.svg?token=FBP2AKLJB3)](https://codecov.io/gh/FeastFramework/framework) +![PHPUnit](https://github.com/FeastFramework/framework/workflows/PHPUnit/badge.svg?branch=v3.x) +![Psalm Static analysis](https://github.com/FeastFramework/framework/workflows/Psalm%20Static%20analysis/badge.svg?branch=v3.x) +[![codecov](https://codecov.io/gh/FeastFramework/framework/branch/v3.x/graph/badge.svg?token=FBP2AKLJB3)](https://codecov.io/gh/FeastFramework/framework) -![PHP Version](https://img.shields.io/packagist/php-v/feast/framework/v2.x-dev) +![PHP Version](https://img.shields.io/packagist/php-v/feast/framework/v3.x-dev) [![Packagist](https://img.shields.io/packagist/v/feast/framework)](https://packagist.org/packages/feast/framework) ![License](https://img.shields.io/packagist/l/feast/framework.svg) [![Docs](https://img.shields.io/badge/docs-quickstart-green.svg)](https://docs.feast-framework.com) diff --git a/composer.json b/composer.json index 26504b3..ee1686a 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } ], "require": { - "php": "^8.1.0", + "php": "^8.2.0", "ext-pdo": "*", "ext-xml": "*", "ext-readline": "*", diff --git a/composer.lock b/composer.lock index 3ad0dec..1c8d4ab 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7851f377b0b126cd0715550dcad67826", + "content-hash": "3f37ec1ab718163295e8b43c2e02c774", "packages": [], "packages-dev": [ { @@ -49,7 +49,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^8.1.0", + "php": "^8.2.0", "ext-pdo": "*", "ext-xml": "*", "ext-readline": "*", diff --git a/docs/CNAME b/docs/CNAME deleted file mode 100644 index ae42c55..0000000 --- a/docs/CNAME +++ /dev/null @@ -1 +0,0 @@ -docs.feast-framework.com \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index d71ce0d..ba89e67 100644 --- a/docs/index.md +++ b/docs/index.md @@ -67,10 +67,10 @@ up with the following principles always in mind. ## Requirements -The current release of FEAST requires >=PHP 8.1 and (if you wish to use the Curl service classes) PHP 8.1-curl. In -addition, PHP 8.1-bcmath is recommended. +The current release of FEAST requires >=PHP 8.2 and (if you wish to use the Curl service classes) PHP 8.2-curl. In +addition, PHP 8.2-bcmath is recommended. -The v1.x line of FEAST requires >=PHP 8.0. The same recommendations above apply +The v1.x line of FEAST requires >=PHP 8.0 and v2.x line requires >=PHP 8.1. The same recommendations above apply FEAST currently works with the MySQL and PostgreSQL database management systems as well as with SQLite for simple queries.