Fix type hint, fix PHP errors

pull/3844/head
Julio Montoya 4 years ago
parent 390409273f
commit 4375c81d4d
  1. 5
      src/CoreBundle/Settings/AbstractSettingsSchema.php
  2. 36
      src/CoreBundle/Settings/SettingsManager.php
  3. 24
      src/CoreBundle/ToolChain.php
  4. 4
      src/CoreBundle/Traits/CourseControllerTrait.php
  5. 2
      src/CoreBundle/Traits/SessionTrait.php
  6. 2
      src/CourseBundle/Controller/CourseControllerInterface.php
  7. 12
      src/CourseBundle/Manager/SettingsFormFactory.php
  8. 2
      src/LtiBundle/Form/ExternalToolType.php

@ -12,10 +12,7 @@ use Sylius\Bundle\SettingsBundle\Schema\SchemaInterface;
abstract class AbstractSettingsSchema implements SchemaInterface abstract class AbstractSettingsSchema implements SchemaInterface
{ {
/** protected EntityRepository $repository;
* @var EntityRepository
*/
protected $repository;
/** /**
* @param array $allowedTypes * @param array $allowedTypes

@ -29,46 +29,28 @@ use Symfony\Component\Validator\Exception\ValidatorException;
*/ */
class SettingsManager implements SettingsManagerInterface class SettingsManager implements SettingsManagerInterface
{ {
/** protected ?AccessUrl $url = null;
* @var null|\Chamilo\CoreBundle\Entity\AccessUrl
*/
protected $url;
/** protected ServiceRegistryInterface $schemaRegistry;
* @var ServiceRegistryInterface
*/
protected $schemaRegistry;
/** protected EntityManager $manager;
* @var EntityManager
*/
protected $manager;
/** protected EntityRepository $repository;
* @var EntityRepository
*/
protected $repository;
/** protected EventDispatcherInterface $eventDispatcher;
* @var EventDispatcherInterface
*/
protected $eventDispatcher;
/** /**
* Runtime cache for resolved parameters. * Runtime cache for resolved parameters.
* *
* @var Settings[] * @var Settings[]
*/ */
protected $resolvedSettings = []; protected array $resolvedSettings = [];
//protected $settings; //protected $settings;
/** /**
* @var array<string, \Sylius\Bundle\SettingsBundle\Model\Settings>|mixed[] * @var array<string, \Sylius\Bundle\SettingsBundle\Model\Settings>|mixed[]|null
*/
protected $schemaList;
/**
* @var \Symfony\Component\HttpFoundation\RequestStack
*/ */
protected $request; protected ?array $schemaList;
protected RequestStack $request;
public function __construct( public function __construct(
ServiceRegistryInterface $schemaRegistry, ServiceRegistryInterface $schemaRegistry,

@ -53,27 +53,21 @@ class ToolChain
/** /**
* @var \Chamilo\CoreBundle\Tool\AbstractTool[]|mixed[] * @var \Chamilo\CoreBundle\Tool\AbstractTool[]|mixed[]
*/ */
protected $tools; protected array $tools;
/** /**
* @var mixed[] * @var mixed[]
*/ */
protected $typeList; protected array $typeList;
/**
* @var \Doctrine\ORM\EntityManagerInterface protected \Doctrine\ORM\EntityManagerInterface $entityManager;
*/
protected $entityManager; protected \Chamilo\CoreBundle\Settings\SettingsManager $settingsManager;
/**
* @var \Chamilo\CoreBundle\Settings\SettingsManager protected \Symfony\Component\Security\Core\Security $security;
*/
protected $settingsManager;
/**
* @var \Symfony\Component\Security\Core\Security
*/
protected $security;
/** /**
* @var mixed[] * @var mixed[]
*/ */
protected $repoEntityList; protected array $repoEntityList;
public function __construct(EntityManagerInterface $entityManager, SettingsManager $settingsManager, Security $security) public function __construct(EntityManagerInterface $entityManager, SettingsManager $settingsManager, Security $security)
{ {

@ -17,7 +17,7 @@ use Psr\Container\ContainerInterface;
*/ */
trait CourseControllerTrait trait CourseControllerTrait
{ {
protected Course $course; protected ?Course $course = null;
protected ?Session $session = null; protected ?Session $session = null;
protected $container; protected $container;
@ -137,7 +137,7 @@ trait CourseControllerTrait
$this->course = $course; $this->course = $course;
} }
public function getCourse(): Course public function getCourse(): ?Course
{ {
return $this->course; return $this->course;
} }

@ -10,7 +10,7 @@ use Chamilo\CoreBundle\Entity\Session;
trait SessionTrait trait SessionTrait
{ {
protected $session; protected ?Session $session;
/** /**
* @return Session * @return Session

@ -22,7 +22,7 @@ interface CourseControllerInterface
public function setSession(Session $session = null): void; public function setSession(Session $session = null): void;
public function getCourse(): Course; public function getCourse(): ?Course;
public function getSession(): ?Session; public function getSession(): ?Session;
} }

@ -13,15 +13,9 @@ use Symfony\Component\Form\FormFactoryInterface;
final class SettingsFormFactory implements SettingsFormFactoryInterface final class SettingsFormFactory implements SettingsFormFactoryInterface
{ {
/** private ServiceRegistryInterface $schemaRegistry;
* @var ServiceRegistryInterface
*/ private FormFactoryInterface $formFactory;
private $schemaRegistry;
/**
* @var FormFactoryInterface
*/
private $formFactory;
public function __construct(ServiceRegistryInterface $schemaRegistry, FormFactoryInterface $formFactory) public function __construct(ServiceRegistryInterface $schemaRegistry, FormFactoryInterface $formFactory)
{ {

@ -7,7 +7,7 @@ declare(strict_types=1);
namespace Chamilo\LtiBundle\Form; namespace Chamilo\LtiBundle\Form;
use Chamilo\LtiBundle\Entity\ExternalTool; use Chamilo\LtiBundle\Entity\ExternalTool;
use SimpleXMLElement; use \SimpleXMLElement;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\Extension\Core\Type\SubmitType;

Loading…
Cancel
Save