Skip to content

Commit

Permalink
TASK: Use assert instead of @var annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Nov 17, 2023
1 parent f8d2890 commit faa72c7
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public function evaluate()
{
$content = $this->getValue();

/** @var RenderingMode $renderingMode */
$renderingMode = $this->runtime->fusionGlobals->get('renderingMode');
assert($renderingMode instanceof RenderingMode);
if (!$renderingMode->isEdit) {
return $content;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public function evaluate()
{
$content = $this->getValue();

/** @var RenderingMode $renderingMode */
$renderingMode = $this->runtime->fusionGlobals->get('renderingMode');
assert($renderingMode instanceof RenderingMode);
if (!$renderingMode->isEdit) {
return $content;
}
Expand Down
2 changes: 1 addition & 1 deletion Neos.Neos/Classes/Fusion/ConvertUrisImplementation.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ public function evaluate()
), 1382624087);
}

/** @var RenderingMode $renderingMode */
$renderingMode = $this->runtime->fusionGlobals->get('renderingMode');
assert($renderingMode instanceof RenderingMode);
if ($renderingMode->isEdit && $this->fusionValue('forceConversion') !== true) {
return $text;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ protected function handle($fusionPath, \Exception $exception, $referenceCode): s
/** @var Node $node */
$node = $currentContext['node'];

/** @var RenderingMode $renderingMode */
$renderingMode = $this->runtime->fusionGlobals->get('renderingMode');
assert($renderingMode instanceof RenderingMode);
$applicationContext = $this->environment->getContext();

if (!$renderingMode->isEdit) {
Expand Down
2 changes: 1 addition & 1 deletion Neos.Neos/Classes/Fusion/ExceptionHandlers/PageHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ protected function handle($fusionPath, \Exception $exception, $referenceCode)
}

if (!is_null($documentNode)) {
/** @var RenderingMode $renderingMode */
$renderingMode = $this->runtime->fusionGlobals->get('renderingMode');
assert($renderingMode instanceof RenderingMode);
if (
$this->privilegeManager->isPrivilegeTargetGranted('Neos.Neos:Backend.GeneralAccess')
&& $renderingMode->isEdit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ public function render(): string

$output = (string)$this->tag->render();

/** @var RenderingMode $renderingMode */
$renderingMode = $this->getContextVariable('renderingMode');
assert($renderingMode instanceof RenderingMode);
if (!$renderingMode->isEdit) {
return $output;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ public function render(): string
);
}

/** @var RenderingMode $renderingMode */
$renderingMode = $fusionObject->getRuntime()->fusionGlobals->get('renderingMode');
assert($renderingMode instanceof RenderingMode);
if (!$renderingMode->isEdit) {
return (string)$this->renderChildren();
}
Expand Down

0 comments on commit faa72c7

Please sign in to comment.