Skip to content

Commit

Permalink
Fix validators
Browse files Browse the repository at this point in the history
  • Loading branch information
jskowronski39 committed Oct 22, 2023
1 parent 340df3c commit 4647951
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 69 deletions.
2 changes: 0 additions & 2 deletions src/Form/Mod/Dto/ModFormDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use App\Entity\Mod\Enum\ModSourceEnum;
use App\Form\AbstractFormDto;
use App\Validator\Mod\ModSourceAndType;
use App\Validator\Mod\SteamWorkshopArma3ModUrl;
use App\Validator\Mod\UniqueDirectoryMod;
use App\Validator\Mod\UniqueSteamWorkshopMod;
Expand All @@ -17,7 +16,6 @@
#[UniqueSteamWorkshopMod(groups: [ModSourceEnum::STEAM_WORKSHOP->value])]
#[SteamWorkshopArma3ModUrl(groups: [ModSourceEnum::STEAM_WORKSHOP->value], errorPath: 'url', nameErrorPath: 'name')]
#[UniqueDirectoryMod(groups: [ModSourceEnum::DIRECTORY->value])]
#[ModSourceAndType(errorPath: 'source')]
class ModFormDto extends AbstractFormDto
{
protected ?UuidInterface $id = null;
Expand Down
32 changes: 0 additions & 32 deletions src/Validator/Mod/ModSourceAndType.php

This file was deleted.

32 changes: 0 additions & 32 deletions src/Validator/Mod/ModSourceAndTypeValidator.php

This file was deleted.

3 changes: 3 additions & 0 deletions src/Validator/Mod/SteamWorkshopArma3ModUrlValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public function validate(mixed $value, Constraint $constraint): void

$name = $value->getName();
$url = $value->getUrl();
if ('' === $url || null === $url) {
return;
}

try {
$itemId = SteamHelper::itemUrlToItemId($url);
Expand Down
3 changes: 0 additions & 3 deletions translations/validators.pl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,3 @@ Mod group with the same name "{{ modGroupName }}" already exist: Grupa modów o

# Unique User Group Name Validator
User group with the same name "{{ userGroupName }}" already exist: Grupa użytkowników o nazwie "{{ userGroupName }}" już istnieje

# Mod Source And Type Validator
Mod from a directory must be a server side mod: Mod pochodzący z katalogu musi być serwerowy

0 comments on commit 4647951

Please sign in to comment.