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
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
tests:
name: Tests (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.3', '8.4', '8.5']

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none

- name: Install dependencies
run: composer install --no-interaction --prefer-dist

- name: Run tests
run: composer run tests

phpstan:
name: PHPStan
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
coverage: none

- name: Install dependencies
run: composer install --no-interaction --prefer-dist

- name: Run PHPStan
run: composer run phpstan
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"phpunit/phpunit": "^9.5",
"rector/rector": "^1.2",
"doctrine/orm": "^3.6",
"doctrine/persistence": "^4.1"
"doctrine/persistence": "^4.1",
"phpstan/phpstan": "^1.12"
},
"autoload": {
"psr-4": {
Expand All @@ -37,6 +38,7 @@
],
"minimum-stability": "stable",
"scripts": {
"tests": "phpunit"
"tests": "phpunit",
"phpstan": "phpstan analyse"
}
}
146 changes: 146 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
parameters:
ignoreErrors:
-
message: "#^Call to method load\\(\\) on an unknown class Symfony\\\\Component\\\\DependencyInjection\\\\Loader\\\\XmlFileLoader\\.$#"
count: 1
path: src/DependencyInjection/MalteHuebnerDataQueryExtension.php

-
message: "#^Instantiated class Symfony\\\\Component\\\\DependencyInjection\\\\Loader\\\\XmlFileLoader not found\\.$#"
count: 1
path: src/DependencyInjection/MalteHuebnerDataQueryExtension.php

-
message: "#^Deprecated in PHP 8\\.4\\: Parameter \\#3 \\$parameterName \\(string\\) is implicitly nullable via default value null\\.$#"
count: 1
path: src/Exception/ParameterConverterException.php

-
message: "#^Call to static method getShortnameFromFqcn\\(\\) on an unknown class App\\\\Criticalmass\\\\Util\\\\ClassUtil\\.$#"
count: 1
path: src/Factory/ConflictResolver/ConflictResolver.php

-
message: "#^Variable \\$parameter in PHPDoc tag @var does not match any variable in the foreach loop\\: \\$parameterCandidate$#"
count: 1
path: src/Factory/ParameterFactory/ParameterFactory.php

-
message: "#^Variable \\$parameterField in PHPDoc tag @var does not match any variable in the foreach loop\\: \\$fieldName, \\$parameterFields$#"
count: 1
path: src/Factory/ParameterFactory/ParameterFactory.php

-
message: "#^Call to static method getShortname\\(\\) on an unknown class App\\\\Criticalmass\\\\Util\\\\ClassUtil\\.$#"
count: 1
path: src/Factory/QueryFactory/QueryFactory.php

-
message: "#^Variable \\$entityField in PHPDoc tag @var does not match any variable in the foreach loop\\: \\$entityFields$#"
count: 1
path: src/Factory/QueryFactory/QueryFactory.php

-
message: "#^Negated boolean expression is always false\\.$#"
count: 1
path: src/Factory/ValueAssigner/ValueAssigner.php

-
message: "#^Call to an undefined method ReflectionType\\:\\:getName\\(\\)\\.$#"
count: 1
path: src/FieldList/EntityFieldList/EntityFieldListFactory.php

-
message: "#^Call to an undefined method ReflectionType\\:\\:getName\\(\\)\\.$#"
count: 1
path: src/FieldList/ParameterFieldList/ParameterFieldListFactory.php

-
message: "#^Call to an undefined method MalteHuebner\\\\DataQueryBundle\\\\FieldList\\\\AbstractField\\:\\:setParameterName\\(\\)\\.$#"
count: 2
path: src/FieldList/QueryFieldList/QueryFieldListFactory.php

-
message: "#^Call to an undefined method ReflectionType\\:\\:getName\\(\\)\\.$#"
count: 2
path: src/FieldList/QueryFieldList/QueryFieldListFactory.php

-
message: "#^Call to method find\\(\\) on an unknown class FOS\\\\ElasticaBundle\\\\Repository\\.$#"
count: 1
path: src/Finder/Finder.php

-
message: "#^Class MalteHuebner\\\\DataQueryBundle\\\\Finder\\\\AbstractOrmQuery not found\\.$#"
count: 1
path: src/Finder/Finder.php

-
message: "#^Parameter \\$repository of method MalteHuebner\\\\DataQueryBundle\\\\Finder\\\\Finder\\:\\:__construct\\(\\) has invalid type FOS\\\\ElasticaBundle\\\\Repository\\.$#"
count: 1
path: src/Finder/Finder.php

-
message: "#^Property MalteHuebner\\\\DataQueryBundle\\\\Finder\\\\Finder\\:\\:\\$repository has unknown class FOS\\\\ElasticaBundle\\\\Repository as its type\\.$#"
count: 1
path: src/Finder/Finder.php

-
message: "#^Class FOS\\\\ElasticaBundle\\\\Manager\\\\RepositoryManagerInterface not found\\.$#"
count: 2
path: src/FinderFactory/FinderFactory.php

-
message: "#^Cannot call method addMust\\(\\) on array\\<string, array\\<string, mixed\\>\\>\\|Elastica\\\\Query\\\\AbstractQuery\\.$#"
count: 1
path: src/Parameter/StartValueParameter.php

-
message: "#^Call to static method getDayEndDateTime\\(\\) on an unknown class App\\\\Criticalmass\\\\Util\\\\DateTimeUtil\\.$#"
count: 2
path: src/Query/DateQuery.php

-
message: "#^Call to static method getDayStartDateTime\\(\\) on an unknown class App\\\\Criticalmass\\\\Util\\\\DateTimeUtil\\.$#"
count: 2
path: src/Query/DateQuery.php

-
message: "#^Call to static method getMonthEndDateTime\\(\\) on an unknown class App\\\\Criticalmass\\\\Util\\\\DateTimeUtil\\.$#"
count: 2
path: src/Query/MonthQuery.php

-
message: "#^Call to static method getMonthStartDateTime\\(\\) on an unknown class App\\\\Criticalmass\\\\Util\\\\DateTimeUtil\\.$#"
count: 2
path: src/Query/MonthQuery.php

-
message: "#^Call to static method getYearEndDateTime\\(\\) on an unknown class App\\\\Criticalmass\\\\Util\\\\DateTimeUtil\\.$#"
count: 2
path: src/Query/YearQuery.php

-
message: "#^Call to static method getYearStartDateTime\\(\\) on an unknown class App\\\\Criticalmass\\\\Util\\\\DateTimeUtil\\.$#"
count: 2
path: src/Query/YearQuery.php

-
message: "#^Access to an undefined property Symfony\\\\Component\\\\Validator\\\\Constraint\\:\\:\\$message\\.$#"
count: 2
path: src/Validator/BoundingBoxValidator.php

-
message: "#^PHPDoc tag @var above a method has no effect\\.$#"
count: 1
path: src/Validator/BoundingBoxValidator.php

-
message: "#^Access to an undefined property Symfony\\\\Component\\\\Validator\\\\Constraint\\:\\:\\$message\\.$#"
count: 1
path: src/Validator/SortableValidator.php

-
message: "#^Variable \\$fieldList in PHPDoc tag @var does not match assigned variable \\$entityFieldList\\.$#"
count: 1
path: src/Validator/SortableValidator.php
8 changes: 8 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
includes:
- phpstan-baseline.neon

parameters:
level: 5
paths:
- src
reportUnmatchedIgnoredErrors: false