Skip to content

Commit

Permalink
php 8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikzogg committed Dec 2, 2023
1 parent 6ef089e commit b12f330
Show file tree
Hide file tree
Showing 12 changed files with 86 additions and 132 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ on:
- cron: '0 0 * * *'

jobs:
php80:
name: PHP 8.0
runs-on: ubuntu-20.04
php81:
name: PHP 8.1
runs-on: ubuntu-22.04
services:
mongo:
image: mongo:5.0
Expand All @@ -32,15 +32,15 @@ jobs:
while ! nc -z localhost 27017; do sleep 0.1; done
while ! nc -z localhost 5432; do sleep 0.1; done
- name: composer test
uses: docker://chubbyphp/ci-php80:latest
uses: docker://chubbyphp/ci-php81:latest
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MONGODB_URI: "mongodb://root:[email protected]:27017"
POSTGRES_URL: "pgsql://root:[email protected]:5432?charset=utf8"
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
php81:
name: PHP 8.1
runs-on: ubuntu-20.04
php82:
name: PHP 8.2
runs-on: ubuntu-22.04
services:
mongo:
image: mongo:5.0
Expand All @@ -64,15 +64,15 @@ jobs:
while ! nc -z localhost 27017; do sleep 0.1; done
while ! nc -z localhost 5432; do sleep 0.1; done
- name: composer test
uses: docker://chubbyphp/ci-php81:latest
uses: docker://chubbyphp/ci-php82:latest
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MONGODB_URI: "mongodb://root:[email protected]:27017"
POSTGRES_URL: "pgsql://root:[email protected]:5432?charset=utf8"
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
php82:
name: PHP 8.2
runs-on: ubuntu-20.04
php83:
name: PHP 8.3
runs-on: ubuntu-22.04
services:
mongo:
image: mongo:5.0
Expand All @@ -96,7 +96,7 @@ jobs:
while ! nc -z localhost 27017; do sleep 0.1; done
while ! nc -z localhost 5432; do sleep 0.1; done
- name: composer test
uses: docker://chubbyphp/ci-php82:latest
uses: docker://chubbyphp/ci-php83:latest
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MONGODB_URI: "mongodb://root:[email protected]:27017"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
.idea/
.phpunit.cache
.vscode/
build/
composer.lock
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![CI](https://github.com/chubbyphp/chubbyphp-laminas-config-doctrine/workflows/CI/badge.svg?branch=master)](https://github.com/chubbyphp/chubbyphp-laminas-config-doctrine/actions?query=workflow%3ACI)
[![Coverage Status](https://coveralls.io/repos/github/chubbyphp/chubbyphp-laminas-config-doctrine/badge.svg?branch=master)](https://coveralls.io/github/chubbyphp/chubbyphp-laminas-config-doctrine?branch=master)
[![Infection MSI](https://badge.stryker-mutator.io/github.com/chubbyphp/chubbyphp-laminas-config-doctrine/master)](https://dashboard.stryker-mutator.io/reports/github.com/chubbyphp/chubbyphp-laminas-config-doctrine/master)
[![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fchubbyphp%2Fchubbyphp-laminas-config-doctrine%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/chubbyphp/chubbyphp-laminas-config-doctrine/master)[![Latest Stable Version](https://poser.pugx.org/chubbyphp/chubbyphp-laminas-config-doctrine/v/stable.png)](https://packagist.org/packages/chubbyphp/chubbyphp-laminas-config-doctrine)
[![Latest Stable Version](https://poser.pugx.org/chubbyphp/chubbyphp-laminas-config-doctrine/v/stable.png)](https://packagist.org/packages/chubbyphp/chubbyphp-laminas-config-doctrine)
[![Total Downloads](https://poser.pugx.org/chubbyphp/chubbyphp-laminas-config-doctrine/downloads.png)](https://packagist.org/packages/chubbyphp/chubbyphp-laminas-config-doctrine)
[![Monthly Downloads](https://poser.pugx.org/chubbyphp/chubbyphp-laminas-config-doctrine/d/monthly)](https://packagist.org/packages/chubbyphp/chubbyphp-laminas-config-doctrine)
Expand Down Expand Up @@ -33,27 +33,27 @@ and the possiblity to install only the needed vendors make the difference to the

## Requirements

* php: 8.0
* [chubbyphp/chubbyphp-laminas-config-factory][10]: ^1.2
* php: 8.1
* [chubbyphp/chubbyphp-laminas-config-factory][10]: ^1.3
* [doctrine/common][11]: ^3.4.3
* [doctrine/event-manager][12]: ^1.2
* [doctrine/event-manager][12]: ^1.2|^2.0
* [psr/container][13]: ^1.1.2|^2.0.2
* [symfony/cache][14]: ^6.0.19
* [symfony/console][14]: ^6.0.19
* [symfony/cache][14]: ^5.4.31|^6.3.8|^7.0
* [symfony/console][14]: ^5.4.31|^6.3.8|^7.0

## Suggested

* [doctrine/dbal][20]: ^3.6
* [doctrine/mongodb-odm][21]: ^2.4.3
* [doctrine/orm][22]: ^2.14.1
* [mongodb/mongodb][23]: ^1.15
* [doctrine/dbal][20]: ^3.7.2
* [doctrine/mongodb-odm][21]: ^2.6.1
* [doctrine/orm][22]: ^2.17.1
* [mongodb/mongodb][23]: ^1.17

## Installation

Through [Composer](http://getcomposer.org) as [chubbyphp/chubbyphp-laminas-config-doctrine][1].

```sh
composer require chubbyphp/chubbyphp-laminas-config-doctrine "^2.0"
composer require chubbyphp/chubbyphp-laminas-config-doctrine "^2.1"
```

## Usage
Expand Down
45 changes: 22 additions & 23 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,35 +22,34 @@
}
],
"require": {
"php": "^8.0",
"chubbyphp/chubbyphp-laminas-config-factory": "^1.2",
"php": "^8.1",
"chubbyphp/chubbyphp-laminas-config-factory": "^1.3",
"doctrine/common": "^3.4.3",
"doctrine/event-manager": "^1.2",
"doctrine/event-manager": "^1.2|^2.0",
"psr/container": "^1.1.2|^2.0.2",
"symfony/cache": "^6.0.19",
"symfony/console": "^6.0.19"
"symfony/cache": "^5.4.31|^6.3.8|^7.0",
"symfony/console": "^5.4.31|^6.3.8|^7.0"
},
"require-dev": {
"chubbyphp/chubbyphp-dev-helper": "dev-master",
"chubbyphp/chubbyphp-laminas-config": "^1.3",
"chubbyphp/chubbyphp-mock": "^1.6.2",
"doctrine/dbal": "^3.6",
"doctrine/mongodb-odm": "^2.4.3",
"doctrine/orm": "^2.14.1",
"infection/infection": "^0.26.19",
"mongodb/mongodb": "^1.15",
"php-coveralls/php-coveralls": "^2.5.3",
"phploc/phploc": "^7.0.2",
"phpstan/extension-installer": "^1.2",
"phpstan/phpstan": "^1.9.18",
"phpunit/phpunit": "^9.6.3",
"ramsey/uuid": "^4.7.3"
"chubbyphp/chubbyphp-laminas-config": "^1.4",
"chubbyphp/chubbyphp-mock": "^1.7",
"doctrine/dbal": "^3.7.2",
"doctrine/mongodb-odm": "^2.6.1",
"doctrine/orm": "^2.17.1",
"infection/infection": "^0.27.8",
"mongodb/mongodb": "^1.17",
"php-coveralls/php-coveralls": "^2.7",
"phpstan/extension-installer": "^1.3.1",
"phpstan/phpstan": "^1.10.47",
"phpunit/phpunit": "^10.5.1",
"ramsey/uuid": "^4.7.5"
},
"conflict": {
"doctrine/dbal": "<3.6 || >=4.0",
"doctrine/mongodb-odm": "<2.4.3 || >=3.0",
"doctrine/orm": "<2.14.1 || >=3.0",
"mongodb/mongodb": "<1.15|| >=2.0"
"doctrine/dbal": "<3.7.2 || >=4.0",
"doctrine/mongodb-odm": "<2.6.1 || >=3.0",
"doctrine/orm": "<2.17.1 || >=3.0",
"mongodb/mongodb": "<1.17|| >=2.0"
},
"autoload": {
"psr-4": {
Expand All @@ -71,7 +70,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
"dev-master": "2.1-dev"
}
},
"scripts": {
Expand Down
42 changes: 15 additions & 27 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
executionOrder="random"
processIsolation="false"
stopOnFailure="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory>./src</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Integration">
<directory>./tests/Integration</directory>
</testsuite>
<testsuite name="Unit">
<directory>./tests/Unit</directory>
</testsuite>
</testsuites>
<extensions>
<extension class="Chubbyphp\Tests\Laminas\Config\Doctrine\LongRunningTestAlert"/>
</extensions>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" colors="true" executionOrder="random" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<coverage/>
<testsuites>
<testsuite name="Integration">
<directory>./tests/Integration</directory>
</testsuite>
<testsuite name="Unit">
<directory>./tests/Unit</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>./src</directory>
</include>
</source>
</phpunit>
4 changes: 1 addition & 3 deletions src/DBAL/Tools/Console/ContainerConnectionProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@

final class ContainerConnectionProvider implements ConnectionProvider
{
public function __construct(private ContainerInterface $container)
{
}
public function __construct(private ContainerInterface $container) {}

public function getDefaultConnection(): Connection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
'dm' => new DocumentManagerHelper($documentManager),
]));

return (int) $this->command->execute($input, $output);
return (int) $this->command->run($input, $output);

Check warning on line 50 in src/ODM/MongoDB/Tools/Console/Command/DocumentManagerCommand.php

View workflow job for this annotation

GitHub Actions / PHP 8.1

Escaped Mutant for Mutator "CastInt": --- Original +++ New @@ @@ throw new \InvalidArgumentException(sprintf('Missing document manager with name "%s"', $documentManagerName), $serviceNotFoundException->getCode(), $serviceNotFoundException); } $this->command->setHelperSet(new HelperSet(['dm' => new DocumentManagerHelper($documentManager)])); - return (int) $this->command->run($input, $output); + return $this->command->run($input, $output); } }

Check warning on line 50 in src/ODM/MongoDB/Tools/Console/Command/DocumentManagerCommand.php

View workflow job for this annotation

GitHub Actions / PHP 8.2

Escaped Mutant for Mutator "CastInt": --- Original +++ New @@ @@ throw new \InvalidArgumentException(sprintf('Missing document manager with name "%s"', $documentManagerName), $serviceNotFoundException->getCode(), $serviceNotFoundException); } $this->command->setHelperSet(new HelperSet(['dm' => new DocumentManagerHelper($documentManager)])); - return (int) $this->command->run($input, $output); + return $this->command->run($input, $output); } }

Check warning on line 50 in src/ODM/MongoDB/Tools/Console/Command/DocumentManagerCommand.php

View workflow job for this annotation

GitHub Actions / PHP 8.3

Escaped Mutant for Mutator "CastInt": --- Original +++ New @@ @@ throw new \InvalidArgumentException(sprintf('Missing document manager with name "%s"', $documentManagerName), $serviceNotFoundException->getCode(), $serviceNotFoundException); } $this->command->setHelperSet(new HelperSet(['dm' => new DocumentManagerHelper($documentManager)])); - return (int) $this->command->run($input, $output); + return $this->command->run($input, $output); } }
}
}
4 changes: 1 addition & 3 deletions src/ORM/Tools/Console/ContainerEntityManagerProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@

final class ContainerEntityManagerProvider implements EntityManagerProvider
{
public function __construct(private ContainerInterface $container)
{
}
public function __construct(private ContainerInterface $container) {}

public function getDefaultManager(): EntityManagerInterface
{
Expand Down
4 changes: 1 addition & 3 deletions src/Persistence/Mapping/Driver/ClassMapDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ final class ClassMapDriver implements MappingDriver
/**
* @param array<string, string> $map
*/
public function __construct(private array $map)
{
}
public function __construct(private array $map) {}

/**
* @param string $className
Expand Down
32 changes: 0 additions & 32 deletions tests/LongRunningTestAlert.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,16 @@ protected function configure(): void
;
}

protected function execute(InputInterface $input, OutputInterface $output): void
protected function execute(InputInterface $input, OutputInterface $output): int
{
/** @var DocumentManagerHelper $documentManagerHelper */
$documentManagerHelper = $this->getHelperSet()->get('dm');

Assert::assertSame($this->documentManager, $documentManagerHelper->getDocumentManager());

$output->writeln('it works!');

return 0;
}
};

Expand Down Expand Up @@ -112,12 +114,14 @@ protected function configure(): void
;
}

protected function execute(InputInterface $input, OutputInterface $output): void
protected function execute(InputInterface $input, OutputInterface $output): int
{
/** @var DocumentManagerHelper $documentManagerHelper */
$documentManagerHelper = $this->getHelperSet()->get('dm');

Assert::assertSame($this->documentManager, $documentManagerHelper->getDocumentManager());

return 0;
}
};

Expand All @@ -141,8 +145,7 @@ public function testRunWithUnknownDocumentManager(): void

$output = new BufferedOutput();

$exception = new class() extends \Exception implements NotFoundExceptionInterface {
};
$exception = new class() extends \Exception implements NotFoundExceptionInterface {};

$command = new class() extends Command {
protected function configure(): void
Expand All @@ -152,8 +155,9 @@ protected function configure(): void
;
}

protected function execute(InputInterface $input, OutputInterface $output): void
protected function execute(InputInterface $input, OutputInterface $output): int
{
return 0;
}
};

Expand Down
Loading

0 comments on commit b12f330

Please sign in to comment.