Skip to content

Commit

Permalink
Updates requirements and fixes minor crashes so bundle can be install…
Browse files Browse the repository at this point in the history
…ed on Symfony 6.2^ (#4)
  • Loading branch information
pkly authored Jan 9, 2023
1 parent 1acee9a commit 342e0f1
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 14 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ jobs:
include:
- symfony-version: 5.4
php-version: 8.1
- symfony-version: 6.2
php-version: 8.1

runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -111,6 +113,8 @@ jobs:
include:
- symfony-version: 5.4
php-version: 8.1
- symfony-version: 6.2
php-version: 8.1

runs-on: ubuntu-latest
needs:
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ Bundle will automatically hook into [Doctrine ORM Bundle](https://github.com/doc

Simply `composer require dualmedia/symfony-request-dto-bundle`, if applicable your Doctrine entity managers will be detected automatically and used as default providers for classes to be loaded with your requests if needed.

Then add the bundle to your `config/bundles.php` file like so

```php
return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
// other bundles ...
DualMedia\DtoRequestBundle\DtoBundle::class => ['all' => true],
];
```

## Usage

1. Create a DTO class for your request
Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
],
"require": {
"php": "^8.1",
"symfony/framework-bundle": "^5.4",
"symfony/event-dispatcher": "^5.4",
"symfony/property-info": "^5.4",
"symfony/validator": "^5.4",
"symfony/property-access": "^5.4"
"symfony/framework-bundle": "^5.4|^6.2",
"symfony/event-dispatcher": "^5.4|^6.2",
"symfony/property-info": "^5.4|^6.2",
"symfony/validator": "^5.4|^6.2",
"symfony/property-access": "^5.4|^6.2"
},
"require-dev": {
"ext-simplexml": "*",
Expand All @@ -30,11 +30,11 @@
"pedrotroller/php-cs-custom-fixer": "^2",
"vimeo/psalm": "^5",
"phpstan/phpstan": "^1",
"symfony/phpunit-bridge": "^5.4",
"symfony/phpunit-bridge": "^5.4|^6.2",
"matthiasnoback/symfony-dependency-injection-test": "^4.3",
"nelmio/api-doc-bundle": "^4",
"symfony/stopwatch": "^5.4",
"symfony/web-profiler-bundle": "^5.4",
"symfony/stopwatch": "^5.4|^6.2",
"symfony/web-profiler-bundle": "^5.4|^6.2",
"doctrine/doctrine-bundle": "^2",
"doctrine/orm": "^2"
},
Expand Down
8 changes: 4 additions & 4 deletions tests/Traits/Unit/KernelAccessTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ trait KernelAccessTrait
/**
* @param string $id
*
* @return mixed
* @return object|null
*/
protected static function getService(
protected function getService(
string $id
) {
return static::$container->get($id);
): ?object {
return $this->getContainer()->get($id);
}
}
2 changes: 1 addition & 1 deletion tests/Unit/ArgumentResolver/DtoArgumentResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protected function setUp(): void
{
self::bootKernel();
$this->eventMock = $this->createMock(EventDispatcherInterface::class);
self::$container->set('event_dispatcher', $this->eventMock);
$this->getContainer()->set('event_dispatcher', $this->eventMock);
$this->service = $this->getService(DtoArgumentResolver::class);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class FindResolveAndErrorsTest extends KernelTestCase
protected function setUp(): void
{
parent::bootKernel();
static::$container->set(DummyModelProvider::class, $this->provider = $this->createMock(DummyModelProvider::class));
$this->getContainer()->set(DummyModelProvider::class, $this->provider = $this->createMock(DummyModelProvider::class));
$this->service = $this->getService(DtoResolverService::class);
}

Expand Down

0 comments on commit 342e0f1

Please sign in to comment.