Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX compile error #89

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Multiplier.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@

private bool $attachedCalled = false;

/** @var ComponentResolver */

Check failure on line 69 in src/Multiplier.php

View workflow job for this annotation

GitHub Actions / Codesniffer / Codesniffer (8.1)

Property \Contributte\FormMultiplier\Multiplier::$resolver has useless @var annotation.
protected ComponentResolver $resolver;

Check failure on line 70 in src/Multiplier.php

View workflow job for this annotation

GitHub Actions / Codesniffer / Codesniffer (8.1)

The placement of "protected properties" group is invalid. Last group was "private properties" and one of these is expected after it: private properties, constructor, destructor, static constructors, public static abstract methods, public static final methods, public static methods, public abstract methods, public final methods, public methods, protected static abstract methods, protected static final methods, protected static methods, protected abstract methods, protected final methods, protected methods, private static methods, private methods, magic methods

public function __construct(callable $factory, int $copyNumber = 1, ?int $maxCopies = null)
{
Expand Down Expand Up @@ -213,7 +213,7 @@

public function createCopies(bool $forceValues = false): void
{
if ($this->created === true) {

Check failure on line 216 in src/Multiplier.php

View workflow job for this annotation

GitHub Actions / Codesniffer / Codesniffer (8.1)

Expected 1 line after "if", found 0.
return;
}
$this->created = true;
Expand All @@ -236,7 +236,7 @@
$this->totalCopies >= $this->minCopies &&
!$this->resolver->reachedMinLimit()
) {
$this->form->setSubmittedBy($this->removeButton->create($this));

Check failure on line 239 in src/Multiplier.php

View workflow job for this annotation

GitHub Actions / Phpstan / Phpstan (8.1)

Cannot call method create() on Contributte\FormMultiplier\Buttons\RemoveButton|null.

$this->resetFormEvents();

Expand Down Expand Up @@ -281,7 +281,7 @@
* @return object|mixed[]
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingAnyTypeHint
*/
public function getValues($returnType = null, ?array $controls = null): object|array

Check failure on line 284 in src/Multiplier.php

View workflow job for this annotation

GitHub Actions / Phpstan / Phpstan (8.1)

Method Contributte\FormMultiplier\Multiplier::getValues() has parameter $returnType with no type specified.
{
if (!$this->resetKeys) {
return parent::getValues($returnType, $controls);
Expand All @@ -291,7 +291,7 @@
$values = parent::getValues('array', $controls);
$values = array_values($values);

$returnType = $returnType === true ? 'array' : $returnType; // @phpstan-ignore-line nette backwards compatibility

Check failure on line 294 in src/Multiplier.php

View workflow job for this annotation

GitHub Actions / Phpstan / Phpstan (8.1)

No error to ignore is reported on line 294.

return $returnType === 'array' ? $values : ArrayHash::from($values);
}
Expand Down Expand Up @@ -323,7 +323,7 @@
* @param mixed[]|object $values
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
*/
public function setValues($values, bool $erase = false): self
public function setValues($values, bool $erase = false): static
{
$values = $values instanceof Traversable ? iterator_to_array($values) : (array) $values;

Expand All @@ -338,7 +338,7 @@

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

Check failure on line 341 in src/Multiplier.php

View workflow job for this annotation

GitHub Actions / Codesniffer / Codesniffer (8.1)

Tabs must be used to indent lines; spaces are not allowed
$this->createCopies();
}

Expand Down Expand Up @@ -386,8 +386,8 @@
protected function loadHttpData(): void
{
if ($this->isFormSubmitted()) {
$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 / Codesniffer / Codesniffer (8.1)

Tabs must be used to indent lines; spaces are not allowed

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);

Check failure on line 390 in src/Multiplier.php

View workflow job for this annotation

GitHub Actions / Codesniffer / Codesniffer (8.1)

Tabs must be used to indent lines; spaces are not allowed
}
}

Expand All @@ -411,7 +411,7 @@
*/
protected function getHtmlName(): array
{
return explode('-', $this->lookupPath(Form::class) ?? '');

Check failure on line 414 in src/Multiplier.php

View workflow job for this annotation

GitHub Actions / Phpstan / Phpstan (8.1)

Expression on left side of ?? is not nullable.
}

protected function createContainer(): Container
Expand Down
Loading