Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,39 @@ jobs:
node-version: '22'
- run: yarn
- run: yarn lint

codestyle:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2

- name: Add additional dependencies
run: |
composer require --no-update --no-interaction neos/contentgraph-doctrinedbaladapter:"~9.0.0"
composer require --no-update --no-interaction league/csv:"~9.0"

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache
key: dependencies-composer-${{ hashFiles('composer.json') }}

- name: Install dependencies
uses: php-actions/composer@v6
with:
php_version: 8.2
version: 2

- name: PHPStan
uses: php-actions/phpstan@v3
with:
php_version: 8.2
version: 2.1.17
command: analyse
path: 'Classes/'
8 changes: 7 additions & 1 deletion Classes/Command/AnalyzerCommandController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class AnalyzerCommandController extends CommandController
/** @noinspection PhpFullyQualifiedNameUsageInspection */
public function validateNodeTypesCommand(): void
{
/** @noinspection ClassConstantCanBeUsedInspection */
if (!class_exists("\\JsonSchema\\Validator")) {
$this->outputLine('Please require "justinrainbow/json-schema" in your composer.json to use this command.');
exit(1);
Expand All @@ -30,9 +31,14 @@ public function validateNodeTypesCommand(): void

$schemaStorage = new \JsonSchema\SchemaStorage();
$validator = new \JsonSchema\Validator(new \JsonSchema\Constraints\Factory($schemaStorage));
$schema = file_get_contents(self::SCHEMA_PATH);
if ($schema === false) {
$this->outputLine(sprintf('Could not read schema from "%s"', self::SCHEMA_PATH));
exit(1);
}
$schemaStorage->addSchema(
self::SCHEMA_NAME,
json_decode(file_get_contents(self::SCHEMA_PATH), false, 512, JSON_THROW_ON_ERROR)
json_decode($schema, false, 512, JSON_THROW_ON_ERROR)
);

$this->outputLine('Validating nodetypes schema...');
Expand Down
Loading