Minor: Format code

pull/5099/head
Angel Fernando Quiroz Campos 10 months ago
parent 17627d96c1
commit a3a7d7ed24
  1. 1
      src/CoreBundle/Controller/ResourceController.php
  2. 6
      src/CoreBundle/Entity/Session.php
  3. 2
      src/CoreBundle/Entity/SessionRelCourseRelUser.php
  4. 3
      src/CoreBundle/Entity/TrackEDownloads.php
  5. 2
      src/CoreBundle/Repository/TrackEDownloadsRepository.php
  6. 2
      src/CourseBundle/Entity/CQuiz.php
  7. 4
      tests/CourseBundle/Repository/CCalendarEventRepositoryTest.php

@ -192,7 +192,6 @@ class ResourceController extends AbstractResourceController implements CourseCon
// If resource node has a file just download it. Don't download the children.
if ($resourceNode->hasResourceFile()) {
/** @var ?User $user */
$user = $this->getUser();
$resourceLinkId = $resourceNode->getResourceLinks()->first()->getId();

@ -767,7 +767,7 @@ class Session implements ResourceWithAccessUrlInterface, Stringable
*/
public function isActive(): bool
{
$now = new Datetime('now');
$now = new DateTime('now');
return $now > $this->getAccessStartDate();
}
@ -844,7 +844,7 @@ class Session implements ResourceWithAccessUrlInterface, Stringable
*/
public function isCurrentlyAccessible(): bool
{
$now = new Datetime();
$now = new DateTime();
return (null === $this->accessStartDate || $this->accessStartDate < $now)
&& (null === $this->accessEndDate || $now < $this->accessEndDate);
@ -1163,7 +1163,7 @@ class Session implements ResourceWithAccessUrlInterface, Stringable
protected function compareDates(?DateTime $start, DateTime $end = null): bool
{
$now = new Datetime('now');
$now = new DateTime('now');
if (!empty($start) && !empty($end) && ($now >= $start && $now <= $end)) {
return true;

@ -77,7 +77,7 @@ class SessionRelCourseRelUser
])]
#[ORM\ManyToOne(targetEntity: UserAlias::class, cascade: ['persist'], inversedBy: 'sessionRelCourseRelUsers')]
#[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', nullable: false)]
protected User $user;
protected UserAlias $user;
#[Groups([
'session_rel_course_rel_user:read',

@ -114,9 +114,6 @@ class TrackEDownloads
/**
* Set resourceLink.
*
* @param ResourceLink|null $resourceLink
* @return TrackEDownloads
*/
public function setResourceLink(?ResourceLink $resourceLink): self
{

@ -26,7 +26,7 @@ class TrackEDownloadsRepository extends ServiceEntityRepository
$download->setDownUserId($userId);
$download->setDownDate(new DateTime());
$resourceLink = $this->_em->getRepository(ResourceLink::class)->find($resourceLinkId);
$resourceLink = $this->_em->getRepository(ResourceLink::class)->find($resourceLinkId);
if ($resourceLink) {
$download->setResourceLink($resourceLink);
}

@ -82,7 +82,7 @@ class CQuiz extends AbstractResource implements ResourceInterface, ResourceShowC
#[ORM\Column(name: 'propagate_neg', type: 'integer', nullable: false)]
protected int $propagateNeg;
#[ORm\Column(name: 'save_correct_answers', type: 'integer', nullable: true)]
#[ORM\Column(name: 'save_correct_answers', type: 'integer', nullable: true)]
protected ?int $saveCorrectAnswers;
#[ORM\Column(name: 'review_answers', type: 'integer', nullable: false)]

@ -410,7 +410,7 @@ class CCalendarEventRepositoryTest extends AbstractApiTest
$event = $calendarRepo->createFromAnnouncement(
$announcement,
new Datetime('now'),
new DateTime('now +30 days'),
new Datetime('now +30 days'),
['everyone'],
$course,
);
@ -430,7 +430,7 @@ class CCalendarEventRepositoryTest extends AbstractApiTest
$event = $calendarRepo->createFromAnnouncement(
$announcement2,
new Datetime('now'),
new DateTime('now +30 days'),
new Datetime('now +30 days'),
['USER:'.$student->getId(), 'GROUP:'.$group->getIid()],
$course,
);

Loading…
Cancel
Save