Internal: Format code, remove unused code

pull/3451/head
Julio Montoya 5 years ago
parent 155e7e26b9
commit 22d16dd5a6
  1. 2
      .php_cs.dist
  2. 2
      ecs.php
  3. 3
      psalm.xml
  4. 4
      src/CoreBundle/Controller/Api/CreateResourceNodeFileAction.php
  5. 4
      src/CoreBundle/Hook/HookEvent.php
  6. 2
      src/CoreBundle/Security/Authorization/Voter/ResourceNodeVoter.php
  7. 9
      src/CoreBundle/Security/Encoder.php
  8. 6
      src/CoreBundle/Traits/ControllerTrait.php

@ -4,7 +4,7 @@ $header = '/* For licensing terms, see /license.txt */';
$rules = [
'@Symfony' => true,
//'@Symfony:risky' => true,
'@Symfony:risky' => true,
'array_syntax' => [
'syntax' => 'short',
],

@ -17,7 +17,7 @@ return static function (ContainerConfigurator $containerConfigurator): void {
$parameters->set(Option::SETS, [
SetList::CLEAN_CODE,
SetList::SYMFONY,
SetList::SYMFONY_RISKY,
//SetList::SYMFONY_RISKY,
]);
// use $a++ instead of ++$a

@ -14,13 +14,10 @@
<!-- <directory name="public/main/exercise"/> -->
<ignoreFiles>
<directory name="vendor/*" />
<directory name="src/CoreBundle/Admin" />
<directory name="src/CoreBundle/Block" />
<directory name="src/CoreBundle/Menu" />
<directory name="src/CoreBundle/Migrations" />
<directory name="src/CoreBundle/Component/Editor" />
<directory name="src/CourseBundle/Component/CourseCopy" />
<directory name="src/CourseBundle/Admin" />
<directory name="src/GraphQlBundle" />
<directory name="src/LtiBundle" />
<file name="public/main/admin/db.php" />

@ -95,9 +95,7 @@ class CreateResourceNodeFileAction
$links = json_decode($links, true);
}
if (empty($links)) {
throw new \InvalidArgumentException(
'resourceLinkList is not a valid json. Example: [{"c_id":1:"visibility":1}]'
);
throw new \InvalidArgumentException('resourceLinkList is not a valid json. Example: [{"c_id":1:"visibility":1}]');
}
$document->setResourceLinkList($links);
}

@ -56,7 +56,7 @@ abstract class HookEvent implements HookEventInterface
*/
public function loadAttachments()
{
if (isset(self::$hook[$this->eventName]) && is_array(self::$hook[$this->eventName])) {
/*if (isset(self::$hook[$this->eventName]) && is_array(self::$hook[$this->eventName])) {
foreach (self::$hook[$this->eventName] as $hookObserver => $val) {
$hookObserverInstance = $hookObserver::create();
$this->observers->attach($hookObserverInstance);
@ -70,7 +70,7 @@ abstract class HookEvent implements HookEventInterface
$this->observers->attach($hookObserverInstance);
}
}
}
}*/
return $this;
}

@ -122,7 +122,7 @@ class ResourceNodeVoter extends Voter
// Checking admin role.
if ($this->security->isGranted('ROLE_ADMIN')) {
// return true;
return true;
}
// Check if I'm the owner.

@ -53,12 +53,9 @@ class Encoder extends BasePasswordEncoder
return $encoder->isPasswordValid($encoded, $raw, $salt);
}
/**
* @return BCryptPasswordEncoder|MessageDigestPasswordEncoder|PlaintextPasswordEncoder
*/
private function getEncoder()
{
switch ($this->passwordEncrypt) {
/*switch ($this->passwordEncrypt) {
case 'none':
$defaultEncoder = new PlaintextPasswordEncoder();
@ -72,8 +69,8 @@ class Encoder extends BasePasswordEncoder
$defaultEncoder = new MessageDigestPasswordEncoder($this->passwordEncrypt, false, 1);
break;
}
}*/
return $defaultEncoder;
//return $defaultEncoder;
}
}

@ -4,7 +4,7 @@
namespace Chamilo\CoreBundle\Traits;
use Chamilo\CoreBundle\Block\BreadcrumbBlockService;
//use Chamilo\CoreBundle\Block\BreadcrumbBlockService;
use Chamilo\CoreBundle\Component\Utils\Glide;
use Chamilo\CoreBundle\Repository\ResourceFactory;
use Knp\Menu\FactoryInterface as MenuFactoryInterface;
@ -33,10 +33,10 @@ trait ControllerTrait
return $this->container->get('request_stack')->getCurrentRequest();
}
public function getBreadCrumb(): BreadcrumbBlockService
/*public function getBreadCrumb(): BreadcrumbBlockService
{
return $this->container->get('breadcrumb');
}
}*/
/**
* @return MenuFactoryInterface

Loading…
Cancel
Save