src/Plugin/Field/FieldWidget/SamlRoleMappingWidget.php
Method formElement
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Wontfix
Wontfix
public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
// If the form is newly built, the form state storage will be null. If the
// form is being rebuilt from an ajax, the storage will be some type of
// array.
syntax error, unexpected ','
Open
Open
id: "saml_role_mapping",
- Exclude checks
Variable $role_id is undefined. Invalid
Invalid
['#markup' => $role ? $role->label() : $this->t('Broken: @id', ['@id' => $role_id])],
- Exclude checks
Missing class doc comment Open
Open
class SamlRoleMappingWidget extends WidgetBase {
- Exclude checks
Variable $comparison is undefined. Invalid
Invalid
[$role_id, $comparison] = explode(':', $role_mapping_string, 2);
- Exclude checks
Variable $comparison is undefined. Invalid
Invalid
$exploded_comparison = explode(',', $comparison, 3);
- Exclude checks
Perl-style comments are not allowed; use "// Comment" instead Open
Open
#[FieldWidget(
- Exclude checks
Variable $role_id is undefined. Invalid
Invalid
->load($role_id);
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 2 Open
Open
id: "saml_role_mapping",
- Exclude checks
Variable $role_id is undefined. Invalid
Invalid
[$role_id, $comparison] = explode(':', $role_mapping_string, 2);
- Exclude checks
Unused use statement Open
Open
use Drupal\Core\Field\Attribute\FieldWidget;
- Exclude checks