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
{
/**
* @var EntityRepository
*/
protected $repository;
protected EntityRepository $repository;
/**
* @param array $allowedTypes

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

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

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

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

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

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

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

Loading…
Cancel
Save