Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions stubs/Drupal/Component/Plugin/ConfigurableInterface.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace Drupal\Component\Plugin;

interface ConfigurableInterface {

/**
* @return array<array-key, mixed>
*/
public function getConfiguration();

/**
* @param array<array-key, mixed> $configuration
*
* @return void|static
*/
public function setConfiguration(array $configuration);

/**
* @return array<array-key, mixed>
*/
public function defaultConfiguration();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace Drupal\Component\Plugin\Definition;

interface PluginDefinitionInterface {

}
22 changes: 22 additions & 0 deletions stubs/Drupal/Component/Plugin/Derivative/DeriverInterface.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace Drupal\Component\Plugin\Derivative;

interface DeriverInterface {

/**
* @param string $derivative_id
* @param array<array-key, mixed>|\Drupal\Component\Plugin\Definition\PluginDefinitionInterface $base_plugin_definition
*
* @return array<array-key, mixed>|null
*/
public function getDerivativeDefinition($derivative_id, $base_plugin_definition);

/**
* @param array<array-key, mixed>|\Drupal\Component\Plugin\Definition\PluginDefinitionInterface $base_plugin_definition
*
* @return array<array-key, mixed>
*/
public function getDerivativeDefinitions($base_plugin_definition);

}
7 changes: 7 additions & 0 deletions stubs/Drupal/Component/Plugin/PluginBase.stub
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,11 @@ namespace Drupal\Component\Plugin;

abstract class PluginBase implements PluginInspectionInterface, DerivativeInspectionInterface {

/**
* @param array<array-key, mixed> $configuration
* @param string $plugin_id
* @param mixed $plugin_definition
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition) {}

}
27 changes: 27 additions & 0 deletions stubs/Drupal/Core/Entity/EntityAccessControlHandler.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace Drupal\Core\Entity;

use Drupal\Core\Session\AccountInterface;

class EntityAccessControlHandler extends EntityHandlerBase implements EntityAccessControlHandlerInterface {

/**
* @var array<array-key, mixed>
*/
protected $accessCache = [];

/**
* @param array<array-key, mixed> $context
* @param string|null $entity_bundle
*
* @return \Drupal\Core\Access\AccessResultInterface
*/
protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) {}

/**
* @param array<array-key, mixed> $context
*/
protected function buildCreateAccessCid(array $context, ?string $entity_bundle): ?string {}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace Drupal\Core\Entity;

interface EntityAccessControlHandlerInterface {

}
17 changes: 17 additions & 0 deletions stubs/Drupal/Core/Entity/EntityForm.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Drupal\Core\Entity;

use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;

class EntityForm extends FormBase implements EntityFormInterface {

/**
* @param array<array-key, mixed> $form
*
* @return array<array-key, mixed>
*/
public function form(array $form, FormStateInterface $form_state) {}

}
24 changes: 24 additions & 0 deletions stubs/Drupal/Core/Entity/EntityFormInterface.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace Drupal\Core\Entity;

use Drupal\Core\Form\BaseFormIdInterface;
use Drupal\Core\Form\FormStateInterface;

interface EntityFormInterface extends BaseFormIdInterface {

/**
* @param array<array-key, mixed> $form
*
* @return \Drupal\Core\Entity\EntityInterface
*/
public function buildEntity(array $form, FormStateInterface $form_state);

/**
* @param array<array-key, mixed> $form
*
* @return int
*/
public function save(array $form, FormStateInterface $form_state);

}
27 changes: 27 additions & 0 deletions stubs/Drupal/Core/Entity/EntityListBuilder.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace Drupal\Core\Entity;

class EntityListBuilder extends EntityHandlerBase implements EntityListBuilderInterface, EntityHandlerInterface {

/**
* @return array<array-key, mixed>
*/
protected function getDefaultOperations(EntityInterface $entity) {}

/**
* @return array<array-key, mixed>
*/
public function buildHeader() {}

/**
* @return array<array-key, mixed>
*/
public function buildRow(EntityInterface $entity) {}

/**
* @return array<array-key, mixed>
*/
public function buildOperations(EntityInterface $entity) {}

}
17 changes: 17 additions & 0 deletions stubs/Drupal/Core/Entity/EntityListBuilderInterface.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Drupal\Core\Entity;

interface EntityListBuilderInterface {

/**
* @return array<array-key, mixed>
*/
public function getOperations(EntityInterface $entity);

/**
* @return array<array-key, mixed>
*/
public function render();

}
2 changes: 2 additions & 0 deletions stubs/Drupal/Core/Entity/FieldableEntityInterface.stub
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ interface FieldableEntityInterface extends EntityInterface {
public static function baseFieldDefinitions(EntityTypeInterface $entity_type): array;

/**
* @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
* @param string $bundle
* @param array<string, \Drupal\Core\Field\FieldDefinitionInterface> $base_field_definitions
* @return array<string, \Drupal\Core\Field\FieldDefinitionInterface>
*/
Expand Down
32 changes: 32 additions & 0 deletions stubs/Drupal/Core/Field/FieldItemInterface.stub
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,39 @@

namespace Drupal\Core\Field;

use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\TypedData\ComplexDataInterface;

interface FieldItemInterface extends ComplexDataInterface {

/**
* @return array<array-key, mixed>
*/
public static function schema(FieldStorageDefinitionInterface $field_definition);

/**
* @param array<array-key, mixed> $form
* @param bool $has_data
*
* @return array<array-key, mixed>
*/
public function storageSettingsForm(array &$form, FormStateInterface $form_state, $has_data);

/**
* @return array<array-key, mixed>
*/
public static function defaultFieldSettings();

/**
* @param array<array-key, mixed> $form
*
* @return array<array-key, mixed>
*/
public function fieldSettingsForm(array $form, FormStateInterface $form_state);

/**
* @return array<array-key, mixed>
*/
public static function generateSampleValue(FieldDefinitionInterface $field_definition);

}
7 changes: 7 additions & 0 deletions stubs/Drupal/Core/Field/FieldStorageDefinitionInterface.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace Drupal\Core\Field;

interface FieldStorageDefinitionInterface {

}
10 changes: 10 additions & 0 deletions stubs/Drupal/Core/Field/FormatterBase.stub
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,14 @@ abstract class FormatterBase extends PluginSettingsBase implements FormatterInte
*/
public function viewElements(FieldItemListInterface $items, $langcode) {}

/**
* @param string $plugin_id
* @param mixed $plugin_definition
* @param array<array-key, mixed> $settings
* @param string $label
* @param string $view_mode
* @param array<array-key, mixed> $third_party_settings
*/
public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings) {}

}
5 changes: 5 additions & 0 deletions stubs/Drupal/Core/Field/PluginSettingsInterface.stub
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@ use Drupal\Core\Config\Entity\ThirdPartySettingsInterface;

interface PluginSettingsInterface extends PluginInspectionInterface, ThirdPartySettingsInterface {

/**
* @return array<array-key, mixed>
*/
public static function defaultSettings();

}
28 changes: 28 additions & 0 deletions stubs/Drupal/Core/Field/WidgetBase.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace Drupal\Core\Field;

use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;

abstract class WidgetBase extends PluginSettingsBase implements WidgetInterface, ContainerFactoryPluginInterface {

/**
* @param string $plugin_id
* @param mixed $plugin_definition
* @param array<array-key, mixed> $settings
* @param array<array-key, mixed> $third_party_settings
*/
public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings) {}

/**
* @param \Drupal\Core\Field\FieldItemListInterface<\Drupal\Core\Field\FieldItemInterface> $items
* @param int $delta
* @param array<array-key, mixed> $element
* @param array<array-key, mixed> $form
*
* @return array<array-key, mixed>
*/
protected function formSingleElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {}

}
7 changes: 7 additions & 0 deletions stubs/Drupal/Core/Field/WidgetBaseInterface.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace Drupal\Core\Field;

interface WidgetBaseInterface extends PluginSettingsInterface {

}
48 changes: 48 additions & 0 deletions stubs/Drupal/Core/Field/WidgetInterface.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

namespace Drupal\Core\Field;

use Drupal\Core\Form\FormStateInterface;
use Symfony\Component\Validator\ConstraintViolationInterface;

interface WidgetInterface extends WidgetBaseInterface {

/**
* @param array<array-key, mixed> $form
*
* @return array<array-key, mixed>
*/
public function settingsForm(array $form, FormStateInterface $form_state);

/**
* @return array<array-key, mixed>
*/
public function settingsSummary();

/**
* @param \Drupal\Core\Field\FieldItemListInterface<\Drupal\Core\Field\FieldItemInterface> $items
* @param int $delta
* @param array<array-key, mixed> $element
* @param array<array-key, mixed> $form
*
* @return array<array-key, mixed>
*/
public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state);

/**
* @param array<array-key, mixed> $element
* @param array<array-key, mixed> $form
*
* @return array<array-key, mixed>|false
*/
public function errorElement(array $element, ConstraintViolationInterface $violation, array $form, FormStateInterface $form_state);

/**
* @param array<array-key, mixed> $values
* @param array<array-key, mixed> $form
*
* @return array<array-key, mixed>
*/
public function massageFormValues(array $values, array $form, FormStateInterface $form_state);

}
7 changes: 7 additions & 0 deletions stubs/Drupal/Core/Form/BaseFormIdInterface.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace Drupal\Core\Form;

interface BaseFormIdInterface extends FormInterface {

}
12 changes: 12 additions & 0 deletions stubs/Drupal/Core/Form/ConfigFormBaseTrait.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace Drupal\Core\Form;

trait ConfigFormBaseTrait {

/**
* @return array<array-key, mixed>
*/
abstract protected function getEditableConfigNames();

}
7 changes: 7 additions & 0 deletions stubs/Drupal/Core/Form/FormBase.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace Drupal\Core\Form;

abstract class FormBase implements FormInterface {

}
Loading
Loading