Minor: Format code

pull/4202/head
Angel Fernando Quiroz Campos 3 years ago
parent 292eb893e9
commit a855f562e6
  1. 4
      src/CoreBundle/DataProvider/Extension/TrackEExerciseExtension.php
  2. 2
      src/CoreBundle/Migrations/Schema/V200/Version20180904175500.php
  3. 4
      src/CoreBundle/Security/Authorization/Voter/TrackEExerciseVoter.php
  4. 3
      src/CourseBundle/Entity/CQuiz.php

@ -25,7 +25,7 @@ final class TrackEExerciseExtension implements QueryCollectionExtensionInterface
QueryNameGeneratorInterface $queryNameGenerator, QueryNameGeneratorInterface $queryNameGenerator,
string $resourceClass, string $resourceClass,
string $operationName = null string $operationName = null
) { ): void {
if (TrackEExercise::class !== $resourceClass) { if (TrackEExercise::class !== $resourceClass) {
return; return;
} }
@ -51,4 +51,4 @@ final class TrackEExerciseExtension implements QueryCollectionExtensionInterface
$queryBuilder->setParameter('user', $user); $queryBuilder->setParameter('user', $user);
} }
} }
} }

@ -133,7 +133,7 @@ class Version20180904175500 extends AbstractMigrationChamilo
} }
$this->addSql('ALTER TABLE track_e_exercises CHANGE exe_exo_id exe_exo_id INT DEFAULT NULL'); $this->addSql('ALTER TABLE track_e_exercises CHANGE exe_exo_id exe_exo_id INT DEFAULT NULL');
$this->addSql("UPDATE track_e_exercises SET exe_exo_id = NULL WHERE exe_exo_id NOT IN (SELECT iid FROM c_quiz)"); $this->addSql('UPDATE track_e_exercises SET exe_exo_id = NULL WHERE exe_exo_id NOT IN (SELECT iid FROM c_quiz)');
if (!$table->hasForeignKey('FK_AA0DA082B9773F9E')) { if (!$table->hasForeignKey('FK_AA0DA082B9773F9E')) {
$this->addSql('ALTER TABLE track_e_exercises ADD CONSTRAINT FK_AA0DA082B9773F9E FOREIGN KEY (exe_exo_id) REFERENCES c_quiz (iid) ON DELETE SET NULL'); $this->addSql('ALTER TABLE track_e_exercises ADD CONSTRAINT FK_AA0DA082B9773F9E FOREIGN KEY (exe_exo_id) REFERENCES c_quiz (iid) ON DELETE SET NULL');

@ -1,5 +1,7 @@
<?php <?php
declare(strict_types=1);
namespace Chamilo\CoreBundle\Security\Authorization\Voter; namespace Chamilo\CoreBundle\Security\Authorization\Voter;
use Chamilo\CoreBundle\Entity\TrackEExercise; use Chamilo\CoreBundle\Entity\TrackEExercise;
@ -24,7 +26,7 @@ class TrackEExerciseVoter extends Voter
self::VIEW, self::VIEW,
]; ];
return $subject instanceof TrackEExercise && in_array($attribute, $allowed); return $subject instanceof TrackEExercise && \in_array($attribute, $allowed, true);
} }
protected function voteOnAttribute(string $attribute, $subject, TokenInterface $token): bool protected function voteOnAttribute(string $attribute, $subject, TokenInterface $token): bool

@ -656,9 +656,6 @@ class CQuiz extends AbstractResource implements ResourceInterface, ResourceShowC
return $this; return $this;
} }
/**
* @return int
*/
public function getIid(): int public function getIid(): int
{ {
return $this->iid; return $this->iid;

Loading…
Cancel
Save