diff --git a/core/modules/aggregator/lib/Drupal/aggregator/FeedInterface.php b/core/modules/aggregator/lib/Drupal/aggregator/FeedInterface.php new file mode 100644 index 0000000..1f56021 --- /dev/null +++ b/core/modules/aggregator/lib/Drupal/aggregator/FeedInterface.php @@ -0,0 +1,17 @@ +theme = $theme; } /** - * Gets the theme value. - * - * When creating a new custom block from the block library, the user is - * redirected to the configure form for that block in the given theme. The - * theme is stored against the block when the custom block add form is shown. - * - * @return string - * The theme name. + * {@inheritdoc} */ public function getTheme() { return $this->theme; diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/Core/Entity/CustomBlockType.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/Core/Entity/CustomBlockType.php index dca5964..ccbe378 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/Core/Entity/CustomBlockType.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/Core/Entity/CustomBlockType.php @@ -10,6 +10,7 @@ use Drupal\Core\Config\Entity\ConfigEntityBase; use Drupal\Core\Entity\Annotation\EntityType; use Drupal\Core\Annotation\Translation; +use Drupal\custom_block\CustomBlockTypeInterface; /** * Defines the custom block type entity. @@ -31,7 +32,7 @@ * } * ) */ -class CustomBlockType extends ConfigEntityBase { +class CustomBlockType extends ConfigEntityBase implements CustomBlockTypeInterface { /** * The custom block type ID. diff --git a/core/modules/block/lib/Drupal/block/BlockBase.php b/core/modules/block/lib/Drupal/block/BlockBase.php index 0909345..6deb139 100644 --- a/core/modules/block/lib/Drupal/block/BlockBase.php +++ b/core/modules/block/lib/Drupal/block/BlockBase.php @@ -18,7 +18,7 @@ * block settings, and handling for general user-defined block visibility * settings. */ -abstract class BlockBase extends PluginBase implements BlockInterface { +abstract class BlockBase extends PluginBase implements BlockPluginInterface { /** * The entity using this plugin. @@ -118,7 +118,7 @@ public function blockAccess() { } /** - * Implements \Drupal\block\BlockInterface::access(). + * Implements \Drupal\block\BlockPluginInterface::access(). * * Adds the user-configured per-role, per-path, and per-language visibility * settings to all blocks, and invokes hook_block_access(). @@ -212,7 +212,7 @@ public function access() { } /** - * Implements \Drupal\block\BlockInterface::form(). + * Implements \Drupal\block\BlockPluginInterface::form(). * * Creates a generic configuration form for all block types. Individual * block plugins can add elements to this form by overriding @@ -419,7 +419,7 @@ public function blockForm($form, &$form_state) { } /** - * Implements \Drupal\block\BlockInterface::validate(). + * Implements \Drupal\block\BlockPluginInterface::validate(). * * Most block plugins should not override this method. To add validation * for a specific block type, override BlockBase::blockValdiate(). @@ -459,7 +459,7 @@ public function validate($form, &$form_state) { public function blockValidate($form, &$form_state) {} /** - * Implements \Drupal\block\BlockInterface::submit(). + * Implements \Drupal\block\BlockPluginInterface::submit(). * * Most block plugins should not override this method. To add submission * handling for a specific block type, override BlockBase::blockSubmit(). diff --git a/core/modules/block/lib/Drupal/block/BlockInterface.php b/core/modules/block/lib/Drupal/block/BlockInterface.php index 65bdee3..cf049a5 100644 --- a/core/modules/block/lib/Drupal/block/BlockInterface.php +++ b/core/modules/block/lib/Drupal/block/BlockInterface.php @@ -2,104 +2,24 @@ /** * @file - * Contains \Drupal\block\BlockInterface. + * Contains \Drupal\block\Plugin\Core\Entity\BlockInterface. */ namespace Drupal\block; +use Drupal\Core\Config\Entity\ConfigEntityInterface; + /** - * Defines the required interface for all block plugins. - * - * @todo Add detailed documentation here explaining the block system's - * architecture and the relationships between the various objects, including - * brif references to the important components that are not coupled to the - * interface. - * - * @see \Drupal\block\BlockBase + * Provides an interface defining a block entity. */ -interface BlockInterface { - - /** - * Returns the default settings for this block plugin. - * - * @return array - * An associative array of block settings for this block, keyed by the - * setting name. - * - * @todo Consider merging this with the general plugin configuration member - * variable and its getter/setter in http://drupal.org/node/1764380. - */ - public function settings(); - - /** - * Indicates whether the block should be shown. - * - * This method allows base implementations to add general access restrictions - * that should apply to all extending block plugins. - * - * @return bool - * TRUE if the block should be shown, or FALSE otherwise. - * - * @see \Drupal\block\BlockAccessController - */ - public function access(); - - /** - * Constructs the block configuration form. - * - * This method allows base implementations to add a generic configuration - * form for extending block plugins. - * - * @param array $form - * The form definition array for the block configuration form. - * @param array $form_state - * An array containing the current state of the configuration form. - * - * @return array $form - * The renderable form array representing the entire configuration form. - * - * @see \Drupal\block\BlockFormController::form() - * @see \Drupal\block\BlockInterace::validate() - * @see \Drupal\block\BlockInterace::submit() - */ - public function form($form, &$form_state); +interface BlockInterface extends ConfigEntityInterface { /** - * Handles form validation for the block configuration form. - * - * @param array $form - * The form definition array for the block configuration form. - * @param array $form_state - * An array containing the current state of the configuration form. - * - * @see \Drupal\block\BlockFormController::validate() - * @see \Drupal\block\BlockInterace::form() - * @see \Drupal\block\BlockInterace::submit() - */ - public function validate($form, &$form_state); - - /** - * Handles form submissions for the block configuration form. - * - * @param array $form - * The form definition array for the block configuration form. - * @param array $form_state - * An array containing the current state of the configuration form. - * - * @see \Drupal\block\BlockFormController::submit() - * @see \Drupal\block\BlockInterace::form() - * @see \Drupal\block\BlockInterace::validate() - */ - public function submit($form, &$form_state); - - /** - * Builds and returns the renderable array for this block plugin. - * - * @return array - * A renderable array representing the content of the block. + * Returns the plugin instance. * - * @see \Drupal\block\BlockRenderController + * @return \Drupal\block\BlockPluginInterface + * The plugin instance for this block. */ - public function build(); + public function getPlugin(); } diff --git a/core/modules/block/lib/Drupal/block/BlockInterface.php b/core/modules/block/lib/Drupal/block/BlockPluginInterface.php similarity index 97% copy from core/modules/block/lib/Drupal/block/BlockInterface.php copy to core/modules/block/lib/Drupal/block/BlockPluginInterface.php index 65bdee3..1887816 100644 --- a/core/modules/block/lib/Drupal/block/BlockInterface.php +++ b/core/modules/block/lib/Drupal/block/BlockPluginInterface.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\block\BlockInterface. + * Contains \Drupal\block\BlockPluginInterface. */ namespace Drupal\block; @@ -17,7 +17,7 @@ * * @see \Drupal\block\BlockBase */ -interface BlockInterface { +interface BlockPluginInterface { /** * Returns the default settings for this block plugin. diff --git a/core/modules/block/lib/Drupal/block/Plugin/Core/Entity/Block.php b/core/modules/block/lib/Drupal/block/Plugin/Core/Entity/Block.php index 2d8c638..d158be4 100644 --- a/core/modules/block/lib/Drupal/block/Plugin/Core/Entity/Block.php +++ b/core/modules/block/lib/Drupal/block/Plugin/Core/Entity/Block.php @@ -11,6 +11,7 @@ use Drupal\Core\Entity\Annotation\EntityType; use Drupal\Core\Annotation\Translation; use Drupal\Component\Plugin\Exception\PluginException; +use Drupal\block\BlockInterface; /** * Defines a Block configuration entity class. @@ -36,7 +37,7 @@ * } * ) */ -class Block extends ConfigEntityBase { +class Block extends ConfigEntityBase implements BlockInterface { /** * The ID of the block. @@ -80,7 +81,7 @@ class Block extends ConfigEntityBase { /** * The plugin instance. * - * @var \Drupal\block\BlockInterface + * @var \Drupal\block\BlockPluginInterface */ protected $instance; @@ -120,10 +121,7 @@ class Block extends ConfigEntityBase { protected $plugin; /** - * Returns the plugin instance. - * - * @return \Drupal\block\BlockInterface - * The plugin instance for this block. + * {@inheritdoc} */ public function getPlugin() { if (!$this->instance) { diff --git a/core/modules/block/lib/Drupal/block/Plugin/Type/BlockManager.php b/core/modules/block/lib/Drupal/block/Plugin/Type/BlockManager.php index b102d4b..97a0d44 100644 --- a/core/modules/block/lib/Drupal/block/Plugin/Type/BlockManager.php +++ b/core/modules/block/lib/Drupal/block/Plugin/Type/BlockManager.php @@ -20,7 +20,7 @@ * * @todo Add documentation to this class. * - * @see \Drupal\block\BlockInterface + * @see \Drupal\block\BlockPluginInterface */ class BlockManager extends PluginManagerBase { diff --git a/core/modules/breakpoint/lib/Drupal/breakpoint/BreakpointGroupInterface.php b/core/modules/breakpoint/lib/Drupal/breakpoint/BreakpointGroupInterface.php new file mode 100644 index 0000000..3f441e9 --- /dev/null +++ b/core/modules/breakpoint/lib/Drupal/breakpoint/BreakpointGroupInterface.php @@ -0,0 +1,48 @@ + TRUE); } /** - * Implements \Drupal\editor\Plugin\EditorInterface::settingsForm(). + * Implements \Drupal\editor\Plugin\EditPluginInterface::settingsForm(). */ function settingsForm(array $form, array &$form_state, Editor $editor) { $form['foo'] = array('#type' => 'textfield', '#default_value' => 'bar'); @@ -40,7 +40,7 @@ function settingsForm(array $form, array &$form_state, Editor $editor) { } /** - * Implements \Drupal\editor\Plugin\EditorInterface::getJSSettings(). + * Implements \Drupal\editor\Plugin\EditPluginInterface::getJSSettings(). */ function getJSSettings(Editor $editor) { $settings = array(); @@ -51,7 +51,7 @@ function getJSSettings(Editor $editor) { } /** - * Implements \Drupal\editor\Plugin\EditorInterface::getLibraries(). + * Implements \Drupal\editor\Plugin\EditPluginInterface::getLibraries(). */ public function getLibraries(Editor $editor) { return array( diff --git a/core/modules/entity/lib/Drupal/entity/EntityDisplayInterface.php b/core/modules/entity/lib/Drupal/entity/EntityDisplayInterface.php new file mode 100644 index 0000000..0c1fa6c --- /dev/null +++ b/core/modules/entity/lib/Drupal/entity/EntityDisplayInterface.php @@ -0,0 +1,96 @@ +createDuplicate(); @@ -158,10 +150,7 @@ public function createCopy($view_mode) { } /** - * Gets the display options for all components. - * - * @return array - * The array of display options, keyed by component name. + * {@inheritdoc} */ public function getComponents() { $result = array(); @@ -175,14 +164,7 @@ public function getComponents() { } /** - * Gets the display options set for a component. - * - * @param string $name - * The name of the component. - * - * @return array|null - * The display options for the component, or NULL if the component is not - * displayed. + * {@inheritdoc} */ public function getComponent($name) { // We always store 'extra fields', whether they are visible or hidden. @@ -220,15 +202,7 @@ public function getComponent($name) { } /** - * Sets the display options for a component. - * - * @param string $name - * The name of the component. - * @param array $options - * The display options. - * - * @return \Drupal\entity\Plugin\Core\Entity\EntityDisplay - * The EntityDisplay object. + * {@inheritdoc} */ public function setComponent($name, array $options = array()) { // If no weight specified, make sure the field sinks at the bottom. @@ -257,13 +231,7 @@ public function setComponent($name, array $options = array()) { } /** - * Sets a component to be hidden. - * - * @param string $name - * The name of the component. - * - * @return \Drupal\entity\Plugin\Core\Entity\EntityDisplay - * The EntityDisplay object. + * {@inheritdoc} */ public function removeComponent($name) { $extra_fields = field_info_extra_fields($this->targetEntityType, $this->bundle, 'display'); @@ -285,11 +253,7 @@ public function removeComponent($name) { } /** - * Returns the highest weight of the components in the display. - * - * @return int|null - * The highest weight of the components in the display, or NULL if the - * display is empty. + * {@inheritdoc} */ public function getHighestWeight() { $weights = array(); @@ -308,14 +272,7 @@ public function getHighestWeight() { } /** - * Returns the Formatter plugin for a field. - * - * @param string $field_name - * The field name. - * - * @return \Drupal\field\Plugin\Type\Formatter\FormatterInterface - * If the field is not hidden, the Formatter plugin to use for rendering - * it. + * {@inheritdoc} */ public function getFormatter($field_name) { if (isset($this->formatters[$field_name])) { diff --git a/core/modules/field/lib/Drupal/field/FieldInstanceInterface.php b/core/modules/field/lib/Drupal/field/FieldInstanceInterface.php new file mode 100644 index 0000000..438bd00 --- /dev/null +++ b/core/modules/field/lib/Drupal/field/FieldInstanceInterface.php @@ -0,0 +1,42 @@ +schema)) { @@ -482,31 +470,7 @@ public function getSchema() { } /** - * Returns information about how the storage backend stores the field data. - * - * The content of the returned value depends on the storage backend, and some - * storage backends might provide no information. - * - * It is strongly discouraged to use this information to perform direct write - * operations to the field data storage, bypassing the regular field saving - * APIs. - * - * Example return value for the default field_sql_storage backend: - * - 'sql' - * - FIELD_LOAD_CURRENT - * - Table name (string). - * - Table schema (array) - * - FIELD_LOAD_REVISION - * - Table name (string). - * - Table schema (array). - * - * @return array - * The storage details. - * - The first dimension is a store type (sql, solr, etc). - * - The second dimension indicates the age of the values in the store - * FIELD_LOAD_CURRENT or FIELD_LOAD_REVISION. - * - Other dimensions are specific to the field storage backend. - + * {@inheritdoc} */ public function getStorageDetails() { if (!isset($this->storageDetails)) { @@ -525,11 +489,7 @@ public function getStorageDetails() { } /** - * Returns the list of bundles where the field has instances. - * - * @return array - * An array keyed by entity type names, whose values are arrays of bundle - * names. + * {@inheritdoc} */ public function getBundles() { if (empty($this->deleted)) { diff --git a/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/FieldInstance.php b/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/FieldInstance.php index 363d54f..2cbcfc5 100644 --- a/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/FieldInstance.php +++ b/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/FieldInstance.php @@ -11,6 +11,7 @@ use Drupal\Core\Annotation\Translation; use Drupal\Core\Config\Entity\ConfigEntityBase; use Drupal\field\FieldException; +use Drupal\field\FieldInstanceInterface; /** * Defines the Field instance entity. @@ -28,7 +29,7 @@ * } * ) */ -class FieldInstance extends ConfigEntityBase implements \ArrayAccess, \Serializable { +class FieldInstance extends ConfigEntityBase implements FieldInstanceInterface { /** * The instance ID (machine name). @@ -430,21 +431,15 @@ public function delete($field_cleanup = TRUE) { } } - /** - * Returns the field entity for this instance. - * - * @return \Drupal\field\Plugin\Core\Entity\Field - * The field entity for this instance. - */ + /** + * {@inheritdoc} + */ public function getField() { return $this->field; } /** - * Returns the Widget plugin for the instance. - * - * @return Drupal\field\Plugin\Type\Widget\WidgetInterface - * The Widget plugin to be used for the instance. + * {@inheritdoc} */ public function getWidget() { if (empty($this->widgetPlugin)) { @@ -474,11 +469,7 @@ public function getWidget() { } /** - * Allows a bundle to be renamed. - * - * Renaming a bundle on the instance is allowed when an entity's bundle - * is renamed and when field_entity_bundle_rename() does internal - * housekeeping. + * {@inheritdoc} */ public function allowBundleRename() { $this->bundle_rename_allowed = TRUE; diff --git a/core/modules/file/lib/Drupal/file/FileInterface.php b/core/modules/file/lib/Drupal/file/FileInterface.php new file mode 100644 index 0000000..5912491 --- /dev/null +++ b/core/modules/file/lib/Drupal/file/FileInterface.php @@ -0,0 +1,17 @@ +route_name) { @@ -277,23 +275,14 @@ public function getRoute() { } /** - * Sets the route object for this link. - * - * This should only be called by MenuLinkStorageController when loading - * the link object. Calling it at other times could result in unpredictable - * behavior. - * - * @param \Symfony\Component\Routing\Route $route + * {@inheritdoc} */ public function setRouteObject(Route $route) { $this->routeObject = $route; } /** - * Resets a system-defined menu link. - * - * @return \Drupal\Core\Entity\EntityInterface - * A menu link entity. + * {@inheritdoc} */ public function reset() { // To reset the link to its original values, we need to retrieve its @@ -313,13 +302,7 @@ public function reset() { } /** - * Builds a menu link entity from a router item. - * - * @param array $item - * A menu router item. - * - * @return MenuLink - * A menu link entity. + * {@inheritdoc} */ public static function buildFromRouterItem(array $item) { // Suggested items are disabled by default. diff --git a/core/modules/node/lib/Drupal/node/NodeInterface.php b/core/modules/node/lib/Drupal/node/NodeInterface.php new file mode 100644 index 0000000..7999675 --- /dev/null +++ b/core/modules/node/lib/Drupal/node/NodeInterface.php @@ -0,0 +1,17 @@ +label; - } - - /** - * The paths that this tour will appear on. - * - * @return array - * Returns array of paths for the tour. + * {@inheritdoc} */ public function getPaths() { return $this->paths; } /** - * Returns tip plugin. - * - * @return string - * The identifier of the tip. + * {@inheritdoc} */ public function getTip($id) { return $this->tipsBag->get($id); } /** - * Returns the tips for this tour. - * - * @return array - * An array of tip plugins. + * {@inheritdoc} */ public function getTips() { $tips = array(); diff --git a/core/modules/tour/lib/Drupal/tour/TourInterface.php b/core/modules/tour/lib/Drupal/tour/TourInterface.php new file mode 100644 index 0000000..4678a7b --- /dev/null +++ b/core/modules/tour/lib/Drupal/tour/TourInterface.php @@ -0,0 +1,44 @@ +