Skip to content

Commit

Permalink
TASK: Fix phpstan errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Aug 28, 2024
1 parent aee6a2c commit 40d20cd
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
3 changes: 3 additions & 0 deletions Classes/Controller/BackendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ public function indexAction(string $node = null)
$rootNodeAggregate = $contentGraph->findRootNodeAggregateByType(
NodeTypeNameFactory::forSites()
);
if (!$rootNodeAggregate) {
throw new \RuntimeException(sprintf('No sites root node found in content repository "%s", while fetching site node "%s"', $contentRepository->id->value, $siteDetectionResult->siteNodeName->value), 1724849303);
}
$rootNode = $rootNodeAggregate->getNodeByCoveredDimensionSpacePoint($defaultDimensionSpacePoint);

$siteNode = $subgraph->findNodeByPath(
Expand Down
12 changes: 6 additions & 6 deletions Classes/Controller/BackendServiceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ protected function initializeController(ActionRequest $request, ActionResponse $

/**
* Apply a set of changes to the system
* @psalm-param list<array<string,mixed>> $changes
* @phpstan-param list<array<string,mixed>> $changes
*/
public function changeAction(array $changes): void
{
Expand Down Expand Up @@ -521,7 +521,7 @@ public function changeBaseWorkspaceAction(string $targetWorkspaceName, string $d
/**
* Persists the clipboard node on copy
*
* @psalm-param list<string> $nodes
* @phpstan-param list<string> $nodes
* @return void
* @throws \Neos\Flow\Property\Exception
* @throws \Neos\Flow\Security\Exception
Expand Down Expand Up @@ -553,7 +553,7 @@ public function clearClipboardAction()
/**
* Persists the clipboard node on cut
*
* @psalm-param list<string> $nodes
* @phpstan-param list<string> $nodes
* @throws \Neos\Flow\Property\Exception
* @throws \Neos\Flow\Security\Exception
*/
Expand Down Expand Up @@ -591,7 +591,7 @@ public function initializeGetAdditionalNodeMetadataAction(): void

/**
* Fetches all the node information that can be lazy-loaded
* @psalm-param list<string> $nodes
* @phpstan-param list<string> $nodes
*/
public function getAdditionalNodeMetadataAction(array $nodes): void
{
Expand Down Expand Up @@ -639,7 +639,7 @@ public function initializeGetPolicyInformationAction(): void
}

/**
* @psalm-param list<NodeAddress> $nodes
* @phpstan-param list<NodeAddress> $nodes
*/
public function getPolicyInformationAction(array $nodes): void
{
Expand Down Expand Up @@ -672,7 +672,7 @@ public function getPolicyInformationAction(array $nodes): void
/**
* Build and execute a flow query chain
*
* @psalm-param list<array{type: string, payload: array<string|int, mixed>}> $chain
* @phpstan-param non-empty-list<array{type: string, payload: array<string|int, mixed>}> $chain
*/
public function flowQueryAction(array $chain): string
{
Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Service/UserLocaleService.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class UserLocaleService
/**
* The current user's locale (cached for performance)
*
* @var Locale
* @var Locale|null
*/
protected $userLocaleRuntimeCache;

Expand Down
7 changes: 5 additions & 2 deletions Classes/FlowQueryOperations/NeosUiDefaultNodesOperation.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,13 @@ public function canEvaluate($context)
*/
public function evaluate(FlowQuery $flowQuery, array $arguments)
{
/** @var array<int,mixed> $context */
$context = $flowQuery->getContext();

/** @var Node $siteNode */
$siteNode = $flowQuery->getContext()[0];
$siteNode = $context[0];
/** @var Node $documentNode */
$documentNode = $flowQuery->getContext()[1] ?? $siteNode;
$documentNode = $context[1] ?? $siteNode;
/** @var string[] $toggledNodes */
list($baseNodeType, $loadingDepth, $toggledNodes, $clipboardNodesContextPaths) = $arguments;

Expand Down

0 comments on commit 40d20cd

Please sign in to comment.