Selaa lähdekoodia

merged branch schmittjoh/annotationUpdate (PR #1483)

Commits
-------

1cc1027 added @Annotation to UniqueEntity
ee22c5d added a note to update file
efcb435 updated to doctrine changes

Discussion
----------

updated to doctrine changes

---------------------------------------------------------------------------

by excelwebzone at 2011/06/30 06:29:23 -0700

Should also be implemented to the Route class and to all SensioFrameworkExtraBundle annotation classes
Fabien Potencier 14 vuotta sitten
vanhempi
commit
1cf3bc4891
34 muutettua tiedostoa jossa 38 lisäystä ja 0 poistoa
  1. 5 0
      UPDATE.md
  2. 1 0
      src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntity.php
  3. 1 0
      src/Symfony/Component/Validator/Constraints/All.php
  4. 1 0
      src/Symfony/Component/Validator/Constraints/Blank.php
  5. 1 0
      src/Symfony/Component/Validator/Constraints/Callback.php
  6. 1 0
      src/Symfony/Component/Validator/Constraints/Choice.php
  7. 1 0
      src/Symfony/Component/Validator/Constraints/Collection.php
  8. 1 0
      src/Symfony/Component/Validator/Constraints/Country.php
  9. 1 0
      src/Symfony/Component/Validator/Constraints/Date.php
  10. 1 0
      src/Symfony/Component/Validator/Constraints/DateTime.php
  11. 1 0
      src/Symfony/Component/Validator/Constraints/Email.php
  12. 1 0
      src/Symfony/Component/Validator/Constraints/False.php
  13. 1 0
      src/Symfony/Component/Validator/Constraints/File.php
  14. 1 0
      src/Symfony/Component/Validator/Constraints/GroupSequence.php
  15. 1 0
      src/Symfony/Component/Validator/Constraints/Image.php
  16. 1 0
      src/Symfony/Component/Validator/Constraints/Ip.php
  17. 1 0
      src/Symfony/Component/Validator/Constraints/Language.php
  18. 1 0
      src/Symfony/Component/Validator/Constraints/Locale.php
  19. 1 0
      src/Symfony/Component/Validator/Constraints/Max.php
  20. 1 0
      src/Symfony/Component/Validator/Constraints/MaxLength.php
  21. 1 0
      src/Symfony/Component/Validator/Constraints/Min.php
  22. 1 0
      src/Symfony/Component/Validator/Constraints/MinLength.php
  23. 1 0
      src/Symfony/Component/Validator/Constraints/NotBlank.php
  24. 1 0
      src/Symfony/Component/Validator/Constraints/NotNull.php
  25. 1 0
      src/Symfony/Component/Validator/Constraints/Null.php
  26. 1 0
      src/Symfony/Component/Validator/Constraints/Regex.php
  27. 1 0
      src/Symfony/Component/Validator/Constraints/Time.php
  28. 1 0
      src/Symfony/Component/Validator/Constraints/True.php
  29. 1 0
      src/Symfony/Component/Validator/Constraints/Type.php
  30. 1 0
      src/Symfony/Component/Validator/Constraints/Url.php
  31. 1 0
      src/Symfony/Component/Validator/Constraints/Valid.php
  32. 1 0
      tests/Symfony/Tests/Component/Validator/Fixtures/ConstraintA.php
  33. 1 0
      tests/Symfony/Tests/Component/Validator/Fixtures/ConstraintB.php
  34. 1 0
      tests/Symfony/Tests/Component/Validator/Fixtures/ConstraintC.php

+ 5 - 0
UPDATE.md

@@ -6,6 +6,11 @@ one. It only discusses changes that need to be done when using the "public"
 API of the framework. If you "hack" the core, you should probably follow the
 API of the framework. If you "hack" the core, you should probably follow the
 timeline closely anyway.
 timeline closely anyway.
 
 
+RC3 to RC4
+----------
+* Annotation classes must be annotated with @Annotation 
+  (see the validator constraints for examples)
+
 beta5 to RC1
 beta5 to RC1
 ------------
 ------------
 
 

+ 1 - 0
src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntity.php

@@ -18,6 +18,7 @@ use Symfony\Component\Validator\Exception\UnexpectedTypeException;
 /**
 /**
  * Constraint for the Unique Entity validator
  * Constraint for the Unique Entity validator
  *
  *
+ * @Annotation
  * @author Benjamin Eberlei <kontakt@beberlei.de>
  * @author Benjamin Eberlei <kontakt@beberlei.de>
  */
  */
 class UniqueEntity extends Constraint
 class UniqueEntity extends Constraint

+ 1 - 0
src/Symfony/Component/Validator/Constraints/All.php

@@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class All extends Constraint
 class All extends Constraint
 {
 {
     public $constraints = array();
     public $constraints = array();

+ 1 - 0
src/Symfony/Component/Validator/Constraints/Blank.php

@@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class Blank extends Constraint
 class Blank extends Constraint
 {
 {
     public $message = 'This value should be blank';
     public $message = 'This value should be blank';

+ 1 - 0
src/Symfony/Component/Validator/Constraints/Callback.php

@@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class Callback extends Constraint
 class Callback extends Constraint
 {
 {
     public $methods;
     public $methods;

+ 1 - 0
src/Symfony/Component/Validator/Constraints/Choice.php

@@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class Choice extends Constraint
 class Choice extends Constraint
 {
 {
     public $choices;
     public $choices;

+ 1 - 0
src/Symfony/Component/Validator/Constraints/Collection.php

@@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class Collection extends Constraint
 class Collection extends Constraint
 {
 {
     public $fields;
     public $fields;

+ 1 - 0
src/Symfony/Component/Validator/Constraints/Country.php

@@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class Country extends Constraint
 class Country extends Constraint
 {
 {
     public $message = 'This value is not a valid country';
     public $message = 'This value is not a valid country';

+ 1 - 0
src/Symfony/Component/Validator/Constraints/Date.php

@@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class Date extends Constraint
 class Date extends Constraint
 {
 {
     public $message = 'This value is not a valid date';
     public $message = 'This value is not a valid date';

+ 1 - 0
src/Symfony/Component/Validator/Constraints/DateTime.php

@@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class DateTime extends Constraint
 class DateTime extends Constraint
 {
 {
     public $message = 'This value is not a valid datetime';
     public $message = 'This value is not a valid datetime';

+ 1 - 0
src/Symfony/Component/Validator/Constraints/Email.php

@@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class Email extends Constraint
 class Email extends Constraint
 {
 {
     public $message = 'This value is not a valid email address';
     public $message = 'This value is not a valid email address';

+ 1 - 0
src/Symfony/Component/Validator/Constraints/False.php

@@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class False extends Constraint
 class False extends Constraint
 {
 {
     public $message = 'This value should be false';
     public $message = 'This value should be false';

+ 1 - 0
src/Symfony/Component/Validator/Constraints/File.php

@@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class File extends Constraint
 class File extends Constraint
 {
 {
     public $maxSize = null;
     public $maxSize = null;

+ 1 - 0
src/Symfony/Component/Validator/Constraints/GroupSequence.php

@@ -14,6 +14,7 @@ namespace Symfony\Component\Validator\Constraints;
 /**
 /**
  * Annotation for group sequences
  * Annotation for group sequences
  *
  *
+ * @Annotation
  * @author Bernhard Schussek <bernhard.schussek@symfony.com>
  * @author Bernhard Schussek <bernhard.schussek@symfony.com>
  */
  */
 class GroupSequence
 class GroupSequence

+ 1 - 0
src/Symfony/Component/Validator/Constraints/Image.php

@@ -11,6 +11,7 @@
 
 
 namespace Symfony\Component\Validator\Constraints;
 namespace Symfony\Component\Validator\Constraints;
 
 
+/** @Annotation */
 class Image extends File
 class Image extends File
 {
 {
     public $mimeTypes = array(
     public $mimeTypes = array(

+ 1 - 0
src/Symfony/Component/Validator/Constraints/Ip.php

@@ -17,6 +17,7 @@ use Symfony\Component\Validator\Constraint;
 /**
 /**
  * Validates that a value is a valid IP address
  * Validates that a value is a valid IP address
  *
  *
+ * @Annotation
  * @author Bernhard Schussek <bernhard.schussek@symfony.com>
  * @author Bernhard Schussek <bernhard.schussek@symfony.com>
  * @author Joseph Bielawski <stloyd@gmail.com>
  * @author Joseph Bielawski <stloyd@gmail.com>
  */
  */

+ 1 - 0
src/Symfony/Component/Validator/Constraints/Language.php

@@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class Language extends Constraint
 class Language extends Constraint
 {
 {
     public $message = 'This value is not a valid language';
     public $message = 'This value is not a valid language';

+ 1 - 0
src/Symfony/Component/Validator/Constraints/Locale.php

@@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class Locale extends Constraint
 class Locale extends Constraint
 {
 {
     public $message = 'This value is not a valid locale';
     public $message = 'This value is not a valid locale';

+ 1 - 0
src/Symfony/Component/Validator/Constraints/Max.php

@@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class Max extends Constraint
 class Max extends Constraint
 {
 {
     public $message = 'This value should be {{ limit }} or less';
     public $message = 'This value should be {{ limit }} or less';

+ 1 - 0
src/Symfony/Component/Validator/Constraints/MaxLength.php

@@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class MaxLength extends Constraint
 class MaxLength extends Constraint
 {
 {
     public $message = 'This value is too long. It should have {{ limit }} characters or less';
     public $message = 'This value is too long. It should have {{ limit }} characters or less';

+ 1 - 0
src/Symfony/Component/Validator/Constraints/Min.php

@@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class Min extends Constraint
 class Min extends Constraint
 {
 {
     public $message = 'This value should be {{ limit }} or more';
     public $message = 'This value should be {{ limit }} or more';

+ 1 - 0
src/Symfony/Component/Validator/Constraints/MinLength.php

@@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class MinLength extends Constraint
 class MinLength extends Constraint
 {
 {
     public $message = 'This value is too short. It should have {{ limit }} characters or more';
     public $message = 'This value is too short. It should have {{ limit }} characters or more';

+ 1 - 0
src/Symfony/Component/Validator/Constraints/NotBlank.php

@@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class NotBlank extends Constraint
 class NotBlank extends Constraint
 {
 {
     public $message = 'This value should not be blank';
     public $message = 'This value should not be blank';

+ 1 - 0
src/Symfony/Component/Validator/Constraints/NotNull.php

@@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class NotNull extends Constraint
 class NotNull extends Constraint
 {
 {
     public $message = 'This value should not be null';
     public $message = 'This value should not be null';

+ 1 - 0
src/Symfony/Component/Validator/Constraints/Null.php

@@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class Null extends Constraint
 class Null extends Constraint
 {
 {
     public $message = 'This value should be null';
     public $message = 'This value should be null';

+ 1 - 0
src/Symfony/Component/Validator/Constraints/Regex.php

@@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class Regex extends Constraint
 class Regex extends Constraint
 {
 {
     public $message = 'This value is not valid';
     public $message = 'This value is not valid';

+ 1 - 0
src/Symfony/Component/Validator/Constraints/Time.php

@@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class Time extends Constraint
 class Time extends Constraint
 {
 {
     public $message = 'This value is not a valid time';
     public $message = 'This value is not a valid time';

+ 1 - 0
src/Symfony/Component/Validator/Constraints/True.php

@@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class True extends Constraint
 class True extends Constraint
 {
 {
     public $message = 'This value should be true';
     public $message = 'This value should be true';

+ 1 - 0
src/Symfony/Component/Validator/Constraints/Type.php

@@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class Type extends Constraint
 class Type extends Constraint
 {
 {
     public $message = 'This value should be of type {{ type }}';
     public $message = 'This value should be of type {{ type }}';

+ 1 - 0
src/Symfony/Component/Validator/Constraints/Url.php

@@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class Url extends Constraint
 class Url extends Constraint
 {
 {
     public $message = 'This value is not a valid URL';
     public $message = 'This value is not a valid URL';

+ 1 - 0
src/Symfony/Component/Validator/Constraints/Valid.php

@@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class Valid extends Constraint
 class Valid extends Constraint
 {
 {
     public $traverse = true;
     public $traverse = true;

+ 1 - 0
tests/Symfony/Tests/Component/Validator/Fixtures/ConstraintA.php

@@ -4,6 +4,7 @@ namespace Symfony\Tests\Component\Validator\Fixtures;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class ConstraintA extends Constraint
 class ConstraintA extends Constraint
 {
 {
     public $property1;
     public $property1;

+ 1 - 0
tests/Symfony/Tests/Component/Validator/Fixtures/ConstraintB.php

@@ -4,6 +4,7 @@ namespace Symfony\Tests\Component\Validator\Fixtures;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class ConstraintB extends Constraint {
 class ConstraintB extends Constraint {
 
 
     public function getTargets()
     public function getTargets()

+ 1 - 0
tests/Symfony/Tests/Component/Validator/Fixtures/ConstraintC.php

@@ -4,6 +4,7 @@ namespace Symfony\Tests\Component\Validator\Fixtures;
 
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraint;
 
 
+/** @Annotation */
 class ConstraintC extends Constraint
 class ConstraintC extends Constraint
 {
 {
     public $option1;
     public $option1;