Skip to content

Commit

Permalink
[TASK] Remove unreachable else because ternary operator condition is …
Browse files Browse the repository at this point in the history
…always true
  • Loading branch information
benjaminkott committed Jan 8, 2021
1 parent 40f4bca commit 8767b93
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Classes/ViewHelpers/Link/Be/AuthorViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function render(): string
{
/** @var Author $author */
$author = $this->arguments['author'];
$authorUid = $author !== null ? (int)$author->getUid() : 0;
$authorUid = (int)$author->getUid();

$routingUriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
$uri = $routingUriBuilder->buildUriFromRoute('record_edit', ['edit[tx_blog_domain_model_author][' . $authorUid . ']' => 'edit']);
Expand Down
2 changes: 1 addition & 1 deletion Classes/ViewHelpers/Link/Be/CategoryViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function render(): string
{
/** @var Category $category */
$category = $this->arguments['category'];
$categoryUid = $category !== null ? (int)$category->getUid() : 0;
$categoryUid = (int)$category->getUid();

$routingUriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
$uri = $routingUriBuilder->buildUriFromRoute('record_edit', ['edit[sys_category][' . $categoryUid . ']' => 'edit']);
Expand Down
2 changes: 1 addition & 1 deletion Classes/ViewHelpers/Link/Be/CommentViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function render(): string
{
/** @var Comment $comment */
$comment = $this->arguments['comment'];
$commentUid = $comment !== null ? (int)$comment->getUid() : 0;
$commentUid = (int)$comment->getUid();

$routingUriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
$uri = $routingUriBuilder->buildUriFromRoute('record_edit', ['edit[tx_blog_domain_model_comment][' . $commentUid . ']' => 'edit']);
Expand Down
2 changes: 1 addition & 1 deletion Classes/ViewHelpers/Link/Be/PostViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function render(): string
{
/** @var Post $post */
$post = $this->arguments['post'];
$pageUid = $post !== null ? (int)$post->getUid() : 0;
$pageUid = (int)$post->getUid();

$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
switch ($this->arguments['action']) {
Expand Down
2 changes: 1 addition & 1 deletion Classes/ViewHelpers/Link/Be/TagViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function render(): string
{
/** @var Tag $tag */
$tag = $this->arguments['tag'];
$tagUid = $tag !== null ? (int)$tag->getUid() : 0;
$tagUid = (int)$tag->getUid();

$routingUriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
$uri = $routingUriBuilder->buildUriFromRoute('record_edit', ['edit[tx_blog_domain_model_tag][' . $tagUid . ']' => 'edit']);
Expand Down
2 changes: 1 addition & 1 deletion Classes/ViewHelpers/Link/PostViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function render(): string
/** @var Post $post */
$post = $this->arguments['post'];
$section = $this->arguments['section'] ?: '';
$pageUid = $post !== null ? (int)$post->getUid() : 0;
$pageUid = (int) $post->getUid();
$uriBuilder = $this->renderingContext->getControllerContext()->getUriBuilder();
$createAbsoluteUri = (bool)$this->arguments['createAbsoluteUri'];
$uri = $uriBuilder->reset()
Expand Down

0 comments on commit 8767b93

Please sign in to comment.