Skip to content

Commit

Permalink
Merge pull request #57 from systopia/fix-phpstan-issues
Browse files Browse the repository at this point in the history
Fix phpstan issues
  • Loading branch information
dontub authored Mar 27, 2024
2 parents fe0b52e + e9c3a85 commit 996b814
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 4 deletions.
1 change: 0 additions & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ parameters:
# Wrong phpdoc type hint in Drupal
- '/^Parameter #1 \$key of method Drupal\\Core\\Form\\FormStateInterface::hasTemporaryValue\(\) expects string, array<int\|string> given.$/'
- '#^Method Drupal\\Core\\Form\\FormBuilderInterface::getForm\(\) invoked with \d+ parameters, 1 required.$#'
- '/^Parameter #1 \$form \(array<int\|string, mixed>\) of method [^\s]+::(build|validate|submit)Form\(\) should be contravariant with parameter \$form \(array\) of method Drupal\\Core\\Form\\(FormInterface|FormBase)::(build|validate|submit)Form\(\)$/'
-
message: '#^Variable property access on mixed.$#'
paths:
Expand Down
1 change: 0 additions & 1 deletion src/Form/AbstractJsonFormsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ protected function buildJsonFormsForm(array $form,
$form['#attributes']['class'][] = 'json-forms';

if ($recalculateOnChange) {
// @phpstan-ignore-next-line
$form['#attached']['library'][] = 'json_forms/submit';
}

Expand Down
2 changes: 0 additions & 2 deletions src/Form/Control/Callbacks/SelectCallbacks.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,10 @@ private static function getValue(array &$element, $input, FormStateInterface $fo
return $element['#default_value'] ?? NULL;
}

// @phpstan-ignore-next-line
if (array_key_exists('#empty_value', $element) && $input === (string) $element['#empty_value']) {
return '' === $element['#empty_value'] ? NULL : $element['#empty_value'];
}

// @phpstan-ignore-next-line
foreach (array_keys($element['#options']) as $option) {
if ($input === (string) $option) {
return $option;
Expand Down

0 comments on commit 996b814

Please sign in to comment.