chamilo/chamilo-lms

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

Summary

Maintainability
A
0 mins
Test Coverage

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

#[ORM\UniqueConstraint(name: 'code', columns: ['code'])]

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

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 getParent(): ?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: 'children_count', type: 'smallint', nullable: true)]

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

#[ApiFilter(filterClass: SearchFilter::class, properties: ['name' => 'partial', 'code' => 'partial'])]

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\JoinColumn(name: 'parent_id', referencedColumnName: 'id', onDelete: 'CASCADE')]

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

    #[ORM\OneToMany(

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

    #[ORM\ManyToMany(targetEntity: Course::class, mappedBy: 'categories')]

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

    #[ORM\OneToMany(mappedBy: 'parent', targetEntity: self::class)]

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

    #[ORM\Column(name: 'auth_course_child', type: 'string', length: 40, nullable: true)]

Missing function doc comment
Open

    public function setParent(self $parent): self

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

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

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

    #[Groups(['course_category:read', 'course_category:write', 'course:read', 'session:read'])]

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

#[ApiResource(

Missing function doc comment
Open

    public function __toString(): string

Add a single space around assignment operators
Open

declare(strict_types=1);

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

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

Missing class doc comment
Open

class CourseCategory implements Stringable

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

    #[ORM\ManyToOne(targetEntity: Asset::class, cascade: ['remove'])]

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

    #[ORM\Column(name: 'auth_cat_child', type: 'string', length: 40, nullable: true)]

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

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

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

    #[Groups(['course_category:read', 'course: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: 'title', type: 'text', nullable: false)]

Missing function doc comment
Open

    public function __construct()

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

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

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

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

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

#[ApiFilter(filterClass: OrderFilter::class, properties: ['name', 'code'])]

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\ManyToOne(targetEntity: self::class, inversedBy: 'children')]

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

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

Missing function doc comment
Open

    public function setAuthCourseChild(string $authCourseChild): self

Missing function doc comment
Open

    public function hasAsset(): bool

Missing function doc comment
Open

    public function addChild(self $child): self

Missing function doc comment
Open

    public function hasUrl(AccessUrl $accessUrl): bool

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

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

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

    #[Groups(['course_category:read', 'course_category:write', 'course:read'])]

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

    #[ORM\JoinColumn(name: 'asset_id', referencedColumnName: 'id', onDelete: 'SET NULL')]

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

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

Missing function doc comment
Open

    public function setAuthCatChild(string $authCatChild): self

Missing function doc comment
Open

    public function setTitle(string $title): self

Missing function doc comment
Open

    public function getAsset(): ?Asset

Missing function doc comment
Open

    public function setAsset(?Asset $asset): self

Missing function doc comment
Open

    public function getDescription(): ?string

Missing function doc comment
Open

    public function getAuthCourseChild(): ?string

Missing function doc comment
Open

    public function getAuthCatChild(): ?string

Missing function doc comment
Open

    public function setDescription(string $description): self

Missing function doc comment
Open

    public function getTitle(): string

Missing function doc comment
Open

    public function setCourses(Collection $courses): self

Missing function doc comment
Open

    public function getUrls(): array|Collection

Missing function doc comment
Open

    public function setTreePos(int $treePos): self

Missing function doc comment
Open

    public function addUrl(AccessUrl $accessUrl): self

Missing function doc comment
Open

    public function setChildrenCount(int $childrenCount): self

Missing function doc comment
Open

    public function addCourse(Course $course): void

Missing function doc comment
Open

    public function setCode(string $code): self

Missing function doc comment
Open

    public function getCourses(): Collection

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

{

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected string $title;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?Asset $asset = null;

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

        $this->courses = new ArrayCollection();

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getParent(): ?self

Line indented incorrectly; expected 4 spaces, found 0
Open

class CourseCategory implements Stringable

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getId()

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?CourseCategory $parent = null;

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

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

        $this->authCatChild = 'TRUE';

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?int $childrenCount;

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

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

        return $this->id;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected Collection $children;

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

    )]

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

        return $this->parent;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected Collection $urls;

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

)]

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?string $authCatChild = null;

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

)]

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?int $treePos = null;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?string $description = null;

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

        $this->childrenCount = 0;

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

    {

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

        $this->parent = $parent;

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

        return $this;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?int $id = null;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?string $authCourseChild = null;

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setParent(self $parent): self

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected Collection $courses;

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

        $this->authCourseChild = 'TRUE';

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected string $code;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function __construct()

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

        $this->urls = new ArrayCollection();

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

        $this->children = new ArrayCollection();

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function __toString(): string

Line indented incorrectly; expected 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 setTreePos(int $treePos): self

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setChildrenCount(int $childrenCount): self

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setAuthCatChild(string $authCatChild): self

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setAsset(?Asset $asset): self

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setCourses(Collection $courses): self

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

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

        $name = strip_tags($this->title);

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->title;

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;

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

    {

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

        $this->authCourseChild = $authCourseChild;

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

        return $this;

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 null !== $this->asset;

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 8 spaces, found 4
Open

    }

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

        $this->title = $title;

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 at least 8 spaces, found 4
Open

    {

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

        return \sprintf('%s (%s)', $name, $this->code);

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

    {

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

        return $this->children;

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->childrenCount;

Line indented incorrectly; expected 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

    public function getCourses(): Collection

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

    {

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

        return $this->courses;

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

        $this->courses[] = $course;

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

        $this->urls = $urls;

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 at least 12 spaces, found 8
Open

        return $this->authCourseChild;

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 getUrls(): array|Collection

Line indented incorrectly; expected 12 spaces, found 8
Open

        if (0 !== $this->urls->count()) {

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

        return $this;

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

        $this->asset = $asset;

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

            return $relation->count() > 0;

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

    }

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

        return $this;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function hasAsset(): bool

Line indented incorrectly; expected 12 spaces, found 8
Open

        if (!$this->hasUrl($accessUrl)) {

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 at least 12 spaces, found 8
Open

        $this->childrenCount = $childrenCount;

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 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 addUrl(AccessUrl $accessUrl): self

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

    {

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

        return $this->treePos;

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

            $item = (new AccessUrlRelCourseCategory())->setCourseCategory($this)->setUrl($accessUrl);

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

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

            $criteria = Criteria::create()->where(Criteria::expr()->eq('url', $accessUrl));

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

            $relation = $this->urls->matching($criteria);

Line indented incorrectly; expected 12 spaces, found 8
Open

        }

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

        $child->setParent($this);

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getChildrenCount()

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getAuthCatChild(): ?string

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

        $this->authCatChild = $authCatChild;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getDescription(): ?string

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setDescription(string $description): 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 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function addChild(self $child): self

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

        $this->children[] = $child;

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 getAuthCourseChild(): ?string

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

        return $this;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getCode()

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

        $this->treePos = $treePos;

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

    {

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

        $this->description = $description;

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function addCourse(Course $course): void

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setUrls(array|Collection $urls): self

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

    {

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function hasUrl(AccessUrl $accessUrl): bool

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getChildren(): Collection

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setTitle(string $title): self

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

        $this->code = $code;

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 false;

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

        return $this->code;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setCode(string $code): self

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

        return $this;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getAsset(): ?Asset

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

    {

Line indented incorrectly; expected 4 spaces, found 0
Open

}

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

    {

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getTreePos()

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

        return $this->asset;

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

        $this->courses = $courses;

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

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

        return $this->urls;

Line indented incorrectly; expected 12 spaces, found 8
Open

        }

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

    {

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setAuthCourseChild(string $authCourseChild): self

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

    {

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

        return $this->authCatChild;

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

        return $this->description;

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

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

            $this->urls->add($item);

There are no issues that match your filters.

Category
Status