mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/16955] Clean up debug, event, and extension classes
PHPBB3-16955
This commit is contained in:
parent
e1a3b6b552
commit
de9019d64e
6 changed files with 20 additions and 13 deletions
|
@ -15,8 +15,14 @@ namespace phpbb\debug;
|
|||
|
||||
use Symfony\Component\Debug\ErrorHandler;
|
||||
|
||||
/**
|
||||
* @psalm-suppress InvalidExtendClass
|
||||
*/
|
||||
class error_handler extends ErrorHandler
|
||||
{
|
||||
/**
|
||||
* @psalm-suppress MethodSignatureMismatch
|
||||
*/
|
||||
public function handleError($type, $message, $file, $line)
|
||||
{
|
||||
if ($type === E_USER_WARNING || $type === E_USER_NOTICE)
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -35,7 +35,7 @@ class base implements \phpbb\extension\extension_interface
|
|||
/** @var string */
|
||||
protected $extension_path;
|
||||
|
||||
/** @var string[]|bool */
|
||||
/** @var string[]|false */
|
||||
private $migrations = false;
|
||||
|
||||
/**
|
||||
|
@ -69,7 +69,7 @@ class base implements \phpbb\extension\extension_interface
|
|||
* Single enable step that installs any included migrations
|
||||
*
|
||||
* @param mixed $old_state State returned by previous call of this method
|
||||
* @return false Indicates no further steps are required
|
||||
* @return bool True if further steps are necessary, otherwise false
|
||||
*/
|
||||
public function enable_step($old_state)
|
||||
{
|
||||
|
@ -95,7 +95,7 @@ class base implements \phpbb\extension\extension_interface
|
|||
* Single purge step that reverts any included and installed migrations
|
||||
*
|
||||
* @param mixed $old_state State returned by previous call of this method
|
||||
* @return false Indicates no further steps are required
|
||||
* @return bool True if further steps are necessary, otherwise false
|
||||
*/
|
||||
public function purge_step($old_state)
|
||||
{
|
||||
|
@ -135,8 +135,6 @@ class base implements \phpbb\extension\extension_interface
|
|||
|
||||
$this->migrator->set_migrations($migrations);
|
||||
|
||||
$migrations = $this->migrator->get_migrations();
|
||||
|
||||
return $migrations;
|
||||
return $this->migrator->get_migrations();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ class manager
|
|||
/**
|
||||
* Loads all extension information from the database
|
||||
*
|
||||
* @return null
|
||||
* @return void
|
||||
*/
|
||||
public function load_extensions()
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue