chamilo/chamilo-lms

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

Summary

Maintainability
A
0 mins
Test Coverage

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

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

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

#[ORM\EntityListeners([ResourceListener::class])]

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

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

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

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

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

#[ORM\Index(columns: ['filetype'], name: 'idx_cdoc_type')]

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

#[ApiFilter(

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: 'title', type: 'string', length: 255, nullable: false)]

Add a single space around assignment operators
Open

declare(strict_types=1);

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

    #[ApiProperty(identifier: true)]

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

#[ApiFilter(filterClass: SearchFilter::class, properties: ['title' => 'partial', 'resourceNode.parent' => 'exact', 'filetype' => 'exact'])]

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: 'comment', type: 'text', nullable: true)]

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

    #[Groups(['document:read', 'document:write', 'document:browse'])]

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

#[ApiFilter(filterClass: PropertyFilter::class)]

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

#[ApiFilter(filterClass: SidFilter::class)]

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

    #[ORM\Column(name: 'iid', 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

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

Missing function doc comment
Open

    public function setTemplate(bool $template): self

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

#[ApiResource(

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

    #[ORM\Column(name: 'filetype', type: 'string', length: 15, nullable: false)]

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

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

Missing function doc comment
Open

    public function getReadonly(): bool

Missing function doc comment
Open

    public function getIid(): ?int

Missing function doc comment
Open

    public function getResourceName(): string

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

#[ApiFilter(filterClass: CidFilter::class)]

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

class CDocument extends AbstractResource implements ResourceInterface, ResourceShowCourseResourcesInSessionInterface, Stringable

Missing function doc comment
Open

    public function __construct()

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

    public function addGradebookCategory(GradebookCategory $gradebookCategory): static

Missing function doc comment
Open

    public function getComment(): ?string

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

    #[Assert\Choice(['folder', 'file', 'certificate'], message: 'Choose a valid filetype.')]

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

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

Missing function doc comment
Open

    public function addGradebookCategory(GradebookCategory $gradebookCategory): static

Missing function doc comment
Open

    public function getTitle(): string

Missing function doc comment
Open

    public function setReadonly(bool $readonly): self

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

    #[ORM\OneToMany(mappedBy: 'document', targetEntity: GradebookCategory::class)]

Missing function doc comment
Open

    public function isTemplate(): bool

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

    #[Groups(['document:read', 'document:fullPath'])]

Missing function doc comment
Open

    public function setFiletype(string $filetype): self

Missing function doc comment
Open

    public function getResourceIdentifier(): int|Uuid

Missing function doc comment
Open

    public function removeGradebookCategory(GradebookCategory $gradebookCategory): static

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

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

Missing function doc comment
Open

    public function setTitle(string $title): self

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

    public function removeGradebookCategory(GradebookCategory $gradebookCategory): static

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

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

Missing function doc comment
Open

    public function setComment(?string $comment): self

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

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

Missing function doc comment
Open

    public function getFiletype(): string

Missing function doc comment
Open

    public function __toString(): string

Missing function doc comment
Open

    public function setResourceName(string $name): self

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

    public function getFullPath(): string

Line indented incorrectly; expected at least 4 spaces, found 0
Open

{

Line indented incorrectly; expected at least 4 spaces, found 0
Open

)]

Line indented incorrectly; expected 4 spaces, found 0
Open

class CDocument extends AbstractResource implements ResourceInterface, ResourceShowCourseResourcesInSessionInterface, Stringable

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected string $title;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?int $iid = null;

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        return $this->getTitle();

Line indented incorrectly; expected at least 8 spaces, found 4
Open

    {

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        return $this->gradebookCategories;

Line indented incorrectly; expected at least 20 spaces, found 16
Open

                $gradebookCategory->setDocument(null);

Line indented incorrectly; expected at least 4 spaces, found 0
Open

)]

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function __construct()

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        $this->filetype = 'folder';

Line indented incorrectly; expected at least 8 spaces, found 4
Open

    {

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        return $this;

Line indented incorrectly; expected at least 16 spaces, found 12
Open

            $parent = $parent->getParent();

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 16 spaces, found 12
Open

            if ($gradebookCategory->getDocument() === $this) {

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        return $this;

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setTemplate(bool $template): self

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getReadonly(): bool

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        return $this->readonly;

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        return $this;

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected at least 8 spaces, found 4
Open

    {

Line indented incorrectly; expected 12 spaces, found 8
Open

        if ($this->gradebookCategories->removeElement($gradebookCategory)) {

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        $this->template = false;

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getComment(): ?string

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getResourceName(): string

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function addGradebookCategory(GradebookCategory $gradebookCategory): static

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        $parent = $this->getParent();

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?string $comment;

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        $this->comment = '';

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        $this->comment = $comment;

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        $this->readonly = $readonly;

Line indented incorrectly; expected at least 8 spaces, found 4
Open

    {

Line indented incorrectly; expected 12 spaces, found 8
Open

        }

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected bool $template;

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        $this->readonly = false;

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        $this->title = $title;

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        return $this->template;

Line indented incorrectly; expected at least 8 spaces, found 4
Open

    {

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        return $this->comment;

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        return $this->filetype;

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        return $this->iid;

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getGradebookCategories(): Collection

Line indented incorrectly; expected at least 16 spaces, found 12
Open

            $gradebookCategory->setDocument($this);

Line indented incorrectly; expected 12 spaces, found 8
Open

        }

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function removeGradebookCategory(GradebookCategory $gradebookCategory): static

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function __toString(): string

Line indented incorrectly; expected at least 8 spaces, found 4
Open

    {

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected at least 8 spaces, found 4
Open

    {

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setResourceName(string $name): self

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected string $filetype;

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        return $this;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getFiletype(): string

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        $this->filetype = $filetype;

Line indented incorrectly; expected at least 8 spaces, found 4
Open

    {

Line indented incorrectly; expected 16 spaces, found 12
Open

            }

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        $pathParts = [$this->getTitle()];

Line indented incorrectly; expected 12 spaces, found 8
Open

        while ($parent instanceof ResourceNode) {

Line indented incorrectly; expected at least 16 spaces, found 12
Open

            array_unshift($pathParts, $parent->getTitle());

Line indented incorrectly; expected at least 8 spaces, found 4
Open

    {

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getResourceIdentifier(): int|Uuid

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected bool $readonly;

Line indented incorrectly; expected 8 spaces, found 4
Open

    private Collection $gradebookCategories;

Line indented incorrectly; expected at least 8 spaces, found 4
Open

    {

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        return $this;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setReadonly(bool $readonly): self

Line indented incorrectly; expected at least 8 spaces, found 4
Open

    {

Line indented incorrectly; expected at least 8 spaces, found 4
Open

    {

Line indented incorrectly; expected 12 spaces, found 8
Open

        if (!$this->gradebookCategories->contains($gradebookCategory)) {

Line indented incorrectly; expected at least 16 spaces, found 12
Open

            $this->gradebookCategories->add($gradebookCategory);

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected at least 8 spaces, found 4
Open

    {

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        return $this->title;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setTitle(string $title): self

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function isTemplate(): bool

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setFiletype(string $filetype): self

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getIid(): ?int

Line indented incorrectly; expected at least 8 spaces, found 4
Open

    {

Line indented incorrectly; expected at least 8 spaces, found 4
Open

    {

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        return implode('/', $pathParts);

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getTitle(): string

Line indented incorrectly; expected at least 8 spaces, found 4
Open

    {

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        $this->template = $template;

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected at least 8 spaces, found 4
Open

    {

Line indented incorrectly; expected at least 8 spaces, found 4
Open

    {

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        return $this->setTitle($name);

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        $this->gradebookCategories = new ArrayCollection();

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        return $this->getTitle();

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setComment(?string $comment): self

Line indented incorrectly; expected at least 8 spaces, found 4
Open

    {

Line indented incorrectly; expected at least 8 spaces, found 4
Open

    {

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        return $this;

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        return $this->getIid();

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected at least 12 spaces, found 8
Open

        return $this;

Line indented incorrectly; expected 12 spaces, found 8
Open

        }

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getFullPath(): string

Line indented incorrectly; expected 4 spaces, found 0
Open

}

There are no issues that match your filters.

Category
Status