-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix DoctrineBundle 2.4 + ORM 2.9 compatibility
- Loading branch information
Showing
8 changed files
with
326 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,52 @@ | ||
{ | ||
"name": "dama/doctrine-test-bundle", | ||
"description": "Symfony bundle to isolate doctrine database tests and improve test performance", | ||
"keywords": ["symfony", "doctrine", "tests", "isolation", "performance"], | ||
"type": "symfony-bundle", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "David Maicher", | ||
"email": "mail@dmaicher.de" | ||
"name": "dama/doctrine-test-bundle", | ||
"description": "Symfony bundle to isolate doctrine database tests and improve test performance", | ||
"keywords": [ | ||
"symfony", | ||
"doctrine", | ||
"tests", | ||
"isolation", | ||
"performance" | ||
], | ||
"type": "symfony-bundle", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "David Maicher", | ||
"email": "mail@dmaicher.de" | ||
} | ||
], | ||
"require": { | ||
"php": "^7.1 || ^8.0", | ||
"doctrine/dbal": "^2.9.3 || ^3.0", | ||
"doctrine/doctrine-bundle": "^1.11 || ^2.0", | ||
"symfony/cache": "^4.4 || ^5.2", | ||
"symfony/framework-bundle": "^4.4 || ^5.2" | ||
}, | ||
"require-dev": { | ||
"behat/behat": "^3.0", | ||
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", | ||
"symfony/yaml": "^4.4 || ^5.2", | ||
"symfony/phpunit-bridge": "^5.2", | ||
"symfony/process": "^4.4 || ^5.2", | ||
"phpstan/phpstan": "^0.12.85" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"DAMA\\DoctrineTestBundle\\": "src/DAMA/DoctrineTestBundle" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Tests\\": "tests/" | ||
} | ||
}, | ||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "7.0.x-dev" | ||
} | ||
}, | ||
"config": { | ||
"sort-packages": true | ||
} | ||
], | ||
"require": { | ||
"php": "^7.1 || ^8.0", | ||
"symfony/framework-bundle": "^4.4 || ^5.2", | ||
"doctrine/dbal": "^2.9.3 || ^3.0", | ||
"doctrine/doctrine-bundle": "^1.11 || ^2.0" | ||
}, | ||
"require-dev": { | ||
"behat/behat": "^3.0", | ||
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", | ||
"symfony/yaml": "^4.4 || ^5.2", | ||
"symfony/phpunit-bridge": "^5.2", | ||
"symfony/process": "^4.4 || ^5.2", | ||
"phpstan/phpstan": "^0.12.85" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"DAMA\\DoctrineTestBundle\\": "src/DAMA/DoctrineTestBundle" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { "Tests\\": "tests/" } | ||
}, | ||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "7.0.x-dev" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 108 additions & 0 deletions
108
src/DAMA/DoctrineTestBundle/Doctrine/Cache/Psr6StaticArrayCache.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
<?php | ||
|
||
namespace DAMA\DoctrineTestBundle\Doctrine\Cache; | ||
|
||
use Psr\Cache\CacheItemInterface; | ||
use Psr\Cache\CacheItemPoolInterface; | ||
use Symfony\Component\Cache\Adapter\ArrayAdapter; | ||
|
||
final class Psr6StaticArrayCache implements CacheItemPoolInterface | ||
{ | ||
/** | ||
* @var array<string, ArrayAdapter> | ||
*/ | ||
private static $adaptersByNamespace; | ||
|
||
/** | ||
* @var ArrayAdapter | ||
*/ | ||
private $adapter; | ||
|
||
public function __construct(string $namespace) | ||
{ | ||
if (!isset(self::$adaptersByNamespace[$namespace])) { | ||
self::$adaptersByNamespace[$namespace] = new ArrayAdapter(0, false); | ||
} | ||
$this->adapter = self::$adaptersByNamespace[$namespace]; | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
public static function reset(): void | ||
{ | ||
self::$adaptersByNamespace = []; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getItem($key) | ||
{ | ||
return $this->adapter->getItem($key); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getItems(array $keys = []) | ||
{ | ||
return $this->adapter->getItems($keys); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function hasItem($key) | ||
{ | ||
return $this->adapter->hasItem($key); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function clear() | ||
{ | ||
return $this->adapter->clear(); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function deleteItem($key) | ||
{ | ||
return $this->adapter->deleteItem($key); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function deleteItems(array $keys) | ||
{ | ||
return $this->adapter->deleteItems($keys); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function save(CacheItemInterface $item) | ||
{ | ||
return $this->adapter->save($item); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function saveDeferred(CacheItemInterface $item) | ||
{ | ||
return $this->adapter->saveDeferred($item); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function commit() | ||
{ | ||
return $this->adapter->commit(); | ||
} | ||
} |
Oops, something went wrong.