Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 0 additions & 60 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -5118,36 +5118,12 @@ parameters:
count: 1
path: src/lib/Form/Data/ContentType/ContentTypesDeleteData.php

-
message: '#^PHPDoc tag @param for parameter \$baseLanguage with type Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Language\|null is not subtype of native type Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Language\.$#'
identifier: parameter.phpDocType
count: 1
path: src/lib/Form/Data/ContentType/Translation/TranslationAddData.php

-
message: '#^PHPDoc tag @param for parameter \$contentType with type Ibexa\\Contracts\\Core\\Repository\\Values\\ContentType\\ContentType\|null is not subtype of native type Ibexa\\Contracts\\Core\\Repository\\Values\\ContentType\\ContentType\.$#'
identifier: parameter.phpDocType
count: 1
path: src/lib/Form/Data/ContentType/Translation/TranslationAddData.php

-
message: '#^PHPDoc tag @param for parameter \$language with type Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Language\|null is not subtype of native type Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Language\.$#'
identifier: parameter.phpDocType
count: 1
path: src/lib/Form/Data/ContentType/Translation/TranslationAddData.php

-
message: '#^Method Ibexa\\AdminUi\\Form\\Data\\ContentType\\Translation\\TranslationRemoveData\:\:__construct\(\) has parameter \$languageCodes with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: src/lib/Form/Data/ContentType/Translation/TranslationRemoveData.php

-
message: '#^PHPDoc tag @param for parameter \$contentType with type Ibexa\\Contracts\\Core\\Repository\\Values\\ContentType\\ContentType\|null is not subtype of native type Ibexa\\Contracts\\Core\\Repository\\Values\\ContentType\\ContentType\.$#'
identifier: parameter.phpDocType
count: 1
path: src/lib/Form/Data/ContentType/Translation/TranslationRemoveData.php

-
message: '#^Method Ibexa\\AdminUi\\Form\\Data\\ContentTypeGroup\\ContentTypeGroupCreateData\:\:setIdentifier\(\) has no return type specified\.$#'
identifier: missingType.return
Expand Down Expand Up @@ -5532,24 +5508,6 @@ parameters:
count: 1
path: src/lib/Form/Data/Location/AbstractLocationCopyData.php

-
message: '#^PHPDoc tag @param has invalid value \(\\Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Location\|\|null \$location\)\: Unexpected token "\|", expected type at offset 75 on line 2$#'
identifier: phpDoc.parseError
count: 1
path: src/lib/Form/Data/Location/AbstractLocationCopyData.php

-
message: '#^PHPDoc tag @param has invalid value \(\\Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Location\|\|null \$newParentLocation\)\: Unexpected token "\|", expected type at offset 75 on line 2$#'
identifier: phpDoc.parseError
count: 1
path: src/lib/Form/Data/Location/AbstractLocationCopyData.php

-
message: '#^PHPDoc tag @return has invalid value \(\\Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\Location\|\|null\)\: Unexpected token "\|", expected type at offset 76 on line 2$#'
identifier: phpDoc.parseError
count: 2
path: src/lib/Form/Data/Location/AbstractLocationCopyData.php

-
message: '#^Method Ibexa\\AdminUi\\Form\\Data\\Location\\LocationMoveData\:\:setLocation\(\) has no return type specified\.$#'
identifier: missingType.return
Expand Down Expand Up @@ -7266,12 +7224,6 @@ parameters:
count: 1
path: src/lib/Form/Factory/ContentTypeFormFactory.php

-
message: '#^PHPDoc tag @param has invalid value \(\\Ibexa\\AdminUi\\Form\\Data\\ContentType\\ContentTypeEditData\)\: Unexpected token "\\n \* ", expected variable at offset 74 on line 2$#'
identifier: phpDoc.parseError
count: 1
path: src/lib/Form/Factory/ContentTypeFormFactory.php

-
message: '#^Parameter \#1 \$name of method Symfony\\Component\\Form\\FormFactoryInterface\:\:createNamed\(\) expects string, string\|null given\.$#'
identifier: argument.type
Expand Down Expand Up @@ -7716,24 +7668,12 @@ parameters:
count: 1
path: src/lib/Form/Factory/FormFactory.php

-
message: '#^PHPDoc tag @param for parameter \$data with type Ibexa\\AdminUi\\Form\\Data\\Search\\SearchData\|null is not subtype of native type Ibexa\\Bundle\\Search\\Form\\Data\\SearchData\|null\.$#'
identifier: parameter.phpDocType
count: 1
path: src/lib/Form/Factory/FormFactory.php

-
message: '#^Parameter \#1 \$name of method Symfony\\Component\\Form\\FormFactoryInterface\:\:createNamed\(\) expects string, string\|null given\.$#'
identifier: argument.type
count: 42
path: src/lib/Form/Factory/FormFactory.php

-
message: '#^Parameter \$data of method Ibexa\\AdminUi\\Form\\Factory\\FormFactory\:\:createSearchForm\(\) has invalid type Ibexa\\AdminUi\\Form\\Data\\Search\\SearchData\.$#'
identifier: class.notFound
count: 1
path: src/lib/Form/Factory/FormFactory.php

-
message: '#^Property Ibexa\\AdminUi\\Form\\Factory\\FormFactory\:\:\$translator is never read, only written\.$#'
identifier: property.onlyWritten
Expand Down
82 changes: 3 additions & 79 deletions src/bundle/Controller/ContentTypeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,6 @@ public function __construct(
}

/**
* @param \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup $group
* @param string $routeName
* @param int $page
*
* @return \Symfony\Component\HttpFoundation\Response
*
* @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException
* @throws \Pagerfanta\Exception\OutOfRangeCurrentPageException
* @throws \Pagerfanta\Exception\NotIntegerCurrentPageException
Expand Down Expand Up @@ -180,8 +174,6 @@ public function listAction(ContentTypeGroup $group, string $routeName, int $page
}

/**
* @param \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup $group
*
* @return \Symfony\Component\HttpFoundation\Response|\Ibexa\AdminUi\View\ContentTypeCreateView
*
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
Expand Down Expand Up @@ -227,11 +219,6 @@ public function addAction(ContentTypeGroup $group)
return $view;
}

/**
* @param \Symfony\Component\HttpFoundation\Request $request
*
* @return \Symfony\Component\HttpFoundation\Response
*/
public function addTranslationAction(Request $request): Response
{
$form = $this->contentTypeFormFactory->addContentTypeTranslation(
Expand Down Expand Up @@ -287,11 +274,6 @@ public function addTranslationAction(Request $request): Response
]);
}

/**
* @param \Symfony\Component\HttpFoundation\Request $request
*
* @return \Symfony\Component\HttpFoundation\Response
*/
public function removeTranslationAction(Request $request): Response
{
$form = $this->contentTypeFormFactory->removeContentTypeTranslation(
Expand Down Expand Up @@ -349,11 +331,6 @@ public function removeTranslationAction(Request $request): Response
}

/**
* @param \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup $group
* @param \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType $contentType
*
* @return \Symfony\Component\HttpFoundation\Response
*
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
*/
Expand Down Expand Up @@ -415,11 +392,6 @@ public function editAction(Request $request, ContentTypeGroup $group, ContentTyp
}

/**
* @param \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup $group
* @param \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType $contentType
*
* @return \Symfony\Component\HttpFoundation\Response
*
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
*/
public function copyAction(Request $request, ContentTypeGroup $group, ContentType $contentType): Response
Expand Down Expand Up @@ -472,12 +444,6 @@ public function copyAction(Request $request, ContentTypeGroup $group, ContentTyp
}

/**
* @param \Symfony\Component\HttpFoundation\Request $request
* @param \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup $group
* @param \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeDraft $contentTypeDraft
* @param \Ibexa\Contracts\Core\Repository\Values\Content\Language|null $language
* @param \Ibexa\Contracts\Core\Repository\Values\Content\Language|null $baseLanguage
*
* @return \Symfony\Component\HttpFoundation\Response|\Ibexa\AdminUi\View\ContentTypeEditView
*
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
Expand All @@ -486,8 +452,8 @@ public function updateAction(
Request $request,
ContentTypeGroup $group,
ContentTypeDraft $contentTypeDraft,
Language $language = null,
Language $baseLanguage = null
?Language $language = null,
?Language $baseLanguage = null
) {
if (!$language) {
$language = $this->getDefaultLanguage($contentTypeDraft);
Expand Down Expand Up @@ -599,12 +565,6 @@ public function addFieldDefinitionFormAction(
}

/**
* @param \Symfony\Component\HttpFoundation\Request $request
* @param \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup $group
* @param \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType $contentType
*
* @return \Symfony\Component\HttpFoundation\Response
*
* @throws \Symfony\Component\Translation\Exception\InvalidArgumentException
*/
public function deleteAction(Request $request, ContentTypeGroup $group, ContentType $contentType): Response
Expand Down Expand Up @@ -638,11 +598,6 @@ public function deleteAction(Request $request, ContentTypeGroup $group, ContentT
/**
* Handles removing content types based on submitted form.
*
* @param \Symfony\Component\HttpFoundation\Request $request
* @param \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup $group
*
* @return \Symfony\Component\HttpFoundation\Response
*
* @throws \Symfony\Component\Translation\Exception\InvalidArgumentException
* @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException
* @throws \InvalidArgumentException
Expand Down Expand Up @@ -680,11 +635,6 @@ public function bulkDeleteAction(Request $request, ContentTypeGroup $group): Res
}

/**
* @param \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup $group
* @param \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType $contentType
*
* @return \Symfony\Component\HttpFoundation\Response
*
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
*/
public function viewAction(
Expand Down Expand Up @@ -737,18 +687,10 @@ public function viewAction(
]);
}

/**
* @param \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup $contentTypeGroup
* @param \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeDraft $contentTypeDraft
* @param \Ibexa\Contracts\Core\Repository\Values\Content\Language|null $language
* @param \Ibexa\Contracts\Core\Repository\Values\Content\Language|null $baseLanguage
*
* @return \Symfony\Component\Form\FormInterface
*/
public function createUpdateForm(
ContentTypeGroup $contentTypeGroup,
ContentTypeDraft $contentTypeDraft,
Language $language = null,
?Language $language = null,
?Language $baseLanguage = null
): FormInterface {
$this->metaFieldDefinitionService->addMetaFieldDefinitions($contentTypeDraft, $language);
Expand All @@ -773,12 +715,6 @@ public function createUpdateForm(
]);
}

/**
* @param \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup $group
* @param \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType $contentType
*
* @return \Symfony\Component\Form\FormInterface
*/
protected function createDeleteForm(ContentTypeGroup $group, ContentType $contentType): FormInterface
{
$formBuilder = $this->createFormBuilder(null, [
Expand All @@ -805,10 +741,6 @@ private function getContentTypesNumbers(array $contentTypes): array
}

/**
* @param int $userId
*
* @return string|null
*
* @throws \Symfony\Component\Translation\Exception\InvalidArgumentException
*/
private function getUserNameById(int $userId): ?string
Expand All @@ -828,10 +760,6 @@ private function getUserNameById(int $userId): ?string
}

/**
* @param \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeDraft $contentTypeDraft
*
* @return \Ibexa\Contracts\Core\Repository\Values\Content\Language
*
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
*/
private function getDefaultLanguage(ContentTypeDraft $contentTypeDraft): Language
Expand All @@ -850,10 +778,6 @@ private function getDefaultLanguage(ContentTypeDraft $contentTypeDraft): Languag
}

/**
* @param \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType $contentType
*
* @return \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeDraft
*
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
*/
Expand Down
2 changes: 1 addition & 1 deletion src/bundle/Templating/Twig/IconPathExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function getFunctions(): array
];
}

public function getIconPath(string $icon, string $set = null): string
public function getIconPath(string $icon, ?string $set = null): string
{
return $this->iconPathResolver->resolve($icon, $set);
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Behat/BrowserContext/ContentActionsMenuContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct(ContentActionsMenu $contentActionsMenu)
* @Given I perform the :buttonName action
* @Given I perform the :buttonName action from the :groupName group
*/
public function clickEditActionBar(string $buttonName, string $groupName = null): void
public function clickEditActionBar(string $buttonName, ?string $groupName = null): void
{
$this->contentActionsMenu->clickButton($buttonName, $groupName);
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/Behat/BrowserContext/ContentViewContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct(
* @Given I start creating a new Content :contentType
* @Given I start creating a new Content :contentType in :language language
*/
public function startCreatingContent(string $contentType, string $language = null): void
public function startCreatingContent(string $contentType, ?string $language = null): void
{
$this->contentViewPage->startCreatingContent($contentType, $language);
}
Expand Down Expand Up @@ -107,7 +107,7 @@ public function startCreatingUser(string $contentTypeName = 'User'): void
* @Given I start editing the current content
* @Given I start editing the current content in :language language
*/
public function startEditingContent(string $language = null): void
public function startEditingContent(?string $language = null): void
{
$this->contentViewPage->editContent($language);
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Behat/BrowserContext/NavigationContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public function iClickOnBreadcrumbLink(string $element): void
/**
* @Given I navigate to content :contentName of type :contentType in :path
*/
public function iNavigateToContent(string $contentName, string $contentType, string $path = null)
public function iNavigateToContent(string $contentName, string $contentType, ?string $path = null)
{
$expectedContentPath = sprintf('%s/%s', $path, $contentName);
$pathParts = explode('/', $expectedContentPath);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Behat/Page/ContentViewPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function __construct(
$this->deleteContentDialog = $deleteContentDialog;
}

public function startCreatingContent(string $contentTypeName, string $language = null)
public function startCreatingContent(string $contentTypeName, ?string $language = null)
{
$this->contentActionsMenu->clickButton('Create content');
$this->contentTypePicker->verifyIsLoaded();
Expand Down
12 changes: 2 additions & 10 deletions src/lib/Component/LinkComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,13 @@ class LinkComponent implements ComponentInterface
/** @var string|null */
protected $integrity;

/**
* @param \Twig\Environment $twig
* @param string $href
* @param string $type
* @param string $rel
* @param string|null $crossorigin
* @param string|null $integrity
*/
public function __construct(
Environment $twig,
string $href,
string $type = 'text/css',
string $rel = 'stylesheet',
string $crossorigin = null,
string $integrity = null
?string $crossorigin = null,
?string $integrity = null
) {
$this->twig = $twig;
$this->href = $href;
Expand Down
Loading
Loading