chamilo/chamilo-lms

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

Summary

Maintainability
A
0 mins
Test Coverage

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

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

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

    #[ORM\OrderBy(['id' => 'ASC'])]

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

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

Missing function doc comment
Open

    public function addChild(self $resourceNode): static

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

    #[ORM\GeneratedValue(strategy: 'AUTO')]

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

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

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

    #[Groups(['ctool:read', 'c_tool_intro:read'])]

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

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

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

    #[Gedmo\Slug(fields: ['title'])]

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

    #[ORM\ManyToOne(targetEntity: ResourceFormat::class, inversedBy: 'resourceNodes')]

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

    #[ORM\JoinColumn(name: 'parent_id', onDelete: 'CASCADE')]

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

    #[Groups(['resource_node:read', 'document: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(type: 'datetime')]

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

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

Missing function doc comment
Open

    public function addComment(ResourceComment $comment): self

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

class ResourceNode implements Stringable

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

    #[Groups(['resource_node:read', 'document:read', 'ctool:read', 'user_json:read', 'course:read'])]

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

    #[ORM\Column(type: 'uuid', unique: 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

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

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

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

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

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

Missing function doc comment
Open

    public function getUuid(): ?UuidV4

Missing function doc comment
Open

    public function getCreator(): ?User

Add a single space around assignment operators
Open

declare(strict_types=1);

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

    #[Gedmo\TreePathSource]

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

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

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

    #[Assert\NotNull]

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\OneToMany(mappedBy: 'parent', targetEntity: self::class, cascade: ['persist'])]

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

    #[Gedmo\TreeLevel]

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

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

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

#[ApiFilter(filterClass: OrderFilter::class, properties: ['id', 'title', 'createdAt', 'updatedAt', 'firstResourceFile.size'])]

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

Missing function doc comment
Open

    public function __toString(): string

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

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

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

#[Gedmo\Tree(type: 'materializedPath')]

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

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

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

    #[ORM\OneToMany(mappedBy: 'resourceNode', targetEntity: ResourceLink::class, cascade: ['persist', 'remove'])]

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

    #[MaxDepth(1)]

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

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

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

    #[Assert\NotNull]

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

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

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

    public function addChild(self $resourceNode): static

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

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

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

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

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

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

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

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

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

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

Missing function doc comment
Open

    public function __construct()

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

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

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

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

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

    #[Gedmo\TreeParent]

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

    #[ORM\OneToMany(mappedBy: 'resourceNode', targetEntity: ResourceComment::class, cascade: ['persist', 'remove'])]

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

#[ORM\HasLifecycleCallbacks]

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

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

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

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

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

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

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

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

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

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

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

    #[Gedmo\TreePath(separator: '/', appendId: true)]

Missing function doc comment
Open

    public function hasCreator(): bool

Missing function doc comment
Open

    public function addResourceLink(ResourceLink $link): self

Missing function doc comment
Open

    public function setTitle(string $title): self

Missing function doc comment
Open

    public function getIcon(?string $additionalClass = null): string

Missing function doc comment
Open

    public function addResourceFile(ResourceFile $resourceFile): static

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

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

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

    #[ORM\OneToOne(mappedBy: 'shortCutNode', targetEntity: CShortcut::class, cascade: ['persist', 'remove'])]

Missing function doc comment
Open

    public function setCreator(?User $creator): self

Missing function doc comment
Open

    public function isPublic(): bool

Missing function doc comment
Open

    public function getResourceFormat(): ?ResourceFormat

Missing function doc comment
Open

    public function isResourceFileAnImage(): bool

Missing function doc comment
Open

    public function getThumbnail(RouterInterface $router): string

Missing function doc comment
Open

    public function getResourceType(): ResourceType

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

    public function removeResourceFile(ResourceFile $resourceFile): static

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

    public function getFirstResourceFile(): ?ResourceFile

Missing function doc comment
Open

    public function setSlug(string $slug): self

Missing function doc comment
Open

    public function getTitle(): string

Missing function doc comment
Open

    public function getResourceLinkByContext(

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

    public function addResourceFile(ResourceFile $resourceFile): static

Missing function doc comment
Open

    public function setResourceLinks(Collection $resourceLinks): self

Missing function doc comment
Open

    public function removeResourceFile(ResourceFile $resourceFile): static

Missing function doc comment
Open

    public function getPathForDisplayRemoveBase(string $base): string

Missing function doc comment
Open

    public function getSlug(): string

Missing function doc comment
Open

    public function setResourceType(ResourceType $resourceType): self

Missing function doc comment
Open

    public function hasEditableTextContent(): bool

Missing function doc comment
Open

    public function hasResourceFile(): bool

Missing function doc comment
Open

    public function getContent(): ?string

Missing function doc comment
Open

    public function setContent(string $content): self

Missing function doc comment
Open

    public function setShortCut(?CShortcut $shortCut): self

Missing function doc comment
Open

    public function getPathForDisplayToArray(?int $baseRoot = null): array

Missing function doc comment
Open

    public function setResourceFormat(?ResourceFormat $resourceFormat): self

Missing function doc comment
Open

    public function isResourceFileAVideo(): bool

Missing function doc comment
Open

    public function setPublic(bool $public): self

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

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

Missing function doc comment
Open

    public function getShortCut(): ?CShortcut

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected string $slug;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?User $creator;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?ResourceNode $parent = null;

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getCreator(): ?User

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

            $this->children->add($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 4 spaces, found 0
Open

)]

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

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function addComment(ResourceComment $comment): self

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected string $title;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected DateTime $updatedAt;

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

    {

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

        $this->children = new ArrayCollection();

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

    protected ?int $id = null;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected bool $fileEditableText;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?string $content = null;

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

    {

Line indented incorrectly; expected 8 spaces, found 4
Open

    private Collection $resourceFiles;

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 getParent(): ?self

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected Collection $resourceLinks;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected DateTime $createdAt;

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

    )]

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

        return $this->path;

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

        return $this;

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

            $resourceNode->setParent($this);

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getPath(): ?string

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

    {

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getPathForDisplayRemoveBase(string $base): string

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?CShortcut $shortCut = null;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function __construct()

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

        return null !== $this->creator;

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

    {

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setCreator(?User $creator): self

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

    use TimestampableTypedEntity;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?string $path = null;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected bool $public;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?UuidV4 $uuid = null;

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

        $this->fileEditableText = false;

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

        return $this->uuid;

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

        return $this->comments;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public const PATH_SEPARATOR = '/';

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected Collection $comments;

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

        $this->resourceFiles = new ArrayCollection();

Line indented incorrectly; expected 12 spaces, found 8
Open

        foreach ($parts as $part) {

Line indented incorrectly; expected 4 spaces, found 0
Open

class ResourceNode implements Stringable

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

{

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getPathForDisplay(): string

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

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

        return $this->parent;

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->createdAt = new DateTime();

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

        return $this->getPathForDisplay();

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function addChild(self $resourceNode): static

Line indented incorrectly; expected 12 spaces, found 8
Open

        if (!$this->children->contains($resourceNode)) {

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getLevel(): int

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

    {

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

            $parts = explode('-', $part);

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getUuid(): ?UuidV4

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

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

        $this->creator = $creator;

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

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

    use TimestampableAgoTrait;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected Collection $children;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ResourceType $resourceType;

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

        $this->public = false;

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

        $this->uuid = Uuid::v4();

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setParent(?self $parent = null): self

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

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

        $comment->setResourceNode($this);

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

    {

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getComments(): array|Collection

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->comments->add($comment);

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?ResourceFormat $resourceFormat = null;

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

        $this->resourceLinks = new ArrayCollection();

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

    {

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getChildren(): Collection

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

            }

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

                continue;

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

        $path = str_replace($base, '', $this->path);

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

    {

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

            $message = 'Invalid character "'.self::PATH_SEPARATOR.'" in resource name';

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

            }

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

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

                Criteria::expr()->eq('session', $session)

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

            );

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

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

        $this->resourceLinks->add($link);

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

        return false;

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

                return true;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getId(): ?int

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

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

        return $this->resourceType;

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

        $this->resourceType = $resourceType;

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

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

        return $this->public;

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 (str_contains(self::PATH_SEPARATOR, $slug)) {

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

        return $this->title;

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

            $criteria->andWhere(

Line indented incorrectly; expected 12 spaces, found 8
Open

        if ($resourceFile = $this->resourceFiles->first()) {

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

            $class = 'far fa-file';

Line indented incorrectly; expected 16 spaces, found 12
Open

            }

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

            $url = $router->generate('chamilo_core_resource_view', $params);

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

    {

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getShortCut(): ?CShortcut

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

        return $this;

Line indented incorrectly; expected 8 spaces, found 4
Open

    protected ?int $level = null;

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

        $this->comments = new ArrayCollection();

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function hasCreator(): bool

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

    }

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getPathForDisplayToArray(?int $baseRoot = null): array

Line indented incorrectly; expected 16 spaces, found 12
Open

            if (empty($parts[1])) {

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

            $id = $parts[1];

Line indented incorrectly; expected 12 spaces, found 8
Open

        }

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

        $pathForDisplay = preg_replace('/-\d+\\'.self::PATH_SEPARATOR.'/', '/', $path);

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

            $pathForDisplay = substr_replace($pathForDisplay, '', -1);

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

    ): ?ResourceLink {

Line indented incorrectly; expected 16 spaces, found 8
Open

        if ($course) {

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 16 spaces, found 12
Open

            if (str_contains($mimeType, 'image')) {

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

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

                return true;

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

        return $this->getIcon('fa-3x');

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

Line indented incorrectly; expected 12 spaces, found 8
Open

        }

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

        return $list;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function convertPathForDisplay(string $path): string

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

        return $this->resourceLinks;

Line indented incorrectly; expected 16 spaces, found 8
Open

        if ($user) {

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

        $this->resourceLinks = $resourceLinks;

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

        $this->content = $content;

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

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

        $criteria = Criteria::create();

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

            );

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

                Criteria::expr()->eq('group', $group)

Line indented incorrectly; expected 12 spaces, found 8
Open

        if ($this->hasResourceFile()) {

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

    {

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function isResourceFileAVideo(): bool

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

            $mimeType = $resourceFile->getMimeType();

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;

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

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

        return $this->resourceFiles;

Line indented incorrectly; expected 12 spaces, found 8
Open

        if (!$this->resourceFiles->contains($resourceFile)) {

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 12 spaces, found 8
Open

        }

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

            Criteria::expr()->eq('resourceTypeGroup', $this->resourceType->getId())

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

            );

Line indented incorrectly; expected 16 spaces, found 12
Open

            if (str_contains($mimeType, 'text')) {

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

                return true;

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

        return $this->slug;

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 16 spaces, found 8
Open

        }

Line indented incorrectly; expected 16 spaces, found 8
Open

        }

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

            ->resourceLinks

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

            if ($this->isResourceFileAVideo()) {

Line indented incorrectly; expected 12 spaces, found 8
Open

        }

Line indented incorrectly; expected 16 spaces, found 12
Open

            if (str_contains($mimeType, 'video')) {

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

            }

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

        $list = [];

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

    {

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getTitle(): string

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

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

        $criteria->where(

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

        );

Line indented incorrectly; expected 16 spaces, found 8
Open

        }

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

            $criteria->andWhere(

Line indented incorrectly; expected 16 spaces, found 8
Open

        if ($group) {

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

            $mimeType = $resourceFile->getMimeType();

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 16 spaces, found 12
Open

            }

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

    {

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setContent(string $content): self

Line indented incorrectly; expected 12 spaces, found 8
Open

        if ($this->resourceFiles->removeElement($resourceFile)) {

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

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

            $value = $parts[0];

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getSlug(): string

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 setResourceFormat(?ResourceFormat $resourceFormat): self

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getResourceLinkByContext(

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

            $criteria->andWhere(

Line indented incorrectly; expected 16 spaces, found 8
Open

        if ($session) {

Line indented incorrectly; expected 16 spaces, found 8
Open

        if ($usergroup) {

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

        ;

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

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

            $class .= " $additionalClass";

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

        return false;

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

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setPublic(bool $public): self

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

        $this->public = $public;

Line indented incorrectly; expected 12 spaces, found 8
Open

        }

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

        return $this->resourceFiles->first() ?: null;

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 12 spaces, found 8
Open

        if (null !== $pathForDisplay && '' !== $pathForDisplay) {

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

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

        $title = str_replace('/', '-', $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 16 spaces, found 8
Open

        }

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

        $first = $this

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

        return $first ?: null;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setResourceLinks(Collection $resourceLinks): self

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

    {

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

                $class = 'far fa-file-image';

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

                $class = 'far fa-file-video';

Line indented incorrectly; expected 12 spaces, found 8
Open

        if ($resourceFile = $this->resourceFiles->first()) {

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

    {

Line indented incorrectly; expected 12 spaces, found 8
Open

        if ($this->isResourceFileAnImage()) {

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 getResourceType(): ResourceType

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setResourceType(ResourceType $resourceType): self

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->resourceFiles->count() > 0;

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

                $resourceFile->setResourceNode(null);

Line indented incorrectly; expected 16 spaces, found 12
Open

            }

Line indented incorrectly; expected 12 spaces, found 8
Open

        if ($additionalClass) {

Line indented incorrectly; expected 12 spaces, found 8
Open

        }

Line indented incorrectly; expected 12 spaces, found 8
Open

        }

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

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

        return $this->shortCut;

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

    {

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function addResourceFile(ResourceFile $resourceFile): static

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 getFirstResourceFile(): ?ResourceFile

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

        return $pathForDisplay;

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

    {

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getResourceLinks(): Collection

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

    {

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

            );

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

                Criteria::expr()->eq('userGroup', $usergroup)

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

            ->first()

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

        $link->setResourceNode($this);

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

        $class = 'fa fa-folder';

Line indented incorrectly; expected 12 spaces, found 8
Open

        }

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

            ];

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

        return $this->content;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function hasResourceFile(): bool

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

                continue;

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

        $this->slug = $slug;

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

    {

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setTitle(string $title): self

Line indented incorrectly; expected 16 spaces, found 8
Open

        }

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getIcon(?string $additionalClass = null): string

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->shortCut = $shortCut;

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

        return $this;

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

            $this->resourceFiles->add($resourceFile);

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function removeResourceFile(ResourceFile $resourceFile): static

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

        $parts = explode(self::PATH_SEPARATOR, $this->path);

Line indented incorrectly; expected 16 spaces, found 12
Open

            if (!empty($baseRoot) && $id < $baseRoot) {

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

        return $this->convertPathForDisplay($path);

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getResourceFormat(): ?ResourceFormat

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

        $this->resourceFormat = $resourceFormat;

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

        return $this;

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

            $criteria->andWhere(

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

                Criteria::expr()->eq('user', $user)

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

            ->matching($criteria)

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function addResourceLink(ResourceLink $link): self

Line indented incorrectly; expected 16 spaces, found 12
Open

            }

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

            $mimeType = $resourceFile->getMimeType();

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

            return \sprintf("<img src='%s'/>", $url);

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

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

            $resourceFile->setResourceNode($this);

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

            throw new InvalidArgumentException($message);

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

        return $this;

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

                Criteria::expr()->eq('course', $course)

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

            $criteria->andWhere(

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function hasEditableTextContent(): bool

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

}

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

            $list[$id] = $value;

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setSlug(string $slug): self

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

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

            );

Line indented incorrectly; expected 8 spaces, found 4
Open

    }

Line indented incorrectly; expected 16 spaces, found 12
Open

            if ($this->isResourceFileAnImage()) {

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

        return '<i class="'.$class.'"></i>';

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function isResourceFileAnImage(): bool

Line indented incorrectly; expected 12 spaces, found 8
Open

        if ($resourceFile = $this->resourceFiles->first()) {

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function getThumbnail(RouterInterface $router): string

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

            $params = [

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

    {

Line indented incorrectly; expected 8 spaces, found 4
Open

    public function setShortCut(?CShortcut $shortCut): self

Line indented incorrectly; expected 16 spaces, found 12
Open

            if ($resourceFile->getResourceNode() === $this) {

There are no issues that match your filters.

Category
Status