Skip to content

Commit

Permalink
Fix coding style issues
Browse files Browse the repository at this point in the history
Follow up to 39725d3
  • Loading branch information
jtojnar authored and f3l1x committed Feb 19, 2024
1 parent 1e6e3b2 commit 4cf1ae4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Multiplier.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,12 @@ class Multiplier extends Container
/** @var Container[] */
protected array $noValidate = [];

protected ComponentResolver $resolver;

private ?Form $form = null;

private bool $attachedCalled = false;

/** @var ComponentResolver */
protected ComponentResolver $resolver;

public function __construct(callable $factory, int $copyNumber = 1, ?int $maxCopies = null)
{
$this->factory = $factory;
Expand Down Expand Up @@ -216,6 +215,7 @@ public function createCopies(bool $forceValues = false): void
if ($this->created === true) {
return;
}

$this->created = true;

if (!isset($this->resolver)) {
Expand Down Expand Up @@ -338,7 +338,7 @@ public function setValues($values, bool $erase = false): static

$this->created = false;
$this->detachCreateButtons();
$this->resolver = new ComponentResolver($this->values, $this->maxCopies, $this->minCopies);
$this->resolver = new ComponentResolver($this->values, $this->maxCopies, $this->minCopies);
$this->createCopies();
}

Expand Down Expand Up @@ -386,8 +386,8 @@ protected function isFormSubmitted(): bool
protected function loadHttpData(): void
{
if ($this->isFormSubmitted()) {
$httpData = Arrays::get($this->form->getHttpData(), $this->getHtmlName(), []);
$this->resolver = new ComponentResolver($httpData ?? [], $this->maxCopies, $this->minCopies);
$httpData = Arrays::get($this->form->getHttpData(), $this->getHtmlName(), []);

Check failure on line 389 in src/Multiplier.php

View workflow job for this annotation

GitHub Actions / Phpstan / Phpstan (8.1)

Cannot call method getHttpData() on Nette\Forms\Form|null.

Check failure on line 389 in src/Multiplier.php

View workflow job for this annotation

GitHub Actions / Phpstan / Phpstan (8.1)

Cannot call method getHttpData() on Nette\Forms\Form|null.
$this->resolver = new ComponentResolver($httpData ?? [], $this->maxCopies, $this->minCopies);
}
}

Expand Down

0 comments on commit 4cf1ae4

Please sign in to comment.