diff --git a/.github/workflows/test-application.yaml b/.github/workflows/test-application.yaml index 5d43b66..dbc478b 100644 --- a/.github/workflows/test-application.yaml +++ b/.github/workflows/test-application.yaml @@ -57,6 +57,21 @@ jobs: dependencies: highest behat-suite: cli + - php-version: '8.3' + dependencies: highest + behat-suite: standalone + composer-stability: 'dev' + + - php-version: '8.3' + dependencies: highest + behat-suite: embedded + composer-stability: 'dev' + + - php-version: '8.3' + dependencies: highest + behat-suite: cli + composer-stability: 'dev' + steps: - name: Checkout project uses: actions/checkout@v2 @@ -74,6 +89,10 @@ jobs: php-version: ${{ matrix.php-version }} tools: 'composer:v2' + - name: Set composer stability + if: ${{ matrix.composer-stability }} + run: composer config minimum-stability ${{ matrix.composer-stability }} + - name: Install dependencies with Composer uses: ramsey/composer-install@v2 with: diff --git a/composer.json b/composer.json index 3f81bbc..09a000f 100644 --- a/composer.json +++ b/composer.json @@ -3,15 +3,15 @@ "description": "Shell for PHPCR", "require": { "php": "^8.0", - "symfony/console": "^5.0 || ^6.0", + "symfony/console": "^5.0 || ^6.0 || ^7.0", "jackalope/jackalope": "^1.3.4", "phpcr/phpcr": "^2.1", - "phpcr/phpcr-utils": "^1.2", - "symfony/finder": "^5.0 || ^6.0", - "symfony/serializer": "^5.0 || ^6.0", - "symfony/yaml": "^5.0 || ^6.0", - "symfony/dependency-injection": "^5.0 || ^6.0", - "symfony/expression-language": "^5.0 || ^6.0", + "phpcr/phpcr-utils": "^1.2 || ^2.0", + "symfony/finder": "^5.0 || ^6.0 || ^7.0", + "symfony/serializer": "^5.0 || ^6.0 || ^7.0", + "symfony/yaml": "^5.0 || ^6.0 || ^7.0", + "symfony/dependency-injection": "^5.0 || ^6.0 || ^7.0", + "symfony/expression-language": "^5.0 || ^6.0 || ^7.0", "dantleech/glob-finder": "^1.0" }, "require-dev": { diff --git a/src/PHPCR/Shell/Serializer/NodeNormalizer.php b/src/PHPCR/Shell/Serializer/NodeNormalizer.php index 3735feb..9c265ff 100644 --- a/src/PHPCR/Shell/Serializer/NodeNormalizer.php +++ b/src/PHPCR/Shell/Serializer/NodeNormalizer.php @@ -39,14 +39,21 @@ public function getNotes() return $this->notes; } + public function getSupportedTypes(?string $format): array + { + return [ + NodeInterface::class => true, + ]; + } + /** * {@inheritdoc} */ - public function normalize($node, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): array { $res = []; - foreach ($node->getProperties() as $property) { + foreach ($object->getProperties() as $property) { if (false === $this->isPropertyEditable($property)) { continue; } @@ -85,7 +92,7 @@ public function normalize($node, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null, array $context = []): bool { return is_object($data) && $data instanceof NodeInterface; } @@ -93,7 +100,7 @@ public function supportsNormalization($data, $format = null) /** * {@inheritdoc} */ - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize($data, $class, $format = null, array $context = []): mixed { if (!$data) { throw new \InvalidArgumentException( @@ -166,7 +173,7 @@ public function denormalize($data, $class, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return $type === 'PHPCR\NodeInterface'; } diff --git a/src/PHPCR/Shell/Serializer/YamlEncoder.php b/src/PHPCR/Shell/Serializer/YamlEncoder.php index e63667d..9f87aab 100644 --- a/src/PHPCR/Shell/Serializer/YamlEncoder.php +++ b/src/PHPCR/Shell/Serializer/YamlEncoder.php @@ -33,7 +33,7 @@ public function encode($data, $format, array $context = []): string return Yaml::dump($data); } - public function decode($data, $format, array $context = []) + public function decode($data, $format, array $context = []): mixed { $arr = Yaml::parse($data);