chamilo/chamilo-lms

View on GitHub
src/CourseBundle/Entity/CAnnouncement.php

Summary

Maintainability
A
0 mins
Test Coverage

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

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

Missing function doc comment
Open

    public function getIid(): ?int

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

class CAnnouncement extends AbstractResource implements ResourceInterface, Stringable

Add a single space around assignment operators
Open

declare(strict_types=1);

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

    #[ORM\Column(name: 'end_date', type: 'date', nullable: true)]

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

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

Missing function doc comment
Open

    public function setTitle(string $title): self

Missing function doc comment
Open

    public function addAttachment(CAnnouncementAttachment $attachment): static

Missing function doc comment
Open

    public function setResourceName(string $name): self

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

#[ORM\Entity(repositoryClass: CAnnouncementRepository::class)]

Missing function doc comment
Open

    public function getContent(): ?string

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\OneToMany(mappedBy: 'announcement', targetEntity: CAnnouncementAttachment::class, cascade: ['persist'])]

Missing function doc comment
Open

    public function getEndDate(): ?DateTime

Missing function doc comment
Open

    public function __construct()

Missing function doc comment
Open

    public function setContent(string $content): self

Scope keyword "static" must be followed by a single space
Open

    public function removeAttachment(CAnnouncementAttachment $attachment): static

Missing function doc comment
Open

    public function getResourceIdentifier(): int

Missing function doc comment
Open

    public function getResourceName(): string

Missing function doc comment
Open

    public function getTitle(): string

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

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

Missing function doc comment
Open

    public function setEndDate(?DateTime $endDate): self

Missing function doc comment
Open

    public function setEmailSent(bool $emailSent): self

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

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

Missing function doc comment
Open

    public function __toString(): string

Missing function doc comment
Open

    public function removeAttachment(CAnnouncementAttachment $attachment): static

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\GeneratedValue]

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

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

Scope keyword "static" must be followed by a single space
Open

    public function addAttachment(CAnnouncementAttachment $attachment): static

The 'getEmailSent()' method which returns a boolean should be named 'is...()' or 'has...()'
Open

    public function getEmailSent()
    {
        return $this->emailSent;
    }

BooleanGetMethodName

Since: 0.2

Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.

Example

class Foo {
    /**
     * @return boolean
     */
    public function getFoo() {} // bad
    /**
     * @return bool
     */
    public function isFoo(); // ok
    /**
     * @return boolean
     */
    public function getFoo($bar); // ok, unless checkParameterizedMethods=true
}

Source https://phpmd.org/rules/naming.html#booleangetmethodname

There are no issues that match your filters.

Category
Status