Fix entity calls + fix function arguments type hints

pull/3844/head
Julio Montoya 5 years ago
parent e99a5a028b
commit ebf70b1c70
  1. 4
      src/CoreBundle/Entity/ResourceFile.php
  2. 4
      src/CoreBundle/Entity/ResourceLink.php
  3. 2
      src/CoreBundle/Entity/ResourceNode.php
  4. 6
      src/CoreBundle/Entity/Session.php
  5. 2
      src/CoreBundle/Entity/SessionRelUser.php
  6. 2
      src/CoreBundle/Entity/SkillRelUser.php
  7. 1
      src/CoreBundle/Entity/UserRelUser.php

@ -326,7 +326,7 @@ class ResourceFile
public function getWidth(): int public function getWidth(): int
{ {
$data = $this->getDimensions(); $data = $this->getDimensions();
if ($data) { if ([] !== $data) {
//$data = explode(',', $data); //$data = explode(',', $data);
return (int) $data[0]; return (int) $data[0];
@ -339,7 +339,7 @@ class ResourceFile
{ {
$data = $this->getDimensions(); $data = $this->getDimensions();
if ($data) { if ([] !== $data) {
//$data = explode(',', $data); //$data = explode(',', $data);
return (int) $data[1]; return (int) $data[1];

@ -91,14 +91,14 @@ class ResourceLink
* *
* @ORM\Column(name="start_visibility_at", type="datetime", nullable=true) * @ORM\Column(name="start_visibility_at", type="datetime", nullable=true)
*/ */
protected ?DateTimeInterface $startVisibilityAt; protected ?DateTimeInterface $startVisibilityAt = null;
/** /**
* @Groups({"resource_node:read", "resource_node:write", "document:write", "document:read"}) * @Groups({"resource_node:read", "resource_node:write", "document:write", "document:read"})
* *
* @ORM\Column(name="end_visibility_at", type="datetime", nullable=true) * @ORM\Column(name="end_visibility_at", type="datetime", nullable=true)
*/ */
protected ?DateTimeInterface $endVisibilityAt; protected ?DateTimeInterface $endVisibilityAt = null;
public function __construct() public function __construct()
{ {

@ -543,7 +543,7 @@ class ResourceNode
$params $params
); );
return sprintf('<img src=\'%s\'/>', $url); return sprintf("<img src='%s'/>", $url);
} }
if ($this->isResourceFileAVideo()) { if ($this->isResourceFileAVideo()) {
$class = sprintf('far fa-file-video %s', $size); $class = sprintf('far fa-file-video %s', $size);

@ -1255,10 +1255,6 @@ class Session
return true; return true;
} }
if (!empty($end) && $now <= $end) { return !empty($end) && $now <= $end;
return true;
}
return false;
} }
} }

@ -76,7 +76,7 @@ class SessionRelUser
/** /**
* @ORM\Column(name="moved_at", type="datetime", nullable=true, unique=false) * @ORM\Column(name="moved_at", type="datetime", nullable=true, unique=false)
*/ */
protected ?DateTime $movedAt; protected ?DateTime $movedAt = null;
/** /**
* @ORM\Column(name="registered_at", type="datetime") * @ORM\Column(name="registered_at", type="datetime")

@ -375,7 +375,7 @@ class SkillRelUser
$sum = 0; $sum = 0;
$countValues = 0; $countValues = 0;
foreach ($this->comments as $comment) { foreach ($this->comments as $comment) {
if (!$comment->getFeedbackValue()) { if (0 === $comment->getFeedbackValue()) {
continue; continue;
} }

@ -77,7 +77,6 @@ class UserRelUser
return $this; return $this;
} }
public function setRelationType(int $relationType): self public function setRelationType(int $relationType): self
{ {
$this->relationType = $relationType; $this->relationType = $relationType;

Loading…
Cancel
Save