Skip to content

Add missing return types #2734

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 13, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class GreetingInput extends BaseParser
{
public function parse(array $data, ParsingDispatcher $parsingDispatcher)
public function parse(array $data, ParsingDispatcher $parsingDispatcher): Greeting
{
if (!isset($data['Salutation'])) {
throw new Exceptions\Parser("Missing or invalid 'Salutation' element for Greeting.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function __construct(URLAliasService $urlAliasService)
$this->urlAliasService = $urlAliasService;
}

public function visit(Visitor $visitor, Generator $generator, $data)
public function visit(Visitor $visitor, Generator $generator, $data): void
{
// Not using $generator->startObjectElement to not have the XML Generator adding its own media-type attribute with the default vendor
$generator->startHashElement('Location');
Expand Down
6 changes: 0 additions & 6 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,6 @@ parameters:
count: 1
path: code_samples/api/rest_api/src/Rest/ValueObjectVisitor/Greeting.php

-
message: '#^Method App\\Rest\\ValueObjectVisitor\\RestLocation\:\:visit\(\) has no return type specified\.$#'
identifier: missingType.return
count: 1
path: code_samples/api/rest_api/src/Rest/ValueObjectVisitor/RestLocation.php

-
message: '#^Parameter \#1 \.\.\.\$arrays of function array_merge expects array, iterable\<Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\URLAlias\> given\.$#'
identifier: argument.type
Expand Down
Loading