Skip to content

Commit

Permalink
OXDEV-7685: Change query/mutation names according to the naming conve…
Browse files Browse the repository at this point in the history
…ntions
  • Loading branch information
MarcelOxid committed Dec 15, 2023
1 parent 610f50b commit 25e10f1
Show file tree
Hide file tree
Showing 14 changed files with 157 additions and 148 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ the API consumer would always have to convert the value after queries or before
we decided to use json encoded strings instead.

To get the specific type of a configuration, we provide queries like
`getShopSettingsList`/`getModuleSettingsList`/`getThemeSettingsList` to figure out the type for configurations.
`shopSettings`/`moduleSettings`/`themeSettings` to figure out the type for configurations.
As a result you get an array of setting types:

```
Expand Down
25 changes: 14 additions & 11 deletions src/Module/Controller/ModuleSettingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
use TheCodingMachine\GraphQLite\Annotations\Query;
use TheCodingMachine\GraphQLite\Annotations\Right;

/**
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
final class ModuleSettingController
{
public function __construct(
Expand All @@ -32,7 +35,7 @@ public function __construct(
#[Logged]
#[HideIfUnauthorized]
#[Right('CHANGE_CONFIGURATION')]
public function getModuleSettingInteger(string $name, string $moduleId): IntegerSetting
public function moduleSettingInteger(string $name, string $moduleId): IntegerSetting
{
return $this->moduleSettingService->getIntegerSetting($name, $moduleId);
}
Expand All @@ -41,7 +44,7 @@ public function getModuleSettingInteger(string $name, string $moduleId): Integer
#[Logged]
#[HideIfUnauthorized]
#[Right('CHANGE_CONFIGURATION')]
public function getModuleSettingFloat(string $name, string $moduleId): FloatSetting
public function moduleSettingFloat(string $name, string $moduleId): FloatSetting
{
return $this->moduleSettingService->getFloatSetting($name, $moduleId);
}
Expand All @@ -50,7 +53,7 @@ public function getModuleSettingFloat(string $name, string $moduleId): FloatSett
#[Logged]
#[HideIfUnauthorized]
#[Right('CHANGE_CONFIGURATION')]
public function getModuleSettingBoolean(string $name, string $moduleId): BooleanSetting
public function moduleSettingBoolean(string $name, string $moduleId): BooleanSetting
{
return $this->moduleSettingService->getBooleanSetting($name, $moduleId);
}
Expand All @@ -59,7 +62,7 @@ public function getModuleSettingBoolean(string $name, string $moduleId): Boolean
#[Logged]
#[HideIfUnauthorized]
#[Right('CHANGE_CONFIGURATION')]
public function getModuleSettingString(string $name, string $moduleId): StringSetting
public function moduleSettingString(string $name, string $moduleId): StringSetting
{
return $this->moduleSettingService->getStringSetting($name, $moduleId);
}
Expand All @@ -68,7 +71,7 @@ public function getModuleSettingString(string $name, string $moduleId): StringSe
#[Logged]
#[HideIfUnauthorized]
#[Right('CHANGE_CONFIGURATION')]
public function getModuleSettingCollection(string $name, string $moduleId): StringSetting
public function moduleSettingCollection(string $name, string $moduleId): StringSetting
{
return $this->moduleSettingService->getCollectionSetting($name, $moduleId);
}
Expand All @@ -77,7 +80,7 @@ public function getModuleSettingCollection(string $name, string $moduleId): Stri
#[Logged]
#[HideIfUnauthorized]
#[Right('CHANGE_CONFIGURATION')]
public function changeModuleSettingInteger(string $name, int $value, string $moduleId): IntegerSetting
public function moduleSettingIntegerChange(string $name, int $value, string $moduleId): IntegerSetting
{
return $this->moduleSettingService->changeIntegerSetting($name, $value, $moduleId);
}
Expand All @@ -86,7 +89,7 @@ public function changeModuleSettingInteger(string $name, int $value, string $mod
#[Logged]
#[HideIfUnauthorized]
#[Right('CHANGE_CONFIGURATION')]
public function changeModuleSettingFloat(string $name, float $value, string $moduleId): FloatSetting
public function moduleSettingFloatChange(string $name, float $value, string $moduleId): FloatSetting
{
return $this->moduleSettingService->changeFloatSetting($name, $value, $moduleId);
}
Expand All @@ -95,7 +98,7 @@ public function changeModuleSettingFloat(string $name, float $value, string $mod
#[Logged]
#[HideIfUnauthorized]
#[Right('CHANGE_CONFIGURATION')]
public function changeModuleSettingBoolean(string $name, bool $value, string $moduleId): BooleanSetting
public function moduleSettingBooleanChange(string $name, bool $value, string $moduleId): BooleanSetting
{
return $this->moduleSettingService->changeBooleanSetting($name, $value, $moduleId);
}
Expand All @@ -104,7 +107,7 @@ public function changeModuleSettingBoolean(string $name, bool $value, string $mo
#[Logged]
#[HideIfUnauthorized]
#[Right('CHANGE_CONFIGURATION')]
public function changeModuleSettingString(string $name, string $value, string $moduleId): StringSetting
public function moduleSettingStringChange(string $name, string $value, string $moduleId): StringSetting
{
return $this->moduleSettingService->changeStringSetting($name, $value, $moduleId);
}
Expand All @@ -113,7 +116,7 @@ public function changeModuleSettingString(string $name, string $value, string $m
#[Logged]
#[HideIfUnauthorized]
#[Right('CHANGE_CONFIGURATION')]
public function changeModuleSettingCollection(string $name, string $value, string $moduleId): StringSetting
public function moduleSettingCollectionChange(string $name, string $value, string $moduleId): StringSetting
{
return $this->moduleSettingService->changeCollectionSetting($name, $value, $moduleId);
}
Expand All @@ -125,7 +128,7 @@ public function changeModuleSettingCollection(string $name, string $value, strin
#[Logged]
#[HideIfUnauthorized]
#[Right('CHANGE_CONFIGURATION')]
public function getModuleSettingsList(string $moduleId): array
public function moduleSettings(string $moduleId): array
{
return $this->moduleSettingService->getSettingsList($moduleId);
}
Expand Down
33 changes: 18 additions & 15 deletions src/Shop/Controller/ShopSettingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
use TheCodingMachine\GraphQLite\Annotations\Query;
use TheCodingMachine\GraphQLite\Annotations\Right;

/**
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/
final class ShopSettingController
{
public function __construct(
Expand All @@ -32,7 +35,7 @@ public function __construct(
#[Logged]
#[HideIfUnauthorized]
#[Right('CHANGE_CONFIGURATION')]
public function getShopSettingInteger(string $name): IntegerSetting
public function shopSettingInteger(string $name): IntegerSetting
{
return $this->shopSettingService->getIntegerSetting($name);
}
Expand All @@ -41,7 +44,7 @@ public function getShopSettingInteger(string $name): IntegerSetting
#[Logged]
#[HideIfUnauthorized]
#[Right('CHANGE_CONFIGURATION')]
public function getShopSettingFloat(string $name): FloatSetting
public function shopSettingFloat(string $name): FloatSetting
{
return $this->shopSettingService->getFloatSetting($name);
}
Expand All @@ -50,7 +53,7 @@ public function getShopSettingFloat(string $name): FloatSetting
#[Logged]
#[HideIfUnauthorized]
#[Right('CHANGE_CONFIGURATION')]
public function getShopSettingBoolean(string $name): BooleanSetting
public function shopSettingBoolean(string $name): BooleanSetting
{
return $this->shopSettingService->getBooleanSetting($name);
}
Expand All @@ -59,7 +62,7 @@ public function getShopSettingBoolean(string $name): BooleanSetting
#[Logged]
#[HideIfUnauthorized]
#[Right('CHANGE_CONFIGURATION')]
public function getShopSettingString(string $name): StringSetting
public function shopSettingString(string $name): StringSetting
{
return $this->shopSettingService->getStringSetting($name);
}
Expand All @@ -68,7 +71,7 @@ public function getShopSettingString(string $name): StringSetting
#[Logged]
#[HideIfUnauthorized]
#[Right('CHANGE_CONFIGURATION')]
public function getShopSettingSelect(string $name): StringSetting
public function shopSettingSelect(string $name): StringSetting
{
return $this->shopSettingService->getSelectSetting($name);
}
Expand All @@ -77,7 +80,7 @@ public function getShopSettingSelect(string $name): StringSetting
#[Logged]
#[HideIfUnauthorized]
#[Right('CHANGE_CONFIGURATION')]
public function getShopSettingCollection(string $name): StringSetting
public function shopSettingCollection(string $name): StringSetting
{
return $this->shopSettingService->getCollectionSetting($name);
}
Expand All @@ -86,7 +89,7 @@ public function getShopSettingCollection(string $name): StringSetting
#[Logged]
#[HideIfUnauthorized]
#[Right('CHANGE_CONFIGURATION')]
public function getShopSettingAssocCollection(string $name): StringSetting
public function shopSettingAssocCollection(string $name): StringSetting
{
return $this->shopSettingService->getAssocCollectionSetting($name);
}
Expand All @@ -95,7 +98,7 @@ public function getShopSettingAssocCollection(string $name): StringSetting
#[Logged]
#[HideIfUnauthorized]
#[Right('CHANGE_CONFIGURATION')]
public function changeShopSettingInteger(string $name, int $value): IntegerSetting
public function shopSettingIntegerChange(string $name, int $value): IntegerSetting
{
return $this->shopSettingService->changeIntegerSetting($name, $value);
}
Expand All @@ -104,7 +107,7 @@ public function changeShopSettingInteger(string $name, int $value): IntegerSetti
#[Logged]
#[HideIfUnauthorized]
#[Right('CHANGE_CONFIGURATION')]
public function changeShopSettingFloat(string $name, float $value): FloatSetting
public function shopSettingFloatChange(string $name, float $value): FloatSetting
{
return $this->shopSettingService->changeFloatSetting($name, $value);
}
Expand All @@ -113,7 +116,7 @@ public function changeShopSettingFloat(string $name, float $value): FloatSetting
#[Logged]
#[HideIfUnauthorized]
#[Right('CHANGE_CONFIGURATION')]
public function changeShopSettingBoolean(string $name, bool $value): BooleanSetting
public function shopSettingBooleanChange(string $name, bool $value): BooleanSetting
{
return $this->shopSettingService->changeBooleanSetting($name, $value);
}
Expand All @@ -122,7 +125,7 @@ public function changeShopSettingBoolean(string $name, bool $value): BooleanSett
#[Logged]
#[HideIfUnauthorized]
#[Right('CHANGE_CONFIGURATION')]
public function changeShopSettingString(string $name, string $value): StringSetting
public function shopSettingStringChange(string $name, string $value): StringSetting
{
return $this->shopSettingService->changeStringSetting($name, $value);
}
Expand All @@ -131,7 +134,7 @@ public function changeShopSettingString(string $name, string $value): StringSett
#[Logged]
#[HideIfUnauthorized]
#[Right('CHANGE_CONFIGURATION')]
public function changeShopSettingSelect(string $name, string $value): StringSetting
public function shopSettingSelectChange(string $name, string $value): StringSetting
{
return $this->shopSettingService->changeSelectSetting($name, $value);
}
Expand All @@ -140,7 +143,7 @@ public function changeShopSettingSelect(string $name, string $value): StringSett
#[Logged]
#[HideIfUnauthorized]
#[Right('CHANGE_CONFIGURATION')]
public function changeShopSettingCollection(string $name, string $value): StringSetting
public function shopSettingCollectionChange(string $name, string $value): StringSetting
{
return $this->shopSettingService->changeCollectionSetting($name, $value);
}
Expand All @@ -149,7 +152,7 @@ public function changeShopSettingCollection(string $name, string $value): String
#[Logged]
#[HideIfUnauthorized]
#[Right('CHANGE_CONFIGURATION')]
public function changeShopSettingAssocCollection(string $name, string $value): StringSetting
public function shopSettingAssocCollectionChange(string $name, string $value): StringSetting
{
return $this->shopSettingService->changeAssocCollectionSetting($name, $value);
}
Expand All @@ -161,7 +164,7 @@ public function changeShopSettingAssocCollection(string $name, string $value): S
#[Logged]
#[HideIfUnauthorized]
#[Right('CHANGE_CONFIGURATION')]
public function getShopSettingsList(): array
public function shopSettings(): array
{
return $this->shopSettingService->getSettingsList();
}
Expand Down
Loading

0 comments on commit 25e10f1

Please sign in to comment.