Skip to content

Commit

Permalink
Merge pull request #852 from droptica/feature/DROOP-1026-Error-displa…
Browse files Browse the repository at this point in the history
…yed-when-background-video-is-added-to-Banner-Paragraph

DROOP-1026: Fixed wrong type declarations in ProviderManager
  • Loading branch information
js-droptica authored Dec 21, 2023
2 parents 4f9c189 + 8dc8add commit 9949aa1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions modules/custom/d_media/src/Service/ProviderManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(\Traversable $namespaces, CacheBackendInterface $cac
/**
* {@inheritdoc}
*/
public function filterApplicableDefinitions(array $definitions, $user_input): ProviderPluginInterface|false {
public function filterApplicableDefinitions(array $definitions, $user_input): array|false {
foreach ($definitions as $definition) {
$is_applicable = $definition['class']::isApplicable($user_input);
if ($is_applicable) {
Expand All @@ -49,7 +49,7 @@ public function loadProviderFromInput($input): ProviderPluginInterface|false {
/**
* {@inheritdoc}
*/
public function loadDefinitionFromInput($input): ProviderPluginInterface|false {
public function loadDefinitionFromInput($input): array|false {
return $this->filterApplicableDefinitions($this->getDefinitions(), $input);
}

Expand Down
12 changes: 6 additions & 6 deletions modules/custom/d_media/src/Service/ProviderManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
interface ProviderManagerInterface {

/**
* Get the provider applicable to the given user input.
* Get the provider definition applicable to the given user input.
*
* @param array $definitions
* A list of definitions to test against.
* @param string $user_input
* The user input to test against the plugins.
*
* @return \Drupal\d_media\Plugin\Provider\ProviderPluginInterface|false
* The relevant plugin or FALSE on failure.
* @return array|false
* The relevant provider definition or FALSE on failure.
*/
public function filterApplicableDefinitions(array $definitions, $user_input): ProviderPluginInterface|false;
public function filterApplicableDefinitions(array $definitions, $user_input): array|false;

/**
* Load a provider from user input.
Expand All @@ -41,9 +41,9 @@ public function loadProviderFromInput($input): ProviderPluginInterface|false;
* @param string $input
* An input string.
*
* @return \Drupal\d_media\Plugin\Provider\ProviderPluginInterface|false
* @return array|false
* The relevant plugin or FALSE on failure.
*/
public function loadDefinitionFromInput($input): ProviderPluginInterface|false;
public function loadDefinitionFromInput($input): array|false;

}

0 comments on commit 9949aa1

Please sign in to comment.