Skip to content

Commit 3910084

Browse files
committed
Merge branch '3.1' into 3.2
* 3.1: fixed @return when returning this or static override property constraints in child class removed unneeded comment [Console] improved code coverage of Command class [FrameworkBundle] Make TemplateController working without the Templating component Only count on arrays or countables to avoid warnings in PHP 7.2
2 parents 4ef7f8c + 5a6d075 commit 3910084

File tree

10 files changed

+35
-35
lines changed

10 files changed

+35
-35
lines changed

Button.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ public function handleRequest($request = null)
369369
* @param null|string $submittedData The data
370370
* @param bool $clearMissing Not used
371371
*
372-
* @return Button The button instance
372+
* @return $this
373373
*
374374
* @throws Exception\AlreadySubmittedException If the button has already been submitted.
375375
*/

ButtonBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ public function setDataMapper(DataMapperInterface $dataMapper = null)
286286
*
287287
* @param bool $disabled Whether the button is disabled
288288
*
289-
* @return ButtonBuilder The button builder
289+
* @return $this
290290
*/
291291
public function setDisabled($disabled)
292292
{
@@ -398,7 +398,7 @@ public function setCompound($compound)
398398
*
399399
* @param ResolvedFormTypeInterface $type The type of the button
400400
*
401-
* @return ButtonBuilder The button builder
401+
* @return $this
402402
*/
403403
public function setType(ResolvedFormTypeInterface $type)
404404
{
@@ -490,7 +490,7 @@ public function setRequestHandler(RequestHandlerInterface $requestHandler)
490490
*
491491
* @param bool $initialize
492492
*
493-
* @return ButtonBuilder
493+
* @return $this
494494
*
495495
* @throws BadMethodCallException
496496
*/

Form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ public function isEmpty()
713713

714714
return FormUtil::isEmpty($this->modelData) ||
715715
// arrays, countables
716-
0 === count($this->modelData) ||
716+
((is_array($this->modelData) || $this->modelData instanceof \Countable) && 0 === count($this->modelData)) ||
717717
// traversables that are not countable
718718
($this->modelData instanceof \Traversable && 0 === iterator_count($this->modelData));
719719
}

FormBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ public function getIterator()
248248
*
249249
* @param string $name The name of the unresolved child
250250
*
251-
* @return FormBuilder The created instance
251+
* @return self The created instance
252252
*/
253253
private function resolveChild($name)
254254
{

FormBuilderInterface.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ interface FormBuilderInterface extends \Traversable, \Countable, FormConfigBuild
2727
* @param string|null $type
2828
* @param array $options
2929
*
30-
* @return FormBuilderInterface The builder object
30+
* @return $this
3131
*/
3232
public function add($child, $type = null, array $options = array());
3333

@@ -38,7 +38,7 @@ public function add($child, $type = null, array $options = array());
3838
* @param string|null $type The type of the form or null if name is a property
3939
* @param array $options The options
4040
*
41-
* @return FormBuilderInterface The created builder
41+
* @return self
4242
*/
4343
public function create($name, $type = null, array $options = array());
4444

@@ -47,7 +47,7 @@ public function create($name, $type = null, array $options = array());
4747
*
4848
* @param string $name The name of the child
4949
*
50-
* @return FormBuilderInterface The builder for the child
50+
* @return self
5151
*
5252
* @throws Exception\InvalidArgumentException if the given child does not exist
5353
*/
@@ -58,7 +58,7 @@ public function get($name);
5858
*
5959
* @param string $name
6060
*
61-
* @return FormBuilderInterface The builder object
61+
* @return $this
6262
*/
6363
public function remove($name);
6464

FormFactoryBuilderInterface.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ interface FormFactoryBuilderInterface
2323
*
2424
* @param ResolvedFormTypeFactoryInterface $resolvedTypeFactory
2525
*
26-
* @return FormFactoryBuilderInterface The builder
26+
* @return $this
2727
*/
2828
public function setResolvedTypeFactory(ResolvedFormTypeFactoryInterface $resolvedTypeFactory);
2929

@@ -32,7 +32,7 @@ public function setResolvedTypeFactory(ResolvedFormTypeFactoryInterface $resolve
3232
*
3333
* @param FormExtensionInterface $extension The extension
3434
*
35-
* @return FormFactoryBuilderInterface The builder
35+
* @return $this
3636
*/
3737
public function addExtension(FormExtensionInterface $extension);
3838

@@ -41,7 +41,7 @@ public function addExtension(FormExtensionInterface $extension);
4141
*
4242
* @param FormExtensionInterface[] $extensions The extensions
4343
*
44-
* @return FormFactoryBuilderInterface The builder
44+
* @return $this
4545
*/
4646
public function addExtensions(array $extensions);
4747

@@ -50,7 +50,7 @@ public function addExtensions(array $extensions);
5050
*
5151
* @param FormTypeInterface $type The form type
5252
*
53-
* @return FormFactoryBuilderInterface The builder
53+
* @return $this
5454
*/
5555
public function addType(FormTypeInterface $type);
5656

@@ -59,7 +59,7 @@ public function addType(FormTypeInterface $type);
5959
*
6060
* @param FormTypeInterface[] $types The form types
6161
*
62-
* @return FormFactoryBuilderInterface The builder
62+
* @return $this
6363
*/
6464
public function addTypes(array $types);
6565

@@ -68,7 +68,7 @@ public function addTypes(array $types);
6868
*
6969
* @param FormTypeExtensionInterface $typeExtension The form type extension
7070
*
71-
* @return FormFactoryBuilderInterface The builder
71+
* @return $this
7272
*/
7373
public function addTypeExtension(FormTypeExtensionInterface $typeExtension);
7474

@@ -77,7 +77,7 @@ public function addTypeExtension(FormTypeExtensionInterface $typeExtension);
7777
*
7878
* @param FormTypeExtensionInterface[] $typeExtensions The form type extensions
7979
*
80-
* @return FormFactoryBuilderInterface The builder
80+
* @return $this
8181
*/
8282
public function addTypeExtensions(array $typeExtensions);
8383

@@ -86,7 +86,7 @@ public function addTypeExtensions(array $typeExtensions);
8686
*
8787
* @param FormTypeGuesserInterface $typeGuesser The type guesser
8888
*
89-
* @return FormFactoryBuilderInterface The builder
89+
* @return $this
9090
*/
9191
public function addTypeGuesser(FormTypeGuesserInterface $typeGuesser);
9292

@@ -95,7 +95,7 @@ public function addTypeGuesser(FormTypeGuesserInterface $typeGuesser);
9595
*
9696
* @param FormTypeGuesserInterface[] $typeGuessers The type guessers
9797
*
98-
* @return FormFactoryBuilderInterface The builder
98+
* @return $this
9999
*/
100100
public function addTypeGuessers(array $typeGuessers);
101101

FormInterface.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ interface FormInterface extends \ArrayAccess, \Traversable, \Countable
2525
*
2626
* @param FormInterface|null $parent The parent form or null if it's the root
2727
*
28-
* @return FormInterface The form instance
28+
* @return self
2929
*
3030
* @throws Exception\AlreadySubmittedException If the form has already been submitted.
3131
* @throws Exception\LogicException When trying to set a parent for a form with
@@ -36,7 +36,7 @@ public function setParent(FormInterface $parent = null);
3636
/**
3737
* Returns the parent form.
3838
*
39-
* @return FormInterface|null The parent form or null if there is none
39+
* @return self|null The parent form or null if there is none
4040
*/
4141
public function getParent();
4242

@@ -47,7 +47,7 @@ public function getParent();
4747
* @param string|null $type The child's type, if a name was passed
4848
* @param array $options The child's options, if a name was passed
4949
*
50-
* @return FormInterface The form instance
50+
* @return self
5151
*
5252
* @throws Exception\AlreadySubmittedException If the form has already been submitted.
5353
* @throws Exception\LogicException When trying to add a child to a non-compound form.
@@ -60,7 +60,7 @@ public function add($child, $type = null, array $options = array());
6060
*
6161
* @param string $name The name of the child
6262
*
63-
* @return FormInterface The child form
63+
* @return self
6464
*
6565
* @throws \OutOfBoundsException If the named child does not exist.
6666
*/
@@ -80,7 +80,7 @@ public function has($name);
8080
*
8181
* @param string $name The name of the child to remove
8282
*
83-
* @return FormInterface The form instance
83+
* @return $this
8484
*
8585
* @throws Exception\AlreadySubmittedException If the form has already been submitted.
8686
*/
@@ -89,7 +89,7 @@ public function remove($name);
8989
/**
9090
* Returns all children in this group.
9191
*
92-
* @return FormInterface[] An array of FormInterface instances
92+
* @return self[]
9393
*/
9494
public function all();
9595

@@ -110,7 +110,7 @@ public function getErrors($deep = false, $flatten = true);
110110
*
111111
* @param mixed $modelData The data formatted as expected for the underlying object
112112
*
113-
* @return FormInterface The form instance
113+
* @return $this
114114
*
115115
* @throws Exception\AlreadySubmittedException If the form has already been submitted.
116116
* @throws Exception\LogicException If listeners try to call setData in a cycle. Or if
@@ -182,7 +182,7 @@ public function getPropertyPath();
182182
*
183183
* @param FormError $error
184184
*
185-
* @return FormInterface The form instance
185+
* @return $this
186186
*/
187187
public function addError(FormError $error);
188188

@@ -248,7 +248,7 @@ public function getTransformationFailure();
248248
*
249249
* Should be called on the root form after constructing the tree.
250250
*
251-
* @return FormInterface The form instance
251+
* @return $this
252252
*/
253253
public function initialize();
254254

@@ -262,7 +262,7 @@ public function initialize();
262262
*
263263
* @param mixed $request The request to handle
264264
*
265-
* @return FormInterface The form instance
265+
* @return $this
266266
*/
267267
public function handleRequest($request = null);
268268

@@ -274,7 +274,7 @@ public function handleRequest($request = null);
274274
* when they are missing in the
275275
* submitted data.
276276
*
277-
* @return FormInterface The form instance
277+
* @return $this
278278
*
279279
* @throws Exception\AlreadySubmittedException If the form has already been submitted.
280280
*/
@@ -283,7 +283,7 @@ public function submit($submittedData, $clearMissing = true);
283283
/**
284284
* Returns the root of the form tree.
285285
*
286-
* @return FormInterface The root of the tree
286+
* @return self The root of the tree
287287
*/
288288
public function getRoot();
289289

FormView.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function isRendered()
8181
/**
8282
* Marks the view as rendered.
8383
*
84-
* @return FormView The view object
84+
* @return $this
8585
*/
8686
public function setRendered()
8787
{
@@ -95,7 +95,7 @@ public function setRendered()
9595
*
9696
* @param string $name The child name
9797
*
98-
* @return FormView The child view
98+
* @return self The child view
9999
*/
100100
public function offsetGet($name)
101101
{

Guess/Guess.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ abstract class Guess
7070
*
7171
* @param Guess[] $guesses An array of guesses
7272
*
73-
* @return Guess|null The guess with the highest confidence
73+
* @return self|null
7474
*/
7575
public static function getBestGuess(array $guesses)
7676
{

SubmitButton.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function isClicked()
3737
* @param null|string $submittedData The data
3838
* @param bool $clearMissing Not used
3939
*
40-
* @return SubmitButton The button instance
40+
* @return $this
4141
*
4242
* @throws Exception\AlreadySubmittedException If the form has already been submitted.
4343
*/

0 commit comments

Comments
 (0)