diff --git a/feeds.js b/feeds.js index b92254d..2b31ccd 100644 --- a/feeds.js +++ b/feeds.js @@ -1,3 +1,13 @@ +/** + * @file + * JS for the feeds admin UI. + */ + +/** + * Sets URL hash so that the correct settings tab is open on the feed type form. + * + * @see \Drupal\feeds\FeedTypeForm::ajaxCallback + */ Drupal.AjaxCommands.prototype.feedsHash = function (ajax, response, status) { "use strict"; diff --git a/feeds.module b/feeds.module index b4119bb..56aaa2f 100644 --- a/feeds.module +++ b/feeds.module @@ -115,11 +115,15 @@ function feeds_file_download($uri) { } /** - * Implements hook_form_FORM_ID_alter(). + * Implements hook_form_FORM_ID_alter() for field_ui_field_overview_form(). * - * Remove our field from the Field UI overview form. + * Removes our field from the Field UI overview form. + * + * @todo implement the feeds_item field as base field instead? See + * https://www.drupal.org/project/feeds/issues/2799225 */ function feeds_form_field_ui_field_overview_form_alter(array &$form, FormStateInterface $form_state) { + // @codingStandardsIgnoreStart // if (in_array('feeds_item', $form['#fields'])) { // unset($form['#fields'][array_search('feeds_item', $form['#fields'])]); @@ -129,6 +133,7 @@ function feeds_form_field_ui_field_overview_form_alter(array &$form, FormStateIn // $key = array_search('feeds_item', $rows_order); // unset($form['fields']['#regions']['content']['rows_order'][$key]); // } + // @codingStandardsIgnoreEnd } /** diff --git a/feeds.ui.css b/feeds.ui.css index cff0e26..c0d99db 100644 --- a/feeds.ui.css +++ b/feeds.ui.css @@ -17,9 +17,6 @@ table.feeds-admin-feed-type tr.disabled.odd { } /* Feeds edit form layout. */ -div.feeds-settings { -} - div.left-bar { float: left; position: relative; @@ -38,9 +35,6 @@ div.configuration-squeeze { } /* Container theming. */ -div.feeds-container { -} - div.feeds-container h4 { font-size: 1.2em; font-weight: bold; @@ -95,11 +89,5 @@ ul.container-actions .form-item, ul.container-actions li form, ul.container-actions li form input { padding: 0; - margin: 0; display: inline; } - -/* Mapping form. */ -#center table form { - margin: 0; -} diff --git a/src/EventSubscriber/PubSubHubbub.php b/src/EventSubscriber/PubSubHubbub.php index 80e6666..288412a 100644 --- a/src/EventSubscriber/PubSubHubbub.php +++ b/src/EventSubscriber/PubSubHubbub.php @@ -50,6 +50,9 @@ class PubSubHubbub implements EventSubscriberInterface { /** * Subscribes to a feed. + * + * @param \Drupal\feeds\Event\FetchEvent $event + * The fetch event. */ public function onPostFetch(FetchEvent $event) { $feed = $event->getFeed(); @@ -110,12 +113,12 @@ class PubSubHubbub implements EventSubscriberInterface { } /** - * ??? + * Subscribes a subscription to a hub in a batch. * * @param \Drupal\feeds\FeedInterface $feed - * ??? + * The feed to which the subscription is linked. * @param \Drupal\feeds\SubscriptionInterface $subscription - * ??? + * The subscription to subscribe. */ protected function subscribe(FeedInterface $feed, SubscriptionInterface $subscription) { $subscription->subscribe(); @@ -134,12 +137,12 @@ class PubSubHubbub implements EventSubscriberInterface { } /** - * ??? + * Unsubscribes a subscription from a hub in a batch. * * @param \Drupal\feeds\FeedInterface $feed - * ??? + * The feed to which the subscription is linked. * @param \Drupal\feeds\SubscriptionInterface $subscription - * ??? + * The subscription to unsubscribe. */ protected function unsubscribe(FeedInterface $feed, SubscriptionInterface $subscription = NULL) { if (!$subscription) { @@ -162,10 +165,15 @@ class PubSubHubbub implements EventSubscriberInterface { } /** - * ??? + * Subscribes to or unsubscribes from a hub. + * + * This method is used as callback for a batch. * * @param \Drupal\feeds\SubscriptionInterface $subscription - * ??? + * The subscription entity. + * + * @see ::subscribe + * @see ::unsubscribe */ public static function runSubscribeBatch(SubscriptionInterface $subscription) { switch ($subscription->getState()) { @@ -268,6 +276,9 @@ class PubSubHubbub implements EventSubscriberInterface { /** * Deletes subscriptions when feeds are deleted. + * + * @param \Drupal\feeds\Event\DeleteFeedsEvent $event + * The delete event. */ public function onDeleteMultipleFeeds(DeleteFeedsEvent $event) { $subscriptions = $this->storage->loadMultiple(array_keys($event->getFeeds())); diff --git a/src/FeedForm.php b/src/FeedForm.php index 01e579c..16c39ac 100644 --- a/src/FeedForm.php +++ b/src/FeedForm.php @@ -265,11 +265,13 @@ class FeedForm extends ContentEntityForm { * @param \Drupal\feeds\Plugin\Type\FeedsPluginInterface $plugin * The Feeds plugin. * @param string $operation - * The type of form to check for. See \Drupal\feeds\Plugin\PluginFormFactory::hasForm() - * for more information. + * The type of form to check for. See + * \Drupal\feeds\Plugin\PluginFormFactory::hasForm() for more information. * * @return bool * True if the plugin implements a form of the given type. False otherwise. + * + * @see \Drupal\feeds\Plugin\PluginFormFactory::hasForm() */ protected function pluginHasForm(FeedsPluginInterface $plugin, $operation) { return $this->formFactory->hasForm($plugin, $operation); diff --git a/src/FeedTypeForm.php b/src/FeedTypeForm.php index d0783b8..8b72dcb 100644 --- a/src/FeedTypeForm.php +++ b/src/FeedTypeForm.php @@ -368,11 +368,13 @@ class FeedTypeForm extends EntityForm { * @param \Drupal\feeds\Plugin\Type\FeedsPluginInterface $plugin * The Feeds plugin. * @param string $operation - * The type of form to check for. See \Drupal\feeds\Plugin\PluginFormFactory::hasForm() - * for more information. + * The type of form to check for. See + * \Drupal\feeds\Plugin\PluginFormFactory::hasForm() for more information. * * @return bool * True if the plugin implements a form of the given type. False otherwise. + * + * @see \Drupal\feeds\Plugin\PluginFormFactory::hasForm() */ protected function pluginHasForm(FeedsPluginInterface $plugin, $operation) { return $this->formFactory->hasForm($plugin, $operation); diff --git a/src/Feeds/Fetcher/Form/HttpFetcherFeedForm.php b/src/Feeds/Fetcher/Form/HttpFetcherFeedForm.php index 5c177ab..7936df7 100644 --- a/src/Feeds/Fetcher/Form/HttpFetcherFeedForm.php +++ b/src/Feeds/Fetcher/Form/HttpFetcherFeedForm.php @@ -105,6 +105,7 @@ class HttpFetcherFeedForm extends ExternalPluginFormBase implements ContainerInj * * @param string $url * The URL to GET. + * * @return \Guzzle\Http\Message\Response * A Guzzle response. * diff --git a/src/Feeds/Fetcher/HttpFetcher.php b/src/Feeds/Fetcher/HttpFetcher.php index 3167e15..33eda49 100644 --- a/src/Feeds/Fetcher/HttpFetcher.php +++ b/src/Feeds/Fetcher/HttpFetcher.php @@ -86,7 +86,9 @@ class HttpFetcher extends PluginBase implements ClearableInterface, FetcherInter $response = $this->get($feed->getSource(), $sink, $this->getCacheKey($feed)); // @todo Handle redirects. + // @codingStandardsIgnoreStart // $feed->setSource($response->getEffectiveUrl()); + // @codingStandardsIgnoreEnd // 304, nothing to see here. if ($response->getStatusCode() == Response::HTTP_NOT_MODIFIED) { diff --git a/src/Plugin/PluginFormFactory.php b/src/Plugin/PluginFormFactory.php index b1ef9e7..602937d 100644 --- a/src/Plugin/PluginFormFactory.php +++ b/src/Plugin/PluginFormFactory.php @@ -40,8 +40,8 @@ class PluginFormFactory { * - feed * Displayed on the feed add/edit form. * - option - * A small form to appear on the plugin select box. The entity processor plugins - * use this to display a form for selecting an entity bundle. + * A small form to appear on the plugin select box. The entity processor + * plugins use this to display a form for selecting an entity bundle. * * @return bool * True if the plugin implements a form of the given type. False otherwise. diff --git a/src/Plugin/Type/PluginBase.php b/src/Plugin/Type/PluginBase.php index 52bab60..b7e8dab 100644 --- a/src/Plugin/Type/PluginBase.php +++ b/src/Plugin/Type/PluginBase.php @@ -131,11 +131,13 @@ abstract class PluginBase extends DrupalPluginBase implements FeedsPluginInterfa /** * Renders a link to a route given a route name and its parameters. * + * See \Drupal\Core\Utility\LinkGeneratorInterface::generate() for details + * on the arguments, usage, and possible exceptions. + * * @return string * An HTML string containing a link to the given route and parameters. * - * @see \Drupal\Core\Utility\LinkGeneratorInterface::generate() for details - * on the arguments, usage, and possible exceptions. + * @see \Drupal\Core\Utility\LinkGeneratorInterface::generate() */ protected function l($text, $route_name, array $parameters = [], array $options = []) { return $this->linkGenerator()->generate($text, $route_name, $parameters, $options); @@ -144,11 +146,13 @@ abstract class PluginBase extends DrupalPluginBase implements FeedsPluginInterfa /** * Generates a URL or path for a specific route based on the given parameters. * + * See \Drupal\Core\Routing\UrlGeneratorInterface::generateFromRoute() for + * details on the arguments, usage, and possible exceptions. + * * @return string * The generated URL for the given route. * - * @see \Drupal\Core\Routing\UrlGeneratorInterface::generateFromRoute() for - * details on the arguments, usage, and possible exceptions. + * @see \Drupal\Core\Routing\UrlGeneratorInterface::generateFromRoute() */ protected function url($route_name, $route_parameters = [], $options = []) { return $this->urlGenerator()->generateFromRoute($route_name, $route_parameters, $options); diff --git a/tests/src/Unit/FeedsUnitTestCase.php b/tests/src/Unit/FeedsUnitTestCase.php index c60bd69..d4e0058 100644 --- a/tests/src/Unit/FeedsUnitTestCase.php +++ b/tests/src/Unit/FeedsUnitTestCase.php @@ -185,7 +185,7 @@ namespace { if (!function_exists('_format_date_callback')) { /** - * + * Stub for _format_date_callback() function. */ function _format_date_callback(array $matches = NULL, $new_langcode = NULL) { // We cache translations to avoid redundant and rather costly calls to @@ -222,19 +222,25 @@ namespace { } /** - * + * Stub for a filter format entity. */ class FeedsFilterStub { /** + * Constructs a new FeedsFilterStub. * + * @param string $label + * The filter's label. */ public function __construct($label) { $this->label = $label; } /** + * Returns the filter's label. * + * @return string + * The label of this filter. */ public function label() { return $this->label;