Skip to content

Commit

Permalink
Use new factory for annotations, support psr cache
Browse files Browse the repository at this point in the history
Previous factory method used the doctrine/cache implementation.
We now require symfony/cache and can use the psr factory instead.
  • Loading branch information
eigan committed Mar 10, 2023
1 parent 534dd1c commit 2e72605
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 5 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ If you were still including this line in your custom_types config, it should be
'json' => LaravelDoctrine\ORM\Types\Json::class
```

## Removed 'simple' Annotations
The `simple` configuration option for simple annotation reader has been removed as support for this
is removed in Doctrine.


## Short namespaces

Short namespaces such as `Entities:User` are no longer supported by Doctrine and have been removed.
7 changes: 3 additions & 4 deletions src/Configuration/MetaData/Annotations.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace LaravelDoctrine\ORM\Configuration\MetaData;

use Doctrine\ORM\Configuration;
use Doctrine\ORM\ORMSetup;
use Illuminate\Support\Arr;

class Annotations extends MetaData
Expand All @@ -14,9 +14,8 @@ class Annotations extends MetaData
*/
public function resolve(array $settings = [])
{
return (new Configuration())->newDefaultAnnotationDriver(
Arr::get($settings, 'paths', []),
Arr::get($settings, 'simple', false)
return ORMSetup::createDefaultAnnotationDriver(
Arr::get($settings, 'paths', [])
);
}
}
1 change: 0 additions & 1 deletion tests/Configuration/MetaData/AnnotationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public function test_can_resolve()
'paths' => ['entities'],
'dev' => true,
'proxies' => ['path' => 'path'],
'simple' => false
]);

$this->assertInstanceOf(MappingDriver::class, $resolved);
Expand Down

0 comments on commit 2e72605

Please sign in to comment.