chamilo/chamilo-lms

View on GitHub
src/CoreBundle/Entity/ExtraField.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid unused parameters such as '$key'.
Open

        return $this->tags->exists(fn ($key, Tag $tag) => $tagName === $tag->getTag());
Severity: Minor
Found in src/CoreBundle/Entity/ExtraField.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[Groups(['extra_field:read', 'extra_field:write'])]

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[ORM\OneToMany(targetEntity: ExtraFieldOptions::class, mappedBy: 'field')]

Missing function doc comment
Open

    public function getAutoRemove(): bool

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

#[ORM\Entity]

Missing function doc comment
Open

    public function __construct()

Missing function doc comment
Open

    public function isVisibleToSelf(): bool

Missing function doc comment
Open

    public function getDescription(): ?string

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[ORM\Column(name: 'id', type: 'integer')]

Missing function doc comment
Open

    public function isChangeable(): ?bool

Missing function doc comment
Open

    public function hasTag(string $tagName): bool

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[Groups(['extra_field:read', 'extra_field:write'])]

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[ORM\Column(name: 'description', type: 'text', nullable: true)]

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[ORM\Column(name: 'display_text', type: 'string', length: 255, nullable: true, unique: false)]

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[Groups(['extra_field:read'])]

Missing function doc comment
Open

    public function getVariable(): string

Missing function doc comment
Open

    public function getDisplayText(): ?string

Space before opening parenthesis of function call prohibited
Open

        return $this->tags->exists(fn ($key, Tag $tag) => $tagName === $tag->getTag());

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

#[ApiFilter(filterClass: SearchFilter::class, properties: ['variable'])]

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[ORM\Column(name: 'item_type', type: 'integer')]

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[Assert\NotBlank]

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[ORM\Column(name: 'visible_to_self', type: 'boolean', nullable: true, unique: false)]

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[Gedmo\Timestampable(on: 'create')]

Missing function doc comment
Open

    public function setTags(Collection $tags): self

Missing function doc comment
Open

    public function getLocale(): string

Missing function doc comment
Open

    public function setLocale(string $locale): self

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

#[ApiResource(operations: [new Get(security: 'is_granted(\'ROLE_ADMIN\')'), new Put(security: 'is_granted(\'ROLE_ADMIN\')'), new GetCollection(security: 'is_granted(\'ROLE_ADMIN\')'), new Post(security: 'is_granted(\'ROLE_ADMIN\')')], security: 'is_granted(\'ROLE_ADMIN\')', denormalizationContext: ['groups' => ['extra_field:write']], normalizationContext: ['groups' => ['extra_field:read']])]

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[Assert\NotBlank]

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[ORM\Column(name: 'helper_text', type: 'text', nullable: true, unique: false)]

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[ORM\Column(name: 'field_order', type: 'integer', nullable: true, unique: false)]

Missing function doc comment
Open

    public function setItemType(int $itemType): self

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[Groups(['extra_field:read', 'extra_field:write'])]

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[ORM\Column(name: 'filter', type: 'boolean', nullable: true, unique: false)]

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[ORM\OneToMany(targetEntity: Tag::class, mappedBy: 'field')]

Missing function doc comment
Open

    public function setValueType(int $valueType): self

Missing function doc comment
Open

    public function isVisibleToOthers(): bool

Space before opening parenthesis of function call prohibited
Open

        return match ($this->getItemType()) {

Missing function doc comment
Open

    public function setHelperText(string $helperText): self

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[Groups(['extra_field:read'])]

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[ORM\GeneratedValue]

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[Groups(['extra_field:read', 'extra_field:write'])]

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[ORM\Column(name: 'auto_remove', type: 'boolean', options: ['default' => false])]

Missing function doc comment
Open

    public function setDefaultValue(string $defaultValue): self

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

#[ORM\MappedSuperclass]

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[ORM\Id]

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[ORM\Column(name: 'variable', type: 'string', length: 255)]

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

#[ORM\Table(name: 'extra_field')]

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[ORM\Column(name: 'value_type', type: 'integer')]

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[ORM\Column(name: 'created_at', type: 'datetime')]

Missing function doc comment
Open

    public function setFieldOrder(int $fieldOrder): self

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[ORM\Column(name: 'visible_to_others', type: 'boolean', nullable: true, unique: false)]

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[ORM\Column(name: 'changeable', type: 'boolean', nullable: true, unique: false)]

Missing function doc comment
Open

    public function getId(): ?int

Missing function doc comment
Open

    public function setVisibleToOthers(bool $visibleToOthers): self

Missing function doc comment
Open

    public function setDescription(string $description): self

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[Gedmo\Translatable]

Missing function doc comment
Open

    public function setVariable(string $variable): self

Missing function doc comment
Open

    public function setChangeable(bool $changeable): self

Missing function doc comment
Open

    public function setFilter(bool $filter): self

Missing function doc comment
Open

    public function setVisibleToSelf(bool $visibleToSelf): self

Missing function doc comment
Open

    public function getTypeToString(): string

Missing function doc comment
Open

    public function getItemType(): int

Missing function doc comment
Open

    public function setDisplayText(string $displayText): self

Missing function doc comment
Open

    public function getDefaultValue(): ?string

Missing function doc comment
Open

    public function getHelperText(): string

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[Groups(['extra_field:read', 'extra_field:write'])]

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[Groups(['extra_field:read'])]

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[Gedmo\Locale]

Missing function doc comment
Open

    public function setOptions(Collection $options): self

Add a single space around assignment operators
Open

declare(strict_types=1);

You must use "/**" style comments for a class comment
Open

class ExtraField

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.
Open

    #[ORM\Column(name: 'default_value', type: 'text', nullable: true, unique: false)]

Missing function doc comment
Open

    public function getValueType(): int

Missing function doc comment
Open

    public function getFieldOrder(): ?int

Missing function doc comment
Open

    public function isFilter(): bool

Missing function doc comment
Open

    public function setAutoRemove(bool $autoRemove): self

Space before opening parenthesis of function call prohibited
Open

        return $this->tags->exists(fn ($key, Tag $tag) => $tagName === $tag->getTag());

Space before opening parenthesis of function call prohibited
Open

        return match ($this->getItemType()) {

Line indented incorrectly; expected 8 spaces, found 12
Open

            default => 'text',

There are no issues that match your filters.

Category
Status