Skip to content
Permalink
Browse files

PHP 7.4 compatibility fixes

  • Loading branch information...
dg committed Aug 6, 2019
1 parent 7d35d44 commit 9270dace1bc8cb126d5dc5790d7807837d2d5a49
Showing with 4 additions and 4 deletions.
  1. +1 −1 src/Forms/Container.php
  2. +2 −2 src/Forms/Controls/UploadControl.php
  3. +1 −1 src/Forms/Form.php
@@ -170,7 +170,7 @@ public function validate(array $controls = null): void
}
foreach ($this->onValidate as $handler) {
$params = Nette\Utils\Callback::toReflection($handler)->getParameters();
$values = isset($params[1]) ? $this->getValues((string) $params[1]->getType()) : null;
$values = isset($params[1]) ? $this->getValues($params[1]->getType() ? $params[1]->getType()->getName() : null) : null;
$handler($this, $values);
}
}
@@ -104,9 +104,9 @@ public function isOk(): bool
public function addRule($validator, $errorMessage = null, $arg = null)
{
if ($validator === Forms\Form::IMAGE) {
$this->control->accept = implode(FileUpload::IMAGE_MIME_TYPES, ', ');
$this->control->accept = implode(', ', FileUpload::IMAGE_MIME_TYPES);
} elseif ($validator === Forms\Form::MIME_TYPE) {
$this->control->accept = implode((array) $arg, ', ');
$this->control->accept = implode(', ', (array) $arg);
}
return parent::addRule($validator, $errorMessage, $arg);
}
@@ -416,7 +416,7 @@ private function invokeHandlers(iterable $handlers, $button = null): void
{
foreach ($handlers as $handler) {
$params = Nette\Utils\Callback::toReflection($handler)->getParameters();
$values = isset($params[1]) ? $this->getValues((string) $params[1]->getType()) : null;
$values = isset($params[1]) ? $this->getValues($params[1]->getType() ? $params[1]->getType()->getName() : null) : null;
$handler($button ?: $this, $values);
if (!$this->isValid()) {
return;

0 comments on commit 9270dac

Please sign in to comment.
You can’t perform that action at this time.