Skip to content

Commit

Permalink
Minor: Format code #5600
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFQC committed Jul 2, 2024
1 parent 9620a61 commit 610c963
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
1 change: 0 additions & 1 deletion src/CoreBundle/Controller/ResourceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Criteria;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Query\Expr\Join;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\Filesystem\Exception\FileNotFoundException;
use Symfony\Component\HttpFoundation\JsonResponse;
Expand Down
4 changes: 0 additions & 4 deletions src/CoreBundle/Entity/ResourceNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,6 @@ class ResourceNode implements Stringable
#[ORM\OneToMany(mappedBy: 'resourceNode', targetEntity: ResourceLink::class, cascade: ['persist', 'remove'])]
protected Collection $resourceLinks;

//#[ORM\OneToOne(inversedBy: 'resourceNode', targetEntity: ResourceFile::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
//#[ORM\JoinColumn(name: 'resource_file_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#protected ?ResourceFile $resourceFile = null;

#[Assert\NotNull]
#[Groups(['resource_node:read', 'resource_node:write', 'document:write'])]
#[ORM\ManyToOne(targetEntity: User::class, cascade: ['persist'], inversedBy: 'resourceNodes')]
Expand Down
10 changes: 5 additions & 5 deletions src/CoreBundle/Migrations/Schema/V200/Version20230913162700.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo;
use Chamilo\CoreBundle\Repository\Node\CourseRepository;
use Chamilo\CoreBundle\Repository\ResourceNodeRepository;
use Chamilo\CourseBundle\Entity\CDocument;
use Chamilo\CourseBundle\Repository\CDocumentRepository;
use Chamilo\CoreBundle\Repository\ResourceNodeRepository;
use Doctrine\DBAL\Schema\Schema;
use Exception;
use RecursiveDirectoryIterator;
Expand Down Expand Up @@ -122,8 +122,8 @@ private function updateHtmlContent($courseDirectory, $courseId, $documentRepo, $
}

$filePath = $resourceFile->getTitle();
if ($resourceFile->getMimeType() === 'text/html') {
error_log("Verifying HTML file: " . $filePath);
if ('text/html' === $resourceFile->getMimeType()) {
error_log('Verifying HTML file: '.$filePath);

Check warning on line 126 in src/CoreBundle/Migrations/Schema/V200/Version20230913162700.php

View check run for this annotation

Codecov / codecov/patch

src/CoreBundle/Migrations/Schema/V200/Version20230913162700.php#L124-L126

Added lines #L124 - L126 were not covered by tests

try {
$content = $resourceNodeRepo->getResourceNodeFileContent($resourceNode);
Expand All @@ -133,8 +133,8 @@ private function updateHtmlContent($courseDirectory, $courseId, $documentRepo, $
$documentRepo->updateResourceFileContent($document, $updatedContent);
$documentRepo->update($document);

Check warning on line 134 in src/CoreBundle/Migrations/Schema/V200/Version20230913162700.php

View check run for this annotation

Codecov / codecov/patch

src/CoreBundle/Migrations/Schema/V200/Version20230913162700.php#L132-L134

Added lines #L132 - L134 were not covered by tests
}
} catch (\Exception $e) {
error_log("Error processing file $filePath: " . $e->getMessage());
} catch (Exception $e) {
error_log("Error processing file $filePath: ".$e->getMessage());

Check warning on line 137 in src/CoreBundle/Migrations/Schema/V200/Version20230913162700.php

View check run for this annotation

Codecov / codecov/patch

src/CoreBundle/Migrations/Schema/V200/Version20230913162700.php#L136-L137

Added lines #L136 - L137 were not covered by tests
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/* For licensing terms, see /license.txt */

declare(strict_types=1);
Expand All @@ -15,9 +16,6 @@ public function getDescription(): string
return 'Migration resource_node --* resource_file (during development)';
}

/**
* @inheritDoc
*/
public function up(Schema $schema): void

Check warning on line 19 in src/CoreBundle/Migrations/Schema/V200/Version20240702222600.php

View check run for this annotation

Codecov / codecov/patch

src/CoreBundle/Migrations/Schema/V200/Version20240702222600.php#L19

Added line #L19 was not covered by tests
{
$tblResourceFile = $schema->getTable('resource_file');
Expand Down Expand Up @@ -47,4 +45,4 @@ public function up(Schema $schema): void
$this->addSql('ALTER TABLE resource_node DROP resource_file_id');

Check warning on line 45 in src/CoreBundle/Migrations/Schema/V200/Version20240702222600.php

View check run for this annotation

Codecov / codecov/patch

src/CoreBundle/Migrations/Schema/V200/Version20240702222600.php#L44-L45

Added lines #L44 - L45 were not covered by tests
}
}
}
}

0 comments on commit 610c963

Please sign in to comment.