Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1 to 2 #854

Merged
merged 25 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
eeca094
prepare release
dbu Sep 21, 2023
71c9100
bump to php 8 because annotations are only available since PHP 8.0
dbu Sep 21, 2023
6d43942
adf
dbu Sep 23, 2023
dedb884
Merge pull request #851 from doctrine/php-8
dbu Sep 23, 2023
2a20f12
make annotations also attributes
dbu Sep 23, 2023
1e1abeb
define annotations as attributes too
dbu Sep 23, 2023
82d859e
attribute driver, fix attribute declarations and adjust documentation
dbu Oct 13, 2023
68f0da2
Merge pull request #852 from doctrine/annotations
dbu Dec 3, 2023
4c4cb4d
prepare release
dbu Dec 3, 2023
4233995
Merge remote-tracking branch 'origin/1.x' into 1-to-2
dbu Dec 3, 2023
625d832
cleanup 1.x changes
dbu Dec 3, 2023
fb19358
convert provided documents to attributes instead of annotations
dbu Dec 3, 2023
552d4a3
Merge pull request #855 from doctrine/internally-use-attributes
dbu Dec 3, 2023
bd15044
Merge remote-tracking branch 'origin/1.x' into 1-to-2
dbu Dec 3, 2023
ba5abaf
convert tests to use attributes instead of annotations
dbu Dec 3, 2023
9213f3a
Merge pull request #856 from doctrine/more-attributes
dbu Dec 3, 2023
4ce52b9
fix test setup
dbu Dec 3, 2023
05664fa
Merge pull request #857 from doctrine/more-attributes
dbu Dec 4, 2023
2619cc0
Merge remote-tracking branch 'origin/1.x' into 1-to-2
dbu Dec 4, 2023
117d8ec
link attributes documentation in toc
dbu Dec 4, 2023
2e397e8
fix typos and add attributes mapping test
dbu Dec 4, 2023
33ee413
Merge pull request #859 from doctrine/attribute-doc
dbu Dec 4, 2023
a1728b1
Merge remote-tracking branch 'origin/1.x' into 1-to-2
dbu Dec 4, 2023
cedafd5
remove obsolete annotation mapping
dbu Dec 3, 2023
c06a9d2
Merge pull request #858 from doctrine/drop-annotations
dbu Jan 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 36 additions & 50 deletions .github/workflows/test-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,38 +27,31 @@ jobs:

matrix:
php-version:
- '7.4'
- '8.0'
- '8.1'
- '8.2'
- '8.3'
dependencies: [highest]
symfony-version: ['*']
jackalope-version: ['1.*']
include:
- php-version: '7.4'
dependencies: lowest
symfony-version: '*'
- php-version: '7.4'
dependencies: highest
symfony-version: '5.4.*'
php-bench: true
- php-version: '8.0'
dependencies: lowest
symfony-version: '*'
- php-version: '8.0'
dependencies: highest
symfony-version: '6.*'
- php-version: '8.1'
dependencies: highest
symfony-version: '5.4.*'
- php-version: '8.2'
dependencies: highest
symfony-version: '6.*'
- php-version: '8.2'
dependencies: highest
symfony-version: '6.*'
jackalope-version: '2.*'
php-bench: true
- php-version: '8.0'
dependencies: lowest
symfony-version: '*'
- php-version: '8.0'
dependencies: highest
symfony-version: '6.*'
- php-version: '8.1'
dependencies: highest
symfony-version: '5.4.*'
- php-version: '8.2'
dependencies: highest
symfony-version: '6.*'
- php-version: '8.2'
dependencies: highest
symfony-version: '6.*'
jackalope-version: '2.*'
php-bench: true

steps:
- name: Checkout project
Expand Down Expand Up @@ -116,38 +109,31 @@ jobs:

matrix:
php-version:
- '7.4'
- '8.0'
- '8.1'
- '8.2'
- '8.3'
dependencies: [highest]
symfony-version: ['*']
jackalope-version: ['1.*']
include:
- php-version: '7.4'
dependencies: lowest
symfony-version: '*'
- php-version: '7.4'
dependencies: highest
symfony-version: '5.4.*'
php-bench: true
- php-version: '8.0'
dependencies: lowest
symfony-version: '*'
- php-version: '8.0'
dependencies: highest
symfony-version: '6.*'
- php-version: '8.1'
dependencies: highest
symfony-version: 5.4.*
- php-version: '8.2'
dependencies: highest
symfony-version: '6.*'
- php-version: '8.2'
dependencies: highest
symfony-version: '6.*'
jackalope-version: '2.*'
php-bench: true
- php-version: '8.0'
dependencies: lowest
symfony-version: '*'
- php-version: '8.0'
dependencies: highest
symfony-version: '6.*'
- php-version: '8.1'
dependencies: highest
symfony-version: 5.4.*
- php-version: '8.2'
dependencies: highest
symfony-version: '6.*'
- php-version: '8.2'
dependencies: highest
symfony-version: '6.*'
jackalope-version: '2.*'
php-bench: true

steps:
- name: Checkout project
Expand Down
20 changes: 18 additions & 2 deletions 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 All @@ -30,6 +30,22 @@ Dropped support for PHP < 7.4 and Symfony < 5.4.
1.x
===

1.8.1 (unreleased)
------------------

* Convert provided documents to use attributes instead of annotations.

1.8.0
-----

* Add support for PHP attributes (only for the annotations that are not deprecated)
* Drop support for PHP 7.

1.7.2
-----

* Maintenance release with doc and phpunit test cleanups.

1.7.1
-----

Expand Down Expand Up @@ -364,7 +380,7 @@ maintenance release of the 1.0 family with bugfixes
- Doctrine\Common\Persistence\Event\LifecycleEventArgs
Only the MoveEventArgs remain specific to PHPCR-ODM.
* **2013-09-27**: Removed deprecated legacy handling for the mapping that
allowed using "name" instead of "property" to configure PHCPR property in mapping.
allowed using "name" instead of "property" to configure PHPCR property in mapping.

* **2013-09-26**: [Model] add HierarchyInterface for objects that resolve to
nt:HierarchyNode, the method AbstractFile::addChild is
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PHPCR ODM for Doctrine2
# PHPCR ODM for Doctrine

[![Build Status](https://github.com/doctrine/phpcr-odm/actions/workflows/test-application.yaml/badge.svg?branch=2.x)](https://github.com/doctrine/phpcr-odm/actions/workflows/test-application.yaml)
[![Latest Stable Version](https://poser.pugx.org/doctrine/phpcr-odm/version.png)](https://packagist.org/packages/doctrine/phpcr-odm)
Expand Down
7 changes: 3 additions & 4 deletions cli-config.doctrine_dbal.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* The config file is responsible to make class loading work and initialize a
* DocumentManagerHelper that contains the doctrine document manager with a
* Session of your phcpr implementation.
* Session of your phpcr implementation.
* The array $extraCommands can be used to inject implementation specific commands.
* Add instances of commands for eventual implementation specific commands to this array.
*/
Expand Down 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
7 changes: 3 additions & 4 deletions cli-config.jackrabbit.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* The config file is responsible to make class loading work and initialize a
* DocumentManagerHelper that contains the doctrine document manager with a
* Session of your phcpr implementation.
* Session of your phpcr implementation.
* The array $extraCommands can be used to inject implementation specific commands.
* Add instances of commands for eventual implementation specific commands to this array.
*/
Expand Down 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
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"minimum-stability": "beta",
"prefer-stable": true,
"require": {
"php": "^7.4 || ^8.0",
"php": "^8.0",
"doctrine/collections": "^1.0 || ^2.0",
"doctrine/common": "^2.4 || ^3.0",
"doctrine/annotations": "^1.13 || ^2.0",
"doctrine/annotations": "^1.14.3 || ^2.0",
"doctrine/data-fixtures": "^1.0",
"doctrine/event-manager": "^1.0 || ^2.0",
"doctrine/persistence": "^2.4",
Expand All @@ -40,7 +40,7 @@
"symfony/yaml": "^5.4 || ^6.0.19",
"symfony/phpunit-bridge": "^5.4.21 || ^6.0.19",
"liip/rmt": "^1.3",
"phpunit/phpunit": "^7.5 || ^8.0 || ^9.0"
"phpunit/phpunit": "^9.6.15"
},
"suggest": {
"symfony/yaml": "^5.4 || ^6.0",
Expand Down
3 changes: 2 additions & 1 deletion docs/en/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ Mapping Objects onto a Document Repository
:doc:`Inheritance <reference/inheritance-mapping>`

* **Mapping Driver References**:
:doc:`Docblock Annotations <reference/annotations-mapping>` |
:doc:`PHP Attributes <reference/attributes-mapping>` |
:doc:`Docblock Annotations (deprecated) <reference/annotations-mapping>` |
:doc:`XML <reference/xml-mapping>` |
:doc:`YAML <reference/yml-mapping>` |
:doc:`Metadata Drivers <reference/metadata-drivers>`
Expand Down
8 changes: 6 additions & 2 deletions docs/en/reference/annotations-mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Annotation Mapping
In this chapter a reference of every PHPCR-ODM annotation is given with short
explanations on their context and usage.

.. warning::

Annotations have been deprecated in favor of :doc:`Attributes<attributes-mapping>`

Note on usage
-------------

Expand Down Expand Up @@ -230,12 +234,12 @@ Examples::
/**
* @PHPCR\Field(type="string", multivalue=true)
*/
protected $keywords; // e.g. array('dog', 'cat', 'mouse')
protected $keywords; // e.g. ['dog', 'cat', 'mouse']

/**
* @PHPCR\Field(type="double", assoc="")
*/
protected $exchangeRates; // e.g. array('GBP' => 0.810709, 'EUR' => 1, 'USD' => 1.307460)
protected $exchangeRates; // e.g. ['GBP' => 0.810709, 'EUR' => 1, 'USD' => 1.307460]

Hierarchy
---------
Expand Down
Loading