Skip to content

Commit

Permalink
Clean Code Syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreGauthier committed Feb 22, 2024
1 parent 28559f8 commit 9d51a9e
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ jobs:
php_extensions: ctype curl dom hash iconv intl gd json mbstring openssl session simplexml xml zip zlib pdo_mysql exif
args: --no-plugins
- name: Php cs fixer
run: php ./vendor/bin/php-cs-fixer fix --dry-run src
run: php ./vendor/bin/php-cs-fixer fix --diff --dry-run src
- name: Phpstan
run: php ./vendor/bin/phpstan --memory-limit=1G analyse
2 changes: 1 addition & 1 deletion src/Command/StructureClean.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$isQuiet = $input->getOption('quiet');

if ($isDryRun) {
$output->writeln("<error>Running in dry run mode, add -f to really delete entities from Gally.</error>");
$output->writeln('<error>Running in dry run mode, add -f to really delete entities from Gally.</error>');
$output->writeln('');
}

Expand Down
2 changes: 1 addition & 1 deletion src/Entity/GallyConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function getId(): ?int
return $this->id;
}

public function setId(int $id = null): void
public function setId(?int $id = null): void
{
$this->id = $id;
}
Expand Down
1 change: 0 additions & 1 deletion src/Synchronizer/AbstractSynchronizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ abstract protected function getIdentity(ModelInterface $entity): string;
*/
public function cleanAll(bool $dryRun = true, bool $quiet = false): void
{

}

protected function buildFetchAllParams(int $page): array
Expand Down
4 changes: 2 additions & 2 deletions src/Synchronizer/CatalogSynchronizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public function cleanAll(bool $dryRun = true, bool $quiet = false): void
/** @var LocalizedCatalogCatalogRead $localizedCatalog */
$localizedCatalog = $this->localizedCatalogSynchronizer->getEntityFromApi($localizedCatalogCode);
if (!$quiet) {
print(" Delete localized catalog {$localizedCatalog->getId()}\n");
echo " Delete localized catalog {$localizedCatalog->getId()}\n";
}
if (!$dryRun) {
$this->localizedCatalogSynchronizer->deleteEntity($localizedCatalog->getId());
Expand All @@ -133,7 +133,7 @@ public function cleanAll(bool $dryRun = true, bool $quiet = false): void
/** @var CatalogCatalogRead $catalog */
$catalog = $this->getEntityFromApi($catalogCode);
if (!$quiet) {
print(" Delete catalog {$catalog->getId()}\n");
echo " Delete catalog {$catalog->getId()}\n";
}
if (!$dryRun) {
$this->deleteEntity($catalog->getId());
Expand Down
2 changes: 1 addition & 1 deletion src/Synchronizer/SourceFieldOptionSynchronizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public function cleanAll(bool $dryRun = true, bool $quiet = false): void
/** @var SourceFieldOptionSourceFieldOptionRead $sourceFieldOption */
$sourceFieldOption = $this->getEntityFromApi($sourceFieldOptionCode);
if (!$quiet) {
print(" Delete sourceFieldOption {$sourceFieldOption->getSourceField()} {$sourceFieldOption->getCode()}\n");
echo " Delete sourceFieldOption {$sourceFieldOption->getSourceField()} {$sourceFieldOption->getCode()}\n";
}
if (!$dryRun) {
$this->deleteEntity($sourceFieldOption->getId());
Expand Down
4 changes: 1 addition & 3 deletions src/Synchronizer/SourceFieldSynchronizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
use Sylius\Component\Product\Model\Product;
use Sylius\Component\Product\Model\ProductAttribute;
use Sylius\Component\Product\Model\ProductOption;
use Sylius\Component\Product\Model\ProductOptionValueInterface;
use Sylius\Component\Product\Model\ProductOptionValueTranslation;
use Sylius\Component\Resource\Repository\RepositoryInterface;

/**
Expand Down Expand Up @@ -162,7 +160,7 @@ public function cleanAll(bool $dryRun = true, bool $quiet = false): void
/** @var SourceFieldSourceFieldRead $sourceField */
$sourceField = $this->getEntityFromApi($sourceFieldCode);
if (!$sourceField->getIsSystem() && !$quiet) {
print(" Delete sourceField {$sourceField->getMetadata()} {$sourceField->getCode()}\n");
echo " Delete sourceField {$sourceField->getMetadata()} {$sourceField->getCode()}\n";
}
if (!$sourceField->getIsSystem() && !$dryRun) {
$this->deleteEntity($sourceField->getId());
Expand Down

0 comments on commit 9d51a9e

Please sign in to comment.