Permalink
Browse files

[Annotations] Introduce doctrine/annotations dependency

  • Loading branch information...
1 parent 9fdc9f4 commit 185e6d76765fe37ddb1a94aad8f51d97c92b0649 @beberlei beberlei committed Jan 12, 2013
Showing with 70 additions and 9,548 deletions.
  1. +2 −1 composer.json
  2. +68 −1 composer.lock
  3. +0 −79 lib/Doctrine/Common/Annotations/Annotation.php
  4. +0 −47 lib/Doctrine/Common/Annotations/Annotation/Attribute.php
  5. +0 −37 lib/Doctrine/Common/Annotations/Annotation/Attributes.php
  6. +0 −85 lib/Doctrine/Common/Annotations/Annotation/Enum.php
  7. +0 −54 lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php
  8. +0 −33 lib/Doctrine/Common/Annotations/Annotation/Required.php
  9. +0 −107 lib/Doctrine/Common/Annotations/Annotation/Target.php
  10. +0 −150 lib/Doctrine/Common/Annotations/AnnotationException.php
  11. +0 −310 lib/Doctrine/Common/Annotations/AnnotationReader.php
  12. +0 −139 lib/Doctrine/Common/Annotations/AnnotationRegistry.php
  13. +0 −250 lib/Doctrine/Common/Annotations/CachedReader.php
  14. +0 −132 lib/Doctrine/Common/Annotations/DocLexer.php
  15. +0 −1,041 lib/Doctrine/Common/Annotations/DocParser.php
  16. +0 −269 lib/Doctrine/Common/Annotations/FileCacheReader.php
  17. +0 −141 lib/Doctrine/Common/Annotations/IndexedReader.php
  18. +0 −89 lib/Doctrine/Common/Annotations/PhpParser.php
  19. +0 −67 lib/Doctrine/Common/Annotations/Reader.php
  20. +0 −157 lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php
  21. +0 −175 lib/Doctrine/Common/Annotations/TokenParser.php
  22. +0 −582 tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php
  23. +0 −13 tests/Doctrine/Tests/Common/Annotations/AnnotationReaderTest.php
  24. +0 −56 tests/Doctrine/Tests/Common/Annotations/CachedReaderTest.php
  25. +0 −137 tests/Doctrine/Tests/Common/Annotations/DocLexerTest.php
  26. +0 −1,264 tests/Doctrine/Tests/Common/Annotations/DocParserTest.php
  27. +0 −48 tests/Doctrine/Tests/Common/Annotations/DummyClass.php
  28. +0 −40 tests/Doctrine/Tests/Common/Annotations/FileCacheReaderTest.php
  29. +0 −10 tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/AnnotWithDefaultValue.php
  30. +0 −10 tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Autoload.php
  31. +0 −11 tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Route.php
  32. +0 −18 tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Secure.php
  33. +0 −14 tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Template.php
  34. +0 −11 tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Version.php
  35. +0 −21 tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationEnum.php
  36. +0 −17 tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationEnumInvalid.php
  37. +0 −34 tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationEnumLiteral.php
  38. +0 −31 tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationEnumLiteralInvalid.php
  39. +0 −14 tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationTargetAll.php
  40. +0 −14 tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationTargetAnnotation.php
  41. +0 −15 tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationTargetClass.php
  42. +0 −15 tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationTargetMethod.php
  43. +0 −14 tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationTargetPropertyMethod.php
  44. +0 −119 tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithAttributes.php
  45. +0 −20 tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithConstants.php
  46. +0 −50 tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithRequiredAttributes.php
  47. +0 −24 .../Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithRequiredAttributesWithoutContructor.php
  48. +0 −11 tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithTargetSyntaxError.php
  49. +0 −62 tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithVarType.php
  50. +0 −10 tests/Doctrine/Tests/Common/Annotations/Fixtures/Api.php
  51. +0 −30 tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassDDC1660.php
  52. +0 −29 tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithAnnotationEnum.php
  53. +0 −21 tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithAnnotationWithTargetSyntaxError.php
  54. +0 −31 tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithAnnotationWithVarType.php
  55. +0 −52 tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithClosure.php
  56. +0 −10 tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithConstants.php
  57. +0 −11 tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithFullyQualifiedUseStatements.php
  58. +0 −17 tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithInvalidAnnotationTargetAtClass.php
  59. +0 −20 tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithInvalidAnnotationTargetAtMethod.php
  60. +0 −24 tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithInvalidAnnotationTargetAtProperty.php
  61. +0 −15 tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithRequire.php
  62. +0 −41 tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithValidAnnotationTarget.php
  63. +0 −300 tests/Doctrine/Tests/Common/Annotations/Fixtures/Controller.php
  64. +0 −15 tests/Doctrine/Tests/Common/Annotations/Fixtures/DifferentNamespacesPerFileWithClassAsFirst.php
  65. +0 −15 tests/Doctrine/Tests/Common/Annotations/Fixtures/DifferentNamespacesPerFileWithClassAsLast.php
  66. +0 −13 tests/Doctrine/Tests/Common/Annotations/Fixtures/EqualNamespacesPerFileWithClassAsFirst.php
  67. +0 −12 tests/Doctrine/Tests/Common/Annotations/Fixtures/EqualNamespacesPerFileWithClassAsLast.php
  68. +0 −12 tests/Doctrine/Tests/Common/Annotations/Fixtures/GlobalNamespacesPerFileWithClassAsFirst.php
  69. +0 −12 tests/Doctrine/Tests/Common/Annotations/Fixtures/GlobalNamespacesPerFileWithClassAsLast.php
  70. +0 −10 tests/Doctrine/Tests/Common/Annotations/Fixtures/IntefaceWithConstants.php
  71. +0 −14 tests/Doctrine/Tests/Common/Annotations/Fixtures/InvalidAnnotationUsageButIgnoredClass.php
  72. +0 −10 tests/Doctrine/Tests/Common/Annotations/Fixtures/InvalidAnnotationUsageClass.php
  73. +0 −9 tests/Doctrine/Tests/Common/Annotations/Fixtures/MultipleClassesInFile.php
  74. +0 −10 tests/Doctrine/Tests/Common/Annotations/Fixtures/MultipleImportsInUseStatement.php
  75. +0 −20 tests/Doctrine/Tests/Common/Annotations/Fixtures/NamespaceAndClassCommentedOut.php
  76. +0 −12 tests/Doctrine/Tests/Common/Annotations/Fixtures/NamespaceWithClosureDeclaration.php
  77. +0 −1,009 tests/Doctrine/Tests/Common/Annotations/Fixtures/NamespacedSingleClassLOC1000.php
  78. +0 −5 tests/Doctrine/Tests/Common/Annotations/Fixtures/NoAnnotation.php
  79. +0 −10 tests/Doctrine/Tests/Common/Annotations/Fixtures/NonNamespacedClass.php
  80. +0 −1,006 tests/Doctrine/Tests/Common/Annotations/Fixtures/SingleClassLOC1000.php
  81. +0 −13 tests/Doctrine/Tests/Common/Annotations/Fixtures/TestInterface.php
  82. +0 −194 tests/Doctrine/Tests/Common/Annotations/PerformanceTest.php
  83. +0 −207 tests/Doctrine/Tests/Common/Annotations/PhpParserTest.php
  84. +0 −97 tests/Doctrine/Tests/Common/Annotations/SimpleAnnotationReaderTest.php
  85. +0 −65 tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM55Test.php
  86. +0 −8 tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM58Entity.php
  87. +0 −112 tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM58Test.php
  88. +0 −8 tests/Doctrine/Tests/Common/Annotations/TopLevelAnnotation.php
View
@@ -17,7 +17,8 @@
"doctrine/inflector": "1.*",
"doctrine/cache": "1.*",
"doctrine/collections": "1.*",
- "doctrine/lexer": "1.*"
+ "doctrine/lexer": "1.*",
+ "doctrine/annotations": "1.*"
},
"autoload": {
"psr-0": { "Doctrine\\Common\\": "lib/" }
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -1,79 +0,0 @@
-<?php
-/*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the MIT license. For more information, see
- * <http://www.doctrine-project.org>.
- */
-
-namespace Doctrine\Common\Annotations;
-
-/**
- * Annotations class
- *
- * @author Benjamin Eberlei <kontakt@beberlei.de>
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
- * @author Jonathan Wage <jonwage@gmail.com>
- * @author Roman Borschel <roman@code-factory.org>
- */
-class Annotation
-{
- /**
- * Value property. Common among all derived classes.
- *
- * @var string
- */
- public $value;
-
- /**
- * Constructor
- *
- * @param array $data Key-value for properties to be defined in this class
- */
- public final function __construct(array $data)
- {
- foreach ($data as $key => $value) {
- $this->$key = $value;
- }
- }
-
- /**
- * Error handler for unknown property accessor in Annotation class.
- *
- * @param string $name Unknown property name
- *
- * @throws \BadMethodCallException
- */
- public function __get($name)
- {
- throw new \BadMethodCallException(
- sprintf("Unknown property '%s' on annotation '%s'.", $name, get_class($this))
- );
- }
-
- /**
- * Error handler for unknown property mutator in Annotation class.
- *
- * @param string $name Unkown property name
- * @param mixed $value Property value
- *
- * @throws \BadMethodCallException
- */
- public function __set($name, $value)
- {
- throw new \BadMethodCallException(
- sprintf("Unknown property '%s' on annotation '%s'.", $name, get_class($this))
- );
- }
-}
@@ -1,47 +0,0 @@
-<?php
-
-/*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the MIT license. For more information, see
- * <http://www.doctrine-project.org>.
- */
-
-namespace Doctrine\Common\Annotations\Annotation;
-
-/**
- * Annotation that can be used to signal to the parser
- * to check the attribute type during the parsing process.
- *
- * @author Fabio B. Silva <fabio.bat.silva@gmail.com>
- *
- * @Annotation
- */
-final class Attribute
-{
- /**
- * @var string
- */
- public $name;
-
- /**
- * @var string
- */
- public $type;
-
- /**
- * @var boolean
- */
- public $required = false;
-}
@@ -1,37 +0,0 @@
-<?php
-
-/*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the MIT license. For more information, see
- * <http://www.doctrine-project.org>.
- */
-
-namespace Doctrine\Common\Annotations\Annotation;
-
-/**
- * Annotation that can be used to signal to the parser
- * to check the types of all declared attributes during the parsing process.
- *
- * @author Fabio B. Silva <fabio.bat.silva@gmail.com>
- *
- * @Annotation
- */
-final class Attributes
-{
- /**
- * @var array<Doctrine\Common\Annotations\Annotation\Attribute>
- */
- public $value;
-}
@@ -1,85 +0,0 @@
-<?php
-
-/*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the MIT license. For more information, see
- * <http://www.doctrine-project.org>.
- */
-
-namespace Doctrine\Common\Annotations\Annotation;
-
-/**
- * Annotation that can be used to signal to the parser
- * to check the available values during the parsing process.
- *
- * @since 2.4
- * @author Fabio B. Silva <fabio.bat.silva@gmail.com>
- *
- * @Annotation
- * @Attributes({
- * @Attribute("value", required = true, type = "array"),
- * @Attribute("literal", required = false, type = "array")
- * })
- */
-final class Enum
-{
- /**
- * @var array
- */
- public $value;
-
- /**
- * Literal target declaration.
- *
- * @var array
- */
- public $literal;
-
- /**
- * Annotation construct
- *
- * @param array $values
- *
- * @throws \InvalidArgumentException
- */
- public function __construct(array $values)
- {
- if ( ! isset($values['literal'])) {
- $values['literal'] = array();
- }
-
- foreach ($values['value'] as $var) {
- if( ! is_scalar($var)) {
- throw new \InvalidArgumentException(sprintf(
- '@Enum supports only scalar values "%s" given.',
- is_object($var) ? get_class($var) : gettype($var)
- ));
- }
- }
-
- foreach ($values['literal'] as $key => $var) {
- if( ! in_array($key, $values['value'])) {
- throw new \InvalidArgumentException(sprintf(
- 'Undefined enumerator value "%s" for literal "%s".',
- $key , $var
- ));
- }
- }
-
- $this->value = $values['value'];
- $this->literal = $values['literal'];
- }
-
-}
@@ -1,54 +0,0 @@
-<?php
-/*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the MIT license. For more information, see
- * <http://www.doctrine-project.org>.
- */
-
-namespace Doctrine\Common\Annotations\Annotation;
-
-/**
- * Annotation that can be used to signal to the parser to ignore specific
- * annotations during the parsing process.
- *
- * @Annotation
- * @author Johannes M. Schmitt <schmittjoh@gmail.com>
- */
-final class IgnoreAnnotation
-{
- /**
- * @var array
- */
- public $names;
-
- /**
- * Constructor
- *
- * @param array $values
- *
- * @throws \RuntimeException
- */
- public function __construct(array $values)
- {
- if (is_string($values['value'])) {
- $values['value'] = array($values['value']);
- }
- if (!is_array($values['value'])) {
- throw new \RuntimeException(sprintf('@IgnoreAnnotation expects either a string name, or an array of strings, but got %s.', json_encode($values['value'])));
- }
-
- $this->names = $values['value'];
- }
-}
Oops, something went wrong.

0 comments on commit 185e6d7

Please sign in to comment.