Commit 538046cd authored by Torben Hansen's avatar Torben Hansen Committed by Nikita Hovratov
Browse files

[TASK] Fix wrong indentation in Context class

The switch structures in `Context` class are indented
wrong. This patch corrects the indentation.

Resolves: #97708
Releases: main, 11.5
Change-Id: I70b9f94b196b8bb94078df41956f67619cd4bc15
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74790


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Simon Schaufelberger's avatarSimon Schaufelberger <simonschaufi+typo3@gmail.com>
Tested-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Tested-by: Nikita Hovratov's avatarNikita Hovratov <nikita.h@live.de>
Reviewed-by: Simon Schaufelberger's avatarSimon Schaufelberger <simonschaufi+typo3@gmail.com>
Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Nikita Hovratov's avatarNikita Hovratov <nikita.h@live.de>
parent 921a6786
Pipeline #27589 passed with stages
in 19 minutes and 2 seconds
......@@ -79,17 +79,17 @@ class Context implements SingletonInterface
public function hasAspect(string $name): bool
{
switch ($name) {
// Ensure the default aspects are available, this is mostly necessary for tests to not set up everything
case 'date':
case 'visibility':
case 'backend.user':
case 'frontend.user':
case 'workspace':
case 'language':
case 'typoscript':
return true;
default:
return isset($this->aspects[$name]);
// Ensure the default aspects are available, this is mostly necessary for tests to not set up everything
case 'date':
case 'visibility':
case 'backend.user':
case 'frontend.user':
case 'workspace':
case 'language':
case 'typoscript':
return true;
default:
return isset($this->aspects[$name]);
}
}
......@@ -105,29 +105,29 @@ class Context implements SingletonInterface
if (!isset($this->aspects[$name])) {
// Ensure the default aspects are available, this is mostly necessary for tests to not set up everything
switch ($name) {
case 'date':
$this->setAspect('date', new DateTimeAspect(new \DateTimeImmutable('@' . $GLOBALS['EXEC_TIME'])));
break;
case 'visibility':
$this->setAspect('visibility', new VisibilityAspect());
break;
case 'backend.user':
$this->setAspect('backend.user', new UserAspect());
break;
case 'frontend.user':
$this->setAspect('frontend.user', new UserAspect());
break;
case 'workspace':
$this->setAspect('workspace', new WorkspaceAspect());
break;
case 'language':
$this->setAspect('language', new LanguageAspect());
break;
case 'typoscript':
$this->setAspect('typoscript', new TypoScriptAspect());
break;
default:
throw new AspectNotFoundException('No aspect named "' . $name . '" found.', 1527777641);
case 'date':
$this->setAspect('date', new DateTimeAspect(new \DateTimeImmutable('@' . $GLOBALS['EXEC_TIME'])));
break;
case 'visibility':
$this->setAspect('visibility', new VisibilityAspect());
break;
case 'backend.user':
$this->setAspect('backend.user', new UserAspect());
break;
case 'frontend.user':
$this->setAspect('frontend.user', new UserAspect());
break;
case 'workspace':
$this->setAspect('workspace', new WorkspaceAspect());
break;
case 'language':
$this->setAspect('language', new LanguageAspect());
break;
case 'typoscript':
$this->setAspect('typoscript', new TypoScriptAspect());
break;
default:
throw new AspectNotFoundException('No aspect named "' . $name . '" found.', 1527777641);
}
}
return $this->aspects[$name];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment