This makes it easier to work with the new searchpage.

CommentFileSizeAuthor
plugindoc.patch571 byteschx
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tim.plunkett’s picture

+++ b/core/modules/search/lib/Drupal/search/Entity/SearchPage.php
@@ -116,6 +116,8 @@ public function __construct(array $values, $entity_type) {
+   * @return \Drupal\search\Plugin\ConfigurableSearchPluginInterface

This isn't correct.

@return \Drupal\search\Plugin\SearchInterface is on SearchPageInterface::getPlugin().

won't fix?

jhodgdon’s picture

Anyway, you cannot do:

  /**
    * {@inheritdoc}
+   *
+   * @return \Drupal\search\Plugin\ConfigurableSearchPluginInterface
    */

I realize it's all over code but as I keep saying over and over on all sorts of issues, you can either use inheritdoc BY ITSELF or you can put in a documentation block. This format is not supported by the API module, our coding standards, or as far as I know any other documentation standards or docs parser.

jhodgdon’s picture

Status: Needs review » Closed (works as designed)

So, just to clarify...

This patch is asking for an @return to be added to SearchPage::getPlugin().

Right now it just has @inheritdoc, meaning that it will get its docs from SearchPageInterface::getPlugin(). This currently says:

  /**
   * Returns the search plugin.
   *
   * @return \Drupal\search\Plugin\SearchInterface
   *   The search plugin used by this search page entity.
   */
  public function getPlugin();

chx's patch proposes overriding this with

+   * @return \Drupal\search\Plugin\ConfigurableSearchPluginInterface

However, in the case of a User page, which would return \Drupal\user\Plugin\Search\UserSearch, this would not be accurate -- UserSearch (currently, anyway) is not a ConfigurableSearchPluginInterface, because it has no configuration.

So the proposed docs change is not accurate.