Skip to content

Commit

Permalink
Fix setMetadataCacheImpl
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Dec 12, 2021
1 parent 6897869 commit 5a8b4c1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-strict-rules": "^1.0",
"phpunit/phpunit": "^9.5",
"ramsey/uuid-doctrine": "^1.5.0"
"ramsey/uuid-doctrine": "^1.5.0",
"symfony/cache": "^4.4.35"
},
"config": {
"platform": {
Expand Down
5 changes: 3 additions & 2 deletions tests/DoctrineIntegration/ODM/document-manager.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<?php declare(strict_types = 1);

use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Common\Cache\ArrayCache;
use Doctrine\ODM\MongoDB\Configuration;
use Doctrine\ODM\MongoDB\DocumentManager;
use Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver;
use Symfony\Component\Cache\Adapter\ArrayAdapter;
use Symfony\Component\Cache\DoctrineProvider;

$config = new Configuration();
$config->setProxyDir(__DIR__);
$config->setProxyNamespace('PHPstan\Doctrine\OdmProxies');
$config->setMetadataCacheImpl(new ArrayCache());
$config->setMetadataCacheImpl(new DoctrineProvider(new ArrayAdapter()));
$config->setHydratorDir(__DIR__);
$config->setHydratorNamespace('PHPstan\Doctrine\OdmHydrators');

Expand Down
5 changes: 3 additions & 2 deletions tests/DoctrineIntegration/ORM/entity-manager.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<?php declare(strict_types = 1);

use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Common\Cache\ArrayCache;
use Doctrine\ORM\Configuration;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
use Symfony\Component\Cache\Adapter\ArrayAdapter;
use Symfony\Component\Cache\DoctrineProvider;

$config = new Configuration();
$config->setProxyDir(__DIR__);
$config->setProxyNamespace('PHPstan\Doctrine\OrmProxies');
$config->setMetadataCacheImpl(new ArrayCache());
$config->setMetadataCacheImpl(new DoctrineProvider(new ArrayAdapter()));

$config->setMetadataDriverImpl(
new AnnotationDriver(
Expand Down
5 changes: 3 additions & 2 deletions tests/Rules/Doctrine/ORM/entity-manager.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<?php declare(strict_types = 1);

use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Common\Cache\ArrayCache;
use Doctrine\ORM\Configuration;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
use Symfony\Component\Cache\Adapter\ArrayAdapter;
use Symfony\Component\Cache\DoctrineProvider;

$config = new Configuration();
$config->setProxyDir(__DIR__);
$config->setProxyNamespace('PHPstan\Doctrine\OrmProxies');
$config->setMetadataCacheImpl(new ArrayCache());
$config->setMetadataCacheImpl(new DoctrineProvider(new ArrayAdapter()));

$config->setMetadataDriverImpl(
new AnnotationDriver(
Expand Down

0 comments on commit 5a8b4c1

Please sign in to comment.