Skip to content

Commit 88c6cfd

Browse files
committed
used more readable quotes strings
1 parent a0bc775 commit 88c6cfd

File tree

8 files changed

+12
-12
lines changed

8 files changed

+12
-12
lines changed

src/Bridges/FormsLatte/FormMacros.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public function macroInput(MacroNode $node, PhpWriter $writer)
139139
*/
140140
public function macroInputAttr(MacroNode $node, PhpWriter $writer)
141141
{
142-
throw new CompileException("Use n:name instead of n:input.");
142+
throw new CompileException('Use n:name instead of n:input.');
143143
}
144144

145145

src/Forms/Container.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function setValues($values, $erase = FALSE)
6565
$values = iterator_to_array($values);
6666

6767
} elseif (!is_array($values)) {
68-
throw new Nette\InvalidArgumentException('First parameter must be an array, ' . gettype($values) . ' given.');
68+
throw new Nette\InvalidArgumentException(sprintf('First parameter must be an array, %s given.', gettype($values)));
6969
}
7070

7171
foreach ($this->getComponents() as $name => $control) {

src/Forms/Controls/Checkbox.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __construct($label = NULL)
4040
public function setValue($value)
4141
{
4242
if (!is_scalar($value) && $value !== NULL) {
43-
throw new Nette\InvalidArgumentException('Value must be scalar or NULL, ' . gettype($value) . " given in field '{$this->name}'.");
43+
throw new Nette\InvalidArgumentException(sprintf("Value must be scalar or NULL, %s given in field '%s'.", gettype($value), $this->name));
4444
}
4545
$this->value = (bool) $value;
4646
return $this;

src/Forms/Controls/HiddenField.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct($persistentValue = NULL)
4141
public function setValue($value)
4242
{
4343
if (!is_scalar($value) && $value !== NULL && !method_exists($value, '__toString')) {
44-
throw new Nette\InvalidArgumentException('Value must be scalar or NULL, ' . gettype($value) . " given in field '{$this->name}'.");
44+
throw new Nette\InvalidArgumentException(sprintf("Value must be scalar or NULL, %s given in field '%s'.", gettype($value), $this->name));
4545
}
4646
if (!$this->persistValue) {
4747
$this->value = (string) $value;

src/Forms/Controls/MultiChoiceControl.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ public function setValue($values)
5757
if (is_scalar($values) || $values === NULL) {
5858
$values = (array) $values;
5959
} elseif (!is_array($values)) {
60-
throw new Nette\InvalidArgumentException('Value must be array or NULL, ' . gettype($values) . " given in field '{$this->name}'.");
60+
throw new Nette\InvalidArgumentException(sprintf("Value must be array or NULL, %s given in field '%s'.", gettype($values), $this->name));
6161
}
6262
$flip = array();
6363
foreach ($values as $value) {
6464
if (!is_scalar($value) && !method_exists($value, '__toString')) {
65-
throw new Nette\InvalidArgumentException('Values must be scalar, ' . gettype($value) . " given in field '{$this->name}'.");
65+
throw new Nette\InvalidArgumentException(sprintf("Values must be scalar, %s given in field '%s'.", gettype($value), $this->name));
6666
}
6767
$flip[(string) $value] = TRUE;
6868
}

src/Forms/Controls/RadioList.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function getContainerPrototype()
7878
public function getControl($key = NULL)
7979
{
8080
if ($key !== NULL) {
81-
trigger_error('Partial ' . __METHOD__ . '() is deprecated; use getControlPart() instead.', E_USER_DEPRECATED);
81+
trigger_error(sprintf('Partial %s() is deprecated; use getControlPart() instead.', __METHOD__), E_USER_DEPRECATED);
8282
return $this->getControlPart($key);
8383
}
8484

@@ -112,7 +112,7 @@ public function getControl($key = NULL)
112112
public function getLabel($caption = NULL, $key = NULL)
113113
{
114114
if ($key !== NULL) {
115-
trigger_error('Partial ' . __METHOD__ . '() is deprecated; use getLabelPart() instead.', E_USER_DEPRECATED);
115+
trigger_error(sprintf('Partial %s() is deprecated; use getLabelPart() instead.', __METHOD__), E_USER_DEPRECATED);
116116
return $this->getLabelPart($key);
117117
}
118118
return parent::getLabel($caption)->for(NULL);

src/Forms/Controls/TextBase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function setValue($value)
4040
if ($value === NULL) {
4141
$value = '';
4242
} elseif (!is_scalar($value) && !method_exists($value, '__toString')) {
43-
throw new Nette\InvalidArgumentException('Value must be scalar or NULL, ' . gettype($value) . " given in field '{$this->name}'.");
43+
throw new Nette\InvalidArgumentException(sprintf("Value must be scalar or NULL, %s given in field '%s'.", gettype($value), $this->name));
4444
}
4545
$this->rawValue = $this->value = $value;
4646
return $this;

src/Forms/Rendering/DefaultFormRenderer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ public function renderBody()
302302
public function renderControls($parent)
303303
{
304304
if (!($parent instanceof Nette\Forms\Container || $parent instanceof Nette\Forms\ControlGroup)) {
305-
throw new Nette\InvalidArgumentException("Argument must be FormContainer or FormGroup instance.");
305+
throw new Nette\InvalidArgumentException('Argument must be FormContainer or FormGroup instance.');
306306
}
307307

308308
$container = $this->getWrapper('controls container');
@@ -367,7 +367,7 @@ public function renderPairMulti(array $controls)
367367
$s = array();
368368
foreach ($controls as $control) {
369369
if (!$control instanceof Nette\Forms\IControl) {
370-
throw new Nette\InvalidArgumentException("Argument must be array of IFormControl instances.");
370+
throw new Nette\InvalidArgumentException('Argument must be array of IFormControl instances.');
371371
}
372372
$description = $control->getOption('description');
373373
if ($description instanceof Html) {
@@ -388,7 +388,7 @@ public function renderPairMulti(array $controls)
388388
}
389389
$pair = $this->getWrapper('pair container');
390390
$pair->add($this->renderLabel($control));
391-
$pair->add($this->getWrapper('control container')->setHtml(implode(" ", $s)));
391+
$pair->add($this->getWrapper('control container')->setHtml(implode(' ', $s)));
392392
return $pair->render(0);
393393
}
394394

0 commit comments

Comments
 (0)