Skip to content

Commit

Permalink
Fix old issues detected by phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesread committed Aug 28, 2023
1 parent 034222d commit 825900e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 2 additions & 0 deletions src/main/php/libAllure/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ public function handleHttpError($code)
case '401':
$message = 'Unauthorized.';
break;
default:
$message = 'Unknown (' . $code . ')';
}

$this->render('HTTP Error', $message, $code);
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/libAllure/HtmlLinksCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function rewind(): void
$this->iteratorPosition = 0;
}

public function getChildCollection($linkTitle = null)
public function getChildCollection($title = null)
{
if (empty($title)) {
$title = $this->collection[$this->iteratorPosition]['title'];
Expand Down
10 changes: 2 additions & 8 deletions src/main/php/libAllure/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,8 @@ public function display($template = null, $cacheId = null, $compileId = null, $p
parent::display($template, $cacheId, $compileId);

foreach ($this->autoClearVars as $varName) {
if (method_exists($this, 'get_template_vars')) {
if ($this->get_template_vars($varName)) {
$this->clear_assign($varName);
}
} elseif (method_exists($this, 'tpl_vars')) {
if ($this->tpl_vars($varName)) {
$this->clear_assign($varName);
}
if ($this->getTemplateVars($varName)) {
$this->clearAssign($varName);
}
}
}
Expand Down

0 comments on commit 825900e

Please sign in to comment.