Skip to content

Commit

Permalink
Merge pull request #193 from Majkl578/dev/open-2.0
Browse files Browse the repository at this point in the history
Open 2.0 - PHP 7.2, change namespace
  • Loading branch information
lcobucci committed May 7, 2018
2 parents 232c5da + cf7a51a commit 31f4c4a
Show file tree
Hide file tree
Showing 147 changed files with 676 additions and 666 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -3,7 +3,6 @@ sudo: false
language: php

php:
- 7.1
- 7.2
- nightly

Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -14,4 +14,4 @@ See the [doctrine-project website](https://www.doctrine-project.org/projects/doc

## Changelog

See [CHANGELOG.md](CHANGELOG.md).
See [UPGRADE.md](UPGRADE.md).
13 changes: 12 additions & 1 deletion CHANGELOG.md → UPGRADE.md
@@ -1,4 +1,15 @@
## Changelog
# Upgrade to 2.0

## Namespace changed to Doctrine\Annotations

Namespace of this library has been changed from `Doctrine\Common\Annotations` to `Doctrine\Annotations`.

## PHP 7.2 is now required

Doctrine Annotations now requires PHP 7.2 or newer.


## 1.x Changelog

### 1.5.0

Expand Down
8 changes: 4 additions & 4 deletions composer.json
Expand Up @@ -13,7 +13,7 @@
{"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"}
],
"require": {
"php": "^7.1",
"php": "^7.2",
"doctrine/lexer": "1.*"
},
"require-dev": {
Expand All @@ -24,14 +24,14 @@
"sort-packages": true
},
"autoload": {
"psr-4": { "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" }
"psr-4": { "Doctrine\\Annotations\\": "lib/Doctrine/Annotations" }
},
"autoload-dev": {
"psr-4": { "Doctrine\\Tests\\Common\\Annotations\\": "tests/Doctrine/Tests/Common/Annotations" }
"psr-4": { "Doctrine\\Tests\\Annotations\\": "tests/Doctrine/Tests/Annotations" }
},
"extra": {
"branch-alias": {
"dev-master": "1.7.x-dev"
"dev-master": "2.0.x-dev"
}
}
}
4 changes: 2 additions & 2 deletions docs/en/index.rst
Expand Up @@ -59,9 +59,9 @@ Reading annotations

The access to the annotations happens by reflection of the class
containing them. There are multiple reader-classes implementing the
``Doctrine\Common\Annotations\Reader`` interface, that can
``Doctrine\Annotations\Reader`` interface, that can
access the annotations of a class. A common one is
``Doctrine\Common\Annotations\AnnotationReader``:
``Doctrine\Annotations\AnnotationReader``:

.. code-block:: php
Expand Down
Expand Up @@ -17,7 +17,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\Common\Annotations;
namespace Doctrine\Annotations;

/**
* Annotations class.
Expand Down
Expand Up @@ -18,7 +18,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\Common\Annotations\Annotation;
namespace Doctrine\Annotations\Annotation;

/**
* Annotation that can be used to signal to the parser
Expand Down
Expand Up @@ -18,7 +18,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\Common\Annotations\Annotation;
namespace Doctrine\Annotations\Annotation;

/**
* Annotation that can be used to signal to the parser
Expand All @@ -31,7 +31,7 @@
final class Attributes
{
/**
* @var array<Doctrine\Common\Annotations\Annotation\Attribute>
* @var array<Doctrine\Annotations\Annotation\Attribute>
*/
public $value;
}
Expand Up @@ -18,7 +18,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\Common\Annotations\Annotation;
namespace Doctrine\Annotations\Annotation;

/**
* Annotation that can be used to signal to the parser
Expand Down
Expand Up @@ -17,7 +17,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\Common\Annotations\Annotation;
namespace Doctrine\Annotations\Annotation;

/**
* Annotation that can be used to signal to the parser to ignore specific
Expand Down
Expand Up @@ -18,7 +18,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\Common\Annotations\Annotation;
namespace Doctrine\Annotations\Annotation;

/**
* Annotation that can be used to signal to the parser
Expand Down
Expand Up @@ -18,7 +18,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\Common\Annotations\Annotation;
namespace Doctrine\Annotations\Annotation;

/**
* Annotation that can be used to signal to the parser
Expand Down
Expand Up @@ -17,7 +17,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\Common\Annotations;
namespace Doctrine\Annotations;

/**
* Description of AnnotationException
Expand Down
Expand Up @@ -17,10 +17,10 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\Common\Annotations;
namespace Doctrine\Annotations;

use Doctrine\Common\Annotations\Annotation\IgnoreAnnotation;
use Doctrine\Common\Annotations\Annotation\Target;
use Doctrine\Annotations\Annotation\IgnoreAnnotation;
use Doctrine\Annotations\Annotation\Target;
use ReflectionClass;
use ReflectionMethod;
use ReflectionProperty;
Expand All @@ -42,7 +42,7 @@ class AnnotationReader implements Reader
* @var array
*/
private static $globalImports = [
'ignoreannotation' => 'Doctrine\Common\Annotations\Annotation\IgnoreAnnotation',
'ignoreannotation' => 'Doctrine\Annotations\Annotation\IgnoreAnnotation',
];

/**
Expand Down Expand Up @@ -136,21 +136,21 @@ static public function addGlobalIgnoredNamespace($namespace)
/**
* Annotations parser.
*
* @var \Doctrine\Common\Annotations\DocParser
* @var \Doctrine\Annotations\DocParser
*/
private $parser;

/**
* Annotations parser used to collect parsing metadata.
*
* @var \Doctrine\Common\Annotations\DocParser
* @var \Doctrine\Annotations\DocParser
*/
private $preParser;

/**
* PHP parser used to collect imports.
*
* @var \Doctrine\Common\Annotations\PhpParser
* @var \Doctrine\Annotations\PhpParser
*/
private $phpParser;

Expand Down
Expand Up @@ -17,7 +17,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\Common\Annotations;
namespace Doctrine\Annotations;

final class AnnotationRegistry
{
Expand Down
Expand Up @@ -17,7 +17,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\Common\Annotations;
namespace Doctrine\Annotations;

use Doctrine\Common\Cache\Cache;
use ReflectionClass;
Expand Down
Expand Up @@ -17,7 +17,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\Common\Annotations;
namespace Doctrine\Annotations;

use Doctrine\Common\Lexer\AbstractLexer;

Expand Down
Expand Up @@ -17,13 +17,13 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\Common\Annotations;
namespace Doctrine\Annotations;

use Doctrine\Common\Annotations\Annotation\Attribute;
use Doctrine\Annotations\Annotation\Attribute;
use ReflectionClass;
use Doctrine\Common\Annotations\Annotation\Enum;
use Doctrine\Common\Annotations\Annotation\Target;
use Doctrine\Common\Annotations\Annotation\Attributes;
use Doctrine\Annotations\Annotation\Enum;
use Doctrine\Annotations\Annotation\Target;
use Doctrine\Annotations\Annotation\Attributes;

/**
* A parser for docblock annotations.
Expand Down Expand Up @@ -54,7 +54,7 @@ final class DocParser
/**
* The lexer.
*
* @var \Doctrine\Common\Annotations\DocLexer
* @var \Doctrine\Annotations\DocLexer
*/
private $lexer;

Expand All @@ -68,7 +68,7 @@ final class DocParser
/**
* Doc parser used to collect annotation target.
*
* @var \Doctrine\Common\Annotations\DocParser
* @var \Doctrine\Annotations\DocParser
*/
private static $metadataParser;

Expand Down Expand Up @@ -138,7 +138,7 @@ final class DocParser
* @var array
*/
private static $annotationMetadata = [
'Doctrine\Common\Annotations\Annotation\Target' => [
'Doctrine\Annotations\Annotation\Target' => [
'is_annotation' => true,
'has_constructor' => true,
'properties' => [],
Expand All @@ -154,7 +154,7 @@ final class DocParser
]
],
],
'Doctrine\Common\Annotations\Annotation\Attribute' => [
'Doctrine\Annotations\Annotation\Attribute' => [
'is_annotation' => true,
'has_constructor' => false,
'targets_literal' => 'ANNOTATION_ANNOTATION',
Expand Down Expand Up @@ -183,7 +183,7 @@ final class DocParser
]
],
],
'Doctrine\Common\Annotations\Annotation\Attributes' => [
'Doctrine\Annotations\Annotation\Attributes' => [
'is_annotation' => true,
'has_constructor' => false,
'targets_literal' => 'ANNOTATION_CLASS',
Expand All @@ -196,12 +196,12 @@ final class DocParser
'value' => [
'type' =>'array',
'required' =>true,
'array_type'=>'Doctrine\Common\Annotations\Annotation\Attribute',
'value' =>'array<Doctrine\Common\Annotations\Annotation\Attribute>'
'array_type'=>'Doctrine\Annotations\Annotation\Attribute',
'value' =>'array<Doctrine\Annotations\Annotation\Attribute>'
]
],
],
'Doctrine\Common\Annotations\Annotation\Enum' => [
'Doctrine\Annotations\Annotation\Enum' => [
'is_annotation' => true,
'has_constructor' => true,
'targets_literal' => 'ANNOTATION_PROPERTY',
Expand Down Expand Up @@ -484,10 +484,10 @@ private function collectAnnotationMetadata($name)
self::$metadataParser->setIgnoreNotImportedAnnotations(true);
self::$metadataParser->setIgnoredAnnotationNames($this->ignoredAnnotationNames);
self::$metadataParser->setImports([
'enum' => 'Doctrine\Common\Annotations\Annotation\Enum',
'target' => 'Doctrine\Common\Annotations\Annotation\Target',
'attribute' => 'Doctrine\Common\Annotations\Annotation\Attribute',
'attributes' => 'Doctrine\Common\Annotations\Annotation\Attributes'
'enum' => 'Doctrine\Annotations\Annotation\Enum',
'target' => 'Doctrine\Annotations\Annotation\Target',
'attribute' => 'Doctrine\Annotations\Annotation\Attribute',
'attributes' => 'Doctrine\Annotations\Annotation\Attributes'
]);

AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Enum.php');
Expand Down
Expand Up @@ -17,7 +17,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\Common\Annotations;
namespace Doctrine\Annotations;

/**
* File cache reader for annotations.
Expand All @@ -27,7 +27,7 @@
*
* @deprecated the FileCacheReader is deprecated and will be removed
* in version 2.0.0 of doctrine/annotations. Please use the
* {@see \Doctrine\Common\Annotations\CachedReader} instead.
* {@see \Doctrine\Annotations\CachedReader} instead.
*/
class FileCacheReader implements Reader
{
Expand Down
Expand Up @@ -17,7 +17,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\Common\Annotations;
namespace Doctrine\Annotations;

/**
* Allows the reader to be used in-place of Doctrine's reader.
Expand Down
Expand Up @@ -17,7 +17,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\Common\Annotations;
namespace Doctrine\Annotations;

use SplFileObject;

Expand Down
Expand Up @@ -17,7 +17,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\Common\Annotations;
namespace Doctrine\Annotations;

/**
* Interface for annotation readers.
Expand Down
Expand Up @@ -17,7 +17,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\Common\Annotations;
namespace Doctrine\Annotations;

/**
* Simple Annotation Reader.
Expand Down
Expand Up @@ -17,7 +17,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\Common\Annotations;
namespace Doctrine\Annotations;

/**
* Parses a file for namespaces/use/class declarations.
Expand Down

0 comments on commit 31f4c4a

Please sign in to comment.