Skip to content
Closed
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
45 changes: 25 additions & 20 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,38 @@ jobs:
strategy:
fail-fast: false
matrix:
php:
- '8.1'
- '8.2'
coverage: ['none']
symfony-versions:
- '4.4.*'
- '5.4.*'
- '6.0.*'
- '6.1.*'
- '6.2.*'
include:
- php: '7.4'
symfony-versions: '^4.4'
# --- Symfony 6.4 LTS ---
- php: '8.1'
symfony-versions: '^6.4'
coverage: 'none'
- php: '7.4'
symfony-versions: '^5.4'
- php: '8.2'
symfony-versions: '^6.4'
coverage: 'none'
- php: '8.0'
symfony-versions: '^5.4'
- php: '8.3'
symfony-versions: '^6.4'
coverage: 'none'
- php: '8.0'
symfony-versions: '^6.0'
- php: '8.4'
symfony-versions: '^6.4'
coverage: 'none'
- php: '8.5'
symfony-versions: '^6.4'
coverage: 'none'

# --- Symfony 7.4 LTS ---
- php: '8.2'
symfony-versions: '^7.4'
coverage: 'none'
- php: '8.3'
symfony-versions: '^7.4'
coverage: 'none'
- php: '8.4'
symfony-versions: '^7.4'
coverage: 'none'
- description: 'Log Code Coverage'
php: '8.2'
php: '8.5'
coverage: 'xdebug'
symfony-versions: '^7.0'
symfony-versions: '^7.4'

name: PHP ${{ matrix.php }} Symfony ${{ matrix.symfony-versions }} ${{ matrix.description }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: composer install --no-progress --no-interaction --prefer-dist

- name: Run script
run: vendor/bin/phpstan analyse
run: vendor/bin/phpstan analyse --memory-limit=1G

composer-validate:
name: Composer validate
Expand Down
24 changes: 11 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,17 @@
}
],
"require": {
"php": ">=7.4",
"symfony/framework-bundle": "^3.4 || ^4.1.12 || ^5.0 || ^6.0 || ^7.0"
"php": "^8.1",
"symfony/framework-bundle": "^6.4 || ^7.4"
},
"require-dev": {
"ext-json": "*",
"phpstan/phpstan": "1.11.*",
"squizlabs/php_codesniffer": "3.7.*",
"symfony/phpunit-bridge": "^3.4 || ^4.1.12 || ^5.0 || ^6.0 || ^7.0",
"phpunit/phpunit": "^8.5 || ^9.0",
"symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0",
"symfony/browser-kit": "^3.4 || ^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/cache": "^3.4 || ^4.4 || ^5.0 || ^6.0 || ^7.0",
"predis/predis": "^2.3"
"phpstan/phpstan": "^2.1",
"squizlabs/php_codesniffer": "^4.0",
"phpunit/phpunit": "^10.5",
"symfony/yaml": "^6.4 || ^7.4",
"symfony/browser-kit": "^6.4 || ^7.4",
"symfony/cache": "^6.4 || ^7.4",
"predis/predis": "^3.3"
},
"autoload": {
"psr-4": {
Expand All @@ -64,10 +62,10 @@
"vendor/bin/phpcbf"
],
"phpstan": [
"vendor/bin/phpstan analyse"
"vendor/bin/phpstan analyse --memory-limit=1G"
],
"phpunit": [
"vendor/bin/simple-phpunit"
"vendor/bin/phpunit"
]
}
}
14 changes: 13 additions & 1 deletion phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,19 @@

<rule ref="Generic.PHP.ForbiddenFunctions">
<properties>
<property name="forbiddenFunctions" type="array" value="eval=>NULL,dd=>NULL,die=>NULL,var_dump=>NULL,dump=>NULL,sizeof=>count,delete=>unset,print=>echo,echo=>NULL,print_r=>NULL,create_function=>NULL"/>
<property name="forbiddenFunctions" type="array">
<element key="create_function" value="NULL"/>
<element key="dd" value="NULL"/>
<element key="delete" value="unset"/>
<element key="die" value="NULL"/>
<element key="dump" value="NULL"/>
<element key="echo" value="NULL"/>
<element key="eval" value="NULL"/>
<element key="print_r" value="NULL"/>
<element key="print" value="echo"/>
<element key="sizeof" value="count"/>
<element key="var_dump" value="NULL"/>
</property>
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.FunctionSpacing">
Expand Down
33 changes: 11 additions & 22 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,37 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheResult="false"
beStrictAboutOutputDuringTests="true"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheResult="false"
beStrictAboutOutputDuringTests="true"
>
<coverage>
<include>
<directory>./src</directory>
</include>
<report>
<clover outputFile="clover.xml"/>
</report>
</coverage>
<php>
<ini name="error_reporting" value="-1"/>
<ini name="memory_limit" value="-1"/>
<server name="APP_ENV" value="testing" force="true"/>
<server name="APP_DEBUG" value="0" force="true"/>
<server name="SHELL_VERBOSITY" value="-1"/>
<server name="SYMFONY_PHPUNIT_REMOVE" value=""/>
<server name="SYMFONY_PHPUNIT_VERSION" value="9"/>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled" />
<env name="KERNEL_CLASS" value="SymfonyHealthCheckBundle\Tests\TestKernel" />
<env name="KERNEL_CLASS" value="SymfonyHealthCheckBundle\Tests\TestKernel"/>
</php>
<testsuites>
<testsuite name="Symfony Health Check Bundle Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
</listeners>
<logging/>
<source>
<include>
<directory>./src</directory>
</include>
</source>
</phpunit>
2 changes: 0 additions & 2 deletions src/Check/RedisCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ private function checkForRedisArrayClient(\RedisArray $client): bool
return $response;
}

// invalid configuration, RedisClient have different response, than one, provided by RedisArray in fact.
// @phpstan-ignore-next-line
foreach ($response as $pingResult) {
if (is_bool($pingResult)) {
continue;
Expand Down
6 changes: 1 addition & 5 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('symfony_health_check');

/** @var ArrayNodeDefinition<TreeBuilder> $root */
$root = method_exists(TreeBuilder::class, 'getRootNode')
? $treeBuilder->getRootNode()
// @phpstan-ignore-next-line - BC layer for Symfony <4.2
: $treeBuilder->root('symfony_health_check');
$root = $treeBuilder->getRootNode();

$root
->children()
Expand Down