Browse files

fixed CS

  • Loading branch information...
1 parent 37eef83 commit 57d3b508c1522a1343f7b505b573c307e7ad0023 @fabpot fabpot committed Jul 9, 2012
Showing with 199 additions and 235 deletions.
  1. +2 −2 DataMapperInterface.php
  2. +2 −2 DataTransformerInterface.php
  3. +1 −1 Extension/Core/ChoiceList/ChoiceList.php
  4. +8 −8 Extension/Core/ChoiceList/ChoiceListInterface.php
  5. +0 −1 Extension/Core/ChoiceList/SimpleChoiceList.php
  6. +1 −0 Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php
  7. +1 −1 Extension/Core/EventListener/FixCheckboxInputListener.php
  8. +1 −1 Extension/Core/EventListener/FixRadioInputListener.php
  9. +1 −1 Extension/Core/EventListener/FixUrlProtocolListener.php
  10. +1 −1 Extension/Core/EventListener/MergeCollectionListener.php
  11. +1 −1 Extension/Core/EventListener/ResizeFormListener.php
  12. +1 −1 Extension/Core/EventListener/TrimListener.php
  13. +0 −1 Extension/Core/Type/FormType.php
  14. +1 −1 Extension/Core/Type/MoneyType.php
  15. +0 −1 Extension/Core/Type/PasswordType.php
  16. +2 −2 Extension/Core/Type/TimezoneType.php
  17. +2 −2 Extension/Csrf/CsrfProvider/CsrfProviderInterface.php
  18. +1 −1 Extension/Csrf/EventListener/CsrfValidationListener.php
  19. +1 −1 Extension/Validator/EventListener/ValidationListener.php
  20. +0 −1 Extension/Validator/ViolationMapper/MappingRule.php
  21. +1 −1 Extension/Validator/ViolationMapper/ViolationMapperInterface.php
  22. +0 −2 Extension/Validator/ViolationMapper/ViolationPath.php
  23. +0 −1 Extension/Validator/ViolationMapper/ViolationPathIterator.php
  24. +0 −1 Form.php
  25. +0 −1 FormBuilder.php
  26. +11 −11 FormBuilderInterface.php
  27. +2 −2 FormConfig.php
  28. +21 −21 FormConfigEditorInterface.php
  29. +24 −24 FormConfigInterface.php
  30. +5 −5 FormExtensionInterface.php
  31. +9 −9 FormFactoryInterface.php
  32. +28 −28 FormInterface.php
  33. +5 −5 FormTypeExtensionInterface.php
  34. +5 −5 FormTypeGuesserInterface.php
  35. +9 −9 FormTypeInterface.php
  36. +1 −1 FormValidatorInterface.php
  37. +16 −16 FormViewInterface.php
  38. +1 −1 Guess/Guess.php
  39. +0 −1 Tests/AbstractFormTest.php
  40. +0 −1 Tests/AbstractLayoutTest.php
  41. +0 −6 Tests/CompoundFormTest.php
  42. +0 −1 Tests/Extension/Core/DataMapper/PropertyPathMapperTest.php
  43. +6 −6 Tests/Extension/Core/DataTransformer/DateTimeToArrayTransformerTest.php
  44. +0 −1 Tests/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformerTest.php
  45. +0 −1 Tests/Extension/Core/EventListener/MergeCollectionListenerTest.php
  46. +0 −1 Tests/Extension/Core/Type/ChoiceTypeTest.php
  47. +6 −8 Tests/Extension/Core/Type/DateTimeTypeTest.php
  48. +0 −1 Tests/Extension/Core/Type/DateTypeTest.php
  49. +0 −1 Tests/Extension/Core/Type/PasswordTypeTest.php
  50. +0 −1 Tests/Extension/Core/Type/RepeatedTypeTest.php
  51. +6 −6 Tests/Extension/Core/Type/TimeTypeTest.php
  52. +0 −1 Tests/Extension/Validator/Constraints/FormValidatorTest.php
  53. +0 −3 Tests/Extension/Validator/EventListener/ValidationListenerTest.php
  54. +0 −1 Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php
  55. +0 −1 Tests/Extension/Validator/ViolationMapper/ViolationPathTest.php
  56. +0 −4 Tests/SimpleFormTest.php
  57. +1 −2 UnmodifiableFormConfig.php
  58. +5 −5 Util/FormUtil.php
  59. +8 −8 Util/PropertyPathInterface.php
  60. +2 −2 Util/PropertyPathIteratorInterface.php
View
4 DataMapperInterface.php
@@ -24,7 +24,7 @@
*
* @throws Exception\UnexpectedTypeException if the type of the data parameter is not supported.
*/
- function mapDataToForms($data, array $forms);
+ public function mapDataToForms($data, array $forms);
/**
* Maps the data of a list of forms into the properties of some data.
@@ -34,5 +34,5 @@ function mapDataToForms($data, array $forms);
*
* @throws Exception\UnexpectedTypeException if the type of the data parameter is not supported.
*/
- function mapFormsToData(array $forms, &$data);
+ public function mapFormsToData(array $forms, &$data);
}
View
4 DataTransformerInterface.php
@@ -46,7 +46,7 @@
* @throws UnexpectedTypeException when the argument is not a string
* @throws TransformationFailedException when the transformation fails
*/
- function transform($value);
+ public function transform($value);
/**
* Transforms a value from the transformed representation to its original
@@ -73,5 +73,5 @@ function transform($value);
* @throws UnexpectedTypeException when the argument is not of the expected type
* @throws TransformationFailedException when the transformation fails
*/
- function reverseTransform($value);
+ public function reverseTransform($value);
}
View
2 Extension/Core/ChoiceList/ChoiceList.php
@@ -335,7 +335,7 @@ protected function addChoice(&$bucketForPreferred, &$bucketForRemaining, $choice
{
$index = $this->createIndex($choice);
- if ('' === $index || null === $index || !FormConfig::isValidName((string)$index)) {
+ if ('' === $index || null === $index || !FormConfig::isValidName((string) $index)) {
throw new InvalidConfigurationException('The index "' . $index . '" created by the choice list is invalid. It should be a valid, non-empty Form name.');
}
View
16 Extension/Core/ChoiceList/ChoiceListInterface.php
@@ -33,14 +33,14 @@
*
* @return array The choices with their indices as keys.
*/
- function getChoices();
+ public function getChoices();
/**
* Returns the values for the choices
*
* @return array The values with the corresponding choice indices as keys.
*/
- function getValues();
+ public function getValues();
/**
* Returns the choice views of the preferred choices as nested array with
@@ -64,7 +64,7 @@ function getValues();
* choice indices as keys on the lowest levels and the choice
* group names in the keys of the higher levels.
*/
- function getPreferredViews();
+ public function getPreferredViews();
/**
* Returns the choice views of the choices that are not preferred as nested
@@ -90,7 +90,7 @@ function getPreferredViews();
*
* @see getPreferredValues
*/
- function getRemainingViews();
+ public function getRemainingViews();
/**
* Returns the choices corresponding to the given values.
@@ -100,7 +100,7 @@ function getRemainingViews();
*
* @return array An array of choices with ascending, 0-based numeric keys
*/
- function getChoicesForValues(array $values);
+ public function getChoicesForValues(array $values);
/**
* Returns the values corresponding to the given choices.
@@ -111,7 +111,7 @@ function getChoicesForValues(array $values);
* @return array An array of choice values with ascending, 0-based numeric
* keys
*/
- function getValuesForChoices(array $choices);
+ public function getValuesForChoices(array $choices);
/**
* Returns the indices corresponding to the given choices.
@@ -121,7 +121,7 @@ function getValuesForChoices(array $choices);
*
* @return array An array of indices with ascending, 0-based numeric keys
*/
- function getIndicesForChoices(array $choices);
+ public function getIndicesForChoices(array $choices);
/**
* Returns the indices corresponding to the given values.
@@ -131,5 +131,5 @@ function getIndicesForChoices(array $choices);
*
* @return array An array of indices with ascending, 0-based numeric keys
*/
- function getIndicesForValues(array $values);
+ public function getIndicesForValues(array $values);
}
View
1 Extension/Core/ChoiceList/SimpleChoiceList.php
@@ -11,7 +11,6 @@
namespace Symfony\Component\Form\Extension\Core\ChoiceList;
-
use Symfony\Component\Form\Exception\UnexpectedTypeException;
/**
View
1 Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php
@@ -159,6 +159,7 @@ protected function getIntlDateFormatter()
$intlDateFormatter = new \IntlDateFormatter(\Locale::getDefault(), $dateFormat, $timeFormat, $timezone, $calendar, $pattern);
$intlDateFormatter->setLenient(false);
+
return $intlDateFormatter;
}
}
View
2 Extension/Core/EventListener/FixCheckboxInputListener.php
@@ -44,7 +44,7 @@ public function preBind(FormEvent $event)
$event->setData(count($indices) > 0 ? array_combine($indices, $values) : array());
}
- static public function getSubscribedEvents()
+ public static function getSubscribedEvents()
{
return array(FormEvents::PRE_BIND => 'preBind');
}
View
2 Extension/Core/EventListener/FixRadioInputListener.php
@@ -44,7 +44,7 @@ public function preBind(FormEvent $event)
$event->setData(false !== $index ? array($index => $value) : array());
}
- static public function getSubscribedEvents()
+ public static function getSubscribedEvents()
{
return array(FormEvents::PRE_BIND => 'preBind');
}
View
2 Extension/Core/EventListener/FixUrlProtocolListener.php
@@ -38,7 +38,7 @@ public function onBind(FormEvent $event)
}
}
- static public function getSubscribedEvents()
+ public static function getSubscribedEvents()
{
return array(FormEvents::BIND => 'onBind');
}
View
2 Extension/Core/EventListener/MergeCollectionListener.php
@@ -47,7 +47,7 @@ public function __construct($allowAdd = false, $allowDelete = false)
$this->allowDelete = $allowDelete;
}
- static public function getSubscribedEvents()
+ public static function getSubscribedEvents()
{
return array(
FormEvents::BIND => 'onBind',
View
2 Extension/Core/EventListener/ResizeFormListener.php
@@ -60,7 +60,7 @@ public function __construct(FormFactoryInterface $factory, $type, array $options
$this->options = $options;
}
- static public function getSubscribedEvents()
+ public static function getSubscribedEvents()
{
return array(
FormEvents::PRE_SET_DATA => 'preSetData',
View
2 Extension/Core/EventListener/TrimListener.php
@@ -31,7 +31,7 @@ public function preBind(FormEvent $event)
}
}
- static public function getSubscribedEvents()
+ public static function getSubscribedEvents()
{
return array(FormEvents::PRE_BIND => 'preBind');
}
View
1 Extension/Core/Type/FormType.php
@@ -12,7 +12,6 @@
namespace Symfony\Component\Form\Extension\Core\Type;
use Symfony\Component\Form\AbstractType;
-use Symfony\Component\Form\Util\PropertyPath;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormInterface;
View
2 Extension/Core/Type/MoneyType.php
@@ -81,7 +81,7 @@ public function getName()
* The pattern contains the placeholder "{{ widget }}" where the HTML tag should
* be inserted
*/
- static private function getPattern($currency)
+ private static function getPattern($currency)
{
if (!$currency) {
return '{{ widget }}';
View
1 Extension/Core/Type/PasswordType.php
@@ -13,7 +13,6 @@
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormInterface;
-use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormViewInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
View
4 Extension/Core/Type/TimezoneType.php
@@ -20,7 +20,7 @@ class TimezoneType extends AbstractType
* Stores the available timezone choices
* @var array
*/
- static private $timezones;
+ private static $timezones;
/**
* {@inheritdoc}
@@ -58,7 +58,7 @@ public function getName()
*
* @return array The timezone choices
*/
- static public function getTimezones()
+ public static function getTimezones()
{
if (null === static::$timezones) {
static::$timezones = array();
View
4 Extension/Csrf/CsrfProvider/CsrfProviderInterface.php
@@ -35,7 +35,7 @@
* @param string $intention Some value that identifies the action intention
* (i.e. "authenticate"). Doesn't have to be a secret value.
*/
- function generateCsrfToken($intention);
+ public function generateCsrfToken($intention);
/**
* Validates a CSRF token.
@@ -45,5 +45,5 @@ function generateCsrfToken($intention);
*
* @return Boolean Whether the token supplied by the browser is correct
*/
- function isCsrfTokenValid($intention, $token);
+ public function isCsrfTokenValid($intention, $token);
}
View
2 Extension/Csrf/EventListener/CsrfValidationListener.php
@@ -44,7 +44,7 @@ class CsrfValidationListener implements EventSubscriberInterface
*/
private $intention;
- static public function getSubscribedEvents()
+ public static function getSubscribedEvents()
{
return array(
FormEvents::PRE_BIND => 'preBind',
View
2 Extension/Validator/EventListener/ValidationListener.php
@@ -30,7 +30,7 @@ class ValidationListener implements EventSubscriberInterface
/**
* {@inheritdoc}
*/
- static public function getSubscribedEvents()
+ public static function getSubscribedEvents()
{
return array(FormEvents::POST_BIND => 'validateForm');
}
View
1 Extension/Validator/ViolationMapper/MappingRule.php
@@ -12,7 +12,6 @@
namespace Symfony\Component\Form\Extension\Validator\ViolationMapper;
use Symfony\Component\Form\FormInterface;
-use Symfony\Component\Form\Util\PropertyPathInterface;
use Symfony\Component\Form\Exception\ErrorMappingException;
/**
View
2 Extension/Validator/ViolationMapper/ViolationMapperInterface.php
@@ -29,5 +29,5 @@
* @param Boolean $allowNonSynchronized Whether to allow
* mapping to non-synchronized forms.
*/
- function mapViolation(ConstraintViolation $violation, FormInterface $form, $allowNonSynchronized = false);
+ public function mapViolation(ConstraintViolation $violation, FormInterface $form, $allowNonSynchronized = false);
}
View
2 Extension/Validator/ViolationMapper/ViolationPath.php
@@ -12,7 +12,6 @@
namespace Symfony\Component\Form\Extension\Validator\ViolationMapper;
use Symfony\Component\Form\Util\PropertyPath;
-use Symfony\Component\Form\Util\PropertyPathIterator;
use Symfony\Component\Form\Util\PropertyPathInterface;
/**
@@ -232,7 +231,6 @@ public function mapsForm($index)
return $this->mapsForm[$index];
}
-
/**
* Returns a new iterator for this path
*
View
1 Extension/Validator/ViolationMapper/ViolationPathIterator.php
@@ -12,7 +12,6 @@
namespace Symfony\Component\Form\Extension\Validator\ViolationMapper;
use Symfony\Component\Form\Util\PropertyPathIterator;
-use Symfony\Component\Form\Util\PropertyPath;
/**
* @author Bernhard Schussek <bschussek@gmail.com>
View
1 Form.php
@@ -18,7 +18,6 @@
use Symfony\Component\Form\Util\FormUtil;
use Symfony\Component\Form\Util\PropertyPath;
use Symfony\Component\HttpFoundation\Request;
-use Symfony\Component\EventDispatcher\EventDispatcherInterface;
/**
* Form represents a form.
View
1 FormBuilder.php
@@ -15,7 +15,6 @@
use Symfony\Component\Form\Exception\UnexpectedTypeException;
use Symfony\Component\Form\Exception\CircularReferenceException;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
-use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/**
* A builder for creating {@link Form} instances.
View
22 FormBuilderInterface.php
@@ -29,7 +29,7 @@
*
* @return FormBuilderInterface The builder object.
*/
- function add($child, $type = null, array $options = array());
+ public function add($child, $type = null, array $options = array());
/**
* Creates a form builder.
@@ -40,7 +40,7 @@ function add($child, $type = null, array $options = array());
*
* @return FormBuilderInterface The created builder.
*/
- function create($name, $type = null, array $options = array());
+ public function create($name, $type = null, array $options = array());
/**
* Returns a child by name.
@@ -51,15 +51,15 @@ function create($name, $type = null, array $options = array());
*
* @throws Exception\FormException if the given child does not exist
*/
- function get($name);
+ public function get($name);
/**
* Removes the field with the given name.
*
* @param string $name
*
* @return FormBuilderInterface The builder object.
*/
- function remove($name);
+ public function remove($name);
/**
* Returns whether a field with the given name exists.
@@ -68,28 +68,28 @@ function remove($name);
*
* @return Boolean
*/
- function has($name);
+ public function has($name);
/**
* Returns the children.
*
* @return array
*/
- function all();
+ public function all();
/**
* Returns the associated form factory.
*
* @return FormFactoryInterface The factory
*/
- function getFormFactory();
+ public function getFormFactory();
/**
* Creates the form.
*
* @return Form The form
*/
- function getForm();
+ public function getForm();
/**
* Sets the parent builder.
@@ -98,19 +98,19 @@ function getForm();
*
* @return FormBuilderInterface The builder object.
*/
- function setParent(FormBuilderInterface $parent = null);
+ public function setParent(FormBuilderInterface $parent = null);
/**
* Returns the parent builder.
*
* @return FormBuilderInterface The parent builder
*/
- function getParent();
+ public function getParent();
/**
* Returns whether the builder has a parent.
*
* @return Boolean
*/
- function hasParent();
+ public function hasParent();
}
View
4 FormConfig.php
@@ -683,7 +683,7 @@ public function setData($data)
* @throws UnexpectedTypeException If the name is not a string.
* @throws \InvalidArgumentException If the name contains invalid characters.
*/
- static public function validateName($name)
+ public static function validateName($name)
{
if (!is_string($name)) {
throw new UnexpectedTypeException($name, 'string');
@@ -711,7 +711,7 @@ static public function validateName($name)
*
* @return Boolean Whether the name is valid.
*/
- static public function isValidName($name)
+ public static function isValidName($name)
{
return '' === $name || preg_match('/^[a-zA-Z0-9_][a-zA-Z0-9_\-:]*$/D', $name);
}
View
42 FormConfigEditorInterface.php
@@ -29,7 +29,7 @@
*
* @return self The configuration object.
*/
- function addEventListener($eventName, $listener, $priority = 0);
+ public function addEventListener($eventName, $listener, $priority = 0);
/**
* Adds an event subscriber for events on this form.
@@ -38,7 +38,7 @@ function addEventListener($eventName, $listener, $priority = 0);
*
* @return self The configuration object.
*/
- function addEventSubscriber(EventSubscriberInterface $subscriber);
+ public function addEventSubscriber(EventSubscriberInterface $subscriber);
/**
* Adds a validator to the form.
@@ -49,7 +49,7 @@ function addEventSubscriber(EventSubscriberInterface $subscriber);
*
* @deprecated Deprecated since version 2.1, to be removed in 2.3.
*/
- function addValidator(FormValidatorInterface $validator);
+ public function addValidator(FormValidatorInterface $validator);
/**
* Appends / prepends a transformer to the view transformer chain.
@@ -64,14 +64,14 @@ function addValidator(FormValidatorInterface $validator);
*
* @return self The configuration object.
*/
- function addViewTransformer(DataTransformerInterface $viewTransformer, $forcePrepend = false);
+ public function addViewTransformer(DataTransformerInterface $viewTransformer, $forcePrepend = false);
/**
* Clears the view transformers.
*
* @return self The configuration object.
*/
- function resetViewTransformers();
+ public function resetViewTransformers();
/**
* Prepends / appends a transformer to the normalization transformer chain.
@@ -86,14 +86,14 @@ function resetViewTransformers();
*
* @return self The configuration object.
*/
- function addModelTransformer(DataTransformerInterface $modelTransformer, $forceAppend = false);
+ public function addModelTransformer(DataTransformerInterface $modelTransformer, $forceAppend = false);
/**
* Clears the normalization transformers.
*
* @return self The configuration object.
*/
- function resetModelTransformers();
+ public function resetModelTransformers();
/**
* Sets the value for an attribute.
@@ -103,7 +103,7 @@ function resetModelTransformers();
*
* @return self The configuration object.
*/
- function setAttribute($name, $value);
+ public function setAttribute($name, $value);
/**
* Sets the attributes.
@@ -112,7 +112,7 @@ function setAttribute($name, $value);
*
* @return self The configuration object.
*/
- function setAttributes(array $attributes);
+ public function setAttributes(array $attributes);
/**
* Sets the data mapper used by the form.
@@ -121,7 +121,7 @@ function setAttributes(array $attributes);
*
* @return self The configuration object.
*/
- function setDataMapper(DataMapperInterface $dataMapper = null);
+ public function setDataMapper(DataMapperInterface $dataMapper = null);
/**
* Set whether the form is disabled.
@@ -130,7 +130,7 @@ function setDataMapper(DataMapperInterface $dataMapper = null);
*
* @return self The configuration object.
*/
- function setDisabled($disabled);
+ public function setDisabled($disabled);
/**
* Sets the data used for the client data when no value is bound.
@@ -139,7 +139,7 @@ function setDisabled($disabled);
*
* @return self The configuration object.
*/
- function setEmptyData($emptyData);
+ public function setEmptyData($emptyData);
/**
* Sets whether errors bubble up to the parent.
@@ -148,7 +148,7 @@ function setEmptyData($emptyData);
*
* @return self The configuration object.
*/
- function setErrorBubbling($errorBubbling);
+ public function setErrorBubbling($errorBubbling);
/**
* Sets whether this field is required to be filled out when bound.
@@ -157,7 +157,7 @@ function setErrorBubbling($errorBubbling);
*
* @return self The configuration object.
*/
- function setRequired($required);
+ public function setRequired($required);
/**
* Sets the property path that the form should be mapped to.
@@ -168,7 +168,7 @@ function setRequired($required);
*
* @return self The configuration object.
*/
- function setPropertyPath($propertyPath);
+ public function setPropertyPath($propertyPath);
/**
* Sets whether the form should be mapped to an element of its
@@ -178,7 +178,7 @@ function setPropertyPath($propertyPath);
*
* @return self The configuration object.
*/
- function setMapped($mapped);
+ public function setMapped($mapped);
/**
* Sets whether the form's data should be modified by reference.
@@ -188,7 +188,7 @@ function setMapped($mapped);
*
* @return self The configuration object.
*/
- function setByReference($byReference);
+ public function setByReference($byReference);
/**
* Sets whether the form should be virtual.
@@ -197,7 +197,7 @@ function setByReference($byReference);
*
* @return self The configuration object.
*/
- function setVirtual($virtual);
+ public function setVirtual($virtual);
/**
* Sets whether the form should be compound.
@@ -208,7 +208,7 @@ function setVirtual($virtual);
*
* @see FormConfigInterface::getCompound()
*/
- function setCompound($compound);
+ public function setCompound($compound);
/**
* Set the types.
@@ -217,7 +217,7 @@ function setCompound($compound);
*
* @return self The configuration object.
*/
- function setTypes(array $types);
+ public function setTypes(array $types);
/**
* Sets the initial data of the form.
@@ -226,5 +226,5 @@ function setTypes(array $types);
*
* @return self The configuration object.
*/
- function setData($data);
+ public function setData($data);
}
View
48 FormConfigInterface.php
@@ -23,36 +23,36 @@
*
* @return \Symfony\Component\EventDispatcher\EventDispatcherInterface The dispatcher.
*/
- function getEventDispatcher();
+ public function getEventDispatcher();
/**
* Returns the name of the form used as HTTP parameter.
*
* @return string The form name.
*/
- function getName();
+ public function getName();
/**
* Returns the property path that the form should be mapped to.
*
* @return Util\PropertyPath The property path.
*/
- function getPropertyPath();
+ public function getPropertyPath();
/**
* Returns whether the form should be mapped to an element of its
* parent's data.
*
* @return Boolean Whether the form is mapped.
*/
- function getMapped();
+ public function getMapped();
/**
* Returns whether the form's data should be modified by reference.
*
* @return Boolean Whether to modify the form's data by reference.
*/
- function getByReference();
+ public function getByReference();
/**
* Returns whether the form should be virtual.
@@ -63,7 +63,7 @@ function getByReference();
*
* @return Boolean Whether the form is virtual.
*/
- function getVirtual();
+ public function getVirtual();
/**
* Returns whether the form is compound.
@@ -74,35 +74,35 @@ function getVirtual();
*
* @return Boolean Whether the form is compound.
*/
- function getCompound();
+ public function getCompound();
/**
* Returns the form types used to construct the form.
*
* @return array An array of {@link FormTypeInterface} instances.
*/
- function getTypes();
+ public function getTypes();
/**
* Returns the view transformers of the form.
*
* @return array An array of {@link DataTransformerInterface} instances.
*/
- function getViewTransformers();
+ public function getViewTransformers();
/**
* Returns the model transformers of the form.
*
* @return array An array of {@link DataTransformerInterface} instances.
*/
- function getModelTransformers();
+ public function getModelTransformers();
/**
* Returns the data mapper of the form.
*
* @return DataMapperInterface The data mapper.
*/
- function getDataMapper();
+ public function getDataMapper();
/**
* Returns the validators of the form.
@@ -111,42 +111,42 @@ function getDataMapper();
*
* @deprecated Deprecated since version 2.1, to be removed in 2.3.
*/
- function getValidators();
+ public function getValidators();
/**
* Returns whether the form is required.
*
* @return Boolean Whether the form is required.
*/
- function getRequired();
+ public function getRequired();
/**
* Returns whether the form is disabled.
*
* @return Boolean Whether the form is disabled.
*/
- function getDisabled();
+ public function getDisabled();
/**
* Returns whether errors attached to the form will bubble to its parent.
*
* @return Boolean Whether errors will bubble up.
*/
- function getErrorBubbling();
+ public function getErrorBubbling();
/**
* Returns the data that should be returned when the form is empty.
*
* @return mixed The data returned if the form is empty.
*/
- function getEmptyData();
+ public function getEmptyData();
/**
* Returns additional attributes of the form.
*
* @return array An array of key-value combinations.
*/
- function getAttributes();
+ public function getAttributes();
/**
* Returns whether the attribute with the given name exists.
@@ -155,7 +155,7 @@ function getAttributes();
*
* @return Boolean Whether the attribute exists.
*/
- function hasAttribute($name);
+ public function hasAttribute($name);
/**
* Returns the value of the given attribute.
@@ -165,28 +165,28 @@ function hasAttribute($name);
*
* @return mixed The attribute value.
*/
- function getAttribute($name, $default = null);
+ public function getAttribute($name, $default = null);
/**
* Returns the initial data of the form.
*
* @return mixed The initial form data.
*/
- function getData();
+ public function getData();
/**
* Returns the class of the form data or null if the data is scalar or an array.
*
* @return string The data class or null.
*/
- function getDataClass();
+ public function getDataClass();
/**
* Returns all options passed during the construction of the form.
*
* @return array The passed options.
*/
- function getOptions();
+ public function getOptions();
/**
* Returns whether a specific option exists.
@@ -195,7 +195,7 @@ function getOptions();
*
* @return Boolean Whether the option exists.
*/
- function hasOption($name);
+ public function hasOption($name);
/**
* Returns the value of a specific option.
@@ -205,5 +205,5 @@ function hasOption($name);
*
* @return mixed The option value.
*/
- function getOption($name, $default = null);
+ public function getOption($name, $default = null);
}
View
10 FormExtensionInterface.php
@@ -25,7 +25,7 @@
*
* @throws Exception\FormException if the given type is not supported by this extension
*/
- function getType($name);
+ public function getType($name);
/**
* Returns whether the given type is supported.
@@ -34,7 +34,7 @@ function getType($name);
*
* @return Boolean Whether the type is supported by this extension
*/
- function hasType($name);
+ public function hasType($name);
/**
* Returns the extensions for the given type.
@@ -43,7 +43,7 @@ function hasType($name);
*
* @return array An array of extensions as FormTypeExtensionInterface instances
*/
- function getTypeExtensions($name);
+ public function getTypeExtensions($name);
/**
* Returns whether this extension provides type extensions for the given type.
@@ -52,12 +52,12 @@ function getTypeExtensions($name);
*
* @return Boolean Whether the given type has extensions
*/
- function hasTypeExtensions($name);
+ public function hasTypeExtensions($name);
/**
* Returns the type guesser provided by this extension.
*
* @return FormTypeGuesserInterface|null The type guesser
*/
- function getTypeGuesser();
+ public function getTypeGuesser();
}
View
18 FormFactoryInterface.php
@@ -30,7 +30,7 @@
*
* @throws Exception\FormException if any given option is not applicable to the given type
*/
- function create($type, $data = null, array $options = array(), FormBuilderInterface $parent = null);
+ public function create($type, $data = null, array $options = array(), FormBuilderInterface $parent = null);
/**
* Returns a form.
@@ -47,7 +47,7 @@ function create($type, $data = null, array $options = array(), FormBuilderInterf
*
* @throws Exception\FormException if any given option is not applicable to the given type
*/
- function createNamed($name, $type, $data = null, array $options = array(), FormBuilderInterface $parent = null);
+ public function createNamed($name, $type, $data = null, array $options = array(), FormBuilderInterface $parent = null);
/**
* Returns a form for a property of a class.
@@ -64,7 +64,7 @@ function createNamed($name, $type, $data = null, array $options = array(), FormB
*
* @throws Exception\FormException if any given option is not applicable to the form type
*/
- function createForProperty($class, $property, $data = null, array $options = array(), FormBuilderInterface $parent = null);
+ public function createForProperty($class, $property, $data = null, array $options = array(), FormBuilderInterface $parent = null);
/**
* Returns a form builder.
@@ -78,7 +78,7 @@ function createForProperty($class, $property, $data = null, array $options = arr
*
* @throws Exception\FormException if any given option is not applicable to the given type
*/
- function createBuilder($type, $data = null, array $options = array(), FormBuilderInterface $parent = null);
+ public function createBuilder($type, $data = null, array $options = array(), FormBuilderInterface $parent = null);
/**
* Returns a form builder.
@@ -93,7 +93,7 @@ function createBuilder($type, $data = null, array $options = array(), FormBuilde
*
* @throws Exception\FormException if any given option is not applicable to the given type
*/
- function createNamedBuilder($name, $type, $data = null, array $options = array(), FormBuilderInterface $parent = null);
+ public function createNamedBuilder($name, $type, $data = null, array $options = array(), FormBuilderInterface $parent = null);
/**
* Returns a form builder for a property of a class.
@@ -111,7 +111,7 @@ function createNamedBuilder($name, $type, $data = null, array $options = array()
*
* @throws Exception\FormException if any given option is not applicable to the form type
*/
- function createBuilderForProperty($class, $property, $data = null, array $options = array(), FormBuilderInterface $parent = null);
+ public function createBuilderForProperty($class, $property, $data = null, array $options = array(), FormBuilderInterface $parent = null);
/**
* Returns a type by name.
@@ -124,7 +124,7 @@ function createBuilderForProperty($class, $property, $data = null, array $option
*
* @throws Exception\FormException if the type can not be retrieved from any extension
*/
- function getType($name);
+ public function getType($name);
/**
* Returns whether the given type is supported.
@@ -133,12 +133,12 @@ function getType($name);
*
* @return Boolean Whether the type is supported
*/
- function hasType($name);
+ public function hasType($name);
/**
* Adds a type.
*
* @param FormTypeInterface $type The type
*/
- function addType(FormTypeInterface $type);
+ public function addType(FormTypeInterface $type);
}
View
56 FormInterface.php
@@ -25,21 +25,21 @@
*
* @return FormInterface The form instance
*/
- function setParent(FormInterface $parent = null);
+ public function setParent(FormInterface $parent = null);
/**
* Returns the parent form.
*
* @return FormInterface The parent form
*/
- function getParent();
+ public function getParent();
/**
* Returns whether the form has a parent.
*
* @return Boolean
*/
- function hasParent();
+ public function hasParent();
/**
* Adds a child to the form.
@@ -48,7 +48,7 @@ function hasParent();
*
* @return FormInterface The form instance
*/
- function add(FormInterface $child);
+ public function add(FormInterface $child);
/**
* Returns the child with the given name.
@@ -57,7 +57,7 @@ function add(FormInterface $child);
*
* @return FormInterface The child form
*/
- function get($name);
+ public function get($name);
/**
* Returns whether a child with the given name exists.
@@ -66,7 +66,7 @@ function get($name);
*
* @return Boolean
*/
- function has($name);
+ public function has($name);
/**
* Removes a child from the form.
@@ -75,21 +75,21 @@ function has($name);
*
* @return FormInterface The form instance
*/
- function remove($name);
+ public function remove($name);
/**
* Returns all children in this group.
*
* @return array An array of FormInterface instances
*/
- function all();
+ public function all();
/**
* Returns all errors.
*
* @return array An array of FormError instances that occurred during binding
*/
- function getErrors();
+ public function getErrors();
/**
* Updates the field with default data.
@@ -98,14 +98,14 @@ function getErrors();
*
* @return FormInterface The form instance
*/
- function setData($modelData);
+ public function setData($modelData);
/**
* Returns the data in the format needed for the underlying object.
*
* @return mixed
*/
- function getData();
+ public function getData();
/**
* Returns the normalized data of the field.
@@ -114,49 +114,49 @@ function getData();
* When the field is bound, the normalized bound data is
* returned if the field is valid, null otherwise.
*/
- function getNormData();
+ public function getNormData();
/**
* Returns the data transformed by the value transformer.
*
* @return string
*/
- function getViewData();
+ public function getViewData();
/**
* Returns the extra data.
*
* @return array The bound data which do not belong to a child
*/
- function getExtraData();
+ public function getExtraData();
/**
* Returns the form's configuration.
*
* @return FormConfigInterface The configuration.
*/
- function getConfig();
+ public function getConfig();
/**
* Returns whether the field is bound.
*
* @return Boolean true if the form is bound to input values, false otherwise
*/
- function isBound();
+ public function isBound();
/**
* Returns the name by which the form is identified in forms.
*
* @return string The name of the form.
*/
- function getName();
+ public function getName();
/**
* Returns the property path that the form is mapped to.
*
* @return Util\PropertyPath The property path.
*/
- function getPropertyPath();
+ public function getPropertyPath();
/**
* Adds an error to this form.
@@ -165,14 +165,14 @@ function getPropertyPath();
*
* @return FormInterface The form instance
*/
- function addError(FormError $error);
+ public function addError(FormError $error);
/**
* Returns whether the form is valid.
*
* @return Boolean
*/
- function isValid();
+ public function isValid();
/**
* Returns whether the form is required to be filled out.
@@ -183,7 +183,7 @@ function isValid();
*
* @return Boolean
*/
- function isRequired();
+ public function isRequired();
/**
* Returns whether this form is disabled.
@@ -196,21 +196,21 @@ function isRequired();
*
* @return Boolean
*/
- function isDisabled();
+ public function isDisabled();
/**
* Returns whether the form is empty.
*
* @return Boolean
*/
- function isEmpty();
+ public function isEmpty();
/**
* Returns whether the data in the different formats is synchronized.
*
* @return Boolean
*/
- function isSynchronized();
+ public function isSynchronized();
/**
* Writes data into the form.
@@ -219,21 +219,21 @@ function isSynchronized();
*
* @return FormInterface The form instance
*/
- function bind($data);
+ public function bind($data);
/**
* Returns the root of the form tree.
*
* @return FormInterface The root of the tree
*/
- function getRoot();
+ public function getRoot();
/**
* Returns whether the field is the root of the form tree.
*
* @return Boolean
*/
- function isRoot();
+ public function isRoot();
/**
* Creates a view.
@@ -242,5 +242,5 @@ function isRoot();
*
* @return FormViewInterface The view
*/
- function createView(FormViewInterface $parent = null);
+ public function createView(FormViewInterface $parent = null);
}
View
10 FormTypeExtensionInterface.php
@@ -29,7 +29,7 @@
* @param FormBuilderInterface $builder The form builder
* @param array $options The options
*/
- function buildForm(FormBuilderInterface $builder, array $options);
+ public function buildForm(FormBuilderInterface $builder, array $options);
/**
* Builds the view.
@@ -43,7 +43,7 @@ function buildForm(FormBuilderInterface $builder, array $options);
* @param FormInterface $form The form
* @param array $options The options
*/
- function buildView(FormViewInterface $view, FormInterface $form, array $options);
+ public function buildView(FormViewInterface $view, FormInterface $form, array $options);
/**
* Finishes the view.
@@ -57,19 +57,19 @@ function buildView(FormViewInterface $view, FormInterface $form, array $options)
* @param FormInterface $form The form
* @param array $options The options
*/
- function finishView(FormViewInterface $view, FormInterface $form, array $options);
+ public function finishView(FormViewInterface $view, FormInterface $form, array $options);
/**
* Overrides the default options from the extended type.
*
* @param OptionsResolverInterface $resolver The resolver for the options.
*/
- function setDefaultOptions(OptionsResolverInterface $resolver);
+ public function setDefaultOptions(OptionsResolverInterface $resolver);
/**
* Returns the name of the type being extended.
*
* @return string The name of the type being extended
*/
- function getExtendedType();
+ public function getExtendedType();
}
View
10 FormTypeGuesserInterface.php
@@ -24,7 +24,7 @@
*
* @return Guess\TypeGuess A guess for the field's type and options
*/
- function guessType($class, $property);
+ public function guessType($class, $property);
/**
* Returns a guess whether a property of a class is required
@@ -34,7 +34,7 @@ function guessType($class, $property);
*
* @return Guess\Guess A guess for the field's required setting
*/
- function guessRequired($class, $property);
+ public function guessRequired($class, $property);
/**
* Returns a guess about the field's maximum length
@@ -44,7 +44,7 @@ function guessRequired($class, $property);
*
* @return Guess\Guess A guess for the field's maximum length
*/
- function guessMaxLength($class, $property);
+ public function guessMaxLength($class, $property);
/**
* Returns a guess about the field's minimum length
@@ -56,7 +56,7 @@ function guessMaxLength($class, $property);
*
* @deprecated Deprecated since version 2.1, to be removed in 2.3.
*/
- function guessMinLength($class, $property);
+ public function guessMinLength($class, $property);
/**
* Returns a guess about the field's pattern
@@ -72,5 +72,5 @@ function guessMinLength($class, $property);
*
* @return Guess\Guess A guess for the field's required pattern
*/
- function guessPattern($class, $property);
+ public function guessPattern($class, $property);
}
View
18 FormTypeInterface.php
@@ -29,7 +29,7 @@
* @param FormBuilderInterface $builder The form builder
* @param array $options The options
*/
- function buildForm(FormBuilderInterface $builder, array $options);
+ public function buildForm(FormBuilderInterface $builder, array $options);
/**
* Builds the form view.
@@ -47,7 +47,7 @@ function buildForm(FormBuilderInterface $builder, array $options);
* @param FormInterface $form The form
* @param array $options The options
*/
- function buildView(FormViewInterface $view, FormInterface $form, array $options);
+ public function buildView(FormViewInterface $view, FormInterface $form, array $options);
/**
* Finishes the form view.
@@ -66,7 +66,7 @@ function buildView(FormViewInterface $view, FormInterface $form, array $options)
* @param FormInterface $form The form
* @param array $options The options
*/
- function finishView(FormViewInterface $view, FormInterface $form, array $options);
+ public function finishView(FormViewInterface $view, FormInterface $form, array $options);
/**
* Returns a builder for the current type.
@@ -80,28 +80,28 @@ function finishView(FormViewInterface $view, FormInterface $form, array $options
*
* @return FormBuilderInterface|null A form builder or null when the type does not have a builder
*/
- function createBuilder($name, FormFactoryInterface $factory, array $options);
+ public function createBuilder($name, FormFactoryInterface $factory, array $options);
/**
* Sets the default options for this type.
*
* @param OptionsResolverInterface $resolver The resolver for the options.
*/
- function setDefaultOptions(OptionsResolverInterface $resolver);
+ public function setDefaultOptions(OptionsResolverInterface $resolver);
/**
* Returns the name of the parent type.
*
* @return string|null The name of the parent type if any, null otherwise.
*/
- function getParent();
+ public function getParent();
/**
* Returns the name of this type.
*
* @return string The name of this type
*/
- function getName();
+ public function getName();
/**
* Sets the extensions for this type.
@@ -110,12 +110,12 @@ function getName();
*
* @throws Exception\UnexpectedTypeException if any extension does not implement FormTypeExtensionInterface
*/
- function setExtensions(array $extensions);
+ public function setExtensions(array $extensions);
/**
* Returns the extensions associated with this type.
*
* @return array An array of FormTypeExtensionInterface
*/
- function getExtensions();
+ public function getExtensions();
}
View
2 FormValidatorInterface.php
@@ -24,5 +24,5 @@
/**
* @deprecated Deprecated since version 2.1, to be removed in 2.3.
*/
- function validate(FormInterface $form);
+ public function validate(FormInterface $form);
}
View
32 FormViewInterface.php
@@ -21,21 +21,21 @@
*
* @return string The form name.
*/
- function getName();
+ public function getName();
/**
* Returns whether the view was already rendered.
*
* @return Boolean Whether this view's widget is rendered.
*/
- function isRendered();
+ public function isRendered();
/**
* Marks the view as rendered.
*
* @return FormViewInterface The view object.
*/
- function setRendered();
+ public function setRendered();
/**
* Sets the parent view.
@@ -44,21 +44,21 @@ function setRendered();
*
* @return FormViewInterface The view object.
*/
- function setParent(FormViewInterface $parent = null);
+ public function setParent(FormViewInterface $parent = null);
/**
* Returns the parent view.
*
* @return FormViewInterface The parent view.
*/
- function getParent();
+ public function getParent();
/**
* Returns whether this view has a parent.
*
* @return Boolean Whether this view has a parent
*/
- function hasParent();
+ public function hasParent();
/**
* Adds a child view.
@@ -67,7 +67,7 @@ function hasParent();
*
* @return FormViewInterface The view object.
*/
- function add(FormViewInterface $child);
+ public function add(FormViewInterface $child);
/**
* Removes a child view.
@@ -76,14 +76,14 @@ function add(FormViewInterface $child);
*
* @return FormViewInterface The view object.
*/
- function remove($name);
+ public function remove($name);
/**
* Returns the children.
*
* @return array The children as instances of FormView
*/
- function all();
+ public function all();
/**
* Returns a given child.
@@ -92,7 +92,7 @@ function all();
*
* @return FormViewInterface The child view
*/
- function get($name);
+ public function get($name);
/**
* Returns whether this view has a given child.
@@ -101,7 +101,7 @@ function get($name);
*
* @return Boolean Whether the child with the given name exists
*/
- function has($name);
+ public function has($name);
/**
* Sets a view variable.
@@ -111,7 +111,7 @@ function has($name);
*
* @return FormViewInterface The view object.
*/
- function setVar($name, $value);
+ public function setVar($name, $value);
/**
* Adds a list of view variables.
@@ -120,7 +120,7 @@ function setVar($name, $value);
*
* @return FormViewInterface The view object.
*/
- function addVars(array $values);
+ public function addVars(array $values);
/**
* Returns whether a view variable exists.
@@ -129,7 +129,7 @@ function addVars(array $values);
*
* @return Boolean Whether the variable exists.
*/
- function hasVar($name);
+ public function hasVar($name);
/**
* Returns the value of a view variable.
@@ -139,12 +139,12 @@ function hasVar($name);
*
* @return mixed The variable value.
*/
- function getVar($name, $default = null);
+ public function getVar($name, $default = null);
/**
* Returns the values of all view variables.
*
* @return array The values of all variables.
*/
- function getVars();
+ public function getVars();
}
View
2 Guess/Guess.php
@@ -77,7 +77,7 @@
*
* @return Guess The guess with the highest confidence
*/
- static public function getBestGuess(array $guesses)
+ public static function getBestGuess(array $guesses)
{
usort($guesses, function ($a, $b) {
return $b->getConfidence() - $a->getConfidence();
View
1 Tests/AbstractFormTest.php
@@ -11,7 +11,6 @@
namespace Symfony\Component\Form\Tests;
-use Symfony\Component\Form\FormError;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
View
1 Tests/AbstractLayoutTest.php
@@ -377,7 +377,6 @@ public function testSingleChoiceWithPreferred()
);
}
-
public function testSingleChoiceWithPreferredAndNoSeparator()
{
$form = $this->factory->createNamed('name', 'choice', '&a', array(
View
6 Tests/CompoundFormTest.php
@@ -12,18 +12,12 @@
namespace Symfony\Component\Form\Tests;
use Symfony\Component\Form\Form;
-use Symfony\Component\Form\Util\PropertyPath;
-use Symfony\Component\Form\FormConfig;
use Symfony\Component\Form\FormView;
-use Symfony\Component\Form\FormBuilder;
use Symfony\Component\Form\FormError;
-use Symfony\Component\Form\Exception\TransformationFailedException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\EventDispatcher\EventDispatcher;
-use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Form\Tests\Fixtures\FixedDataTransformer;
-use Symfony\Component\Form\Tests\Fixtures\FixedFilterListener;
class FormTest extends AbstractFormTest
{
View
1 Tests/Extension/Core/DataMapper/PropertyPathMapperTest.php
@@ -11,7 +11,6 @@
namespace Symfony\Component\Form\Tests\Extension\Core\DataMapper;
-use Symfony\Component\Form\Tests\FormInterface;
use Symfony\Component\Form\Form;
use Symfony\Component\Form\FormConfig;
use Symfony\Component\Form\FormConfigInterface;
View
12 Tests/Extension/Core/DataTransformer/DateTimeToArrayTransformerTest.php
@@ -105,12 +105,12 @@ public function testTransform_differentTimezones()
$dateTime = new \DateTime('2010-02-03 04:05:06 America/New_York');
$dateTime->setTimezone(new \DateTimeZone('Asia/Hong_Kong'));
$output = array(
- 'year' => (string)(int)$dateTime->format('Y'),
- 'month' => (string)(int)$dateTime->format('m'),
- 'day' => (string)(int)$dateTime->format('d'),
- 'hour' => (string)(int)$dateTime->format('H'),
- 'minute' => (string)(int)$dateTime->format('i'),
- 'second' => (string)(int)$dateTime->format('s'),
+ 'year' => (string) (int) $dateTime->format('Y'),
+ 'month' => (string) (int) $dateTime->format('m'),
+ 'day' => (string) (int) $dateTime->format('d'),
+ 'hour' => (string) (int) $dateTime->format('H'),
+ 'minute' => (string) (int) $dateTime->format('i'),
+ 'second' => (string) (int) $dateTime->format('s'),
);
$this->assertSame($output, $transformer->transform($input));
View
1 Tests/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformerTest.php
@@ -13,7 +13,6 @@
use Symfony\Component\Form\Extension\Core\DataTransformer\MoneyToLocalizedStringTransformer;
-
class MoneyToLocalizedStringTransformerTest extends LocalizedTestCase
{
protected function setUp()
View
1 Tests/Extension/Core/EventListener/MergeCollectionListenerTest.php
@@ -13,7 +13,6 @@
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\Extension\Core\EventListener\MergeCollectionListener;
-use Symfony\Component\Form\FormBuilder;
abstract class MergeCollectionListenerTest extends \PHPUnit_Framework_TestCase
{
View
1 Tests/Extension/Core/Type/ChoiceTypeTest.php
@@ -61,7 +61,6 @@ protected function setUp()
);
}
-
protected function tearDown()
{
parent::tearDown();