Unverified Commit ef5ed098 authored by Alex Pott's avatar Alex Pott
Browse files

fix: #3567159 Fix "expects array<string>" issues detected by phpstan

By: mstrelan
By: dcam
By: alexpott
(cherry picked from commit a7b81e94)
parent f0666e7b
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ class AnnotatedClassDiscovery implements DiscoveryInterface {
  /**
   * The namespaces within which to find plugin classes.
   *
   * @var string[]
   * @var array<string, list<string>>
   */
  protected $pluginNamespaces;

@@ -60,7 +60,7 @@ class AnnotatedClassDiscovery implements DiscoveryInterface {
  /**
   * Constructs a new instance.
   *
   * @param string[] $plugin_namespaces
   * @param array<string, list<string>> $plugin_namespaces
   *   (optional) An array of namespace that may contain plugin implementations.
   *   Defaults to an empty array.
   * @param string $plugin_definition_annotation_name
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ class AttributeClassDiscovery implements DiscoveryInterface {
  /**
   * Constructs a new instance.
   *
   * @param string[] $pluginNamespaces
   * @param array<string, list<string>> $pluginNamespaces
   *   (optional) An array of namespace that may contain plugin implementations.
   *   Defaults to an empty array.
   * @param string $pluginDefinitionAttributeName
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ protected function mockInstalledExtensionsInfo(array $installed_extensions): voi
  /**
   * Sets default information about installed extensions.
   *
   * @param string[] $default_info
   * @param array<string, string|int> $default_info
   *   The *.info.yml key-value pairs to be mocked across all
   *   extensions. Hence, these can be seen as default/fallback values.
   */
+8 −8
Original line number Diff line number Diff line
@@ -103,17 +103,17 @@ public function render($empty = FALSE) {
    $current_record_count = ($end - $start) + $start_offset;
    // Get the search information.
    $replacements = [];
    $replacements['@start'] = $start;
    $replacements['@end'] = $end;
    $replacements['@total'] = $total;
    $replacements['@start'] = (string) $start;
    $replacements['@end'] = (string) $end;
    $replacements['@total'] = (string) $total;
    $replacements['@label'] = $label;
    $replacements['@per_page'] = $per_page;
    $replacements['@current_page'] = $current_page;
    $replacements['@current_record_count'] = $current_record_count;
    $replacements['@page_count'] = $page_count;
    $replacements['@per_page'] = (string) $per_page;
    $replacements['@current_page'] = (string) $current_page;
    $replacements['@current_record_count'] = (string) $current_record_count;
    $replacements['@page_count'] = (string) $page_count;
    // Send the output.
    if (!empty($total) || !empty($this->options['empty'])) {
      $output .= str_replace(array_keys($replacements), array_values($replacements), $format);
      $output .= str_replace(array_keys($replacements), $replacements, $format);
      // Return as render array.
      return [
        '#markup' => $output,
+1 −1
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ protected function applyRecipe(string $path, int $expected_exit_code = 0, array
  /**
   * Runs the `core/scripts/drupal` script with the given arguments.
   *
   * @param string[] $arguments
   * @param array<string|int> $arguments
   *   The arguments and options to pass to the script.
   * @param int $timeout
   *   (optional) How long the command should run before timing out, in seconds.
Loading