Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed CS (mainly method signatures)

  • Loading branch information...
commit e4adb7a7cfbdf1cba1882090c8b91a30e1906d8f 1 parent f080523
@fabpot fabpot authored
View
8 DataMapperInterface.php
@@ -13,11 +13,11 @@
interface DataMapperInterface
{
- function mapDataToForms($data, array $forms);
+ public function mapDataToForms($data, array $forms);
- function mapDataToForm($data, FormInterface $form);
+ public function mapDataToForm($data, FormInterface $form);
- function mapFormsToData(array $forms, &$data);
+ public function mapFormsToData(array $forms, &$data);
- function mapFormToData(FormInterface $form, &$data);
+ public function mapFormToData(FormInterface $form, &$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/ChoiceListInterface.php
@@ -18,5 +18,5 @@
*
* @return array
*/
- function getChoices();
+ public function getChoices();
}
View
2  Extension/Core/ChoiceList/TimezoneChoiceList.php
@@ -22,7 +22,7 @@ class TimezoneChoiceList implements ChoiceListInterface
* Stores the available timezone choices
* @var array
*/
- static protected $timezones;
+ protected static $timezones;
/**
* Returns the timezone choices.
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/FixRadioInputListener.php
@@ -30,7 +30,7 @@ public function onBindClientData(FilterDataEvent $event)
$event->setData(strlen($data) < 1 ? array() : array($data => true));
}
- static public function getSubscribedEvents()
+ public static function getSubscribedEvents()
{
return array(FormEvents::BIND_CLIENT_DATA => 'onBindClientData');
}
View
2  Extension/Core/EventListener/FixUrlProtocolListener.php
@@ -38,7 +38,7 @@ public function onBindNormData(FilterDataEvent $event)
}
}
- static public function getSubscribedEvents()
+ public static function getSubscribedEvents()
{
return array(FormEvents::BIND_NORM_DATA => 'onBindNormData');
}
View
2  Extension/Core/EventListener/ResizeFormListener.php
@@ -61,7 +61,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 onBindClientData(FilterDataEvent $event)
}
}
- static public function getSubscribedEvents()
+ public static function getSubscribedEvents()
{
return array(FormEvents::BIND_CLIENT_DATA => 'onBindClientData');
}
View
2  Extension/Core/Type/MoneyType.php
@@ -80,7 +80,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
4 Extension/Validator/Validator/DelegatingValidator.php
@@ -104,7 +104,7 @@ public function validate(FormInterface $form)
* @param FormInterface $form The validated form
* @param ExecutionContext $context The current validation context
*/
- static public function validateFormData(FormInterface $form, ExecutionContext $context)
+ public static function validateFormData(FormInterface $form, ExecutionContext $context)
{
if (is_object($form->getData()) || is_array($form->getData())) {
$propertyPath = $context->getPropertyPath();
@@ -127,7 +127,7 @@ static public function validateFormData(FormInterface $form, ExecutionContext $c
}
}
- static protected function getFormValidationGroups(FormInterface $form)
+ protected static function getFormValidationGroups(FormInterface $form)
{
$groups = null;
View
10 FormExtensionInterface.php
@@ -23,7 +23,7 @@
*
* @return FormTypeInterface The type
*/
- function getType($name);
+ public function getType($name);
/**
* Returns whether the given type is supported.
@@ -32,7 +32,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.
@@ -41,7 +41,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.
@@ -50,12 +50,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
@@ -26,7 +26,7 @@
*
* @throws FormException if any given option is not applicable to the given type
*/
- function create($type, $data = null, array $options = array());
+ public function create($type, $data = null, array $options = array());
/**
* Returns a form.
@@ -40,7 +40,7 @@ function create($type, $data = null, array $options = array());
*
* @throws FormException if any given option is not applicable to the given type
*/
- function createNamed($type, $name, $data = null, array $options = array());
+ public function createNamed($type, $name, $data = null, array $options = array());
/**
* Returns a form for a property of a class.
@@ -54,7 +54,7 @@ function createNamed($type, $name, $data = null, array $options = array());
*
* @throws FormException if any given option is not applicable to the form type
*/
- function createForProperty($class, $property, $data = null, array $options = array());
+ public function createForProperty($class, $property, $data = null, array $options = array());
/**
* Returns a form builder
@@ -67,7 +67,7 @@ function createForProperty($class, $property, $data = null, array $options = arr
*
* @throws FormException if any given option is not applicable to the given type
*/
- function createBuilder($type, $data = null, array $options = array());
+ public function createBuilder($type, $data = null, array $options = array());
/**
* Returns a form builder.
@@ -81,7 +81,7 @@ function createBuilder($type, $data = null, array $options = array());
*
* @throws FormException if any given option is not applicable to the given type
*/
- function createNamedBuilder($type, $name, $data = null, array $options = array());
+ public function createNamedBuilder($type, $name, $data = null, array $options = array());
/**
* Returns a form builder for a property of a class.
@@ -98,11 +98,11 @@ function createNamedBuilder($type, $name, $data = null, array $options = array()
*
* @throws FormException if any given option is not applicable to the form type
*/
- function createBuilderForProperty($class, $property, $data = null, array $options = array());
+ public function createBuilderForProperty($class, $property, $data = null, array $options = array());
- function getType($name);
+ public function getType($name);
- function hasType($name);
+ public function hasType($name);
- function addType(FormTypeInterface $type);
+ public function addType(FormTypeInterface $type);
}
View
58 FormInterface.php
@@ -23,28 +23,28 @@
*
* @param FormInterface $parent The parent form
*/
- 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.
*
* @param FormInterface $child The FormInterface to add as a child
*/
- function add(FormInterface $child);
+ public function add(FormInterface $child);
/**
* Returns whether a child with the given name exists.
@@ -53,35 +53,35 @@ function add(FormInterface $child);
*
* @return Boolean
*/
- function has($name);
+ public function has($name);
/**
* Removes a child from the form.
*
* @param string $name The name of the child to remove
*/
- function remove($name);
+ public function remove($name);
/**
* Returns all children in this group.
*
* @return array An array of FormInterface instances
*/
- function getChildren();
+ public function getChildren();
/**
* Return whether the form has children.
*
* @return Boolean
*/
- function hasChildren();
+ public function hasChildren();
/**
* 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.
@@ -90,14 +90,14 @@ function getErrors();
*
* @return Form The current form
*/
- function setData($appData);
+ public function setData($appData);
/**
* 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.
@@ -106,56 +106,56 @@ 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 getClientData();
+ public function getClientData();
/**
* Returns the extra data.
*
* @return array The bound data which do not belong to a child
*/
- function getExtraData();
+ public function getExtraData();
/**
* 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 supported types.
*
* @return array An array of FormTypeInterface
*/
- function getTypes();
+ public function getTypes();
/**
* Returns the name by which the form is identified in forms.
*
* @return string The name of the form.
*/
- function getName();
+ public function getName();
/**
* Adds an error to this form.
*
* @param FormError $error
*/
- 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.
@@ -166,7 +166,7 @@ function isValid();
*
* @return Boolean
*/
- function isRequired();
+ public function isRequired();
/**
* Returns whether this form can be read only.
@@ -179,56 +179,56 @@ function isRequired();
*
* @return Boolean
*/
- function isReadOnly();
+ public function isReadOnly();
/**
* 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.
*
* @param mixed $data The data
*/
- function bind($data);
+ public function bind($data);
/**
* Returns whether the form has an attribute with the given name.
*
* @param string $name The name of the attribute
*/
- function hasAttribute($name);
+ public function hasAttribute($name);
/**
* Returns the value of the attributes with the given name.
*
* @param string $name The name of the attribute
*/
- function getAttribute($name);
+ public function getAttribute($name);
/**
* 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.
@@ -237,5 +237,5 @@ function isRoot();
*
* @return FormView The view
*/
- function createView(FormView $parent = null);
+ public function createView(FormView $parent = null);
}
View
13 FormTypeExtensionInterface.php
@@ -24,7 +24,7 @@
* @param FormBuilder $builder The form builder
* @param array $options The options
*/
- function buildForm(FormBuilder $builder, array $options);
+ public function buildForm(FormBuilder $builder, array $options);
/**
* Builds the view.
@@ -37,7 +37,7 @@ function buildForm(FormBuilder $builder, array $options);
* @param FormView $view The view
* @param FormInterface $form The form
*/
- function buildView(FormView $view, FormInterface $form);
+ public function buildView(FormView $view, FormInterface $form);
/**
* Builds the view.
@@ -50,7 +50,7 @@ function buildView(FormView $view, FormInterface $form);
* @param FormView $view The view
* @param FormInterface $form The form
*/
- function buildViewBottomUp(FormView $view, FormInterface $form);
+ public function buildViewBottomUp(FormView $view, FormInterface $form);
/**
* Overrides the default options form the extended type.
@@ -59,7 +59,7 @@ function buildViewBottomUp(FormView $view, FormInterface $form);
*
* @return array
*/
- function getDefaultOptions(array $options);
+ public function getDefaultOptions(array $options);
/**
* Returns the allowed option values for each option (if any).
@@ -68,13 +68,12 @@ function getDefaultOptions(array $options);
*
* @return array The allowed option values
*/
- function getAllowedOptionValues(array $options);
-
+ public function getAllowedOptionValues(array $options);
/**
* Returns the name of the type being extended
*
* @return string The name of the type being extended
*/
- function getExtendedType();
+ public function getExtendedType();
}
View
8 FormTypeGuesserInterface.php
@@ -21,7 +21,7 @@
*
* @return 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
@@ -31,7 +31,7 @@ function guessType($class, $property);
*
* @return 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
@@ -41,7 +41,7 @@ function guessRequired($class, $property);
*
* @return 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
@@ -51,6 +51,6 @@ function guessMaxLength($class, $property);
*
* @return Guess A guess for the field's minimum length
*/
- function guessMinLength($class, $property);
+ public function guessMinLength($class, $property);
}
View
20 FormTypeInterface.php
@@ -25,7 +25,7 @@
* @param FormBuilder $builder The form builder
* @param array $options The options
*/
- function buildForm(FormBuilder $builder, array $options);
+ public function buildForm(FormBuilder $builder, array $options);
/**
* Builds the form view.
@@ -39,7 +39,7 @@ function buildForm(FormBuilder $builder, array $options);
* @param FormView $view The view
* @param FormInterface $form The form
*/
- function buildView(FormView $view, FormInterface $form);
+ public function buildView(FormView $view, FormInterface $form);
/**
* Builds the form view.
@@ -56,7 +56,7 @@ function buildView(FormView $view, FormInterface $form);
* @param FormView $view The view
* @param FormInterface $form The form
*/
- function buildViewBottomUp(FormView $view, FormInterface $form);
+ public function buildViewBottomUp(FormView $view, FormInterface $form);
/**
* Returns a builder for the current type.
@@ -70,7 +70,7 @@ function buildViewBottomUp(FormView $view, FormInterface $form);
*
* @return FormBuilder|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);
/**
* Returns the default options for this type.
@@ -79,7 +79,7 @@ function createBuilder($name, FormFactoryInterface $factory, array $options);
*
* @return array The default options
*/
- function getDefaultOptions(array $options);
+ public function getDefaultOptions(array $options);
/**
* Returns the allowed option values for each option (if any).
@@ -88,7 +88,7 @@ function getDefaultOptions(array $options);
*
* @return array The allowed option values
*/
- function getAllowedOptionValues(array $options);
+ public function getAllowedOptionValues(array $options);
/**
* Returns the name of the parent type.
@@ -97,14 +97,14 @@ function getAllowedOptionValues(array $options);
*
* @return string|null The name of the parent type if any otherwise null
*/
- function getParent(array $options);
+ public function getParent(array $options);
/**
* Returns the name of this type.
*
* @return string The name of this type
*/
- function getName();
+ public function getName();
/**
* Adds extensions for this type.
@@ -113,12 +113,12 @@ function getName();
*
* @throws 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
@@ -13,5 +13,5 @@
interface FormValidatorInterface
{
- function validate(FormInterface $form);
+ public function validate(FormInterface $form);
}
View
2  Guess/Guess.php
@@ -69,7 +69,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
8 Util/FormUtil.php
@@ -13,7 +13,7 @@
abstract class FormUtil
{
- static public function toArrayKey($value)
+ public static function toArrayKey($value)
{
if (is_bool($value) || (string) (int) $value === (string) $value) {
return (int) $value;
@@ -22,7 +22,7 @@ static public function toArrayKey($value)
return (string) $value;
}
- static public function toArrayKeys(array $array)
+ public static function toArrayKeys(array $array)
{
return array_map(array(__CLASS__, 'toArrayKey'), $array);
}
@@ -34,7 +34,7 @@ static public function toArrayKeys(array $array)
*
* @return Boolean Whether the choice is a group
*/
- static public function isChoiceGroup($choice)
+ public static function isChoiceGroup($choice)
{
return is_array($choice) || $choice instanceof \Traversable;
}
@@ -47,7 +47,7 @@ static public function isChoiceGroup($choice)
*
* @return Boolean Whether the choice is selected
*/
- static public function isChoiceSelected($choice, $value)
+ public static function isChoiceSelected($choice, $value)
{
$choice = static::toArrayKey($choice);
Please sign in to comment.
Something went wrong with that request. Please try again.