Skip to content

Commit 7ee6262

Browse files
committed
fix: CS
1 parent bb33f0e commit 7ee6262

11 files changed

Lines changed: 22 additions & 54 deletions

File tree

src/bundle/Controller/AdminController.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,6 @@ public function newAction(Request $request)
153153
/**
154154
* @Route("/edit/{menu}", name="menu_manager.menu_edit")
155155
*
156-
* @param Request $request
157-
* @param Menu $menu
158156
* @return RedirectResponse|Response
159157
*/
160158
public function editAction(Request $request, Menu $menu)

src/bundle/Entity/MenuItem/ContentMenuItem.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ public function getContentId(): int
3333
return (int) ltrim($this->getUrl(), static::URL_PREFIX);
3434
}
3535

36-
/**
37-
* @param int $contentId
38-
*/
3936
public function setContentId(int $contentId): void
4037
{
4138
if (!$contentId) {

src/lib/FieldType/MenuItem/SearchField.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ public function getIndexDefinition(): array
4444
* As field types can index multiple fields (see MapLocation field type's
4545
* implementation of this interface), this method is used to define default
4646
* field for matching. Default field is typically used by Field criterion.
47-
*
48-
* @return string|null
4947
*/
5048
public function getDefaultMatchField(): ?string
5149
{
@@ -58,8 +56,6 @@ public function getDefaultMatchField(): ?string
5856
* As field types can index multiple fields (see MapLocation field type's
5957
* implementation of this interface), this method is used to define default
6058
* field for sorting. Default field is typically used by Field sort clause.
61-
*
62-
* @return string|null
6359
*/
6460
public function getDefaultSortField(): ?string
6561
{

src/lib/FieldType/MenuItem/Type.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function validateValidatorConfiguration($validatorConfiguration): array
5555
* Validates a field based on the validators in the field definition.
5656
*
5757
* @param FieldDefinition $fieldDefinition The field definition of the field
58-
* @param SPIValue $value The field value for which an action is performed
58+
* @param SPIValue $value The field value for which an action is performed
5959
*
6060
* @return \eZ\Publish\SPI\FieldType\ValidationError[]
6161
*/
@@ -72,8 +72,6 @@ public function validate(FieldDefinition $fieldDefinition, SPIValue $value): arr
7272

7373
/**
7474
* Returns the field type identifier for this field type.
75-
*
76-
* @return string
7775
*/
7876
public function getFieldTypeIdentifier(): string
7977
{
@@ -91,6 +89,7 @@ public function getName(ValueInterface $value, FieldDefinition $fieldDefinition,
9189
if ($value instanceof Value) {
9290
return (string) $value->menuItems;
9391
}
92+
9493
return '';
9594
}
9695

@@ -101,10 +100,6 @@ public function getEmptyValue(): Value
101100

102101
/**
103102
* Returns if the given $value is considered empty by the field type.
104-
*
105-
* @param SPIValue $value
106-
*
107-
* @return bool
108103
*/
109104
public function isEmptyValue(SPIValue $value): bool
110105
{
@@ -138,8 +133,6 @@ protected function checkValueStructure(BaseValue $value): void
138133
* Returns information for FieldValue->$sortKey relevant to the field type.
139134
*
140135
* @param Value $value
141-
*
142-
* @return array|null
143136
*/
144137
protected function getSortInfo(BaseValue $value): ?array
145138
{
@@ -148,9 +141,6 @@ protected function getSortInfo(BaseValue $value): ?array
148141

149142
/**
150143
* Converts a persistence $fieldValue to a Value.
151-
*
152-
* @param PersistenceValue $fieldValue
153-
* @return value
154144
*/
155145
public function fromPersistenceValue(PersistenceValue $fieldValue): Value
156146
{
@@ -191,8 +181,6 @@ public function toHash(SPIValue $value)
191181

192182
/**
193183
* Returns whether the field type is searchable.
194-
*
195-
* @return bool
196184
*/
197185
public function isSearchable(): bool
198186
{

src/lib/FieldType/MenuItem/Value.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ class Value extends BaseValue
2626

2727
/**
2828
* Construct a new Value object and initialize it $text.
29-
*
30-
* @param array $menuItems
3129
*/
3230
public function __construct(array $menuItems = [])
3331
{
@@ -43,8 +41,9 @@ public function __toString()
4341
{
4442
$string = '';
4543
foreach ($this->menuItems as $menuItem) {
46-
$string .= ', ' . $menuItem->__toString();
44+
$string .= ', '.$menuItem->__toString();
4745
}
46+
4847
return $string;
4948
}
5049
}

src/lib/Form/Type/FieldType/MenuItemFieldType.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,14 @@ class MenuItemFieldType extends AbstractType
5656
* MenuItemFieldType constructor.
5757
*/
5858
public function __construct(
59-
FieldTypeService $fieldTypeService,
60-
MenuService $menuService,
61-
LocationService $locationService,
59+
FieldTypeService $fieldTypeService,
60+
MenuService $menuService,
61+
LocationService $locationService,
6262
MenuItemValueTransformer $fieldValueTransformer,
63-
TranslationHelper $translationHelper,
64-
TranslatorInterface $translator,
65-
GlobalHelper $globalHelper
66-
)
67-
{
63+
TranslationHelper $translationHelper,
64+
TranslatorInterface $translator,
65+
GlobalHelper $globalHelper
66+
) {
6867
$this->fieldTypeService = $fieldTypeService;
6968
$this->menuService = $menuService;
7069
$this->locationService = $locationService;
@@ -124,7 +123,7 @@ public function buildView(FormView $view, FormInterface $form, array $options)
124123
'getName'
125124
);
126125
$contentInfo = $formData->contentDraft->contentInfo;
127-
if ($contentInfo->status == ContentInfo::STATUS_DRAFT) {
126+
if (ContentInfo::STATUS_DRAFT == $contentInfo->status) {
128127
$parentLocationsId[] = $this->globalHelper->getRootLocation()->id;
129128
} else {
130129
$locations = $this->locationService->loadLocations($contentInfo);

src/lib/MenuItem/MenuItemConverter.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ public function toHash(MenuItem $menuItem): array
3737

3838
/**
3939
* @param $hash
40-
* @param string $defaultClass
41-
* @return MenuItem|null
40+
*
4241
* @throws MenuItemTypeNotFoundException
4342
*/
4443
public function fromHash($hash, string $defaultClass = MenuItem::class): ?MenuItem
@@ -51,7 +50,6 @@ public function fromHash($hash, string $defaultClass = MenuItem::class): ?MenuIt
5150
/**
5251
* @param $menuItems
5352
*
54-
* @return array
5553
* @throws UnexpectedTypeException
5654
*/
5755
public function toHashArray($menuItems): array
@@ -68,13 +66,10 @@ public function toHashArray($menuItems): array
6866
}
6967

7068
/**
71-
* @param array $hashArray
72-
* @param string $defaultClass
69+
* @throws MenuItemTypeNotFoundException
7370
*
7471
* @return MenuItem[]
7572
* @SuppressWarnings(PHPMD.IfStatementAssignment)
76-
*
77-
* @throws MenuItemTypeNotFoundException
7873
*/
7974
public function fromHashArray(array $hashArray, string $defaultClass = MenuItem::class): array
8075
{

src/lib/MenuItem/Type/ContentMenuItemType.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,6 @@ public function fromHash($hash): ?MenuItem
128128
return $menuItem;
129129
}
130130

131-
/**
132-
* @param MenuItem $menuItem
133-
* @return MenuItemValue|null
134-
*/
135131
public function toMenuItemLink(MenuItem $menuItem): ?MenuItemValue
136132
{
137133
try {
@@ -162,7 +158,7 @@ protected function getMenuItemLinkInfos(MenuItem $menuItem): array
162158
}
163159

164160
if (!$menuItem instanceof MenuItem\ContentMenuItem) {
165-
throw new RuntimeException(sprintf("%s only works with ContentMenuItem", __METHOD__));
161+
throw new RuntimeException(sprintf('%s only works with ContentMenuItem', __METHOD__));
166162
}
167163
$content = $this->contentService->loadContent($menuItem->getContentId());
168164
$location = $this->locationService->loadLocation($content->contentInfo->mainLocationId);
@@ -180,7 +176,7 @@ protected function getMenuItemLinkInfos(MenuItem $menuItem): array
180176
'extras' => [
181177
'contentId' => $location->contentId,
182178
'locationId' => $location->id,
183-
'locationRemoteId' => $location->remoteId
179+
'locationRemoteId' => $location->remoteId,
184180
],
185181
];
186182

src/lib/MenuItem/Type/DefaultMenuItemType.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ public function fromHash($hash): ?MenuItem
8888
if (isset($hash['parentId']) && $hash['parentId']) {
8989
$parent = $menuItemRepo->find($hash['parentId']);
9090
$menuItem->setParent($parent);
91+
} else {
92+
$menuItem->setParent(null);
9193
}
9294

9395
if (isset($hash['menuId'])) {

src/lib/Persistence/Legacy/Content/FieldValue/Converter/MenuItemConverter.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ class MenuItemConverter implements Converter
2525
*
2626
* Note: Class should instead be configured as service if it gains dependencies.
2727
*
28-
* @return MenuItemConverter
2928
* @deprecated since 6.8, will be removed in 7.x, use default constructor instead.
30-
*
3129
*/
3230
public static function create(): MenuItemConverter
3331
{
@@ -77,8 +75,6 @@ public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefin
7775
* Returns the name of the index column the datatype uses, which is either
7876
* "sort_key_int" or "sort_key_string". This column is then used for
7977
* filtering and sorting for this type.
80-
*
81-
* @return string
8278
*/
8379
public function getIndexColumn(): string
8480
{

0 commit comments

Comments
 (0)