Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Commit 2bdc94b

Browse files
committed
CS fixes
1 parent 9dab0de commit 2bdc94b

27 files changed

+222
-58
lines changed

src/Element/Captcha.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ public function setCaptcha($captcha)
5353
$captcha = ZendCaptcha\Factory::factory($captcha);
5454
} elseif (! $captcha instanceof ZendCaptcha\AdapterInterface) {
5555
throw new Exception\InvalidArgumentException(sprintf(
56-
'%s expects either a Zend\Captcha\AdapterInterface or specification to pass to Zend\Captcha\Factory; received "%s"',
56+
'%s expects either a Zend\Captcha\AdapterInterface or specification to pass to Zend\Captcha\Factory; '
57+
. 'received "%s"',
5758
__METHOD__,
5859
(is_object($captcha) ? get_class($captcha) : gettype($captcha))
5960
));

src/ElementFactory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ public function createService(ServiceLocatorInterface $serviceLocator, $canonica
106106
}
107107

108108
throw new InvalidServiceException(sprintf(
109-
'%s requires that the requested name is provided on invocation; please update your tests or consuming container',
109+
'%s requires that the requested name is provided on invocation; please update your tests or '
110+
. 'consuming container',
110111
__CLASS__
111112
));
112113
}

src/Fieldset.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,9 @@ public function bindValues(array $values = [], array $validationGroup = null)
570570
foreach ($this->iterator as $element) {
571571
$name = $element->getName();
572572

573-
if ($validationGroup && (! array_key_exists($name, $validationGroup) && ! in_array($name, $validationGroup))) {
573+
if ($validationGroup
574+
&& (! array_key_exists($name, $validationGroup) && ! in_array($name, $validationGroup))
575+
) {
574576
continue;
575577
}
576578

src/FieldsetInterface.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ interface FieldsetInterface extends
2626
* $flags could contain metadata such as the alias under which to register
2727
* the element or fieldset, order in which to prioritize it, etc.
2828
*
29-
* @param array|\Traversable|ElementInterface $elementOrFieldset Typically, only allow objects implementing ElementInterface;
30-
* however, keeping it flexible to allow a factory-based form
29+
* @param array|\Traversable|ElementInterface $elementOrFieldset Typically, only allow objects implementing
30+
* ElementInterface; however, keeping it flexible
31+
* to allow a factory-based form
3132
* implementation as well
3233
* @param array $flags
3334
* @return FieldsetInterface

src/Form.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ public function setOptions($options)
167167
*/
168168
public function add($elementOrFieldset, array $flags = [])
169169
{
170-
// TODO: find a better solution than duplicating the factory code, the problem being that if $elementOrFieldset is an array,
171-
// it is passed by value, and we don't get back the concrete ElementInterface
170+
// TODO: find a better solution than duplicating the factory code, the problem being that if
171+
// $elementOrFieldset is an array, it is passed by value, and we don't get back the concrete ElementInterface
172172
if (is_array($elementOrFieldset)
173173
|| ($elementOrFieldset instanceof Traversable && ! $elementOrFieldset instanceof ElementInterface)
174174
) {
@@ -607,8 +607,8 @@ public function getValidationGroup()
607607
}
608608

609609
/**
610-
* Prepare the validation group in case Collection elements were used (this function also handle the case where elements
611-
* could have been dynamically added or removed from a collection using JavaScript)
610+
* Prepare the validation group in case Collection elements were used (this function also handle
611+
* the case where elements could have been dynamically added or removed from a collection using JavaScript)
612612
*
613613
* @param FieldsetInterface $formOrFieldset
614614
* @param array $data
@@ -766,7 +766,10 @@ public function attachInputFilterDefaults(InputFilterInterface $inputFilter, Fie
766766
$elements = $fieldset->getElements();
767767
}
768768

769-
if (! $fieldset instanceof Collection || ! $fieldset->getTargetElement() instanceof FieldsetInterface || $inputFilter instanceof CollectionInputFilter) {
769+
if (! $fieldset instanceof Collection
770+
|| ! $fieldset->getTargetElement() instanceof FieldsetInterface
771+
|| $inputFilter instanceof CollectionInputFilter
772+
) {
770773
foreach ($elements as $name => $element) {
771774
if ($this->preferFormInputFilter && $inputFilter->has($name)) {
772775
continue;

src/FormAbstractServiceFactory.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ public function canCreate(ContainerInterface $container, $requestedName)
6868
return false;
6969
}
7070

71-
return (isset($config[$requestedName]) && is_array($config[$requestedName]) && ! empty($config[$requestedName]));
71+
return (isset($config[$requestedName])
72+
&& is_array($config[$requestedName])
73+
&& ! empty($config[$requestedName]));
7274
}
7375

7476
/**

src/View/Helper/Captcha/AbstractWord.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ protected function renderCaptchaInputs(ElementInterface $element)
8181

8282
if ($captcha === null || ! $captcha instanceof CaptchaAdapter) {
8383
throw new Exception\DomainException(sprintf(
84-
'%s requires that the element has a "captcha" attribute implementing Zend\Captcha\AdapterInterface; none found',
84+
'%s requires that the element has a "captcha" attribute implementing Zend\Captcha\AdapterInterface; '
85+
. 'none found',
8586
__METHOD__
8687
));
8788
}

src/View/Helper/Captcha/ReCaptcha.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ public function render(ElementInterface $element)
4747

4848
if ($captcha === null || ! $captcha instanceof CaptchaAdapter) {
4949
throw new Exception\DomainException(sprintf(
50-
'%s requires that the element has a "captcha" attribute implementing Zend\Captcha\AdapterInterface; none found',
50+
'%s requires that the element has a "captcha" attribute implementing Zend\Captcha\AdapterInterface; '
51+
. 'none found',
5152
__METHOD__
5253
));
5354
}

src/View/Helper/FormCaptcha.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public function __invoke(ElementInterface $element = null)
3636
* Render a form captcha for an element
3737
*
3838
* @param ElementInterface $element
39-
* @throws Exception\DomainException if the element does not compose a captcha, or the renderer does not implement plugin()
39+
* @throws Exception\DomainException if the element does not compose a captcha, or the renderer does
40+
* not implement plugin()
4041
* @return string
4142
*/
4243
public function render(ElementInterface $element)
@@ -45,7 +46,8 @@ public function render(ElementInterface $element)
4546

4647
if ($captcha === null || ! $captcha instanceof CaptchaAdapter) {
4748
throw new Exception\DomainException(sprintf(
48-
'%s requires that the element has a "captcha" attribute implementing Zend\Captcha\AdapterInterface; none found',
49+
'%s requires that the element has a "captcha" attribute implementing Zend\Captcha\AdapterInterface; '
50+
. 'none found',
4951
__METHOD__
5052
));
5153
}

src/View/Helper/FormCollection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ protected function getElementHelper()
262262
}
263263

264264
if (! $this->elementHelper instanceof HelperInterface) {
265-
throw new RuntimeException('Invalid element helper set in FormCollection. The helper must be an instance of Zend\View\Helper\HelperInterface.');
265+
throw new RuntimeException('Invalid element helper set in FormCollection. The helper must be an '
266+
. 'instance of Zend\View\Helper\HelperInterface.');
266267
}
267268

268269
return $this->elementHelper;

0 commit comments

Comments
 (0)