Permalink
Browse files

Cherry picked FabioBatSilva upgrade of Common lib.

  • Loading branch information...
1 parent f8811c4 commit 3bb803fd697d92d661f5b8cea473f75f46c34857 @guilhermeblanco guilhermeblanco committed Sep 13, 2011
@@ -19,7 +19,8 @@
namespace Doctrine\ORM\Mapping;
-use Doctrine\Common\Annotations\Annotation;
+abstract class Annotation {}
+
/* Annotations */
@@ -28,7 +29,9 @@
* @Target("CLASS")
*/
final class Entity extends Annotation {
+ /** @var string */
public $repositoryClass;
+ /** @var boolean */
public $readOnly = false;
}
@@ -37,31 +40,42 @@
* @Target("CLASS")
*/
final class MappedSuperclass extends Annotation {
+ /** @var string */
public $repositoryClass;
}
/**
* @Annotation
* @Target("CLASS")
*/
-final class InheritanceType extends Annotation {}
+final class InheritanceType extends Annotation {
+ /** @var string */
+ public $value;
+}
/**
* @Annotation
* @Target("CLASS")
*/
final class DiscriminatorColumn extends Annotation {
+ /** @var string */
public $name;
- public $fieldName; // field name used in non-object hydration (array/scalar)
+ /** @var string */
public $type;
+ /** @var integer */
public $length;
+ /** @var mixed */
+ public $fieldName; // field name used in non-object hydration (array/scalar)
}
/**
* @Annotation
* @Target("CLASS")
*/
-final class DiscriminatorMap extends Annotation {}
+final class DiscriminatorMap extends Annotation {
+ /** @var array<string> */
+ public $value;
+}
/**
* @Annotation
@@ -74,6 +88,7 @@
* @Target("PROPERTY")
*/
final class GeneratedValue extends Annotation {
+ /** @var string */
public $strategy = 'AUTO';
}
@@ -88,36 +103,53 @@
* @Target({"PROPERTY","ANNOTATION"})
*/
final class JoinColumn extends Annotation {
+ /** @var string */
public $name;
- public $fieldName; // field name used in non-object hydration (array/scalar)
+ /** @var string */
public $referencedColumnName = 'id';
+ /** @var boolean */
public $unique = false;
+ /** @var boolean */
public $nullable = true;
+ /** @var mixed */
public $onDelete;
+ /** @var string */
public $columnDefinition;
+ /** @var string */
+ public $fieldName; // field name used in non-object hydration (array/scalar)
}
/**
* @Annotation
* @Target("PROPERTY")
*/
-final class JoinColumns extends Annotation {}
+final class JoinColumns extends Annotation {
+ /** @var array<Doctrine\ORM\Mapping\JoinColumn> */
+ public $value;
+}
/**
* @Annotation
* @Target("PROPERTY")
*/
final class Column extends Annotation {
+ /** @var string */
+ public $name;
+ /** @var mixed */
public $type = 'string';
+ /** @var integer */
public $length;
- // The precision for a decimal (exact numeric) column (Applies only for decimal column)
- public $precision = 0;
- // The scale for a decimal (exact numeric) column (Applies only for decimal column)
- public $scale = 0;
+ /** @var integer */
+ public $precision = 0; // The precision for a decimal (exact numeric) column (Applies only for decimal column)
+ /** @var integer */
+ public $scale = 0; // The scale for a decimal (exact numeric) column (Applies only for decimal column)
+ /** @var boolean */
public $unique = false;
+ /** @var boolean */
public $nullable = false;
- public $name;
+ /** @var array */
public $options = array();
+ /** @var string */
public $columnDefinition;
}
@@ -126,11 +158,17 @@
* @Target("PROPERTY")
*/
final class OneToOne extends Annotation {
+ /** @var string */
public $targetEntity;
+ /** @var string */
public $mappedBy;
+ /** @var string */
public $inversedBy;
+ /** @var array<string> */
public $cascade;
+ /** @var string */
public $fetch = 'LAZY';
+ /** @var boolean */
public $orphanRemoval = false;
}
@@ -139,11 +177,17 @@
* @Target("PROPERTY")
*/
final class OneToMany extends Annotation {
+ /** @var string */
public $mappedBy;
+ /** @var string */
public $targetEntity;
+ /** @var array<string> */
public $cascade;
+ /** @var string */
public $fetch = 'LAZY';
+ /** @var boolean */
public $orphanRemoval = false;
+ /** @var string */
public $indexBy;
}
@@ -152,9 +196,13 @@
* @Target("PROPERTY")
*/
final class ManyToOne extends Annotation {
+ /** @var string */
public $targetEntity;
+ /** @var array<string> */
public $cascade;
+ /** @var string */
public $fetch = 'LAZY';
+ /** @var string */
public $inversedBy;
}
@@ -163,11 +211,17 @@
* @Target("PROPERTY")
*/
final class ManyToMany extends Annotation {
+ /** @var string */
public $targetEntity;
+ /** @var string */
public $mappedBy;
+ /** @var string */
public $inversedBy;
+ /** @var array<string> */
public $cascade;
+ /** @var string */
public $fetch = 'LAZY';
+ /** @var string */
public $indexBy;
}
@@ -177,6 +231,7 @@
* @todo check available targets
*/
final class ElementCollection extends Annotation {
+ /** @var string */
public $tableName;
}
@@ -185,9 +240,13 @@
* @Target("CLASS")
*/
final class Table extends Annotation {
+ /** @var string */
public $name;
+ /** @var string */
public $schema;
+ /** @var array<Doctrine\ORM\Mapping\Index> */
public $indexes;
+ /** @var array<Doctrine\ORM\Mapping\UniqueConstraint> */
public $uniqueConstraints;
}
@@ -196,7 +255,9 @@
* @Target("ANNOTATION")
*/
final class UniqueConstraint extends Annotation {
+ /** @var string */
public $name;
+ /** @var array<string> */
public $columns;
}
@@ -205,7 +266,9 @@
* @Target("ANNOTATION")
*/
final class Index extends Annotation {
+ /** @var string */
public $name;
+ /** @var array<string> */
public $columns;
}
@@ -214,9 +277,13 @@
* @Target("PROPERTY")
*/
final class JoinTable extends Annotation {
+ /** @var string */
public $name;
+ /** @var string */
public $schema;
+ /** @var array<Doctrine\ORM\Mapping\JoinColumn> */
public $joinColumns = array();
+ /** @var array<Doctrine\ORM\Mapping\JoinColumn> */
public $inverseJoinColumns = array();
}
@@ -225,35 +292,49 @@
* @Target("PROPERTY")
*/
final class SequenceGenerator extends Annotation {
+ /** @var string */
public $sequenceName;
+ /** @var integer */
public $allocationSize = 1;
+ /** @var integer */
public $initialValue = 1;
}
/**
* @Annotation
* @Target("CLASS")
*/
-final class ChangeTrackingPolicy extends Annotation {}
+final class ChangeTrackingPolicy extends Annotation {
+ /** @var string */
+ public $value;
+}
/**
* @Annotation
* @Target("PROPERTY")
*/
-final class OrderBy extends Annotation {}
+final class OrderBy extends Annotation {
+ /** @var array<string> */
+ public $value;
+}
/**
* @Annotation
* @Target("CLASS")
*/
-final class NamedQueries extends Annotation {}
+final class NamedQueries extends Annotation {
+ /** @var array<Doctrine\ORM\Mapping\NamedQuery> */
+ public $value;
+}
/**
* @Annotation
* @Target("ANNOTATION")
*/
final class NamedQuery extends Annotation {
+ /** @var string */
public $name;
+ /** @var string */
public $query;
}
Submodule doctrine-common updated 90 files
+61 −0 UPGRADE_TO_2_2
+47 −0 lib/Doctrine/Common/Annotations/Annotation/Attribute.php
+37 −0 lib/Doctrine/Common/Annotations/Annotation/Attributes.php
+1 −0 lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php
+33 −0 lib/Doctrine/Common/Annotations/Annotation/Required.php
+105 −0 lib/Doctrine/Common/Annotations/Annotation/Target.php
+57 −0 lib/Doctrine/Common/Annotations/AnnotationException.php
+22 −105 lib/Doctrine/Common/Annotations/AnnotationReader.php
+1 −1 lib/Doctrine/Common/Annotations/DocLexer.php
+351 −84 lib/Doctrine/Common/Annotations/DocParser.php
+136 −85 lib/Doctrine/Common/Annotations/PhpParser.php
+155 −0 lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php
+80 −0 lib/Doctrine/Common/Cache/APCCache.php
+15 −25 lib/Doctrine/Common/Cache/ApcCache.php
+15 −18 lib/Doctrine/Common/Cache/ArrayCache.php
+0 −1 lib/Doctrine/Common/Cache/Cache.php
+53 −100 lib/Doctrine/Common/Cache/CacheProvider.php
+17 −37 lib/Doctrine/Common/Cache/MemcacheCache.php
+103 −0 lib/Doctrine/Common/Cache/MemcachedCache.php
+76 −0 lib/Doctrine/Common/Cache/WinCacheCache.php
+18 −30 lib/Doctrine/Common/Cache/XcacheCache.php
+13 −17 lib/Doctrine/Common/Cache/ZendDataCache.php
+20 −19 lib/Doctrine/Common/ClassLoader.php
+7 −1 lib/Doctrine/Common/Collections/ArrayCollection.php
+1 −1 lib/Doctrine/Common/Collections/Collection.php
+43 −0 lib/Doctrine/Common/Comparable.php
+167 −0 lib/Doctrine/Common/DateTime/DateTime.php
+81 −0 lib/Doctrine/Common/DateTime/DateTimeFactory.php
+41 −0 lib/Doctrine/Common/DateTime/ImmutableException.php
+0 −2 lib/Doctrine/Common/EventManager.php
+1 −1 lib/Doctrine/Common/EventSubscriber.php
+12 −12 lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php
+4 −4 lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php
+10 −10 lib/Doctrine/Common/Persistence/ObjectManager.php
+4 −4 lib/Doctrine/Common/Persistence/ObjectRepository.php
+3 −2 lib/Doctrine/Common/Util/Debug.php
+1 −1 lib/Doctrine/Common/Version.php
+147 −2 tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php
+3 −3 tests/Doctrine/Tests/Common/Annotations/CachedReaderTest.php
+720 −10 tests/Doctrine/Tests/Common/Annotations/DocParserTest.php
+10 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/AnnotWithDefaultValue.php
+1 −2 tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Autoload.php
+5 −3 tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Route.php
+1 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Secure.php
+1 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Template.php
+14 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationTargetAll.php
+14 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationTargetAnnotation.php
+15 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationTargetClass.php
+15 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationTargetMethod.php
+14 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationTargetPropertyMethod.php
+119 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithAttributes.php
+50 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithRequiredAttributes.php
+24 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithRequiredAttributesWithoutContructor.php
+11 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithTargetSyntaxError.php
+62 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithVarType.php
+21 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithAnnotationWithTargetSyntaxError.php
+31 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithAnnotationWithVarType.php
+11 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithFullyQualifiedUseStatements.php
+17 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithInvalidAnnotationTargetAtClass.php
+20 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithInvalidAnnotationTargetAtMethod.php
+24 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithInvalidAnnotationTargetAtProperty.php
+41 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithValidAnnotationTarget.php
+15 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/DifferentNamespacesPerFileWithClassAsFirst.php
+15 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/DifferentNamespacesPerFileWithClassAsLast.php
+13 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/EqualNamespacesPerFileWithClassAsFirst.php
+12 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/EqualNamespacesPerFileWithClassAsLast.php
+12 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/GlobalNamespacesPerFileWithClassAsFirst.php
+12 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/GlobalNamespacesPerFileWithClassAsLast.php
+14 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/InvalidAnnotationUsageButIgnoredClass.php
+10 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/InvalidAnnotationUsageClass.php
+20 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/NamespaceAndClassCommentedOut.php
+15 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/NamespaceWithClosureDeclaration.php
+1,009 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/NamespacedSingleClassLOC1000.php
+5 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/NoAnnotation.php
+1,006 −0 tests/Doctrine/Tests/Common/Annotations/Fixtures/SingleClassLOC1000.php
+37 −3 tests/Doctrine/Tests/Common/Annotations/PerformanceTest.php
+131 −12 tests/Doctrine/Tests/Common/Annotations/PhpParserTest.php
+0 −258 tests/Doctrine/Tests/Common/Annotations/Regression/BCAnnotationReaderTest.php
+43 −0 tests/Doctrine/Tests/Common/Annotations/SimpleAnnotationReaderTest.php
+12 −13 tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM55Test.php
+8 −0 tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM58Entity.php
+119 −0 tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM58Test.php
+1 −0 tests/Doctrine/Tests/Common/Annotations/TopLevelAnnotation.php
+8 −39 tests/Doctrine/Tests/Common/Cache/CacheTest.php
+31 −0 tests/Doctrine/Tests/Common/Cache/MemcachedCacheTest.php
+20 −0 tests/Doctrine/Tests/Common/Cache/WinCacheCacheTest.php
+1 −22 tests/Doctrine/Tests/Common/Cache/ZendDataCacheTest.php
+42 −0 tests/Doctrine/Tests/Common/DateTime/DateTimeFactoryTest.php
+105 −0 tests/Doctrine/Tests/Common/DateTime/DateTimeTest.php
+4 −0 tests/Doctrine/Tests/TestInit.php
@@ -15,7 +15,7 @@ class CompanyCar
private $id;
/**
- * @Column(type="string", length="50")
+ * @Column(type="string", length=50)
*/
private $brand;
@@ -9,7 +9,7 @@
class CompanyManager extends CompanyEmployee
{
/**
- * @Column(type="string", length="250")
+ * @Column(type="string", length=250)
*/
private $title;
@@ -22,7 +22,7 @@ class ECommerceProduct
private $id;
/**
- * @Column(type="string", length=50, nullable="true")
+ * @Column(type="string", length=50, nullable=true)
*/
private $name;
Oops, something went wrong.

3 comments on commit 3bb803f

Owner

beberlei replied Jan 18, 2012

I dot know how, but this commit here broke http://www.doctrine-project.org/jira/browse/DDC-1609

What? This is just weird...

Owner

FabioBatSilva replied Jan 18, 2012

This is realy weird
I got the same problem some times ago running the test suite on postgres.
#194

Please sign in to comment.