Skip to content

Commit

Permalink
remove obsolete annotation mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Dec 4, 2023
1 parent a1728b1 commit 4680bb7
Show file tree
Hide file tree
Showing 117 changed files with 169 additions and 1,553 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Changelog
* DocumentManager::flush no longer saves the PHPCR session if there are no changes
on the ODM layer.

* Removed deprecated annotations for fields. Use `@Field(type="...")` instead.
* Removed annotation mappings. Use attributes (or XML or YAML) instead.

### New Features

Expand Down
5 changes: 2 additions & 3 deletions cli-config.doctrine_dbal.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ if (isset($argv[1])

/* prepare the doctrine configuration */
$config = new \Doctrine\ODM\PHPCR\Configuration();
$driver = new \Doctrine\ODM\PHPCR\Mapping\Driver\AnnotationDriver(
new \Doctrine\Common\Annotations\AnnotationReader(),
$driver = new \Doctrine\ODM\PHPCR\Mapping\Driver\AttributeDriver([
__DIR__ . '/lib/Doctrine/ODM/PHPCR/Document'
);
]);
$config->setMetadataDriverImpl($driver);

$dm = \Doctrine\ODM\PHPCR\DocumentManager::create($session, $config);
Expand Down
5 changes: 2 additions & 3 deletions cli-config.jackrabbit.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ $session = $repository->login($credentials, $workspace);

/* prepare the doctrine configuration */
$config = new \Doctrine\ODM\PHPCR\Configuration();
$driver = new \Doctrine\ODM\PHPCR\Mapping\Driver\AnnotationDriver(
new \Doctrine\Common\Annotations\AnnotationReader(),
$driver = new \Doctrine\ODM\PHPCR\Mapping\Driver\AttributeDriver([
__DIR__ . '/lib/Doctrine/ODM/PHPCR/Document'
);
]);
$config->setMetadataDriverImpl($driver);

$dm = \Doctrine\ODM\PHPCR\DocumentManager::create($session, $config);
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/PHPCR/Document/AbstractFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Doctrine\ODM\PHPCR\Document;

use Doctrine\ODM\PHPCR\HierarchyInterface;
use PHPCR\NodeInterface;
use Doctrine\ODM\PHPCR\Mapping\Attributes as PHPCR;
use PHPCR\NodeInterface;

/**
* This class represents an abstract "file".
Expand Down
8 changes: 5 additions & 3 deletions lib/Doctrine/ODM/PHPCR/Document/Generic.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
/**
* This class represents an arbitrary node.
*
* It is used as a default document, for example with the ParentDocument annotation.
* You can not use this to create nodes as it has no type annotation.
* It is used as a default document, for example with the ParentDocument mapping.
* You can not use this to create nodes as it has no type mapping.
*/
#[PHPCR\Document]
class Generic
Expand Down Expand Up @@ -51,13 +51,14 @@ public function __construct()
}

/**
* Id (path) of this document
* Id (path) of this document.
*/
public function getId(): string
{
if (!isset($this->id)) {
throw new BadMethodCallException('Do not call getId on unsaved objects.');
}

return $this->id;
}

Expand Down Expand Up @@ -95,6 +96,7 @@ public function getParentDocument(): object
if (!isset($this->parent)) {
throw new BadMethodCallException('Do not call getParentDocument on unsaved objects before setting the parent.');
}

return $this->parent;
}

Expand Down
8 changes: 3 additions & 5 deletions lib/Doctrine/ODM/PHPCR/Document/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@
*/
#[PHPCR\Document(nodeType: 'nt:resource')]
class Resource
{ #[PHPCR\Id]
{
#[PHPCR\Id]
protected string $id;

/**
* @var NodeInterface
*/
#[PHPCR\Node]
protected NodeInterface $node;

Expand Down Expand Up @@ -88,7 +86,7 @@ public function setParentDocument(object $parent): self

/**
* Set the data from a binary stream.
*
* @param resource $data the contents of this resource
*/
public function setData($data): self

Check failure on line 92 in lib/Doctrine/ODM/PHPCR/Document/Resource.php

View workflow job for this annotation

GitHub Actions / PHPStan

Class Doctrine\ODM\PHPCR\Document\Resource referenced with incorrect case: Doctrine\ODM\PHPCR\Document\resource.
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/PHPCR/DocumentManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function hasLocaleChooserStrategy(): bool
public function getLocaleChooserStrategy(): LocaleChooserInterface
{
if (!isset($this->localeChooserStrategy)) {
throw new InvalidArgumentException('You must configure a language chooser strategy when having documents with the translatable annotation');
throw new InvalidArgumentException('You must configure a language chooser strategy when having documents with the translatable mapping');
}

return $this->localeChooserStrategy;
Expand Down
22 changes: 0 additions & 22 deletions lib/Doctrine/ODM/PHPCR/Mapping/Annotations/Child.php

This file was deleted.

26 changes: 0 additions & 26 deletions lib/Doctrine/ODM/PHPCR/Mapping/Annotations/Children.php

This file was deleted.

13 changes: 0 additions & 13 deletions lib/Doctrine/ODM/PHPCR/Mapping/Annotations/Depth.php

This file was deleted.

28 changes: 0 additions & 28 deletions lib/Doctrine/ODM/PHPCR/Mapping/Annotations/Document.php

This file was deleted.

13 changes: 0 additions & 13 deletions lib/Doctrine/ODM/PHPCR/Mapping/Annotations/Field.php

This file was deleted.

16 changes: 0 additions & 16 deletions lib/Doctrine/ODM/PHPCR/Mapping/Annotations/Id.php

This file was deleted.

13 changes: 0 additions & 13 deletions lib/Doctrine/ODM/PHPCR/Mapping/Annotations/Locale.php

This file was deleted.

13 changes: 0 additions & 13 deletions lib/Doctrine/ODM/PHPCR/Mapping/Annotations/MappedSuperclass.php

This file was deleted.

14 changes: 0 additions & 14 deletions lib/Doctrine/ODM/PHPCR/Mapping/Annotations/MixedReferrers.php

This file was deleted.

13 changes: 0 additions & 13 deletions lib/Doctrine/ODM/PHPCR/Mapping/Annotations/Node.php

This file was deleted.

15 changes: 0 additions & 15 deletions lib/Doctrine/ODM/PHPCR/Mapping/Annotations/Nodename.php

This file was deleted.

20 changes: 0 additions & 20 deletions lib/Doctrine/ODM/PHPCR/Mapping/Annotations/ParentDocument.php

This file was deleted.

13 changes: 0 additions & 13 deletions lib/Doctrine/ODM/PHPCR/Mapping/Annotations/PostLoad.php

This file was deleted.

13 changes: 0 additions & 13 deletions lib/Doctrine/ODM/PHPCR/Mapping/Annotations/PostPersist.php

This file was deleted.

13 changes: 0 additions & 13 deletions lib/Doctrine/ODM/PHPCR/Mapping/Annotations/PostRemove.php

This file was deleted.

13 changes: 0 additions & 13 deletions lib/Doctrine/ODM/PHPCR/Mapping/Annotations/PostUpdate.php

This file was deleted.

Loading

0 comments on commit 4680bb7

Please sign in to comment.