Skip to content

Commit

Permalink
[TASK] Cleanup phpstan and doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nhovratov committed Mar 25, 2022
1 parent f381fa0 commit 6df515e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 42 deletions.
20 changes: 0 additions & 20 deletions Build/phpstan/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -160,26 +160,6 @@ parameters:
count: 1
path: ../../Classes/Controller/AjaxController.php

-
message: "#^Method MASK\\\\Mask\\\\Controller\\\\AjaxController\\:\\:translateTcaFieldLabels\\(\\) has no return type specified\\.$#"
count: 1
path: ../../Classes/Controller/AjaxController.php

-
message: "#^Method MASK\\\\Mask\\\\Controller\\\\AjaxController\\:\\:translateTcaFieldLabels\\(\\) has parameter \\$field with no type specified\\.$#"
count: 1
path: ../../Classes/Controller/AjaxController.php

-
message: "#^Method MASK\\\\Mask\\\\Controller\\\\AjaxController\\:\\:translateTcaFieldLabels\\(\\) has parameter \\$key with no type specified\\.$#"
count: 1
path: ../../Classes/Controller/AjaxController.php

-
message: "#^Method MASK\\\\Mask\\\\Controller\\\\AjaxController\\:\\:translateTcaFieldLabels\\(\\) has parameter \\$tcaFields with no type specified\\.$#"
count: 1
path: ../../Classes/Controller/AjaxController.php

-
message: "#^Property MASK\\\\Mask\\\\Controller\\\\AjaxController\\:\\:\\$maskExtensionConfiguration type has no value type specified in iterable type array\\.$#"
count: 1
Expand Down
25 changes: 6 additions & 19 deletions Classes/Controller/AjaxController.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,6 @@ public function fixMissingFilesOrFolders(ServerRequestInterface $request): Respo

/**
* Generates Fluid HTML for Contentelements
*
* @param ServerRequestInterface $request
* @return Response
*/
public function showHtmlAction(ServerRequestInterface $request): Response
{
Expand Down Expand Up @@ -315,9 +312,6 @@ public function save(ServerRequestInterface $request): Response

/**
* Delete a content element
*
* @param ServerRequestInterface $request
* @return Response
*/
public function delete(ServerRequestInterface $request): Response
{
Expand All @@ -331,10 +325,6 @@ public function delete(ServerRequestInterface $request): Response
return new JsonResponse($this->flashMessageQueue->getAllMessagesAndFlush());
}

/**
* @param ServerRequestInterface $request
* @return Response
*/
public function toggleVisibility(ServerRequestInterface $request): Response
{
$params = $request->getParsedBody();
Expand Down Expand Up @@ -519,9 +509,6 @@ public function multiUse(ServerRequestInterface $request): Response
* Checks all fields of an element for multi usage.
* These fields CAN NOT be shared: inline, palette, tab, fields in inline.
* These fields CAN be shared: all other first level fields, all other fields in first level palettes.
*
* @param ServerRequestInterface $request
* @return Response
*/
public function loadAllMultiUse(ServerRequestInterface $request): Response
{
Expand Down Expand Up @@ -730,7 +717,12 @@ public function tables(ServerRequestInterface $request): Response
return new JsonResponse($json);
}

protected function translateTcaFieldLabels($key, $field, $tcaFields)
/**
* @param array{label: string, description?: string, placeholder?: string} $field
* @param array<string, array<string, mixed>> $tcaFields
* @return array<string, array<string, mixed>>
*/
protected function translateTcaFieldLabels(string $key, array $field, array $tcaFields): array
{
$tcaFields[$key]['label'] = $this->translateLabel($field['label']);
if (isset($field['placeholder'])) {
Expand Down Expand Up @@ -923,8 +915,6 @@ protected function saveHtml(string $key, string $html): bool

/**
* Checks if a key for an element is available
* @param ServerRequest $request
* @return Response
*/
public function checkElementKey(ServerRequest $request): Response
{
Expand All @@ -938,9 +928,6 @@ public function checkElementKey(ServerRequest $request): Response
* Checks if a key for a field is available.
* Inline fields and content fields must not be used across elements.
* Other "normal" fields can be used in different elements, but changes are applied for both.
*
* @param ServerRequest $request
* @return Response
*/
public function checkFieldKey(ServerRequest $request): Response
{
Expand Down
4 changes: 2 additions & 2 deletions Classes/Definition/TcaFieldDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ protected static function removeBlankOptions(array $haystack, TcaFieldDefinition
}

/**
* @param array<mixed, mixed> $definition
* @return array<mixed, mixed>
* @param array<string, mixed> $definition
* @return array<string, mixed>
*/
protected static function migrateTCA(array $definition, TcaFieldDefinition $tcaFieldDefinition): array
{
Expand Down
2 changes: 1 addition & 1 deletion Classes/Helper/InlineHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ protected function fillInlineField(array &$data, FieldType $fieldType, string $f
}

/**
* @param array<mixed, mixed> $tcaFieldConf
* @param array<string, mixed> $tcaFieldConf
*
* Returns the selected relations of select or group element
*/
Expand Down

0 comments on commit 6df515e

Please sign in to comment.