Minor - format code

pull/3425/head
Julio Montoya 5 years ago
parent d55312762e
commit 297d497149
  1. 14
      plugin/zoom/Entity/MeetingEntity.php
  2. 14
      plugin/zoom/Entity/RecordingEntity.php
  3. 22
      plugin/zoom/Entity/RegistrantEntity.php
  4. 2
      plugin/zoom/lib/API/MeetingInfoGet.php
  5. 8
      plugin/zoom/lib/ZoomPlugin.php

@ -64,33 +64,27 @@ class MeetingEntity
/**
* @var int the remote zoom meeting identifier
* @ORM\Column(type="string")
* @ORM\Column(name="meeting_id", type="string")
*/
protected $meetingId;
/**
* @var User
* @ORM\ManyToOne(
* targetEntity="Chamilo\UserBundle\Entity\User",
* )
* @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User")
* @ORM\JoinColumn(name="user_id", nullable=true)
*/
protected $user;
/**
* @var Course
* @ORM\ManyToOne(
* targetEntity="Chamilo\CoreBundle\Entity\Course",
* )
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course")
* @ORM\JoinColumn(name="course_id", nullable=true)
*/
protected $course;
/**
* @var Session
* @ORM\ManyToOne(
* targetEntity="Chamilo\CoreBundle\Entity\Session",
* )
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Session")
* @ORM\JoinColumn(name="session_id", nullable=true)
*/
protected $session;

@ -44,13 +44,13 @@ class RecordingEntity
* @ORM\Id
* @ORM\GeneratedValue()
*/
private $id;
protected $id;
/**
* @var string
* @ORM\Column(type="string")
*/
private $uuid;
protected $uuid;
/**
* @var MeetingEntity
@ -60,16 +60,16 @@ class RecordingEntity
* )
* @ORM\JoinColumn(name="meeting_id")
*/
private $meeting;
protected $meeting;
/**
* @var string
* @ORM\Column(type="text", name="recording_meeting_json", nullable=true)
*/
private $recordingMeetingJson;
protected $recordingMeetingJson;
/** @var RecordingMeeting */
private $recordingMeeting;
protected $recordingMeeting;
/**
* @param $name
@ -142,8 +142,8 @@ class RecordingEntity
}
if (null === $this->meeting) {
$this->meeting = Database::getManager()->getRepository(MeetingEntity::class)->find($recordingMeeting->id);
// $this->meeting remains null when the remote RecordingMeeting refers to a deleted meeting
} elseif ($this->meeting->getId() != $recordingMeeting->id) {
// $this->meeting remains null when the remote RecordingMeeting refers to a deleted meeting.
throw new Exception('The RecordingEntity meeting id differs from the RecordingMeeting meeting id');
}
$this->recordingMeeting = $recordingMeeting;
@ -169,7 +169,7 @@ class RecordingEntity
*/
public function preFlush()
{
if (!is_null($this->recordingMeeting)) {
if (null !== $this->recordingMeeting) {
$this->recordingMeetingJson = json_encode($this->recordingMeeting);
}
}

@ -35,16 +35,14 @@ class RegistrantEntity
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
protected $id;
/**
* @var User
* @ORM\ManyToOne(
* targetEntity="Chamilo\UserBundle\Entity\User",
* )
* @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User")
* @ORM\JoinColumn(name="user_id", nullable=false)
*/
private $user;
protected $user;
/**
* @var MeetingEntity
@ -54,34 +52,34 @@ class RegistrantEntity
* )
* @ORM\JoinColumn(name="meeting_id")
*/
private $meeting;
protected $meeting;
/**
* @var string
* @ORM\Column(type="text", name="created_registration_json", nullable=true)
*/
private $createdRegistrationJson;
protected $createdRegistrationJson;
/**
* @var string
* @ORM\Column(type="text", name="meeting_registrant_list_item_json", nullable=true)
*/
private $meetingRegistrantListItemJson;
protected $meetingRegistrantListItemJson;
/**
* @var string
* @ORM\Column(type="text", name="meeting_registrant_json", nullable=true)
*/
private $meetingRegistrantJson;
protected $meetingRegistrantJson;
/** @var CreatedRegistration */
private $createdRegistration;
protected $createdRegistration;
/** @var MeetingRegistrant */
private $meetingRegistrant;
protected $meetingRegistrant;
/** @var MeetingRegistrantListItem */
private $meetingRegistrantListItem;
protected $meetingRegistrantListItem;
/**
* @return string

@ -8,7 +8,7 @@ use Exception;
/**
* Class MeetingInfoGet
* Full Meeting as returned by the server, with unique identifiers and current status. *
* Full Meeting as returned by the server, with unique identifiers and current status.
*/
class MeetingInfoGet extends MeetingInfo
{

@ -738,7 +738,7 @@ class ZoomPlugin extends Plugin
public function createLinkToFileInCourse($meeting, $file, $name)
{
$course = $meeting->getCourse();
if (is_null($course)) {
if (null === $course) {
throw new Exception('This meeting is not linked to a course');
}
$courseInfo = api_get_course_info_by_id($course->getId());
@ -764,7 +764,7 @@ class ZoomPlugin extends Plugin
public function copyFileToCourse($meeting, $file, $name)
{
$course = $meeting->getCourse();
if (is_null($course)) {
if (null === $course) {
throw new Exception('This meeting is not linked to a course');
}
$courseInfo = api_get_course_info_by_id($course->getId());
@ -901,10 +901,10 @@ class ZoomPlugin extends Plugin
{
foreach (RecordingList::loadPeriodRecordings($startDate, $endDate) as $recordingMeeting) {
$recordingEntity = $this->getRecordingRepository()->find($recordingMeeting->uuid);
if (is_null($recordingEntity)) {
if (null === $recordingEntity) {
$recordingEntity = new RecordingEntity();
$meetingEntity = $this->getMeetingRepository()->find($recordingMeeting->id);
if (is_null($meetingEntity)) {
if (null === $meetingEntity) {
try {
$meetingInfoGet = MeetingInfoGet::fromId($recordingMeeting->id);
} catch (Exception $exception) {

Loading…
Cancel
Save