Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for php 8.1 and uUpdate dependencies #6

Merged
merged 1 commit into from
Mar 6, 2024
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
6 changes: 3 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:

strategy:
matrix:
php-version: ['8.1']
php-version: ['8.2', '8.3']
dependencies: ['']
include:
- { php-version: '8.1', dependencies: '--prefer-lowest --prefer-stable' }
- { php-version: '8.2', dependencies: '--prefer-lowest --prefer-stable' }

name: Unit tests - PHP ${{ matrix.dependencies }}

Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
extensions: json, mbstring

- name: Install dependencies
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<!-- There should always be "Unreleased" section at the beginning. -->

## Unreleased
- Drop support for php 8.1
- Add support for Symfon 7
- Update dependencies

## 2.0.0 - 2022-05-06
- Require php 8.1
Expand Down
32 changes: 16 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,31 @@
"license": "MIT",
"type": "symfony-bundle",
"require": {
"php": "^8.1",
"php": "^8.2",
"ext-json": "*",
"ext-mbstring": "*",
"lmc/cqrs-handler": "^2.0",
"lmc/cqrs-types": "^3.0",
"symfony/config": "^5.2 || ^6.0",
"symfony/console": "^5.2 || ^6.0",
"symfony/dependency-injection": "^5.2 || ^6.0",
"symfony/error-handler": "^5.2 || ^6.0",
"symfony/framework-bundle": "^5.2 || ^6.0",
"symfony/http-foundation": "^5.2 || ^6.0",
"symfony/http-kernel": "^5.2 || ^6.0",
"lmc/cqrs-handler": "^2.2",
"lmc/cqrs-types": "^3.2",
"symfony/config": "^5.2 || ^6.0 || ^7.0",
"symfony/console": "^5.2 || ^6.0 || ^7.0",
"symfony/dependency-injection": "^5.2 || ^6.0 || ^7.0",
"symfony/error-handler": "^5.2 || ^6.0 || ^7.0",
"symfony/framework-bundle": "^5.2 || ^6.0 || ^7.0",
"symfony/http-foundation": "^5.2 || ^6.0 || ^7.0",
"symfony/http-kernel": "^5.2 || ^6.0 || ^7.0",
"twig/twig": "^2.0 || ^3.0"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.5",
"lmc/coding-standard": "^3.3",
"lmc/cqrs-http": "^3.0",
"lmc/cqrs-solr": "^3.0",
"lmc/cqrs-http": "^3.1",
"lmc/cqrs-solr": "^3.1",
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.6",
"phpstan/phpstan-phpunit": "^1.1",
"phpunit/phpunit": "^9.5.20",
"symfony/yaml": "^5.2 || ^6.0"
"phpunit/phpunit": "^11.0.4",
"symfony/yaml": "^5.2 || ^6.0 || ^7.0"
},
"suggest": {
"lmc/cqrs-http": "Provides http handler and base types for queries and commands.",
Expand All @@ -46,9 +46,9 @@
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"ergebnis/composer-normalize": true,
"dealerdirect/phpcodesniffer-composer-installer": true
"phpstan/extension-installer": true
},
"sort-packages": true
},
Expand Down
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ parameters:
- src/DependencyInjection/Configuration.php

ignoreErrors:
- '#.*and class-string\|null will always evaluate to false.*#'
27 changes: 11 additions & 16 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,38 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
colors="true"
bootstrap="vendor/autoload.php"
>

xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.0/phpunit.xsd" colors="true"
bootstrap="vendor/autoload.php">
<coverage>
<include>
<directory suffix=".php">src</directory>
</include>
<exclude>
<directory suffix=".php">src/Command</directory>
<directory suffix=".php">src/Controller</directory>
</exclude>
<report>
<clover outputFile="./reports/clover.xml"/>
<html outputDirectory="./reports" highLowerBound="90"/>
</report>
</coverage>

<php>
<!-- E_ALL = 30719 -->
<ini name="error_reporting" value="30719"/>
</php>

<testsuites>
<testsuite name="unit">
<directory>tests/</directory>
</testsuite>
</testsuites>

<logging>
<junit outputFile="./reports/junit.xml"/>
</logging>
<source>
<include>
<directory suffix=".php">src</directory>
</include>
<exclude>
<directory suffix=".php">src/Command</directory>
<directory suffix=".php">src/Controller</directory>
</exclude>
</source>
</phpunit>
2 changes: 1 addition & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('lmc_cqrs');
$treeBuilder->getRootNode()
Expand Down
9 changes: 3 additions & 6 deletions tests/DependencyInjection/Compiler/HandlerPassTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
use Lmc\Cqrs\Bundle\AbstractTestCase;
use Lmc\Cqrs\Types\CommandSenderInterface;
use Lmc\Cqrs\Types\QueryFetcherInterface;
use PHPUnit\Framework\Attributes\Test;
use Symfony\Component\DependencyInjection\ContainerBuilder;

class HandlerPassTest extends AbstractTestCase
{
/**
* @test
*/
#[Test]
public function shouldSetUpQueryFetcher(): void
{
$container = new ContainerBuilder();
Expand Down Expand Up @@ -41,9 +40,7 @@ public function shouldSetUpQueryFetcher(): void
$this->assertCalledMethods($expectedMethods, $methodCalls);
}

/**
* @test
*/
#[Test]
public function shouldSetUpCommandSender(): void
{
$container = new ContainerBuilder();
Expand Down
5 changes: 2 additions & 3 deletions tests/DependencyInjection/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
namespace Lmc\Cqrs\Bundle\DependencyInjection;

use Lmc\Cqrs\Bundle\AbstractTestCase;
use PHPUnit\Framework\Attributes\Test;
use Symfony\Component\Config\Definition\Dumper\YamlReferenceDumper;

class ConfigurationTest extends AbstractTestCase
{
/**
* @test
*/
#[Test]
public function configurationDefinition(): void
{
$dumper = new YamlReferenceDumper();
Expand Down
38 changes: 12 additions & 26 deletions tests/DependencyInjection/LmcCqrsExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
use Lmc\Cqrs\Types\QueryFetcherInterface;
use Lmc\Cqrs\Types\QueryHandlerInterface;
use Lmc\Cqrs\Types\SendCommandHandlerInterface;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Test;
use Symfony\Component\DependencyInjection\ContainerBuilder;

class LmcCqrsExtensionTest extends AbstractTestCase
Expand All @@ -56,9 +58,7 @@ protected function setUp(): void
$this->containerBuilder->registerExtension($this->extension);
}

/**
* @test
*/
#[Test]
public function shouldSetUpDefaultServices(): void
{
$configs = [];
Expand Down Expand Up @@ -180,9 +180,7 @@ private function assertNoSolrExtensionSettings(ContainerBuilder $containerBuilde
}
}

/**
* @test
*/
#[Test]
public function shouldSetUpCacheForServices(): void
{
$configs = [
Expand Down Expand Up @@ -221,9 +219,7 @@ private function assertCacheSettings(
$this->assertSame('cache_class', $containerBuilder->findDefinition('lmc_cqrs.cache_provider')->getClass());
}

/**
* @test
*/
#[Test]
public function shouldSetUpAllServices(): void
{
$configs = [
Expand Down Expand Up @@ -253,10 +249,8 @@ public function shouldSetUpAllServices(): void
$this->assertSolrExtensionSettings($this->containerBuilder);
}

/**
* @test
* @dataProvider provideProfilerConfigs
*/
#[Test]
#[DataProvider('provideProfilerConfigs')]
public function shouldSetUpServicesForProfiler(array $config): void
{
$configs = [$config];
Expand All @@ -276,7 +270,7 @@ public function shouldSetUpServicesForProfiler(array $config): void
);
}

public function provideProfilerConfigs(): array
public static function provideProfilerConfigs(): array
{
return [
// config
Expand Down Expand Up @@ -317,9 +311,7 @@ private function assertProfilerSettings(ContainerBuilder $containerBuilder): voi
);
}

/**
* @test
*/
#[Test]
public function shouldSetUpServicesForProfilerWithVerbosity(): void
{
$configs = [
Expand Down Expand Up @@ -350,9 +342,7 @@ public function shouldSetUpServicesForProfilerWithVerbosity(): void
$this->assertSame(ProfilerBag::VERBOSITY_DEBUG, $profilerBag->getVerbosity());
}

/**
* @test
*/
#[Test]
public function shouldSetUpServicesForDebug(): void
{
$configs = [
Expand Down Expand Up @@ -389,9 +379,7 @@ private function assertDebugSettings(ContainerBuilder $containerBuilder): void
}
}

/**
* @test
*/
#[Test]
public function shouldSetUpServicesForHttpExtension(): void
{
$configs = [
Expand Down Expand Up @@ -441,9 +429,7 @@ private function assertHttpExtensionSettings(ContainerBuilder $containerBuilder)
);
}

/**
* @test
*/
#[Test]
public function shouldSetUpServicesForSolrExtension(): void
{
$configs = [
Expand Down
5 changes: 2 additions & 3 deletions tests/LmcCqrsBundleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
namespace Lmc\Cqrs\Bundle;

use Lmc\Cqrs\Bundle\DependencyInjection\Compiler\HandlerPass;
use PHPUnit\Framework\Attributes\Test;
use Symfony\Component\DependencyInjection\ContainerBuilder;

class LmcCqrsBundleTest extends AbstractTestCase
{
/**
* @test
*/
#[Test]
public function shouldSetUpHandlerPass(): void
{
$containerBuilder = new ContainerBuilder();
Expand Down
25 changes: 8 additions & 17 deletions tests/Profiler/CqrsDataCollectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
use Lmc\Cqrs\Types\ValueObject\CacheKey;
use Lmc\Cqrs\Types\ValueObject\FormattedValue;
use Lmc\Cqrs\Types\ValueObject\ProfilerItem;
use PHPUnit\Framework\Attributes\Depends;
use PHPUnit\Framework\Attributes\Test;
use Ramsey\Uuid\Uuid;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\HttpFoundation\Request;
Expand All @@ -34,9 +36,7 @@ protected function setUp(): void
$this->commandSender = new CommandSender(null);
}

/**
* @test
*/
#[Test]
public function shouldGetDefaultFormattersPriority(): void
{
$this->assertSame(0, CqrsDataCollector::getDefaultPriority());
Expand Down Expand Up @@ -77,9 +77,7 @@ private function setUpCollectorWithData(
);
}

/**
* @test
*/
#[Test]
public function shouldCollectsQueriesAndCommands(): CqrsDataCollector
{
$queries = [
Expand Down Expand Up @@ -162,11 +160,8 @@ public function shouldCollectsQueriesAndCommands(): CqrsDataCollector
return $collector;
}

/**
* @depends shouldCollectsQueriesAndCommands
*
* @test
*/
#[Test]
#[Depends('shouldCollectsQueriesAndCommands')]
public function shouldResetCollectedQueries(CqrsDataCollector $collector): void
{
$collector->reset();
Expand All @@ -181,9 +176,7 @@ public function shouldResetCollectedQueries(CqrsDataCollector $collector): void
$this->assertEmpty($collector->getRegisteredFormatters());
}

/**
* @test
*/
#[Test]
public function countsCachedAndUncachedQueries(): void
{
$queries = [
Expand Down Expand Up @@ -233,9 +226,7 @@ public function countsCachedAndUncachedQueries(): void
$this->assertSame(1, $collector->countUncachedQueries());
}

/**
* @test
*/
#[Test]
public function shouldFormatCollectedItems(): void
{
$error = new \Exception('error message');
Expand Down
Loading
Loading