Skip to content

Commit

Permalink
OXDEV-7557 Automatic simple code style issues fix
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Fedurtsya <[email protected]>
  • Loading branch information
Sieg committed Nov 13, 2023
1 parent 9c1d9dc commit efe539a
Show file tree
Hide file tree
Showing 31 changed files with 222 additions and 194 deletions.
3 changes: 2 additions & 1 deletion src/Setting/Controller/ModuleSettingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ final class ModuleSettingController
{
public function __construct(
private ModuleSettingServiceInterface $settingService
){}
) {
}

/**
* @Query()
Expand Down
3 changes: 2 additions & 1 deletion src/Setting/Controller/ShopSettingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ final class ShopSettingController
{
public function __construct(
private ShopSettingServiceInterface $settingService
){}
) {
}

/**
* @Query()
Expand Down
3 changes: 2 additions & 1 deletion src/Setting/Controller/ThemeSettingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ final class ThemeSettingController
{
public function __construct(
private ThemeSettingServiceInterface $settingService
){}
) {
}

/**
* @Query()
Expand Down
3 changes: 2 additions & 1 deletion src/Setting/DataType/BooleanSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ final class BooleanSetting
public function __construct(
private ID $name,
private bool $value
) {}
) {
}

/**
* @Field()
Expand Down
3 changes: 2 additions & 1 deletion src/Setting/DataType/FloatSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ final class FloatSetting
public function __construct(
private ID $name,
private float $value
) {}
) {
}

/**
* @Field()
Expand Down
3 changes: 2 additions & 1 deletion src/Setting/DataType/IntegerSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ final class IntegerSetting
public function __construct(
private ID $name,
private int $value
) {}
) {
}

/**
* @Field()
Expand Down
7 changes: 3 additions & 4 deletions src/Setting/DataType/SettingType.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,15 @@ final class SettingType

public function __construct(
private ID $name,
String $type
string $type
) {
$valid = FieldType::validateFieldType($type);
if (!$valid) {
throw new UnexpectedValueException('The value "'.$type.'" is not a valid field type.
Please use one of the following types: "'.implode('", "', FieldType::getEnums()).'".');
throw new UnexpectedValueException('The value "' . $type . '" is not a valid field type.
Please use one of the following types: "' . implode('", "', FieldType::getEnums()) . '".');
}

$this->type = $type;

}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/Setting/DataType/StringSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ final class StringSetting
public function __construct(
private ID $name,
private string $value
) {}
) {
}

/**
* @Field()
Expand Down
1 change: 0 additions & 1 deletion src/Setting/Enum/FieldType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace OxidEsales\GraphQL\ConfigurationAccess\Setting\Enum;


final class FieldType
{
public const ASSOCIATIVE_ARRAY = 'aarr';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected function isFloatString(string $number): bool
protected function getSettingValue(ID $name, string $fieldType, string $theme = ''): string
{
if ($theme) {
$theme = 'theme:'.$theme;
$theme = 'theme:' . $theme;
}

$queryBuilder = $this->queryBuilderFactory->create();
Expand Down Expand Up @@ -64,7 +64,7 @@ protected function getSettingValue(ID $name, string $fieldType, string $theme =

protected function getSettingTypes(string $theme = ''): array
{
$themeCondition = (!empty($theme)) ? 'theme:'.$theme : '';
$themeCondition = (!empty($theme)) ? 'theme:' . $theme : '';
$shopId = $this->basicContext->getCurrentShopId();

$queryBuilder = $this->queryBuilderFactory->create();
Expand All @@ -80,9 +80,9 @@ protected function getSettingTypes(string $theme = ''): array
$result = $queryBuilder->execute();
$value = $result->fetchAllKeyValue();

$notFoundLocation = (!empty($theme)) ? 'theme: "'.$theme.'"' : 'shopID: "'.$shopId.'"';
$notFoundLocation = (!empty($theme)) ? 'theme: "' . $theme . '"' : 'shopID: "' . $shopId . '"';
if ($value === []) {
throw new NotFound('No configurations found for '.$notFoundLocation);
throw new NotFound('No configurations found for ' . $notFoundLocation);
}

return $value;
Expand Down
3 changes: 2 additions & 1 deletion src/Setting/Infrastructure/ModuleSettingRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ public function __construct(
private ModuleSettingServiceInterface $moduleSettingService,
private ModuleConfigurationDaoInterface $moduleConfigurationDao,
private BasicContextInterface $basicContext
) {}
) {
}

public function getIntegerSetting(ID $name, string $moduleId): IntegerSetting
{
Expand Down
13 changes: 7 additions & 6 deletions src/Setting/Service/ModuleSettingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ final class ModuleSettingService implements ModuleSettingServiceInterface
{
public function __construct(
private ModuleSettingRepositoryInterface $moduleSettingRepository
) {}
) {
}

public function getIntegerSetting(ID $name, $moduleId): IntegerSetting
{
Expand All @@ -50,35 +51,35 @@ public function getCollectionSetting(ID $name, $moduleId): StringSetting
return $this->moduleSettingRepository->getCollectionSetting($name, $moduleId);
}

public function changeIntegerSetting(ID $name, int $value, string $moduleId):IntegerSetting
public function changeIntegerSetting(ID $name, int $value, string $moduleId): IntegerSetting
{
$this->moduleSettingRepository->saveIntegerSetting($name, $value, $moduleId);

return new IntegerSetting($name, $value);
}

public function changeFloatSetting(ID $name, float $value, string $moduleId):FloatSetting
public function changeFloatSetting(ID $name, float $value, string $moduleId): FloatSetting
{
$this->moduleSettingRepository->saveFloatSetting($name, $value, $moduleId);

return new FloatSetting($name, $value);
}

public function changeBooleanSetting(ID $name, bool $value, string $moduleId):BooleanSetting
public function changeBooleanSetting(ID $name, bool $value, string $moduleId): BooleanSetting
{
$this->moduleSettingRepository->saveBooleanSetting($name, $value, $moduleId);

return new BooleanSetting($name, $value);
}

public function changeStringSetting(ID $name, string $value, string $moduleId):StringSetting
public function changeStringSetting(ID $name, string $value, string $moduleId): StringSetting
{
$this->moduleSettingRepository->saveStringSetting($name, $value, $moduleId);

return new StringSetting($name, $value);
}

public function changeCollectionSetting(ID $name, string $value, string $moduleId):StringSetting
public function changeCollectionSetting(ID $name, string $value, string $moduleId): StringSetting
{
$arrayValue = json_decode($value, true);

Expand Down
3 changes: 2 additions & 1 deletion src/Setting/Service/ShopSettingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ final class ShopSettingService implements ShopSettingServiceInterface
{
public function __construct(
private ShopSettingRepositoryInterface $shopSettingRepository
) {}
) {
}

public function getIntegerSetting(ID $name): IntegerSetting
{
Expand Down
3 changes: 2 additions & 1 deletion src/Setting/Service/ThemeSettingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ final class ThemeSettingService implements ThemeSettingServiceInterface
{
public function __construct(
private ThemeSettingRepositoryInterface $themeSettingRepository
) {}
) {
}

public function getIntegerSetting(ID $name, string $themeId): IntegerSetting
{
Expand Down
1 change: 0 additions & 1 deletion src/Shared/Service/NamespaceMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

final class NamespaceMapper implements NamespaceMapperInterface
{

private const SPACE = '\\OxidEsales\\GraphQL\\ConfigurationAccess\\';

public function getControllerNamespaceMapping(): array
Expand Down
Loading

0 comments on commit efe539a

Please sign in to comment.