chamilo/chamilo-lms

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

Summary

Maintainability
A
0 mins
Test Coverage

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\Table(name: 'skill_rel_user')]

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

#[ORM\Index(columns: ['session_id', 'course_id', 'user_id'], name: 'idx_select_s_c_u')]

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

    #[ORM\JoinColumn(name: 'session_id', referencedColumnName: 'id', nullable: true, onDelete: 'CASCADE')]

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

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

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

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

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

    #[ORM\JoinColumn(name: 'skill_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]

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(['skill_rel_user:read'])]

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

    #[ORM\GeneratedValue]

Missing function doc comment
Open

    public function getSkill(): ?Skill

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

    #[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]

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

    #[ORM\JoinColumn(name: 'acquired_level', referencedColumnName: 'id')]

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

    #[ORM\Column(name: 'acquired_skill_at', type: 'datetime', nullable: false)]

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

    #[ORM\ManyToOne(targetEntity: Session::class, cascade: ['persist'], inversedBy: 'issuedSkills')]

Missing function doc comment
Open

    public function setCourse(Course $course): self

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

    #[ORM\ManyToOne(targetEntity: User::class, cascade: ['persist'], inversedBy: 'achievedSkills')]

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

    #[ORM\ManyToOne(targetEntity: Skill::class, cascade: ['persist'], inversedBy: 'issuedSkills')]

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

    #[ORM\ManyToOne(targetEntity: Course::class, cascade: ['persist'], inversedBy: 'issuedSkills')]

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

    #[ORM\JoinColumn(name: 'course_id', referencedColumnName: 'id', nullable: true, onDelete: 'CASCADE')]

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

#[ORM\Index(columns: ['skill_id', 'user_id'], name: 'idx_select_sk_u')]

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

    #[ORM\ManyToOne(targetEntity: Level::class)]

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

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

Missing function doc comment
Open

    public function setSkill(Skill $skill): self

Missing function doc comment
Open

    public function getCourse(): ?Course

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

#[ApiFilter(SearchFilter::class, properties: ['user' => 'exact'])]

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

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

#[ApiResource(

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

#[ORM\Entity]

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

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

Missing function doc comment
Open

    public function __construct()

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\OneToMany(

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

class SkillRelUser

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

#[ORM\Index(columns: ['course_id', 'session_id'], name: 'idx_select_cs')]

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

    #[ORM\Column(name: 'argumentation', type: 'text')]

Missing function doc comment
Open

    public function getAssignedBy(): int

Missing function doc comment
Open

    public function getAcquiredLevel(): ?Level

Missing function doc comment
Open

    public function getSession(): ?Session

Missing function doc comment
Open

    public function setAcquiredLevel(Level $acquiredLevel): self

Missing function doc comment
Open

    public function setSession(Session $session): self

Missing function doc comment
Open

    public function setAcquiredSkillAt(DateTime $acquiredSkillAt): self

Missing function doc comment
Open

    public function getId(): ?int

Missing function doc comment
Open

    public function getComments(bool $sortDescByDateTime = false): Collection

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

    public function setValidationStatus(int $validationStatus): static

Missing function doc comment
Open

    public function setArgumentation(string $argumentation): self

Missing function doc comment
Open

    public function getAcquiredSkillAt(): DateTime

Missing function doc comment
Open

    public function setAssignedBy(int $assignedBy): self

Missing function doc comment
Open

    public function getArgumentation(): string

Missing function doc comment
Open

    public function setValidationStatus(int $validationStatus): static

Missing function doc comment
Open

    public function setArgumentationAuthorId(int $argumentationAuthorId): self

Missing function doc comment
Open

    public function getValidationStatus(): int

Missing function doc comment
Open

    public function getArgumentationAuthorId(): int

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected string $argumentation;

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

        $this->validationStatus = 0;

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

        $this->comments = new ArrayCollection();

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

)]

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected User $user;

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

        return $this;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected DateTime $acquiredSkillAt;

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

        $this->acquiredLevel = null;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setCourse(Course $course): self

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

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

    use UserTrait;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected int $validationStatus;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected int $argumentationAuthorId;

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

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function __construct()

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

{

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected Collection $comments;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setSkill(Skill $skill): self

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getSkill(): ?Skill

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getCourse(): ?Course

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?int $id = null;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?Course $course = null;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?Skill $skill = null;

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

        $this->acquiredSkillAt = new DateTime();

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

    {

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

        return $this->skill;

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

    )]

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected int $assignedBy;

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

    {

Line indented incorrectly; expected 4 spaces, found 0
Open

class SkillRelUser

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?Level $acquiredLevel = null;

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

    protected ?Session $session = null;

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

        $this->skill = $skill;

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

        $this->course = $course;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getSession(): ?Session

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

        $this->assignedBy = $assignedBy;

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

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

    {

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

        return $this->validationStatus;

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

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

        $this->acquiredSkillAt = $acquiredSkillAt;

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

        $average = $countValues > 0 ? $sum / $countValues : 0;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setSession(Session $session): self

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

        return $this->argumentationAuthorId;

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

        return $this;

Line indented incorrectly; expected 12 spaces, found 8
Open

        if (null !== $this->session) {

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

    {

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

            $criteria->orderBy([

Line indented incorrectly; expected 12 spaces, found 8
Open

        foreach ($this->comments as $comment) {

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

    }

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getAssignedBy(): int

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

        return $this->acquiredLevel;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setArgumentation(string $argumentation): 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

    public function getIssueUrlAll(): string

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

        $sum = 0;

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

        return number_format($average, 2);

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

            ]);

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getValidationStatus(): int

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

        $this->argumentationAuthorId = $argumentationAuthorId;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getArgumentation(): string

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

        return api_get_path(WEB_PATH).\sprintf('badge/%s', $this->id);

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getAssertionUrl(): string

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

                continue;

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

        return $this->session;

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

        }

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

        return $source;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getIssueUrl(): string

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

        $this->session = $session;

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

        $source = '';

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

            $source .= $this->course->getTitle();

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

    }

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 12 spaces, found 8
Open

        if (null !== $this->course) {

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

            $sum += $comment->getFeedbackValue();

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

    {

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

        $this->validationStatus = $validationStatus;

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

    {

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setAcquiredSkillAt(DateTime $acquiredSkillAt): self

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

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

        $this->acquiredLevel = $acquiredLevel;

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

        ]);

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

        return $this->comments;

Line indented incorrectly; expected 16 spaces, found 12
Open

            if (0 === $comment->getFeedbackValue()) {

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

    {

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

            $source .= \sprintf('[%s] ', $this->session->getTitle());

Line indented incorrectly; expected 12 spaces, found 8
Open

        if ($sortDescByDateTime) {

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

            $criteria = Criteria::create();

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setValidationStatus(int $validationStatus): static

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

    {

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

        return $this->acquiredSkillAt;

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

        return $this->argumentation;

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getAcquiredSkillAt(): DateTime

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 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 getId(): ?int

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getAcquiredLevel(): ?Level

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

        $this->argumentation = $argumentation;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setArgumentationAuthorId(int $argumentationAuthorId): 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 getArgumentationAuthorId(): int

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

    }

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

    {

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

        $url = api_get_path(WEB_CODE_PATH).'skills/assertion.php?';

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

        return $url.http_build_query([

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

            $countValues++;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getComments(bool $sortDescByDateTime = false): Collection

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

        return $this->assignedBy;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setAcquiredLevel(Level $acquiredLevel): self

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

            return $this->comments->matching($criteria);

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

    }

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

        $countValues = 0;

Line indented incorrectly; expected 12 spaces, found 8
Open

        }

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setAssignedBy(int $assignedBy): self

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

        return $this->id;

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

        return api_get_path(WEB_PATH).\sprintf('skill/%s/user/%s', $this->skill->getId(), $this->user->getId());

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getAverage(): string

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

    {

There are no issues that match your filters.

Category
Status