Skip to content

Instantly share code, notes, and snippets.

@dpi
Last active March 10, 2023 11:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dpi/37a18538284d98ecd7baf3629515566e to your computer and use it in GitHub Desktop.
Save dpi/37a18538284d98ecd7baf3629515566e to your computer and use it in GitHub Desktop.
stubs
<?php
/**
* @file
* Dumping ground for stubs, until a pattern emerges.
*/
declare(strict_types=1);
namespace Drupal\datetime\Plugin\Field\FieldType {
/**
* @property \Drupal\Core\Datetime\DrupalDateTime|null $date
*/
class DateTimeFieldItemList {
}
/**
* @property \Drupal\Core\Datetime\DrupalDateTime $date
*/
class DateTimeItem {
}
}
namespace Drupal\path\Plugin\Field\FieldType {
/**
* @property string $alias
*/
class PathItem {
}
}
namespace Drupal\geofield\Plugin\Field\FieldType {
/**
* @property int $lat
* @property int $lon
*/
class GeofieldItem {
}
}
namespace Drupal\date_recur_oh_field\Plugin\Field\FieldType {
/**
* @property bool $open
* @property string|null $message
*/
class DateRecurOHItem {
}
}
namespace Drupal\Core\Field\Plugin\Field\FieldType {
/**
* @property string|null $target_id
*/
interface EntityReferenceItemInterface {
}
}
namespace Drupal\text\Plugin\Field\FieldType {
/**
* @property string $format
* @property string $value
* @property \Drupal\filter\Render\FilteredMarkup $processed
*/
class TextItem {
}
/**
* @property string $format
* @property string $value
*/
class TextLongItem {
}
}
namespace Drupal\Core\StringTranslation {
class TranslatableMarkup {
}
}
namespace Drupal\Component\Render {
interface MarkupInterface {}
}
namespace Drupal\views {
class ResultRow {}
}
namespace Drupal\views\Plugin\views\field {
interface FieldHandlerInterface {
/**
* @param \Drupal\views\ResultRow $values
* @phpstan-return string|array<mixed>|\Drupal\Core\StringTranslation\TranslatableMarkup
*/
public function render($values);
}
}
namespace Drupal\Core\Field {
class WidgetBase {}
}
namespace Drupal\Core\Field\Plugin\Field\FieldWidget {
abstract class OptionsSelectWidget extends \Drupal\Core\Field\WidgetBase {
/**
* @return \Drupal\Core\StringTranslation\TranslatableMarkup|string|null
*/
protected function getEmptyLabel() {}
}
}
namespace Drupal\Core\TypedData {
class DataDefinition {
/**
* @phpstan-param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label
* @return $this
*/
public function setLabel($label) {}
/**
* @phpstan-param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description
* @return $this
*/
public function setDescription($description) { }
}
}
namespace Drupal\Core\Form {
interface FormStateInterface {
/**
* @param string $name
* @param \Drupal\Core\StringTranslation\TranslatableMarkup|string $message
* @return $this
*/
public function setErrorByName(string $name, \Drupal\Core\StringTranslation\TranslatableMarkup|string $message = ''): static;
/**
* @param array<mixed> $element
* @param \Drupal\Core\StringTranslation\TranslatableMarkup|string $message
* @return $this
*/
public function setError(array &$element, \Drupal\Core\StringTranslation\TranslatableMarkup|string $message = ''): static;
}
}
namespace Drupal\Core\Queue {
interface QueueInterface {
/**
* @phpstan-return false|\stdClass{'data':mixed}
*/
public function claimItem(int $lease_time = 3600): mixed;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment