1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-20 07:21:30 +02:00

[ticket/16955] Clean up debug, event, and extension classes

PHPBB3-16955
This commit is contained in:
Marc Alexander
2022-12-26 22:46:43 +01:00
parent e1a3b6b552
commit de9019d64e
6 changed files with 20 additions and 13 deletions

View File

@@ -461,7 +461,7 @@ class md_exporter
* Validate "Changed" Information
*
* @param string $changed
* @return string
* @return array{string, string} Changed information containing version and description in respective order
* @throws \LogicException
*/
public function validate_changed($changed)
@@ -481,7 +481,7 @@ class md_exporter
throw new \LogicException("Invalid changed information found for event '{$this->current_event}'");
}
return array($version, $description);
return [$version, $description];
}
/**
@@ -492,7 +492,7 @@ class md_exporter
*/
public function validate_version($version)
{
return preg_match('#^\d+\.\d+\.\d+(?:-(?:a|b|RC|pl)\d+)?$#', $version);
return (bool) preg_match('#^\d+\.\d+\.\d+(?:-(?:a|b|RC|pl)\d+)?$#', $version);
}
/**

View File

@@ -148,8 +148,9 @@ class php_exporter
$files = array();
foreach ($iterator as $file_info)
{
/** @var \RecursiveDirectoryIterator $file_info */
$relative_path = $iterator->getInnerIterator()->getSubPathname();
/** @var \RecursiveDirectoryIterator $inner_iterator */
$inner_iterator = $iterator->getInnerIterator();
$relative_path = $inner_iterator->getSubPathname();
$files[] = str_replace(DIRECTORY_SEPARATOR, '/', $relative_path);
}

View File

@@ -41,7 +41,9 @@ class recursive_event_filter_iterator extends \RecursiveFilterIterator
*/
public function getChildren()
{
return new self($this->getInnerIterator()->getChildren(), $this->root_path);
$inner_iterator = $this->getInnerIterator();
assert($inner_iterator instanceof \RecursiveIterator);
return new self($inner_iterator->getChildren(), $this->root_path);
}
/**