8000 [Form] Add position support by egeloen · Pull Request #11241 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Form] Add position support #11241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Apply fabbot.io changes
  • Loading branch information
GeLoLabs committed Jan 17, 2017
commit a1c523868546e82facb1bd85efd663a44d0650e0
2 changes: 1 addition & 1 deletion src/Symfony/Component/Form/ButtonBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface, Ordered
* @param string $name The name of the button
* @param array $options The button's options
*
* @throws InvalidArgumentException If the name is empty.
* @throws InvalidArgumentException if the name is empty
*/
public function __construct($name, array $options = array())
{
Expand Down
8 changes: 4 additions & 4 deletions src/Symfony/Component/Form/FormConfigBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ class FormConfigBuilder implements FormConfigBuilderInterface, OrderedFormConfig
* @param EventDispatcherInterface $dispatcher The event dispatcher
* @param array $options The form options
*
* @throws InvalidArgumentException If the data class is not a valid class or if
* the name contains invalid characters.
* @throws InvalidArgumentException if the data class is not a valid class or if
* the name contains invalid characters
*/
public function __construct($name, $dataClass, EventDispatcherInterface $dispatcher, array $options = array())
{
Expand Down Expand Up @@ -888,8 +888,8 @@ public function getFormConfig()
*
* @param string|int $name The tested form name
*
* @throws UnexpectedTypeException If the name is not a string or an integer.
* @throws InvalidArgumentException If the name contains invalid characters.
* @throws UnexpectedTypeException if the name is not a string or an integer
* @throws InvalidArgumentException if the name contains invalid characters
*/
public static function validateName($name)
{
Expand Down
26 changes: 13 additions & 13 deletions src/Symfony/Component/Form/FormOrderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function order(FormInterface $form)
}

/**
* Process the form using the current weight in order to maintain the default order
* Process the form using the current weight in order to maintain the default order.
*
* @param FormInterface $form
*/
Expand All @@ -68,7 +68,7 @@ private function processEmptyPosition(FormInterface $form)

/**
* Process the form using the current first/last weight in order to put your form at the
* first/last position according to the default order
* first/last position according to the default order.
*
* @param FormInterface $form
* @param string $position
Expand All @@ -84,7 +84,7 @@ private function processStringPosition(FormInterface $form, $position)

/**
* Process the form using the weight of the "before" or "after" form
* If the "before" or "after" form has not been processed yet, we defer it for the next forms
* If the "before" or "after" form has not been processed yet, we defer it for the next forms.
*
* @param FormInterface $form
* @param array $position
Expand All @@ -102,7 +102,7 @@ private function processArrayPosition(FormInterface $form, array $position)

/**
* Process the form using the current first weight in order to put
* your form at the first position according to the default order
* your form at the first position according to the default order.
*
* @param FormInterface $form
*/
Expand All @@ -113,7 +113,7 @@ private function processFirst(FormInterface $form)

/**
* Processes the form using the current last weight in order to put
* your form at the last position according to the default order
* your form at the last position according to the default order.
*
* @param FormInterface $form
*/
Expand All @@ -124,7 +124,7 @@ private function processLast(FormInterface $form)

/**
* Process the form using the weight of the "before" form
* If the "before" form has not been processed yet, we defer it for the next forms
* If the "before" form has not been processed yet, we defer it for the next forms.
*
* @param FormInterface $form
* @param string $before
Expand All @@ -140,7 +140,7 @@ private function processBefore(FormInterface $form, $before)

/**
* Process the form using the weight of the "after" form
* If the "after" form has not been processed yet, we defer it for the next forms
* If the "after" form has not been processed yet, we defer it for the next forms.
*
* @param FormInterface $form
* @param string $after
Expand All @@ -155,7 +155,7 @@ private function processAfter(FormInterface $form, $after)
}

/**
* Process the form using the given weight
* Process the form using the given weight.
*
* This method also updates the orderer state accordingly
*
Expand All @@ -182,7 +182,7 @@ private function processWeight(FormInterface $form, $weight)

/**
* Finishes the form weight processing by trying to process deferred forms
* which refers to the current processed form
* which refers to the current processed form.
*
* @param FormInterface $form
* @param int $weight
Expand Down Expand Up @@ -215,7 +215,7 @@ private function finishWeight(FormInterface $form, $weight, $position = null)

/**
* Processes a deferred form by checking if it is valid and
* if it does not become a circular or symmetric ordering
* if it does not become a circular or symmetric ordering.
*
* @param FormInterface $form
* @param string $deferred
Expand All 8000 @@ -238,7 +238,7 @@ private function processDeferred(FormInterface $form, $deferred, $position)
}

/**
* Detects circular deferred forms for after/before position such as A => B => C => A
* Detects circular deferred forms for after/before position such as A => B => C => A.
*
* @param string $name
* @param string $position
Expand Down Expand Up @@ -268,7 +268,7 @@ private function detectCircularDeferred($name, $position, array $stack = array()
}

/**
* Detects symmetric before/after deferred such as A after B and B after A
* Detects symmetric before/after deferred such as A after B and B after A.
*
* @param string $name
* @param string $deferred
Expand All @@ -290,7 +290,7 @@ private function detectedSymmetricDeferred($name, $deferred, $position)
}

/**
* Resets the orderer
* Resets the orderer.
*/
private function reset()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ interface OrderedFormConfigBuilderInterface extends OrderedFormConfigInterface
* You can combine the `after` & `before` options together or with `first` and/or `last` to achieve
* more complex use cases.
*
* @param null|string|array $position The form position.
* @param null|string|array $position the form position
*
* @throws \Symfony\Component\Form\Exception\InvalidConfigurationException If the position is not valid.
* @throws \Symfony\Component\Form\Exception\InvalidConfigurationException if the position is not valid
*
* @return self The configuration object.
* @return self the configuration object
*/
public function setPosition($position);
}
2 changes: 1 addition & 1 deletion src/Symfony/Component/Form/OrderedFormConfigInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface OrderedFormConfigInterface
*
* @see FormConfigBuilderInterface::setPosition
*
* @return null|string|array The position.
* @return null|string|array the position
*/
public function getPosition();
}
1 change: 0 additions & 1 deletion src/Symfony/Component/Form/Tests/FormOrdererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ public function getValidPositions()
'ban',
'biz' => array('before' => 'nan'),
'boz' => array('before' => 'biz', array('after' => 'pop')),

),
array('foo', 'bar', 'baz', 'bat', 'ban', 'pop', 'boz', 'biz', 'nan'),
),
Expand Down
0