Skip to content
Snippets Groups Projects
Commit 3281c177 authored by Alberto Paderno's avatar Alberto Paderno Committed by Mariano Gutiérrez
Browse files

Issue #3360082: Fix the issues reported by phpcs

parent 0803c2c9
Branches 1.0.x
No related tags found
1 merge request!1Issue #3360082: Fix the issues reported by phpcs
Pipeline #152361 passed with warnings
################
# DrupalCI GitLabCI template
#
# Gitlab-ci.yml to replicate DrupalCI testing for Contrib
#
# With thanks to:
# * The GitLab Acceleration Initiative participants
# * DrupalSpoons
################
################
# Guidelines
#
# This template is designed to give any Contrib maintainer everything they need to test, without requiring modification. It is also designed to keep up to date with Core Development automatically through the use of include files that can be centrally maintained.
#
# However, you can modify this template if you have additional needs for your project.
################
################
# Includes
#
# Additional configuration can be provided through includes.
# One advantage of include files is that if they are updated upstream, the changes affect all pipelines using that include.
#
# Includes can be overridden by re-declaring anything provided in an include, here in gitlab-ci.yml
# https://docs.gitlab.com/ee/ci/yaml/includes.html#override-included-configuration-values
################
include:
################
# DrupalCI includes:
# As long as you include this, any future includes added by the Drupal Association will be accessible to your pipelines automatically.
# 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'
- '/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/main/includes/include.drupalci.variables.yml
################
# variables:
# SKIP_ESLINT: '1'
# OPT_IN_TEST_NEXT_MAJOR: '1'
# _CURL_TEMPLATES_REF: 'main'
###################################################################################
#
# *
# /(
# ((((,
# /(((((((
# ((((((((((*
# ,(((((((((((((((
# ,(((((((((((((((((((
# ((((((((((((((((((((((((*
# *(((((((((((((((((((((((((((((
# ((((((((((((((((((((((((((((((((((*
# *(((((((((((((((((( .((((((((((((((((((
# ((((((((((((((((((. /(((((((((((((((((*
# /((((((((((((((((( .(((((((((((((((((,
# ,(((((((((((((((((( ((((((((((((((((((
# .(((((((((((((((((((( .(((((((((((((((((
# ((((((((((((((((((((((( ((((((((((((((((/
# (((((((((((((((((((((((((((/ ,(((((((((((((((*
# .((((((((((((((/ /(((((((((((((. ,(((((((((((((((
# *(((((((((((((( ,(((((((((((((/ *((((((((((((((.
# ((((((((((((((, /(((((((((((((. ((((((((((((((,
# (((((((((((((/ ,(((((((((((((* ,(((((((((((((,
# *((((((((((((( .((((((((((((((( ,(((((((((((((
# ((((((((((((/ /((((((((((((((((((. ,((((((((((((/
# ((((((((((((( *(((((((((((((((((((((((* *((((((((((((
# ((((((((((((( ,(((((((((((((..((((((((((((( *((((((((((((
# ((((((((((((, /((((((((((((* /((((((((((((/ ((((((((((((
# ((((((((((((( /((((((((((((/ (((((((((((((* ((((((((((((
# (((((((((((((/ /(((((((((((( ,((((((((((((, *((((((((((((
# (((((((((((((( *(((((((((((/ *((((((((((((. ((((((((((((/
# *((((((((((((((((((((((((((, /(((((((((((((((((((((((((
# ((((((((((((((((((((((((( ((((((((((((((((((((((((,
# .(((((((((((((((((((((((/ ,(((((((((((((((((((((((
# ((((((((((((((((((((((/ ,(((((((((((((((((((((/
# *((((((((((((((((((((( (((((((((((((((((((((,
# ,(((((((((((((((((((((, ((((((((((((((((((((/
# ,(((((((((((((((((((((* /((((((((((((((((((((
# ((((((((((((((((((((((, ,/((((((((((((((((((((,
# ,(((((((((((((((((((((((((((((((((((((((((((((((((((
# .(((((((((((((((((((((((((((((((((((((((((((((
# .((((((((((((((((((((((((((((((((((((,.
# .,(((((((((((((((((((((((((.
#
###################################################################################
......@@ -5,6 +5,9 @@ namespace Drupal\trapadata\Form;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Configuration form.
*/
class TrapadataForm extends ConfigFormBase {
/**
......@@ -18,7 +21,6 @@ class TrapadataForm extends ConfigFormBase {
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
// Form constructor.
$form = parent::buildForm($form, $form_state);
// Default settings.
$config = $this->config('trapadata.settings');
......@@ -40,7 +42,7 @@ class TrapadataForm extends ConfigFormBase {
return $form;
}
/**
/**
* {@inheritdoc}
*/
public function validateForm(array &$form, FormStateInterface $form_state) {
......
......@@ -3,4 +3,4 @@ type: module
description: 'Trapadata Management module for Drupal'
package: Development
core_version_requirement: ^9 || ^10
configure: trapadata.form
\ No newline at end of file
configure: trapadata.form
<?php
/**
* @file
* Hook implementations for the Trapadata Management module.
*/
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Routing\RouteMatchInterface;
/**
......@@ -12,10 +18,10 @@ function trapadata_help($route_name, RouteMatchInterface $route_match) {
<h2>Trapadata management module for Drupal.</h2>
<h3>Instructions</h3>
<p>Lorem ipsum dolor sit amet... <strong>Just kidding!</strong></p>
<p>Unpack in the <em>modules/custom/</em> folder (currently in the root of your Drupal installation) and enable in
<p>Unpack in the <em>modules/custom/</em> folder (currently in the root of your Drupal installation) and enable in
<strong>/admin/modules</strong>.</p>
<p>Then, visit <strong>/admin/config/development/trapadata</strong> and enter your own set of phrases to build
random-generated
<p>Then, visit <strong>/admin/config/development/trapadata</strong> and enter your own set of phrases to build
random-generated
text (or go with the default Lorem ipsum).</p>
<p>Last, visit <strong>e.com/loremipsum/generate/P/S</strong> where:</p>
<ul>
......@@ -26,26 +32,25 @@ text (or go with the default Lorem ipsum).</p>
phrases and it\'ll do the rest.</p>
<p>If you need, there\'s also a specific <em>generate lorem ipsum</em> permission.</p>
<h3>Attention</h3>
<p>Most bugs have been ironed out, holes covered, features added. But this module is a work in progress. Please report bugs and
<p>Most bugs have been ironed out, holes covered, features added. But this module is a work in progress. Please report bugs and
suggestions, ok?</p>
');
}
}
/**
* Implements hook_entity_presave().
*/
function trapadata_entity_presave(Drupal\Core\Entity\EntityInterface $entity) {
#\Drupal::messenger()->addMessage($i++.'. Tipo entidad: '.$entity->bundle());
function trapadata_entity_presave(EntityInterface $entity) {
switch ($entity->bundle()) {
case 'operacion':
$array_intervinientes = array();
$array_intervinientes = [];
$intervinientes = $entity->get('field_intervinientes')->referencedEntities();
foreach ($intervinientes as $interviniente) {
$array_intervinientes[] = $interviniente->field_interviniente->target_id;
}
break;
break;
}
\Drupal::messenger()->addMessage(print_r($array_intervinientes, -1));
$entity->field_accesos_especificos = $array_intervinientes;
}
\ No newline at end of file
}
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