src/CourseBundle/Entity/CForumPost.php
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[ORM\OneToMany(targetEntity: CForumAttachment::class, mappedBy: 'post', cascade: ['persist', 'remove'], orphanRemoval: true)]
- Exclude checks
Add a single space around assignment operators Open
Open
declare(strict_types=1);
- Exclude checks
You must use "/**" style comments for a class comment Open
Open
class CForumPost extends AbstractResource implements ResourceInterface, Stringable
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[Assert\NotBlank]
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[Assert\NotBlank]
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[ORM\Column(name: 'post_text', type: 'text', nullable: true)]
- Exclude checks
Missing function doc comment Open
Open
public function setTitle(string $title): self
- Exclude checks
Missing function doc comment Open
Open
public function getPostParent(): ?self
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[Assert\NotBlank]
- Exclude checks
Missing function doc comment Open
Open
public function getTitle(): string
- Exclude checks
Missing function doc comment Open
Open
public function setThread(?CForumThread $thread = null): self
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[ORM\Table(name: 'c_forum_post')]
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[ORM\Id]
- Exclude checks
Missing function doc comment Open
Open
public function setStatus(int $status): self
- Exclude checks
Missing function doc comment Open
Open
public function getResourceIdentifier(): int|Uuid
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[ORM\Column(name: 'iid', type: 'integer')]
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[ORM\Column(name: 'title', type: 'string', length: 250, nullable: false)]
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[ORM\ManyToOne(targetEntity: User::class)]
- Exclude checks
Missing function doc comment Open
Open
public function __construct()
- Exclude checks
Missing function doc comment Open
Open
public function setPostNotification(bool $postNotification): self
- Exclude checks
Missing function doc comment Open
Open
public function getUser(): User
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[ORM\ManyToOne(targetEntity: CForumThread::class, inversedBy: 'posts')]
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[ORM\JoinColumn(name: 'poster_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
- Exclude checks
Missing function doc comment Open
Open
public function getPostText(): ?string
- Exclude checks
Missing function doc comment Open
Open
public function removeAttachment(CForumAttachment $attachment): void
- Exclude checks
Missing function doc comment Open
Open
public function getForum(): ?CForum
- Exclude checks
Missing function doc comment Open
Open
public function setPostParent(?self $postParent): self
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[ORM\Column(name: 'post_notification', type: 'boolean', nullable: true)]
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[ORM\JoinColumn(name: 'thread_id', referencedColumnName: 'iid', nullable: true, onDelete: 'SET NULL')]
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[ORM\JoinColumn(name: 'forum_id', referencedColumnName: 'iid', nullable: true, onDelete: 'SET NULL')]
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[ORM\Column(name: 'post_date', type: 'datetime', nullable: false)]
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[ORM\ManyToOne(targetEntity: CForum::class, inversedBy: 'posts')]
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[ORM\JoinColumn(name: 'post_parent_id', referencedColumnName: 'iid', onDelete: 'SET NULL')]
- Exclude checks
Missing function doc comment Open
Open
public function setVisible(bool $visible): self
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[ORM\Index(name: 'idx_forum_post_visible', columns: ['visible'])]
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[ORM\Entity(repositoryClass: CForumPostRepository::class)]
- Exclude checks
Missing function doc comment Open
Open
public function __toString(): string
- Exclude checks
Missing function doc comment Open
Open
public function setPostDate(DateTime $postDate): self
- Exclude checks
Missing function doc comment Open
Open
public function setUser(User $user): self
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[ORM\GeneratedValue]
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[Assert\NotNull]
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[ORM\Column(name: 'status', type: 'integer', nullable: true)]
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[ORM\OneToMany(targetEntity: self::class, mappedBy: 'postParent')]
- Exclude checks
Missing function doc comment Open
Open
public function getThread(): ?CForumThread
- Exclude checks
Missing function doc comment Open
Open
public function getAttachments(): Collection
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'children')]
- Exclude checks
Missing function doc comment Open
Open
public function getResourceName(): string
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[ORM\Index(name: 'forum_id', columns: ['forum_id'])]
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[ORM\Index(name: 'idx_forum_post_thread_id', columns: ['thread_id'])]
- Exclude checks
Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead. Open
Open
#[ORM\Column(name: 'visible', type: 'boolean', nullable: false)]
- Exclude checks
Missing function doc comment Open
Open
public function setResourceName(string $name): self
- Exclude checks
Missing function doc comment Open
Open
public function setPostText(string $postText): self
- Exclude checks
Missing function doc comment Open
Open
public function setForum(?CForum $forum): self
- Exclude checks
The 'getVisible()' method which returns a boolean should be named 'is...()' or 'has...()' Open
Open
public function getVisible()
{
return $this->visible;
}
- Read upRead up
- Exclude checks
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
The 'getPostNotification()' method which returns a boolean should be named 'is...()' or 'has...()' Open
Open
public function getPostNotification()
{
return $this->postNotification;
}
- Read upRead up
- Exclude checks
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
}