Browse files

adds spaces

  • Loading branch information...
1 parent 2bbfeee commit 14cabb36ad4501820ac5313cbf2f2b108438b09e @FabioBatSilva FabioBatSilva committed Aug 28, 2011
Showing with 6 additions and 38 deletions.
  1. +0 −32 UPGRADE_TO_2_2
  2. +6 −6 lib/Doctrine/Common/Annotations/DocParser.php
View
32 UPGRADE_TO_2_2
@@ -34,38 +34,6 @@ updating your project from Doctrine Common 2.1 to 2.2:
AnnotationReader::addGlobalIgnoredName (the exception message will contain detailed
instructions when you run into this problem).
-- The annotation parser has support for classes without constructor parameters
- If not has a constructor will inject values into public properties
-
-- The annotation parser has support for the @Target annotation
- That can be used to signal to the parser to check the annotation target during the parsing process.
- Usage is as follows:
- @Target("CLASS") for a single target
- @Target({"CLASS", "METHOD", "PROPERTY", "ANNOTATION"}) for multiple targets
-
-- The annotation parser will validate the type of the attributes of an annotation when not using the constructor parameters.
- Parser will look for the attribute type declared in the annotation @ var and validate the input with that type.
- Usage is as follows for a simple type:
- /** @var string */
- public $stringAttrib;
- /** @var Fully\Qualified\AnnotationClass */
- public $annotAttrib;
- Usage is as follows for a array with type, like java generics:
- /** @var array<integer> */
- public $arrayOfIntegersAttrib;
- /** @var array<Fully\Qualified\AnnotationClass> */
- public $arrayOfAnnotationsAttrib;
-
-- The annotation parser will validate the type of the attributes of an annotation when using @Attributes.
- Parser will look for all @Attribute in @Attributes declared at annotation class doc block and validate the input with that type.
- Usage is as follows:
- @Attributes({
- @Attribute("stringAttrib", type = "string"),
- @Attribute("annotAttrib", type = "Fully\Qualified\AnnotationClass"),
- @Attribute("arrayOfAnnotationsAttrib", type = "array<Fully\Qualified\AnnotationClass>"),
- })
-
-
## Cache Changes
- Renamed old AbstractCache to CacheProvider
View
12 lib/Doctrine/Common/Annotations/DocParser.php
@@ -374,7 +374,7 @@ private function classExists($fqcn)
*/
private function collectAnnotationMetadata($name)
{
- if(self::$metadataParser == null){
+ if (self::$metadataParser == null){
self::$metadataParser = new self();
self::$metadataParser->setTarget(Target::TARGET_CLASS);
self::$metadataParser->setIgnoreNotImportedAnnotations(true);
@@ -410,7 +410,7 @@ private function collectAnnotationMetadata($name)
$metadata['targets'] = $annotation->targets;
$metadata['targets_literal'] = $annotation->literal;
- }elseif ($annotation instanceof Attributes) {
+ } elseif ($annotation instanceof Attributes) {
foreach ($annotation->value as $attrib) {
// handle internal type declaration
$type = isset(self::$typeMap[$attrib->type]) ? self::$typeMap[$attrib->type] : $attrib->type;
@@ -634,15 +634,15 @@ private function Annotation()
}
foreach (self::$annotationMetadata[$name]['attribute_types'] as $property => $type) {
- if(!isset($values[$property])){
+ if (!isset($values[$property])){
$values[$property] = null;
}
- if($values[$property] === null){
- if ($type['required'] === true) {
+ if ($values[$property] === null){
+ if ($type['required']) {
throw AnnotationException::requiredError($property, $originalName, $this->context, 'a(n) '.$type['value']);
}
- }else{
+ } else {
if ($type['type'] === 'array') {
// Handle the case of a single value
if (!is_array($values[$property])) {

0 comments on commit 14cabb3

Please sign in to comment.