chamilo/chamilo-lms

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

Summary

Maintainability
A
0 mins
Test Coverage

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

    #[Groups(['resource_file:read', 'resource_node:read', 'document:read', 'message:read', 'personal_file:read'])]

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

    #[ORM\Column(type: 'array', nullable: true)]

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

    #[Groups(['resource_file:read', 'resource_node:read', 'document:read', 'message:read'])]

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

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

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(type: 'integer')]

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: OrderFilter::class, properties: ['id', 'name', 'size', 'updatedAt'])]

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

    #[Groups(['resource_file:read', 'resource_node:read', 'document:read', 'message:read'])]

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

class ResourceFile implements Stringable

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

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

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

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

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

    #[Groups(['resource_file:read', 'resource_node:read', 'document:read', 'message:read'])]

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

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

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

    #[ORM\Column(type: 'datetime')]

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

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

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

    #[Groups(['resource_file:read', 'resource_node:read', 'document:read'])]

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

    #[ORM\Column(type: 'simple_array', nullable: true)]

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

    #[Groups(['resource_file:read', 'resource_node:read', 'document:read', 'message:read'])]

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

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

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

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

    #[Groups(['resource_file:read', 'resource_node:read', 'document:read', 'message:read'])]

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

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

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

    #[Gedmo\Timestampable(on: 'update')]

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

    #[ORM\ManyToOne(inversedBy: 'resourceFiles')]

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

    #[Groups(['resource_file:read', 'resource_node:read', 'document:read', 'message:read'])]

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

    #[Groups(['resource_file:read', 'resource_node:read', 'document:read'])]

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

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

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

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

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

    public function getMimeType(): ?string

Missing function doc comment
Open

    public function getDescription(): string

Missing function doc comment
Open

    public function isImage(): bool

Missing function doc comment
Open

    public function setMetadata(array $metadata): self

Missing function doc comment
Open

    public function setTitle(?string $title): self

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

    public function getId(): ?int

Missing function doc comment
Open

    public function getFile(): ?File

Missing function doc comment
Open

    public function __toString(): string

Missing function doc comment
Open

    public function setFile(File|UploadedFile|null $file = null): self

Missing function doc comment
Open

    public function getSize(): ?int

Missing function doc comment
Open

    public function getResourceNode(): ?ResourceNode

Missing function doc comment
Open

    public function setSize(?int $size): self

Missing function doc comment
Open

    public function getMetadata(): array

Missing function doc comment
Open

    public function isVideo(): bool

Missing function doc comment
Open

    public function setMimeType(?string $mimeType): self

Missing function doc comment
Open

    public function setResourceNode(?ResourceNode $resourceNode): static

Missing function doc comment
Open

    public function setDimensions(?array $dimensions): self

Missing function doc comment
Open

    public function setDescription(string $description): self

Missing function doc comment
Open

    public function isText(): bool

Missing function doc comment
Open

    public function getHeight(): int

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

    public function setResourceNode(?ResourceNode $resourceNode): static

Missing function doc comment
Open

    public function isAudio(): bool

Missing function doc comment
Open

    public function getWidth(): int

Missing function doc comment
Open

    public function getTitle(): ?string

Missing function doc comment
Open

    public function __construct()

Missing function doc comment
Open

    public function getOriginalName(): string

Missing function doc comment
Open

    public function getCrop(): ?string

Missing function doc comment
Open

    public function setOriginalName(?string $originalName): self

Missing function doc comment
Open

    public function getDimensions(): array

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?string $description = null;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected $updatedAt;

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

)]

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?string $originalName = null;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?File $file = null;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?int $size = 0;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?int $id = null;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?bool $audio = null;

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

{

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

    use TimestampableEntity;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?string $mimeType = null;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?string $crop = null;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?bool $image = null;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?bool $video = null;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?bool $text = null;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?array $dimensions;

Line indented incorrectly; expected 4 spaces, found 0
Open

class ResourceFile implements Stringable

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?string $title = null;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?array $metadata = [];

Line indented incorrectly; expected 8 spaces, found 4
Open

    private ?ResourceNode $resourceNode = null;

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

        return str_contains($mimeType, 'text');

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

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

            return (int) $data[1];

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

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

            return (int) $data[0];

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

    {

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setResourceNode(?ResourceNode $resourceNode): static

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

        return $this->id;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getMimeType(): ?string

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

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

        return $this->resourceNode;

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

        $this->resourceNode = $resourceNode;

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

        return str_contains($mimeType, 'video');

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function isAudio(): bool

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getCrop(): ?string

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getId(): ?int

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

        return 0;

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

    {

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

        return $this->file;

Line indented incorrectly; expected 12 spaces, found 8
Open

        if (null !== $file) {

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

    {

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function __toString(): string

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function isText(): bool

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

    {

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

        return str_contains($mimeType, 'image');

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 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 getResourceNode(): ?ResourceNode

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

        return $this->originalName;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setOriginalName(?string $originalName): self

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

    {

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getHeight(): int

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

        return 0;

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

        $this->metadata = $metadata;

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

        $this->file = $file;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function isImage(): bool

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

        $mimeType = $this->getMimeType();

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getTitle(): ?string

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setTitle(?string $title): self

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

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function __construct()

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

    {

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

        $this->crop = $crop;

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

        return $this->mimeType;

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

        $data = $this->getDimensions();

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

}

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

        $this->size = 0;

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

    }

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setDescription(string $description): self

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 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 isVideo(): bool

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

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getWidth(): int

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

        return $this->description;

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

    {

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

        $mimeType = $this->getMimeType();

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

        $this->size = $size;

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

        $this->metadata = [];

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

        $mimeType = $this->getMimeType();

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setSize(?int $size): self

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

        $this->originalName = $originalName;

Line indented incorrectly; expected 12 spaces, found 8
Open

        if ([] !== $data) {

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setMetadata(array $metadata): self

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setCrop(string $crop): self

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

        $this->mimeType = $mimeType;

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

        $this->dimensions = $dimensions;

Line indented incorrectly; expected 12 spaces, found 8
Open

        }

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getMetadata(): array

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

        $this->dimensions = [];

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

    {

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

        $this->title = $title;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getSize(): ?int

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

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

        $data = $this->getDimensions();

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getDescription(): string

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setFile(File|UploadedFile|null $file = null): self

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

        $mimeType = $this->getMimeType();

Line indented incorrectly; expected 12 spaces, found 8
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

        return $this->size;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setMimeType(?string $mimeType): self

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

        return $this;

Line indented incorrectly; expected 12 spaces, found 8
Open

        if ([] !== $data) {

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

        return $this;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getFile(): ?File

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

        return $this->getOriginalName();

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 str_contains($mimeType, 'audio');

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;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setDimensions(?array $dimensions): self

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

    {

Line indented incorrectly; expected 12 spaces, found 8
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 16 spaces, found 12
Open

            $this->updatedAt = new DateTimeImmutable();

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

There are no issues that match your filters.

Category
Status