Fix array params
Closes #3463440
Merge request reports
Activity
196 196 /** 197 197 * Gets a consolidated list of file mappings from all allowed packages. 198 198 * 199 * @param \Composer\Package\Package[] $allowed_packages 199 * @param \Composer\Package\PackageInterface[] $allowed_packages 25 25 * the plugin. The array is keyed by context names. 26 26 * @param class-string|null $deriver 27 27 * (optional) The deriver class. 28 * @param string[] $forms 29 * (optional) An array of form class names keyed by a string. 28 * @param array<string, string|false> $forms 29 * (optional) An array of form class names or FALSE, keyed by a string. I think there is a question about this line and coding standards. The @param is to be followed by a data type indicator. Those docs do not specify anything for the "<" or ">" style, nor is there an example of such usages. However, this style was first introduced in commit 54fad06e and there are other usages. Based on that we need an issue in Coding Standards project to update the documentation to include this type of example.
When I read the comment though I think that $forms can be FALSE, so I think it needs a tweak. Maybe something like "(optional) An associative array where the key is the form class name and the values are ?. The value may be FALSE."
@quietone are you suggesting that if we open the issue in coding standards we can commit this as it is (with the tweaked description) while waiting for the coding standards process to run its course, given the precedent already exist? If we have to wait for that process I'd rather just change this to
@param array
and improve it later in a followup.I'm trying to improve the description for
$forms
but I'm struggling to figure out what it's used for. It seems it is either an empty array,['settings_tray' => FALSE]
,['settings_tray' => SomeClass]
, or['secondary' => SomeClass]
.It looks like there is a whole heap of docs in settings_tray.api.php which is probably now out of date, and I don't have the patience to try understand it. It doesn't seem like this should be part of the Block attribute, and was not previously mentioned in the Block annotation.
The only instance of 'secondary' is in
test_multiple_forms_block
which probably gives more clues about why we have this.
611 611 /** 612 612 * Updates the kernel module list. 613 613 * 614 * @param string[] $module_filenames 614 * @param \Drupal\Core\Extension\Extension[] $module_filenames 40 40 * - it's a configuration entity. 41 41 * - its dependencies can be met. 42 42 * 43 * @param \Drupal\Core\Config\StorageInterface $storage 43 * @param \Drupal\Core\Config\StorageInterface|null $storage