Skip to content

Commit

Permalink
Merge 4.x into 5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
SonataCI committed Aug 5, 2022
2 parents b864b78 + 1c414a3 commit 10e02e1
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [4.5.0](https://github.com/sonata-project/SonataMediaBundle/compare/4.4.0...4.5.0) - 2022-08-04
### Added
- [[#2326](https://github.com/sonata-project/SonataMediaBundle/pull/2326)] Support for sonata-project/doctrine-extensions ^2 ([@VincentLanglet](https://github.com/VincentLanglet))
- [[#2326](https://github.com/sonata-project/SonataMediaBundle/pull/2326)] Support for sonata-project/twig-extensions ^2 ([@VincentLanglet](https://github.com/VincentLanglet))

## [4.4.0](https://github.com/sonata-project/SonataMediaBundle/compare/4.3.0...4.4.0) - 2022-06-28
### Added
- [[#2317](https://github.com/sonata-project/SonataMediaBundle/pull/2317)] Add support for `doctrine/persistence` ^3.0. ([@jordisala1991](https://github.com/jordisala1991))
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
"psr/http-factory": "^1.0",
"psr/http-message": "^1.0",
"psr/log": "^1.0 || ^2.0 || ^3.0",
"sonata-project/doctrine-extensions": "^1.13",
"sonata-project/doctrine-extensions": "^1.13 || ^2.0",
"sonata-project/form-extensions": "^1.4",
"sonata-project/twig-extensions": "^1.3",
"sonata-project/twig-extensions": "^1.3 || ^2.0",
"symfony/asset": "^4.4 || ^5.4 || ^6.0",
"symfony/config": "^4.4.11 || ^5.4 || ^6.0",
"symfony/console": "^4.4 || ^5.4 || ^6.0",
Expand Down
2 changes: 1 addition & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
]);

$rectorConfig->importNames();
$rectorConfig->disableImportShortClasses();
$rectorConfig->importShortClasses(false);
$rectorConfig->skip([
CountOnNullRector::class,
ExceptionHandlerTypehintRector::class,
Expand Down
33 changes: 32 additions & 1 deletion src/Model/NoDriverGalleryManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,26 @@ public function findAll(): array
throw new NoDriverException();
}

/**
* TODO: Add typehint with the drop of sonata-project/doctrine-extensions < 2.
*
* @param int|null $limit
* @param int|null $offset
*
* @return array<GalleryInterface<GalleryItemInterface>>
*/
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
{
throw new NoDriverException();
}

/**
* TODO: Remove $orderBy param with the drop of sonata-project/doctrine-extensions < 2.
*
* @param array<string, string>|null $orderBy
*
* @return GalleryInterface<GalleryItemInterface>|null
*/
public function findOneBy(array $criteria, ?array $orderBy = null): ?object
{
throw new NoDriverException();
Expand All @@ -52,11 +67,23 @@ public function create(): object
throw new NoDriverException();
}

/**
* TODO: Add typehint with the drop of sonata-project/doctrine-extensions < 2.
*
* @param GalleryInterface<GalleryItemInterface> $entity
* @param bool $andFlush
*/
public function save($entity, $andFlush = true): void
{
throw new NoDriverException();
}

/**
* TODO: Add typehint with the drop of sonata-project/doctrine-extensions < 2.
*
* @param GalleryInterface<GalleryItemInterface> $entity
* @param bool $andFlush
*/
public function delete($entity, $andFlush = true): void
{
throw new NoDriverException();
Expand All @@ -72,8 +99,12 @@ public function getTableName(): string
* Doctrine DBAL that we do not want here. This method will probably be
* deprecated on sonata-project/doctrine-extensions because it is only for
* Doctrine ORM.
*
* TODO: Remove this with the drop of sonata-project/doctrine-extensions < 2.
*
* @psalm-suppress MissingReturnType
*/
public function getConnection()
public function getConnection() // @phpstan-ignore-line
{
throw new NoDriverException();
}
Expand Down
33 changes: 32 additions & 1 deletion src/Model/NoDriverMediaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,26 @@ public function findAll(): array
throw new NoDriverException();
}

/**
* TODO: Add typehint with the drop of sonata-project/doctrine-extensions < 2.
*
* @param int|null $limit
* @param int|null $offset
*
* @return MediaInterface[]
*/
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
{
throw new NoDriverException();
}

/**
* TODO: Remove $orderBy param with the drop of sonata-project/doctrine-extensions < 2.
*
* @param array<string, string>|null $orderBy
*
* @return MediaInterface|null
*/
public function findOneBy(array $criteria, ?array $orderBy = null): ?object
{
throw new NoDriverException();
Expand All @@ -52,11 +67,23 @@ public function create(): object
throw new NoDriverException();
}

/**
* TODO: Add typehint with the drop of sonata-project/doctrine-extensions < 2.
*
* @param MediaInterface $entity
* @param bool $andFlush
*/
public function save($entity, $andFlush = true): void
{
throw new NoDriverException();
}

/**
* TODO: Add typehint with the drop of sonata-project/doctrine-extensions < 2.
*
* @param MediaInterface $entity
* @param bool $andFlush
*/
public function delete($entity, $andFlush = true): void
{
throw new NoDriverException();
Expand All @@ -72,8 +99,12 @@ public function getTableName(): string
* Doctrine DBAL that we do not want here. This method will probably be
* deprecated on sonata-project/doctrine-extensions because it is only for
* Doctrine ORM.
*
* TODO: Remove this with the drop of sonata-project/doctrine-extensions < 2.
*
* @psalm-suppress MissingReturnType
*/
public function getConnection()
public function getConnection() // @phpstan-ignore-line
{
throw new NoDriverException();
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Command/CleanMediaCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function testExecuteFilesExists(): void

$this->mediaManager->expects(static::once())->method('findOneBy')
->with(['id' => 1, 'context' => 'foo'])
->willReturn([$media]);
->willReturn($media);
$this->mediaManager->expects(static::once())->method('findBy')
->with(['providerReference' => 'qwertz.ext', 'providerName' => ['fooprovider']])
->willReturn([$media]);
Expand All @@ -137,7 +137,7 @@ public function testExecuteFilesExistsVerbose(): void

$this->mediaManager->expects(static::once())->method('findOneBy')
->with(['id' => 1, 'context' => 'foo'])
->willReturn([$media]);
->willReturn($media);
$this->mediaManager->expects(static::once())->method('findBy')
->with(['providerReference' => 'qwertz.ext', 'providerName' => ['fooprovider']])
->willReturn([$media]);
Expand Down

0 comments on commit 10e02e1

Please sign in to comment.