Fix argument types and return types

pull/5042/head
Angel Fernando Quiroz Campos 11 months ago
parent ec44f8e63b
commit cd318ea1ed
  1. 28
      psalm.xml
  2. 4
      src/CoreBundle/Component/Utils/NameConvention.php
  3. 2
      src/CoreBundle/Controller/Admin/IndexBlocksController.php
  4. 10
      src/CoreBundle/DataFixtures/SequenceFixtures.php
  5. 6
      src/CoreBundle/Entity/BranchSync.php
  6. 6
      src/CoreBundle/Entity/CourseCategory.php
  7. 42
      src/CoreBundle/Entity/ExtraField.php
  8. 4
      src/CoreBundle/Entity/PageCategory.php
  9. 5
      src/CoreBundle/Entity/PortfolioComment.php
  10. 11
      src/CoreBundle/Entity/SequenceCondition.php
  11. 8
      src/CoreBundle/Entity/SequenceMethod.php
  12. 44
      src/CoreBundle/Entity/SequenceValue.php
  13. 20
      src/CoreBundle/Entity/Skill.php
  14. 2
      src/CoreBundle/Entity/SkillRelUser.php
  15. 6
      src/CoreBundle/Entity/Tool.php
  16. 2
      src/CoreBundle/Entity/User.php
  17. 20
      src/CoreBundle/Entity/Usergroup.php
  18. 2
      src/CoreBundle/Form/ContactType.php
  19. 2
      src/CoreBundle/Form/ExtraFieldType.php
  20. 6
      src/CoreBundle/Framework/Container.php
  21. 8
      src/CoreBundle/Migrations/AbstractMigrationChamilo.php
  22. 6
      src/CourseBundle/Entity/CForum.php
  23. 4
      src/CourseBundle/Entity/CForumCategory.php
  24. 8
      src/CourseBundle/Entity/CForumThread.php
  25. 8
      src/CourseBundle/Entity/CGroup.php
  26. 8
      src/CourseBundle/Entity/CLpCategory.php
  27. 6
      src/CourseBundle/Entity/CQuiz.php
  28. 4
      src/CourseBundle/Entity/CQuizQuestionCategory.php
  29. 12
      src/CourseBundle/Entity/CSurveyQuestion.php
  30. 8
      src/CourseBundle/Entity/CThematic.php

@ -1,6 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<psalm <psalm
errorLevel="7" errorLevel="6"
resolveFromConfigFile="true" resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config" xmlns="https://getpsalm.org/schema/config"
@ -151,38 +151,16 @@
<directory name="vendor"/> <directory name="vendor"/>
<directory name="src/CoreBundle/Component/Editor"/> <directory name="src/CoreBundle/Component/Editor"/>
<directory name="src/CoreBundle/Hook"/>
<directory name="src/CourseBundle/Component/CourseCopy"/> <directory name="src/CourseBundle/Component/CourseCopy"/>
<directory name="src/LtiBundle"/> <directory name="src/LtiBundle"/>
<directory name="public/main/inc/lib/javascript"/> <file name="public/main/**/**"/>
<directory name="public/main/inc/lib/kses-0.2.2"/>
<directory name="public/main/inc/lib/nusoap"/>
<directory name="public/main/inc/lib/pear"/>
<directory name="public/main/inc/lib/ppt2png"/>
<directory name="public/main/inc/lib/search"/>
<directory name="public/main/inc/lib/zombie"/>
<directory name="public/main/exercise/export/qti2"/>
<file name="public/main/admin/index.php"/>
<file name="public/main/admin/settings.php"/>
<file name="public/main/admin/periodic_export.php"/>
<file name="public/main/admin/user_move_stats.php"/>
<file name="public/main/admin/settings.lib.php"/>
<file name="public/main/admin/user_update_import.php"/>
<file name="public/main/admin/teachers_time_by_session_report.php"/>
<file name="public/main/admin/specific_fields.php"/>
<file name="public/main/admin/sub_language*"/>
<file name="public/main/admin/ldap_*"/>
<file name="public/main/admin/special_exports.php"/>
<file name="public/main/lp/openoffice_presentation.class.php"/> <file name="public/main/lp/openoffice_presentation.class.php"/>
<file name="public/main/lp/openoffice_document.class.php"/> <file name="public/main/lp/openoffice_document.class.php"/>
<file name="public/main/lp/openoffice_text.class.php"/> <file name="public/main/lp/openoffice_text.class.php"/>
<file name="public/main/lp/openoffice_text_document.class.php"/> <file name="public/main/lp/openoffice_text_document.class.php"/>
<file name="public/main/lp/aicc.class.php"/>
<file name="public/main/exercise/admin.php"/>
<file name="public/main/survey/survey_list.php"/>
<file name="src/CoreBundle/Component/Utils/AssetDirectoryNamer.php"/> <file name="src/CoreBundle/Component/Utils/AssetDirectoryNamer.php"/>
<file name="src/CoreBundle/Controller/EditorController.php"/> <file name="src/CoreBundle/Controller/EditorController.php"/>

@ -22,9 +22,9 @@ class NameConvention
{ {
$format = $this->getFormat()['format']; $format = $this->getFormat()['format'];
$personName = str_replace( $personName = (string) str_replace(
['title ', 'first_name', 'last_name'], ['title ', 'first_name', 'last_name'],
['', $user->getFirstname(), $user->getLastname()], ['', (string) $user->getFirstname(), (string) $user->getLastname()],
$format $format
); );

@ -673,7 +673,7 @@ class IndexBlocksController extends BaseController
private function getItemsChamilo(): array private function getItemsChamilo(): array
{ {
$languageInterface = 'english'; $languageInterface = api_get_language_isocode();
$items = []; $items = [];
$items[] = [ $items[] = [

@ -32,8 +32,8 @@ class SequenceFixtures extends Fixture
$sequenceCondition1 = (new SequenceCondition()) $sequenceCondition1 = (new SequenceCondition())
->setDescription('<= 100%') ->setDescription('<= 100%')
->setMathOperation('<=') ->setMathOperation('<=')
->setParam('100.0') ->setParam(100.0)
->setActTrue('2') ->setActTrue(2)
->setActFalse('0') ->setActFalse('0')
; ;
$manager->persist($sequenceCondition1); $manager->persist($sequenceCondition1);
@ -41,8 +41,8 @@ class SequenceFixtures extends Fixture
$sequenceCondition2 = (new SequenceCondition()) $sequenceCondition2 = (new SequenceCondition())
->setDescription('>= 70%') ->setDescription('>= 70%')
->setMathOperation('>=') ->setMathOperation('>=')
->setParam('70.0') ->setParam(70.0)
->setActTrue('0') ->setActTrue(0)
->setActFalse('') ->setActFalse('')
; ;
$manager->persist($sequenceCondition2); $manager->persist($sequenceCondition2);
@ -150,7 +150,7 @@ class SequenceFixtures extends Fixture
$sequenceMethod = (new SequenceMethod()) $sequenceMethod = (new SequenceMethod())
->setDescription($item['description']) ->setDescription($item['description'])
->setFormula($item['formula']) ->setFormula($item['formula'])
->setAssign((string) $item['assign']) ->setAssign((int) $item['assign'])
->setMetType($item['met_type']) ->setMetType($item['met_type'])
->setActFalse($item['act_false']) ->setActFalse($item['act_false'])
; ;

@ -171,8 +171,6 @@ class BranchSync
/** /**
* Get latitude. * Get latitude.
*
* @return float
*/ */
public function getLatitude(): ?string public function getLatitude(): ?string
{ {
@ -188,10 +186,8 @@ class BranchSync
/** /**
* Get longitude. * Get longitude.
*
* @return float
*/ */
public function getLongitude() public function getLongitude(): ?string
{ {
return $this->longitude; return $this->longitude;
} }

@ -65,7 +65,7 @@ class CourseCategory implements Stringable
protected ?int $id = null; protected ?int $id = null;
/** /**
* @var Collection|CourseCategory[] * @var Collection<int, CourseCategory>
*/ */
#[ORM\OneToMany(mappedBy: 'parent', targetEntity: self::class)] #[ORM\OneToMany(mappedBy: 'parent', targetEntity: self::class)]
protected Collection $children; protected Collection $children;
@ -152,9 +152,9 @@ class CourseCategory implements Stringable
} }
/** /**
* @return Collection * @return Collection<int, CourseCategory>
*/ */
public function getChildren() public function getChildren(): Collection
{ {
return $this->children; return $this->children;
} }

@ -96,7 +96,7 @@ class ExtraField
protected Collection $options; protected Collection $options;
/** /**
* @var Tag[]|Collection * @var Collection<int, Tag>
*/ */
#[ORM\OneToMany(targetEntity: Tag::class, mappedBy: 'field')] #[ORM\OneToMany(targetEntity: Tag::class, mappedBy: 'field')]
protected Collection $tags; protected Collection $tags;
@ -114,12 +114,7 @@ class ExtraField
$this->filter = false; $this->filter = false;
} }
/** public function getId(): ?int
* Get id.
*
* @return int
*/
public function getId()
{ {
return $this->id; return $this->id;
} }
@ -144,10 +139,7 @@ class ExtraField
return $this; return $this;
} }
/** public function getVariable(): string
* @return string
*/
public function getVariable()
{ {
return $this->variable; return $this->variable;
} }
@ -158,10 +150,7 @@ class ExtraField
return $this; return $this;
} }
/** public function getDisplayText(): ?string
* @return string
*/
public function getDisplayText()
{ {
return $this->displayText; return $this->displayText;
} }
@ -172,10 +161,7 @@ class ExtraField
return $this; return $this;
} }
/** public function getDefaultValue(): ?string
* @return string
*/
public function getDefaultValue()
{ {
return $this->defaultValue; return $this->defaultValue;
} }
@ -186,10 +172,7 @@ class ExtraField
return $this; return $this;
} }
/** public function getFieldOrder(): ?int
* @return int
*/
public function getFieldOrder()
{ {
return $this->fieldOrder; return $this->fieldOrder;
} }
@ -200,10 +183,7 @@ class ExtraField
return $this; return $this;
} }
/** public function isChangeable(): ?bool
* @return bool
*/
public function isChangeable()
{ {
return $this->changeable; return $this->changeable;
} }
@ -269,9 +249,9 @@ class ExtraField
} }
/** /**
* @return Tag[]|Collection * @return Collection<int, Tag>
*/ */
public function getTags(): array|Collection public function getTags(): Collection
{ {
return $this->tags; return $this->tags;
} }
@ -306,13 +286,13 @@ class ExtraField
return $this; return $this;
} }
public function setTranslatableLocale($locale) public function setTranslatableLocale($locale): static
{ {
$this->locale = $locale; $this->locale = $locale;
return $this; return $this;
} }
public function getTranslatableLocale() public function getTranslatableLocale(): ?string
{ {
return $this->locale; return $this->locale;
} }

@ -102,9 +102,9 @@ class PageCategory
} }
/** /**
* @return ArrayCollection<int, Page> * @return Collection<int, Page>
*/ */
public function getPages(): ArrayCollection public function getPages(): Collection
{ {
return $this->pages; return $this->pages;
} }

@ -8,6 +8,7 @@ namespace Chamilo\CoreBundle\Entity;
use DateTime; use DateTime;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo; use Gedmo\Mapping\Annotation as Gedmo;
@ -71,7 +72,7 @@ class PortfolioComment
#[ORM\OneToMany(targetEntity: self::class, mappedBy: 'parent')] #[ORM\OneToMany(targetEntity: self::class, mappedBy: 'parent')]
#[ORM\OrderBy(['lft' => 'DESC'])] #[ORM\OrderBy(['lft' => 'DESC'])]
private ArrayCollection $children; private Collection $children;
#[ORM\Column(type: 'float', nullable: true)] #[ORM\Column(type: 'float', nullable: true)]
private ?float $score; private ?float $score;
@ -151,7 +152,7 @@ class PortfolioComment
return $this; return $this;
} }
public function getChildren(): ArrayCollection public function getChildren(): Collection
{ {
return $this->children; return $this->children;
} }

@ -72,9 +72,6 @@ class SequenceCondition
return $this; return $this;
} }
/**
* @return string
*/
public function getParam(): float public function getParam(): float
{ {
return $this->param; return $this->param;
@ -87,9 +84,6 @@ class SequenceCondition
return $this; return $this;
} }
/**
* @return string
*/
public function getActTrue(): int public function getActTrue(): int
{ {
return $this->actTrue; return $this->actTrue;
@ -102,10 +96,7 @@ class SequenceCondition
return $this; return $this;
} }
/** public function getActFalse(): string
* @return string
*/
public function getActFalse()
{ {
return $this->actFalse; return $this->actFalse;
} }

@ -72,9 +72,6 @@ class SequenceMethod
return $this; return $this;
} }
/**
* @return string
*/
public function getAssign(): int public function getAssign(): int
{ {
return $this->assign; return $this->assign;
@ -87,10 +84,7 @@ class SequenceMethod
return $this; return $this;
} }
/** public function getMetType(): string
* @return string
*/
public function getMetType()
{ {
return $this->metType; return $this->metType;
} }

@ -53,12 +53,7 @@ class SequenceValue
#[ORM\Column(name: 'available_end_date', type: 'datetime', nullable: true)] #[ORM\Column(name: 'available_end_date', type: 'datetime', nullable: true)]
protected ?DateTime $availableEndDate = null; protected ?DateTime $availableEndDate = null;
/** public function getId(): ?int
* Get id.
*
* @return int
*/
public function getId()
{ {
return $this->id; return $this->id;
} }
@ -75,17 +70,11 @@ class SequenceValue
return $this; return $this;
} }
/**
* @return int
*/
public function getAdvance(): float public function getAdvance(): float
{ {
return $this->advance; return $this->advance;
} }
/**
* @return SequenceValue
*/
public function setAdvance(float $advance): static public function setAdvance(float $advance): static
{ {
$this->advance = $advance; $this->advance = $advance;
@ -93,10 +82,7 @@ class SequenceValue
return $this; return $this;
} }
/** public function getCompleteItems(): int
* @return int
*/
public function getCompleteItems()
{ {
return $this->completeItems; return $this->completeItems;
} }
@ -108,10 +94,7 @@ class SequenceValue
return $this; return $this;
} }
/** public function getTotalItems(): int
* @return int
*/
public function getTotalItems()
{ {
return $this->totalItems; return $this->totalItems;
} }
@ -123,9 +106,6 @@ class SequenceValue
return $this; return $this;
} }
/**
* @return int
*/
public function getSuccess(): bool public function getSuccess(): bool
{ {
return $this->success; return $this->success;
@ -138,10 +118,7 @@ class SequenceValue
return $this; return $this;
} }
/** public function getSuccessDate(): ?DateTime
* @return DateTime
*/
public function getSuccessDate()
{ {
return $this->successDate; return $this->successDate;
} }
@ -153,9 +130,6 @@ class SequenceValue
return $this; return $this;
} }
/**
* @return int
*/
public function getAvailable(): bool public function getAvailable(): bool
{ {
return $this->available; return $this->available;
@ -168,10 +142,7 @@ class SequenceValue
return $this; return $this;
} }
/** public function getAvailableStartDate(): ?DateTime
* @return DateTime
*/
public function getAvailableStartDate()
{ {
return $this->availableStartDate; return $this->availableStartDate;
} }
@ -183,10 +154,7 @@ class SequenceValue
return $this; return $this;
} }
/** public function getAvailableEndDate(): ?DateTime
* @return DateTime
*/
public function getAvailableEndDate()
{ {
return $this->availableEndDate; return $this->availableEndDate;
} }

@ -34,31 +34,31 @@ class Skill implements Stringable
protected ?Profile $profile = null; protected ?Profile $profile = null;
/** /**
* @var SkillRelUser[]|Collection * @var Collection<int, SkillRelUser>
*/ */
#[ORM\OneToMany(targetEntity: SkillRelUser::class, mappedBy: 'skill', cascade: ['persist'])] #[ORM\OneToMany(targetEntity: SkillRelUser::class, mappedBy: 'skill', cascade: ['persist'])]
protected Collection $issuedSkills; protected Collection $issuedSkills;
/** /**
* @var Collection|SkillRelItem[] * @var Collection<int, SkillRelItem>
*/ */
#[ORM\OneToMany(targetEntity: SkillRelItem::class, mappedBy: 'skill', cascade: ['persist'])] #[ORM\OneToMany(targetEntity: SkillRelItem::class, mappedBy: 'skill', cascade: ['persist'])]
protected Collection $items; protected Collection $items;
/** /**
* @var Collection|SkillRelSkill[] * @var Collection<int, SkillRelSkill>
*/ */
#[ORM\OneToMany(targetEntity: SkillRelSkill::class, mappedBy: 'skill', cascade: ['persist'])] #[ORM\OneToMany(targetEntity: SkillRelSkill::class, mappedBy: 'skill', cascade: ['persist'])]
protected Collection $skills; protected Collection $skills;
/** /**
* @var Collection|SkillRelCourse[] * @var Collection<int, SkillRelCourse>
*/ */
#[ORM\OneToMany(targetEntity: SkillRelCourse::class, mappedBy: 'skill', cascade: ['persist'])] #[ORM\OneToMany(targetEntity: SkillRelCourse::class, mappedBy: 'skill', cascade: ['persist'])]
protected Collection $courses; protected Collection $courses;
/** /**
* @var Collection|SkillRelGradebook[] * @var Collection<int, SkillRelGradebook>
*/ */
#[ORM\OneToMany(targetEntity: SkillRelGradebook::class, mappedBy: 'skill', cascade: ['persist'])] #[ORM\OneToMany(targetEntity: SkillRelGradebook::class, mappedBy: 'skill', cascade: ['persist'])]
protected Collection $gradeBookCategories; protected Collection $gradeBookCategories;
@ -253,19 +253,17 @@ class Skill implements Stringable
} }
/** /**
* Get issuedSkills. * @return Collection<int, SkillRelUser>
*
* @return Collection
*/ */
public function getIssuedSkills() public function getIssuedSkills(): Collection
{ {
return $this->issuedSkills; return $this->issuedSkills;
} }
/** /**
* @return Collection * @return Collection<int, SkillRelItem>
*/ */
public function getItems() public function getItems(): Collection
{ {
return $this->items; return $this->items;
} }

@ -46,7 +46,7 @@ class SkillRelUser
protected ?Session $session = null; protected ?Session $session = null;
/** /**
* @var Collection|SkillRelUserComment[] * @var Collection<int, SkillRelUserComment>
*/ */
#[ORM\OneToMany(targetEntity: \Chamilo\CoreBundle\Entity\SkillRelUserComment::class, mappedBy: 'skillRelUser', cascade: ['persist', 'remove'], orphanRemoval: true)] #[ORM\OneToMany(targetEntity: \Chamilo\CoreBundle\Entity\SkillRelUserComment::class, mappedBy: 'skillRelUser', cascade: ['persist', 'remove'], orphanRemoval: true)]
protected Collection $comments; protected Collection $comments;

@ -32,7 +32,7 @@ class Tool implements Stringable
protected string $name; protected string $name;
/** /**
* @var ResourceType[]|Collection * @var Collection<int, ResourceType>
*/ */
#[ORM\OneToMany(targetEntity: \Chamilo\CoreBundle\Entity\ResourceType::class, mappedBy: 'tool', cascade: ['persist', 'remove'])] #[ORM\OneToMany(targetEntity: \Chamilo\CoreBundle\Entity\ResourceType::class, mappedBy: 'tool', cascade: ['persist', 'remove'])]
protected Collection $resourceTypes; protected Collection $resourceTypes;
@ -99,9 +99,9 @@ class Tool implements Stringable
} }
/** /**
* @return Collection * @return Collection<int, ResourceType>
*/ */
public function getResourceTypes() public function getResourceTypes(): Collection
{ {
return $this->resourceTypes; return $this->resourceTypes;
} }

@ -2072,7 +2072,7 @@ class User implements UserInterface, EquatableInterface, ResourceInterface, Reso
return $this->templates; return $this->templates;
} }
public function getDropBoxReceivedFiles(): ArrayCollection|Collection public function getDropBoxReceivedFiles(): Collection
{ {
return $this->dropBoxReceivedFiles; return $this->dropBoxReceivedFiles;
} }

@ -98,12 +98,16 @@ class Usergroup extends AbstractResource implements ResourceInterface, ResourceI
} }
/** /**
* @return ArrayCollection<int, UsergroupRelUser> * @return Collection<int, UsergroupRelUser>
*/ */
public function getUsers(): ArrayCollection public function getUsers(): Collection
{ {
return $this->users; return $this->users;
} }
/**
* @return Collection<int, AccessUrlRelUserGroup>
*/
public function getUrls(): Collection public function getUrls(): Collection
{ {
return $this->urls; return $this->urls;
@ -227,9 +231,9 @@ class Usergroup extends AbstractResource implements ResourceInterface, ResourceI
} }
/** /**
* @return ArrayCollection<int, UsergroupRelCourse> * @return Collection<int, UsergroupRelCourse>
*/ */
public function getCourses(): ArrayCollection public function getCourses(): Collection
{ {
return $this->courses; return $this->courses;
} }
@ -241,9 +245,9 @@ class Usergroup extends AbstractResource implements ResourceInterface, ResourceI
} }
/** /**
* @return ArrayCollection<int, UsergroupRelSession> * @return Collection<int, UsergroupRelSession>
*/ */
public function getSessions(): ArrayCollection public function getSessions(): Collection
{ {
return $this->sessions; return $this->sessions;
} }
@ -255,9 +259,9 @@ class Usergroup extends AbstractResource implements ResourceInterface, ResourceI
} }
/** /**
* @return ArrayCollection<int, UsergroupRelQuestion> * @return Collection<int, UsergroupRelQuestion>
*/ */
public function getQuestions(): ArrayCollection public function getQuestions(): Collection
{ {
return $this->questions; return $this->questions;
} }

@ -20,7 +20,7 @@ use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
/** /**
* @template-extends AbstractType<object> * @template-extends AbstractType<array>
*/ */
class ContactType extends AbstractType class ContactType extends AbstractType
{ {

@ -31,7 +31,7 @@ use Symfony\Component\Form\FormEvents;
use Symfony\Component\Security\Core\Security; use Symfony\Component\Security\Core\Security;
/** /**
* @template-extends AbstractType<ExtraField> * @template-extends AbstractType<array>
*/ */
class ExtraFieldType extends AbstractType class ExtraFieldType extends AbstractType
{ {

@ -93,6 +93,7 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInt
use Symfony\Component\Security\Core\Authorization\AuthorizationChecker; use Symfony\Component\Security\Core\Authorization\AuthorizationChecker;
use Symfony\Component\Translation\Translator; use Symfony\Component\Translation\Translator;
use Twig\Environment; use Twig\Environment;
use UnitEnum;
/** /**
* Symfony services for the legacy Chamilo code. * Symfony services for the legacy Chamilo code.
@ -112,10 +113,7 @@ class Container
self::$container = $container; self::$container = $container;
} }
/** public static function getParameter(string $parameter): UnitEnum|float|array|bool|int|string|null
* @return array|bool|float|int|string|null
*/
public static function getParameter(string $parameter)
{ {
if (self::$container->hasParameter($parameter)) { if (self::$container->hasParameter($parameter)) {
return self::$container->getParameter($parameter); return self::$container->getParameter($parameter);

@ -7,6 +7,7 @@ declare(strict_types=1);
namespace Chamilo\CoreBundle\Migrations; namespace Chamilo\CoreBundle\Migrations;
use Chamilo\CoreBundle\Entity\AbstractResource; use Chamilo\CoreBundle\Entity\AbstractResource;
use Chamilo\CoreBundle\Entity\AccessUrl;
use Chamilo\CoreBundle\Entity\ResourceInterface; use Chamilo\CoreBundle\Entity\ResourceInterface;
use Chamilo\CoreBundle\Entity\ResourceLink; use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Entity\SettingsCurrent; use Chamilo\CoreBundle\Entity\SettingsCurrent;
@ -121,6 +122,9 @@ abstract class AbstractMigrationChamilo extends AbstractMigration implements Con
$options = [] $options = []
): void { ): void {
$em = $this->getEntityManager(); $em = $this->getEntityManager();
$accessUrl = $em->find(AccessUrl::class, $accessUrl);
$setting = new SettingsCurrent(); $setting = new SettingsCurrent();
$setting $setting
->setVariable($variable) ->setVariable($variable)
@ -133,8 +137,8 @@ abstract class AbstractMigrationChamilo extends AbstractMigration implements Con
->setScope($scope) ->setScope($scope)
->setSubkeytext($subKeyText) ->setSubkeytext($subKeyText)
->setUrl($accessUrl) ->setUrl($accessUrl)
->setAccessUrlChangeable($accessUrlChangeable) ->setAccessUrlChangeable((int) $accessUrlChangeable)
->setAccessUrlLocked($accessUrlLocked) ->setAccessUrlLocked((int) $accessUrlLocked)
; ;
$em->persist($setting); $em->persist($setting);

@ -366,7 +366,7 @@ class CForum extends AbstractResource implements ResourceInterface, Stringable
return $this->iid; return $this->iid;
} }
public function getThreads(): ArrayCollection public function getThreads(): Collection
{ {
return $this->threads; return $this->threads;
} }
@ -396,9 +396,9 @@ class CForum extends AbstractResource implements ResourceInterface, Stringable
} }
/** /**
* @return ArrayCollection<int, CForumPost> * @return Collection<int, CForumPost>
*/ */
public function getPosts(): ArrayCollection public function getPosts(): Collection
{ {
return $this->posts; return $this->posts;
} }

@ -111,9 +111,9 @@ class CForumCategory extends AbstractResource implements ResourceInterface, Stri
} }
/** /**
* @return ArrayCollection<int, CForum> * @return Collection<int, CForum>
*/ */
public function getForums(): ArrayCollection public function getForums(): Collection
{ {
return $this->forums; return $this->forums;
} }

@ -281,9 +281,9 @@ class CForumThread extends AbstractResource implements ResourceInterface, String
} }
/** /**
* @return ArrayCollection<int, CForumPost> * @return Collection<int, CForumPost>
*/ */
public function getPosts(): ArrayCollection public function getPosts(): Collection
{ {
return $this->posts; return $this->posts;
} }
@ -301,9 +301,9 @@ class CForumThread extends AbstractResource implements ResourceInterface, String
} }
/** /**
* @return ArrayCollection<int, CForumThreadQualify> * @return Collection<int, CForumThreadQualify>
*/ */
public function getQualifications(): ArrayCollection public function getQualifications(): Collection
{ {
return $this->qualifications; return $this->qualifications;
} }

@ -260,9 +260,9 @@ class CGroup extends AbstractResource implements ResourceInterface, Stringable
} }
/** /**
* @return ArrayCollection<int, CGroupRelUser> * @return Collection<int, CGroupRelUser>
*/ */
public function getMembers(): ArrayCollection public function getMembers(): Collection
{ {
return $this->members; return $this->members;
} }
@ -297,9 +297,9 @@ class CGroup extends AbstractResource implements ResourceInterface, Stringable
} }
/** /**
* @return ArrayCollection<int, CGroupRelTutor> * @return Collection<int, CGroupRelTutor>
*/ */
public function getTutors(): ArrayCollection public function getTutors(): Collection
{ {
return $this->tutors; return $this->tutors;
} }

@ -93,17 +93,17 @@ class CLpCategory extends AbstractResource implements ResourceInterface, Stringa
} }
/** /**
* @return ArrayCollection<int, CLp> * @return Collection<int, CLp>
*/ */
public function getLps(): ArrayCollection public function getLps(): Collection
{ {
return $this->lps; return $this->lps;
} }
/** /**
* @return ArrayCollection<int, CLpCategoryRelUser> * @return Collection<int, CLpCategoryRelUser>
*/ */
public function getUsers(): ArrayCollection public function getUsers(): Collection
{ {
return $this->users; return $this->users;
} }

@ -185,7 +185,7 @@ class CQuiz extends AbstractResource implements ResourceInterface, ResourceShowC
/** /**
* @return ArrayCollection<int, CQuizRelQuestion> * @return ArrayCollection<int, CQuizRelQuestion>
*/ */
public function getQuestions(): ArrayCollection public function getQuestions(): Collection
{ {
return $this->questions instanceof ArrayCollection ? return $this->questions instanceof ArrayCollection ?
$this->questions : $this->questions :
@ -616,9 +616,9 @@ class CQuiz extends AbstractResource implements ResourceInterface, ResourceShowC
} }
/** /**
* @return ArrayCollection<int, CQuizRelQuestionCategory> * @return Collection<int, CQuizRelQuestionCategory>
*/ */
public function getQuestionsCategories(): ArrayCollection public function getQuestionsCategories(): Collection
{ {
return $this->questionsCategories instanceof ArrayCollection ? return $this->questionsCategories instanceof ArrayCollection ?
$this->questionsCategories : $this->questionsCategories :

@ -101,9 +101,9 @@ class CQuizQuestionCategory extends AbstractResource implements ResourceInterfac
} }
/** /**
* @return ArrayCollection<int, CQuizQuestion> * @return Collection<int, CQuizQuestion>
*/ */
public function getQuestions(): ArrayCollection public function getQuestions(): Collection
{ {
return $this->questions; return $this->questions;
} }

@ -287,9 +287,9 @@ class CSurveyQuestion
} }
/** /**
* @return ArrayCollection<int, CSurveyQuestion> * @return Collection<int, CSurveyQuestion>
*/ */
public function getChildren(): ArrayCollection public function getChildren(): Collection
{ {
return $this->children; return $this->children;
} }
@ -326,17 +326,17 @@ class CSurveyQuestion
} }
/** /**
* @return ArrayCollection<int, CSurveyAnswer> * @return Collection<int, CSurveyAnswer>
*/ */
public function getAnswers(): ArrayCollection public function getAnswers(): Collection
{ {
return $this->answers; return $this->answers;
} }
/** /**
* @return ArrayCollection<int, CSurveyQuestionOption> * @return Collection<int, CSurveyQuestionOption>
*/ */
public function getOptions(): ArrayCollection public function getOptions(): Collection
{ {
return $this->options; return $this->options;
} }

@ -127,17 +127,17 @@ class CThematic extends AbstractResource implements ResourceInterface, Stringabl
} }
/** /**
* @return ArrayCollection<int, CThematicPlan> * @return Collection<int, CThematicPlan>
*/ */
public function getPlans(): ArrayCollection public function getPlans(): Collection
{ {
return $this->plans; return $this->plans;
} }
/** /**
* @return ArrayCollection<int, CThematicAdvance> * @return Collection<int, CThematicAdvance>
*/ */
public function getAdvances(): ArrayCollection public function getAdvances(): Collection
{ {
return $this->advances; return $this->advances;
} }

Loading…
Cancel
Save