Skip to content
Snippets Groups Projects
Commit 78f232ed authored by Bálint Junkuncz's avatar Bálint Junkuncz Committed by Wolfgang Ziegler
Browse files

Issue #3427892 by junkuncz: Stabilise 2.x CI build by addressing phpstan issues.

parent 662ea1d5
No related branches found
Tags 7.x-4.0-beta4
No related merge requests found
......@@ -33,24 +33,31 @@ include:
# View these include files at https://git.drupalcode.org/project/gitlab_templates/
################
- project: $_GITLAB_TEMPLATES_REPO
# "ref" value can be:
# - Recommended (default) - `ref: $_GITLAB_TEMPLATES_REF` - The Drupal Association will update this value to the recommended tag for contrib.
# - Latest - `ref: main` - Get the latest additions and bug fixes as they are merged into the templates.
# - Minor or Major latests - `ref: 1.x-latest` or `ref: 1.0.x-latest` - Get the latest additions within a minor (mostly bugfixes) or major (bugs and new features).
# - Fixed tag - `ref: 1.0.1` - Set the value to a known tag. This will not get any updates.
# If you change the default value of ref, you should set the _CURL_TEMPLATES_REF variable in the variables section to be the same as set here.
ref: $_GITLAB_TEMPLATES_REF
file:
- '/includes/include.drupalci.main.yml'
# EXPERIMENTAL: For Drupal 7, remove the above line and uncomment the below.
# - '/includes/include.drupalci.main-d7.yml'
- '/includes/include.drupalci.variables.yml'
- '/includes/include.drupalci.workflows.yml'
- "/includes/include.drupalci.main.yml"
# For Drupal 7, remove the above line and uncomment the below.
# - "/includes/include.drupalci.main-d7.yml"
- "/includes/include.drupalci.variables.yml"
- "/includes/include.drupalci.workflows.yml"
#
################
# Pipeline configuration variables
#
# These are the variables provided to the Run Pipeline form that a user may want to override.
#
# Docs at https://git.drupalcode.org/project/gitlab_templates/-/blob/1.0.x/includes/include.drupalci.variables.yml
# Docs at https://git.drupalcode.org/project/gitlab_templates/-/blob/main/includes/include.drupalci.variables.yml
################
# variables:
# SKIP_ESLINT: '1'
variables:
SKIP_CSPELL: '1'
# OPT_IN_TEST_NEXT_MAJOR: '1'
# _CURL_TEMPLATES_REF: 'main'
###################################################################################
#
......
......@@ -5,8 +5,8 @@
* Hooks specific to the module.
*/
use Drupal\custom_elements\CustomElement;
use Drupal\Core\Entity\EntityInterface;
use Drupal\custom_elements\CustomElement;
/**
* Allows preparing custom element defaults before it is processed.
......
......@@ -6,12 +6,12 @@
*/
use Drupal\Component\Render\MarkupInterface;
use Drupal\Core\Render\Markup;
use Drupal\custom_elements\CustomElement;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Render\BubbleableMetadata;
use Drupal\Core\Render\Markup;
use Drupal\Core\Template\Attribute;
use Drupal\custom_elements\CustomElement;
use Drupal\custom_elements\CustomElementsEntityViewDisplay;
use Drupal\custom_elements\CustomElementsLayoutBuilderEntityViewDisplay;
......
......@@ -120,6 +120,7 @@ class CustomElement implements CacheableDependencyInterface {
* The created custom element.
*/
public static function create($tag = 'div') {
// @phpstan-ignore-next-line
$element = new static();
$element->setTag($tag);
return $element;
......@@ -264,6 +265,7 @@ class CustomElement implements CacheableDependencyInterface {
* @return $this
*/
public function setSlotFromRenderArray($key, array $build, string $tag = 'div', array $attributes = [], int $index = NULL, int $weight = 0) {
// @phpstan-ignore-next-line
$markup = \Drupal::service('renderer')->renderPlain($build);
// Add cache metadata as needed from the cache metadata attached to the
// render array.
......
......@@ -67,6 +67,7 @@ class DefaultContentEntityProcessor implements CustomElementProcessorInterface {
*/
public function getEntityTypeManager() {
if (empty($this->entityTypeManager)) {
// @phpstan-ignore-next-line
$this->entityTypeManager = \Drupal::entityTypeManager();
}
return $this->entityTypeManager;
......
......@@ -5,10 +5,10 @@
* Contains hook implementations for testing Custom elements module.
*/
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Session\AccountInterface;
/**
* Implements hook_entity_field_access().
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment