Merge branch '3.3.x'

This commit is contained in:
Máté Bartus 2021-01-03 00:11:11 +01:00
commit 864321ecf6
46 changed files with 206 additions and 110 deletions

View file

@ -19,21 +19,34 @@ use PHP_CodeSniffer\Sniffs\Sniff;
*/ */
class phpbb_Sniffs_Namespaces_UnusedUseSniff implements Sniff class phpbb_Sniffs_Namespaces_UnusedUseSniff implements Sniff
{ {
const FIND = [
T_NS_SEPARATOR,
T_STRING,
T_WHITESPACE,
];
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function register() public function register()
{ {
return array(T_USE); return [T_USE];
} }
protected function check(File $phpcsFile, $found_name, $full_name, $short_name, $line) protected function check(File $phpcsFile, $found_name, $full_name, $short_name, $stack_pointer)
{ {
$found_name_normalized = ltrim($found_name, '\\');
$full_name = ltrim($full_name, '\\');
if ($found_name === $full_name) $is_global = ($full_name === $short_name);
$unnecessarily_fully_qualified = ($is_global)
? ($found_name_normalized !== $found_name && $found_name_normalized === $short_name)
: ($found_name_normalized === $full_name);
if ($unnecessarily_fully_qualified)
{ {
$error = 'Either use statement or full name must be used.'; $error = 'Either use statement or full name must be used.';
$phpcsFile->addError($error, $line, 'FullName'); $phpcsFile->addError($error, $stack_pointer, 'FullName');
} }
if ($found_name === $short_name) if ($found_name === $short_name)
@ -58,27 +71,50 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements Sniff
$class_name_start = $phpcsFile->findNext(array(T_NS_SEPARATOR, T_STRING), ($stackPtr + 1)); $class_name_start = $phpcsFile->findNext(array(T_NS_SEPARATOR, T_STRING), ($stackPtr + 1));
$find = array( $class_name_end = $phpcsFile->findNext(self::FIND, ($stackPtr + 1), null, true);
T_NS_SEPARATOR,
T_STRING,
T_WHITESPACE,
);
$class_name_end = $phpcsFile->findNext($find, ($stackPtr + 1), null, true);
$aliasing_as_position = $phpcsFile->findNext(T_AS, $class_name_end, null, false, null, true); $aliasing_as_position = $phpcsFile->findNext(T_AS, $class_name_end, null, false, null, true);
if ($aliasing_as_position !== false) if ($aliasing_as_position !== false)
{ {
$alias_position = $phpcsFile->findNext(T_STRING, $aliasing_as_position, null, false, null, true); $alias_position = $phpcsFile->findNext(T_STRING, $aliasing_as_position, null, false, null, true);
$class_name_short = $tokens[$alias_position]['content']; $name_short = $tokens[$alias_position]['content'];
$class_name_full = $phpcsFile->getTokensAsString($class_name_start, ($class_name_end - $class_name_start - 1)); $name_full = $phpcsFile->getTokensAsString($class_name_start, ($class_name_end - $class_name_start - 1));
} }
else else
{ {
$class_name_full = $phpcsFile->getTokensAsString($class_name_start, ($class_name_end - $class_name_start)); $name_full = $phpcsFile->getTokensAsString($class_name_start, ($class_name_end - $class_name_start));
$class_name_short = $tokens[$class_name_end - 1]['content']; $name_short = $tokens[$class_name_end - 1]['content'];
} }
if ($tokens[$class_name_start]['content'] === 'function'
&& $tokens[$class_name_start + 1]['code'] === T_WHITESPACE)
{
$class_name_start += 2;
$name_full = $phpcsFile->getTokensAsString(
$class_name_start,
($class_name_end - $class_name_start - (int) ($aliasing_as_position !== false))
);
$ok = $this->findFunctionUsage($phpcsFile, $stackPtr, $tokens, $name_full, $name_short);
}
else
{
$ok = $this->findClassUsage($phpcsFile, $stackPtr, $tokens, $name_full, $name_short);
}
if ($name_full[0] === '\\')
{
$phpcsFile->addError("There must not be a leading '\\' in use statements.", $stackPtr, 'Malformed');
}
if (!$ok)
{
$error = 'There must not be unused USE statements.';
$phpcsFile->addError($error, $stackPtr, 'Unused');
}
}
private function findClassUsage(File $phpcsFile, $stackPtr, $tokens, $class_name_full, $class_name_short)
{
$ok = false; $ok = false;
// Checks in simple statements (new, instanceof and extends) // Checks in simple statements (new, instanceof and extends)
@ -95,11 +131,11 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements Sniff
continue; continue;
} }
$simple_class_name_end = $phpcsFile->findNext($find, ($simple_statement + 1), null, true); $simple_class_name_end = $phpcsFile->findNext(self::FIND, ($simple_statement + 1), null, true);
$simple_class_name = trim($phpcsFile->getTokensAsString($simple_class_name_start, ($simple_class_name_end - $simple_class_name_start))); $simple_class_name = trim($phpcsFile->getTokensAsString($simple_class_name_start, ($simple_class_name_end - $simple_class_name_start)));
$ok = $this->check($phpcsFile, $simple_class_name, $class_name_full, $class_name_short, $simple_statement) ? true : $ok; $ok = $this->check($phpcsFile, $simple_class_name, $class_name_full, $class_name_short, $simple_statement) || $ok;
} }
} }
@ -109,12 +145,12 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements Sniff
{ {
$old_paamayim_nekudotayim = $paamayim_nekudotayim; $old_paamayim_nekudotayim = $paamayim_nekudotayim;
$paamayim_nekudotayim_class_name_start = $phpcsFile->findPrevious($find, $paamayim_nekudotayim - 1, null, true); $paamayim_nekudotayim_class_name_start = $phpcsFile->findPrevious(self::FIND, $paamayim_nekudotayim - 1, null, true);
$paamayim_nekudotayim_class_name_end = $paamayim_nekudotayim - 1; $paamayim_nekudotayim_class_name_end = $paamayim_nekudotayim - 1;
$paamayim_nekudotayim_class_name = trim($phpcsFile->getTokensAsString($paamayim_nekudotayim_class_name_start + 1, ($paamayim_nekudotayim_class_name_end - $paamayim_nekudotayim_class_name_start))); $paamayim_nekudotayim_class_name = trim($phpcsFile->getTokensAsString($paamayim_nekudotayim_class_name_start + 1, ($paamayim_nekudotayim_class_name_end - $paamayim_nekudotayim_class_name_start)));
$ok = $this->check($phpcsFile, $paamayim_nekudotayim_class_name, $class_name_full, $class_name_short, $paamayim_nekudotayim) ? true : $ok; $ok = $this->check($phpcsFile, $paamayim_nekudotayim_class_name, $class_name_full, $class_name_short, $paamayim_nekudotayim) || $ok;
} }
// Checks in implements // Checks in implements
@ -129,11 +165,11 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements Sniff
$old_implemented_class = $implemented_class; $old_implemented_class = $implemented_class;
$implements_class_name_start = $phpcsFile->findNext(array(T_NS_SEPARATOR, T_STRING), ($implemented_class - 1)); $implements_class_name_start = $phpcsFile->findNext(array(T_NS_SEPARATOR, T_STRING), ($implemented_class - 1));
$implements_class_name_end = $phpcsFile->findNext($find, ($implemented_class - 1), null, true); $implements_class_name_end = $phpcsFile->findNext(self::FIND, ($implemented_class - 1), null, true);
$implements_class_name = trim($phpcsFile->getTokensAsString($implements_class_name_start, ($implements_class_name_end - $implements_class_name_start))); $implements_class_name = trim($phpcsFile->getTokensAsString($implements_class_name_start, ($implements_class_name_end - $implements_class_name_start)));
$ok = $this->check($phpcsFile, $implements_class_name, $class_name_full, $class_name_short, $implements) ? true : $ok; $ok = $this->check($phpcsFile, $implements_class_name, $class_name_full, $class_name_short, $implements) || $ok;
} }
} }
@ -141,7 +177,7 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements Sniff
while (($docblock = $phpcsFile->findNext(T_DOC_COMMENT_CLOSE_TAG, ($old_docblock + 1))) !== false) while (($docblock = $phpcsFile->findNext(T_DOC_COMMENT_CLOSE_TAG, ($old_docblock + 1))) !== false)
{ {
$old_docblock = $docblock; $old_docblock = $docblock;
$ok = $this->checkDocblock($phpcsFile, $docblock, $tokens, $class_name_full, $class_name_short) ? true : $ok; $ok = $this->checkDocblock($phpcsFile, $docblock, $tokens, $class_name_full, $class_name_short) || $ok;
} }
// Checks in type hinting // Checks in type hinting
@ -154,7 +190,7 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements Sniff
$params = $phpcsFile->getMethodParameters($function_declaration); $params = $phpcsFile->getMethodParameters($function_declaration);
foreach ($params as $param) foreach ($params as $param)
{ {
$ok = $this->check($phpcsFile, $param['type_hint'], $class_name_full, $class_name_short, $function_declaration) ? true : $ok; $ok = $this->check($phpcsFile, $param['type_hint'], $class_name_full, $class_name_short, $function_declaration) || $ok;
} }
} }
@ -165,18 +201,81 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements Sniff
$old_catch = $catch; $old_catch = $catch;
$caught_class_name_start = $phpcsFile->findNext(array(T_NS_SEPARATOR, T_STRING), $catch + 1); $caught_class_name_start = $phpcsFile->findNext(array(T_NS_SEPARATOR, T_STRING), $catch + 1);
$caught_class_name_end = $phpcsFile->findNext($find, $caught_class_name_start + 1, null, true); $caught_class_name_end = $phpcsFile->findNext(self::FIND, $caught_class_name_start + 1, null, true);
$caught_class_name = trim($phpcsFile->getTokensAsString($caught_class_name_start, ($caught_class_name_end - $caught_class_name_start))); $caught_class_name = trim($phpcsFile->getTokensAsString($caught_class_name_start, ($caught_class_name_end - $caught_class_name_start)));
$ok = $this->check($phpcsFile, $caught_class_name, $class_name_full, $class_name_short, $catch) ? true : $ok; $ok = $this->check($phpcsFile, $caught_class_name, $class_name_full, $class_name_short, $catch) || $ok;
} }
if (!$ok) return $ok;
}
private function findFunctionUsage(File $phpcsFile, $stackPtr, $tokens, $name_full, $name_short)
{
$ok = false;
$position = $phpcsFile->findNext(T_OPEN_PARENTHESIS, $stackPtr + 1);
while ($position !== false)
{ {
$error = 'There must not be unused USE statements.'; $function_name_end = $position;
$phpcsFile->addError($error, $stackPtr, 'Unused'); $found_start = 1 + $phpcsFile->findPrevious(
[T_NS_SEPARATOR, T_STRING, T_WHITESPACE],
$function_name_end - 1,
null,
true
);
$position = $phpcsFile->findNext(T_OPEN_PARENTHESIS, $position + 1);
if ($found_start === null)
{
continue;
}
$function_name_start = $found_start;
// Trim the output.
while ($tokens[$function_name_start]['code'] === T_WHITESPACE && $function_name_start < $function_name_end)
{
++$function_name_start;
}
while ($tokens[$function_name_end]['code'] === T_WHITESPACE && $function_name_end > $function_name_start)
{
--$function_name_end;
}
$function_name_length = $function_name_end - $function_name_start;
// Filter out control structures, built in type constructors, etc.
if ($function_name_length <= 0)
{
continue;
}
// This doesn't seem to be valid PHP, where is the opening tag?
if ($found_start === 0)
{
continue;
}
$previous_token = $found_start - 1;
$filter = [
T_FUNCTION, // Function declaration
T_OBJECT_OPERATOR, // Method call
T_DOUBLE_COLON, // Static method call
];
// Filter out calls to methods and function declarations.
if (in_array($tokens[$previous_token]['code'], $filter))
{
continue;
}
$function_name = $phpcsFile->getTokensAsString($function_name_start, $function_name_length);
$ok = $this->check($phpcsFile, $function_name, $name_full, $name_short, $function_name_start) || $ok;
} }
return $ok;
} }
/** /**
@ -247,7 +346,7 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements Sniff
$classes = explode('|', str_replace('[]', '', $classes)); $classes = explode('|', str_replace('[]', '', $classes));
foreach ($classes as $class) foreach ($classes as $class)
{ {
$ok = $this->check($phpcsFile, $class, $class_name_full, $class_name_short, $tokens[$tag + 2]['line']) ? true : $ok; $ok = $this->check($phpcsFile, $class, $class_name_full, $class_name_short, $tag + 2) || $ok;
} }
} }

View file

@ -13,7 +13,7 @@
namespace phpbb\attachment; namespace phpbb\attachment;
use \phpbb\db\driver\driver_interface; use phpbb\db\driver\driver_interface;
/** /**
* Attachment resync class * Attachment resync class

View file

@ -26,11 +26,12 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
class check extends \phpbb\console\command\command class check extends \phpbb\console\command\command
{ {
/** @var \phpbb\config\config */ /** @var config */
protected $config; protected $config;
/** @var ContainerInterface */ /** @var ContainerInterface */
protected $phpbb_container; protected $phpbb_container;
/** /**
* @var language * @var language
*/ */

View file

@ -14,7 +14,7 @@
namespace phpbb\controller; namespace phpbb\controller;
use phpbb\auth\auth; use phpbb\auth\auth;
use \phpbb\cache\driver\driver_interface as cache_interface; use phpbb\cache\driver\driver_interface as cache_interface;
use phpbb\config\config; use phpbb\config\config;
use phpbb\cron\manager; use phpbb\cron\manager;
use phpbb\db\driver\driver_interface; use phpbb\db\driver\driver_interface;

View file

@ -64,7 +64,7 @@ class resolver implements ControllerResolverInterface
/** /**
* Load a controller callable * Load a controller callable
* *
* @param \Symfony\Component\HttpFoundation\Request $request Symfony Request object * @param Request $request Symfony Request object
* @return bool|Callable Callable or false * @return bool|Callable Callable or false
* @throws \phpbb\controller\exception * @throws \phpbb\controller\exception
*/ */
@ -119,7 +119,7 @@ class resolver implements ControllerResolverInterface
* and should match the parameters of the method you are using as your * and should match the parameters of the method you are using as your
* controller. * controller.
* *
* @param \Symfony\Component\HttpFoundation\Request $request Symfony Request object * @param Request $request Symfony Request object
* @param mixed $controller A callable (controller class, method) * @param mixed $controller A callable (controller class, method)
* @return array An array of arguments to pass to the controller * @return array An array of arguments to pass to the controller
* @throws \phpbb\controller\exception * @throws \phpbb\controller\exception

View file

@ -26,17 +26,17 @@ use Symfony\Component\HttpKernel\Event\PostResponseEvent;
class cron_runner_listener implements EventSubscriberInterface class cron_runner_listener implements EventSubscriberInterface
{ {
/** /**
* @var \phpbb\lock\db * @var db
*/ */
private $cron_lock; private $cron_lock;
/** /**
* @var \phpbb\cron\manager * @var manager
*/ */
private $cron_manager; private $cron_manager;
/** /**
* @var \phpbb\request\request_interface * @var request_interface
*/ */
private $request; private $request;

View file

@ -80,8 +80,6 @@ class manager
* and puts them into $this->tasks. * and puts them into $this->tasks.
* *
* @param array|\Traversable $tasks Array of instances of \phpbb\cron\task\task * @param array|\Traversable $tasks Array of instances of \phpbb\cron\task\task
*
* @return null
*/ */
public function load_tasks($tasks) public function load_tasks($tasks)
{ {
@ -94,8 +92,6 @@ class manager
/** /**
* Loads registered tasks from the container, wraps them * Loads registered tasks from the container, wraps them
* and puts them into $this->tasks. * and puts them into $this->tasks.
*
* @return null
*/ */
public function load_tasks_from_container() public function load_tasks_from_container()
{ {
@ -116,7 +112,7 @@ class manager
* *
* If no tasks are ready, null is returned. * If no tasks are ready, null is returned.
* *
* @return \phpbb\cron\task\wrapper|null * @return wrapper|null
*/ */
public function find_one_ready_task() public function find_one_ready_task()
{ {
@ -161,7 +157,7 @@ class manager
* Web runner uses this method to resolve names to tasks. * Web runner uses this method to resolve names to tasks.
* *
* @param string $name Name of the task to look up. * @param string $name Name of the task to look up.
* @return \phpbb\cron\task\wrapper A wrapped task corresponding to the given name, or null. * @return wrapper A wrapped task corresponding to the given name, or null.
*/ */
public function find_task($name) public function find_task($name)
{ {
@ -193,7 +189,7 @@ class manager
* Wraps a task inside an instance of \phpbb\cron\task\wrapper. * Wraps a task inside an instance of \phpbb\cron\task\wrapper.
* *
* @param \phpbb\cron\task\task $task The task. * @param \phpbb\cron\task\task $task The task.
* @return \phpbb\cron\task\wrapper The wrapped task. * @return wrapper The wrapped task.
*/ */
public function wrap_task(\phpbb\cron\task\task $task) public function wrap_task(\phpbb\cron\task\task $task)
{ {

View file

@ -13,7 +13,7 @@
namespace phpbb\db\driver; namespace phpbb\db\driver;
use \Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Database Abstraction Layer * Database Abstraction Layer

View file

@ -21,7 +21,7 @@ class mssql_extractor extends base_extractor
* Writes closing line(s) to database backup * Writes closing line(s) to database backup
* *
* @return null * @return null
* @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor() * @throws extractor_not_initialized_exception when calling this function before init_extractor()
*/ */
public function write_end() public function write_end()
{ {
@ -195,7 +195,7 @@ class mssql_extractor extends base_extractor
* *
* @param string $table_name name of the database table * @param string $table_name name of the database table
* @return null * @return null
* @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor() * @throws extractor_not_initialized_exception when calling this function before init_extractor()
*/ */
protected function write_data_mssqlnative($table_name) protected function write_data_mssqlnative($table_name)
{ {
@ -311,7 +311,7 @@ class mssql_extractor extends base_extractor
* *
* @param string $table_name name of the database table * @param string $table_name name of the database table
* @return null * @return null
* @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor() * @throws extractor_not_initialized_exception when calling this function before init_extractor()
*/ */
protected function write_data_odbc($table_name) protected function write_data_odbc($table_name)
{ {

View file

@ -87,7 +87,7 @@ class mysql_extractor extends base_extractor
* *
* @param string $table_name name of the database table * @param string $table_name name of the database table
* @return null * @return null
* @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor() * @throws extractor_not_initialized_exception when calling this function before init_extractor()
*/ */
protected function write_data_mysqli($table_name) protected function write_data_mysqli($table_name)
{ {
@ -177,7 +177,7 @@ class mysql_extractor extends base_extractor
* *
* @param string $table_name name of the database table * @param string $table_name name of the database table
* @return null * @return null
* @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor() * @throws extractor_not_initialized_exception when calling this function before init_extractor()
*/ */
protected function new_write_table($table_name) protected function new_write_table($table_name)
{ {
@ -202,7 +202,7 @@ class mysql_extractor extends base_extractor
* *
* @param string $table_name name of the database table * @param string $table_name name of the database table
* @return null * @return null
* @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor() * @throws extractor_not_initialized_exception when calling this function before init_extractor()
*/ */
protected function old_write_table($table_name) protected function old_write_table($table_name)
{ {

View file

@ -324,7 +324,7 @@ class postgres_extractor extends base_extractor
* Writes closing line(s) to database backup * Writes closing line(s) to database backup
* *
* @return null * @return null
* @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor() * @throws extractor_not_initialized_exception when calling this function before init_extractor()
*/ */
public function write_end() public function write_end()
{ {

View file

@ -136,7 +136,7 @@ class sqlite3_extractor extends base_extractor
* Writes closing line(s) to database backup * Writes closing line(s) to database backup
* *
* @return null * @return null
* @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor() * @throws extractor_not_initialized_exception when calling this function before init_extractor()
*/ */
public function write_end() public function write_end()
{ {

View file

@ -22,7 +22,7 @@ class container_configuration implements ConfigurationInterface
/** /**
* Generates the configuration tree builder. * Generates the configuration tree builder.
* *
* @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder * @return TreeBuilder The tree builder
*/ */
public function getConfigTreeBuilder() public function getConfigTreeBuilder()
{ {

View file

@ -21,7 +21,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
class service_collection extends \ArrayObject class service_collection extends \ArrayObject
{ {
/** /**
* @var \Symfony\Component\DependencyInjection\ContainerInterface * @var ContainerInterface
*/ */
protected $container; protected $container;

View file

@ -55,7 +55,7 @@ class upload
/** @var \bantu\IniGetWrapper\IniGetWrapper ini_get() wrapper */ /** @var \bantu\IniGetWrapper\IniGetWrapper ini_get() wrapper */
protected $php_ini; protected $php_ini;
/** @var \phpbb\language\language Language class */ /** @var language Language class */
protected $language; protected $language;
/** @var request_interface Request class */ /** @var request_interface Request class */

View file

@ -98,7 +98,7 @@ class install extends \phpbb\console\command\command
{ {
$this->iohandler_factory->set_environment('cli'); $this->iohandler_factory->set_environment('cli');
/** @var \phpbb\install\helper\iohandler\cli_iohandler $iohandler */ /** @var cli_iohandler $iohandler */
$iohandler = $this->iohandler_factory->get(); $iohandler = $this->iohandler_factory->get();
$style = new SymfonyStyle($input, $output); $style = new SymfonyStyle($input, $output);
$iohandler->set_style($style, $output); $iohandler->set_style($style, $output);

View file

@ -98,7 +98,7 @@ class update extends \phpbb\console\command\command
{ {
$this->iohandler_factory->set_environment('cli'); $this->iohandler_factory->set_environment('cli');
/** @var \phpbb\install\helper\iohandler\cli_iohandler $iohandler */ /** @var cli_iohandler $iohandler */
$iohandler = $this->iohandler_factory->get(); $iohandler = $this->iohandler_factory->get();
$style = new SymfonyStyle($input, $output); $style = new SymfonyStyle($input, $output);
$iohandler->set_style($style, $output); $iohandler->set_style($style, $output);

View file

@ -40,7 +40,7 @@ class helper
protected $installer_config; protected $installer_config;
/** /**
* @var \phpbb\language\language * @var language
*/ */
protected $language; protected $language;
@ -50,37 +50,37 @@ class helper
protected $language_cookie; protected $language_cookie;
/** /**
* @var \phpbb\language\language_file_helper * @var language_file_helper
*/ */
protected $lang_helper; protected $lang_helper;
/** /**
* @var \phpbb\install\helper\navigation\navigation_provider * @var navigation_provider
*/ */
protected $navigation_provider; protected $navigation_provider;
/** /**
* @var \phpbb\template\template * @var template
*/ */
protected $template; protected $template;
/** /**
* @var \phpbb\path_helper * @var path_helper
*/ */
protected $path_helper; protected $path_helper;
/** /**
* @var \phpbb\request\request * @var request
*/ */
protected $phpbb_request; protected $phpbb_request;
/** /**
* @var \phpbb\symfony_request * @var symfony_request
*/ */
protected $request; protected $request;
/** /**
* @var \phpbb\routing\router * @var router
*/ */
protected $router; protected $router;

View file

@ -35,7 +35,7 @@ class container_factory
protected $php_ext; protected $php_ext;
/** /**
* @var \phpbb\request\request * @var request
*/ */
protected $request; protected $request;
@ -78,7 +78,7 @@ class container_factory
* @return \Symfony\Component\DependencyInjection\ContainerInterface|Object phpBB's dependency injection container * @return \Symfony\Component\DependencyInjection\ContainerInterface|Object phpBB's dependency injection container
* or the service specified in $service_name * or the service specified in $service_name
* *
* @throws \phpbb\install\exception\cannot_build_container_exception When container cannot be built * @throws cannot_build_container_exception When container cannot be built
* @throws \Symfony\Component\DependencyInjection\Exception\InvalidArgumentException If the service is not defined * @throws \Symfony\Component\DependencyInjection\Exception\InvalidArgumentException If the service is not defined
* @throws \Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException When a circular reference is detected * @throws \Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException When a circular reference is detected
* @throws \Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException When the service is not defined * @throws \Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException When the service is not defined
@ -101,7 +101,7 @@ class container_factory
* *
* @return mixed * @return mixed
* *
* @throws \phpbb\install\exception\cannot_build_container_exception When container cannot be built * @throws cannot_build_container_exception When container cannot be built
*/ */
public function get_parameter($param_name) public function get_parameter($param_name)
{ {
@ -117,7 +117,7 @@ class container_factory
/** /**
* Build dependency injection container * Build dependency injection container
* *
* @throws \phpbb\install\exception\cannot_build_container_exception When container cannot be built * @throws cannot_build_container_exception When container cannot be built
*/ */
protected function build_container() protected function build_container()
{ {

View file

@ -231,7 +231,7 @@ class database
* *
* @return bool|array true if table prefix is valid, array of errors otherwise * @return bool|array true if table prefix is valid, array of errors otherwise
* *
* @throws \phpbb\install\exception\invalid_dbms_exception When $dbms is not a valid * @throws invalid_dbms_exception When $dbms is not a valid
*/ */
public function validate_table_prefix($dbms, $table_prefix) public function validate_table_prefix($dbms, $table_prefix)
{ {

View file

@ -54,7 +54,7 @@ class factory
* *
* @return \phpbb\install\helper\iohandler\iohandler_interface * @return \phpbb\install\helper\iohandler\iohandler_interface
* *
* @throws \phpbb\install\helper\iohandler\exception\iohandler_not_implemented_exception * @throws iohandler_not_implemented_exception
* When the specified iohandler_interface does not exists * When the specified iohandler_interface does not exists
*/ */
public function get() public function get()

View file

@ -137,7 +137,7 @@ class installer
if (!$this->install_config->get('cache_purged_before', false) && $this->purge_cache_before) if (!$this->install_config->get('cache_purged_before', false) && $this->purge_cache_before)
{ {
/** @var \phpbb\cache\driver\driver_interface $cache */ /** @var driver_interface $cache */
$cache = $this->container_factory->get('cache.driver'); $cache = $this->container_factory->get('cache.driver');
$cache->purge(); $cache->purge();
$this->install_config->set('cache_purged_before', true); $this->install_config->set('cache_purged_before', true);
@ -311,7 +311,7 @@ class installer
try try
{ {
/** @var \phpbb\cache\driver\driver_interface $cache */ /** @var driver_interface $cache */
$cache = $this->container_factory->get('cache.driver'); $cache = $this->container_factory->get('cache.driver');
$cache->purge(); $cache->purge();
} }

View file

@ -22,7 +22,7 @@ class installer_configuration implements ConfigurationInterface
/** /**
* Generates the configuration tree builder. * Generates the configuration tree builder.
* *
* @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder * @return TreeBuilder The tree builder
*/ */
public function getConfigTreeBuilder() public function getConfigTreeBuilder()
{ {

View file

@ -36,7 +36,7 @@ class notify_user extends \phpbb\install\task_base
protected $auth; protected $auth;
/** /**
* @var \phpbb\config\db * @var db
*/ */
protected $config; protected $config;

View file

@ -91,7 +91,7 @@ class obtain_admin_data extends \phpbb\install\task_base implements \phpbb\insta
* *
* @param bool $use_request_data Whether to use submited data * @param bool $use_request_data Whether to use submited data
* *
* @throws \phpbb\install\exception\user_interaction_required_exception When the user is required to provide data * @throws user_interaction_required_exception When the user is required to provide data
*/ */
protected function request_form_data($use_request_data = false) protected function request_form_data($use_request_data = false)
{ {

View file

@ -110,7 +110,7 @@ class obtain_board_data extends \phpbb\install\task_base implements \phpbb\insta
* *
* @param bool $use_request_data Whether to use submited data * @param bool $use_request_data Whether to use submited data
* *
* @throws \phpbb\install\exception\user_interaction_required_exception When the user is required to provide data * @throws user_interaction_required_exception When the user is required to provide data
*/ */
protected function request_form_data($use_request_data = false) protected function request_form_data($use_request_data = false)
{ {

View file

@ -108,7 +108,7 @@ class obtain_database_data extends \phpbb\install\task_base implements \phpbb\in
* *
* @param bool $use_request_data Whether to use submited data * @param bool $use_request_data Whether to use submited data
* *
* @throws \phpbb\install\exception\user_interaction_required_exception When the user is required to provide data * @throws user_interaction_required_exception When the user is required to provide data
*/ */
protected function request_form_data($use_request_data = false) protected function request_form_data($use_request_data = false)
{ {

View file

@ -28,12 +28,12 @@ class obtain_file_updater_method extends task_base
protected $available_methods; protected $available_methods;
/** /**
* @var \phpbb\install\helper\config * @var config
*/ */
protected $installer_config; protected $installer_config;
/** /**
* @var \phpbb\install\helper\iohandler\iohandler_interface * @var iohandler_interface
*/ */
protected $iohandler; protected $iohandler;

View file

@ -22,12 +22,12 @@ use phpbb\install\task_base;
class obtain_update_ftp_data extends task_base class obtain_update_ftp_data extends task_base
{ {
/** /**
* @var \phpbb\install\helper\config * @var config
*/ */
protected $installer_config; protected $installer_config;
/** /**
* @var \phpbb\install\helper\iohandler\iohandler_interface * @var iohandler_interface
*/ */
protected $iohandler; protected $iohandler;

View file

@ -21,12 +21,12 @@ use phpbb\install\task_base;
class obtain_update_settings extends task_base class obtain_update_settings extends task_base
{ {
/** /**
* @var \phpbb\install\helper\config * @var config
*/ */
protected $installer_config; protected $installer_config;
/** /**
* @var \phpbb\install\helper\iohandler\iohandler_interface * @var iohandler_interface
*/ */
protected $iohandler; protected $iohandler;

View file

@ -22,7 +22,7 @@ class updater_configuration implements ConfigurationInterface
/** /**
* Generates the configuration tree builder. * Generates the configuration tree builder.
* *
* @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder * @return TreeBuilder The tree builder
*/ */
public function getConfigTreeBuilder() public function getConfigTreeBuilder()
{ {

View file

@ -399,7 +399,7 @@ class language
* *
* @return int The plural-case we need to use for the number plural-rule combination * @return int The plural-case we need to use for the number plural-rule combination
* *
* @throws \phpbb\language\exception\invalid_plural_rule_exception When $force_rule has an invalid value * @throws invalid_plural_rule_exception When $force_rule has an invalid value
*/ */
public function get_plural_form($number, $force_rule = false) public function get_plural_form($number, $force_rule = false)
{ {

View file

@ -13,7 +13,7 @@
namespace phpbb\language; namespace phpbb\language;
use \phpbb\language\exception\language_file_not_found; use phpbb\language\exception\language_file_not_found;
/** /**
* Language file loader * Language file loader

View file

@ -76,7 +76,7 @@ class module_manager
* *
* @return array Array of data fetched from the database * @return array Array of data fetched from the database
* *
* @throws \phpbb\module\exception\module_not_found_exception When there is no module with $module_id * @throws module_not_found_exception When there is no module with $module_id
*/ */
public function get_module_row($module_id, $module_class) public function get_module_row($module_id, $module_class)
{ {
@ -243,7 +243,7 @@ class module_manager
* *
* @param array &$module_data The module data * @param array &$module_data The module data
* *
* @throws \phpbb\module\exception\module_not_found_exception When parent module or the category is not exist * @throws module_not_found_exception When parent module or the category is not exist
*/ */
public function update_module_data(&$module_data) public function update_module_data(&$module_data)
{ {
@ -340,8 +340,8 @@ class module_manager
* @param int $to_parent_id ID of the target parent module * @param int $to_parent_id ID of the target parent module
* @param string $module_class Class of the module (acp, ucp, mcp etc...) * @param string $module_class Class of the module (acp, ucp, mcp etc...)
* *
* @throws \phpbb\module\exception\module_not_found_exception If the module specified to move modules from does not * @throws module_not_found_exception If the module specified to move modules from does not
* have any children. * have any children.
*/ */
public function move_module($from_module_id, $to_parent_id, $module_class) public function move_module($from_module_id, $to_parent_id, $module_class)
{ {
@ -433,7 +433,7 @@ class module_manager
* @param int $module_id ID of the module to delete * @param int $module_id ID of the module to delete
* @param string $module_class Class of the module (acp, ucp, mcp etc...) * @param string $module_class Class of the module (acp, ucp, mcp etc...)
* *
* @throws \phpbb\module\exception\module_exception When the specified module cannot be removed * @throws module_exception When the specified module cannot be removed
*/ */
public function delete_module($module_id, $module_class) public function delete_module($module_id, $module_class)
{ {
@ -482,7 +482,7 @@ class module_manager
* *
* @return string Returns the language name of the module * @return string Returns the language name of the module
* *
* @throws \phpbb\module\exception\module_not_found_exception When the specified module does not exists * @throws module_not_found_exception When the specified module does not exists
*/ */
public function move_module_by($module_row, $module_class, $action = 'move_up', $steps = 1) public function move_module_by($module_row, $module_class, $action = 'move_up', $steps = 1)
{ {

View file

@ -108,7 +108,7 @@ class email extends \phpbb\notification\method\messenger_base
{ {
$insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, $this->notification_emails_table); $insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, $this->notification_emails_table);
/** @var \phpbb\notification\type\type_interface $notification */ /** @var type_interface $notification */
foreach ($this->queue as $notification) foreach ($this->queue as $notification)
{ {
$data = self::clean_data($notification->get_insert_array()); $data = self::clean_data($notification->get_insert_array());

View file

@ -97,7 +97,7 @@ abstract class messenger_base extends \phpbb\notification\method\base
$messenger = new \messenger(); $messenger = new \messenger();
// Time to go through the queue and send emails // Time to go through the queue and send emails
/** @var \phpbb\notification\type\type_interface $notification */ /** @var type_interface $notification */
foreach ($this->queue as $notification) foreach ($this->queue as $notification)
{ {
if ($notification->get_email_template() === false) if ($notification->get_email_template() === false)

View file

@ -92,7 +92,7 @@ class report
* @param int $id ID of the entity to report * @param int $id ID of the entity to report
* @param string $mode * @param string $mode
* @return \Symfony\Component\HttpFoundation\Response a Symfony response object * @return \Symfony\Component\HttpFoundation\Response a Symfony response object
* @throws \phpbb\exception\http_exception when $mode or $id is invalid for some reason * @throws http_exception when $mode or $id is invalid for some reason
*/ */
public function handle($id, $mode) public function handle($id, $mode)
{ {

View file

@ -13,7 +13,7 @@
namespace phpbb\report\exception; namespace phpbb\report\exception;
use \phpbb\exception\runtime_exception; use phpbb\exception\runtime_exception;
class factory_invalid_argument_exception extends runtime_exception class factory_invalid_argument_exception extends runtime_exception
{ {

View file

@ -13,7 +13,7 @@
namespace phpbb\report\exception; namespace phpbb\report\exception;
use \phpbb\exception\runtime_exception; use phpbb\exception\runtime_exception;
class invalid_report_exception extends runtime_exception class invalid_report_exception extends runtime_exception
{ {

View file

@ -37,7 +37,7 @@ class handler_factory
* *
* @param string $type * @param string $type
* @return \phpbb\report\report_handler_interface * @return \phpbb\report\report_handler_interface
* @throws \phpbb\report\exception\factory_invalid_argument_exception if $type is not valid * @throws factory_invalid_argument_exception if $type is not valid
*/ */
public function get_instance($type) public function get_instance($type)
{ {

View file

@ -55,7 +55,7 @@ abstract class report_handler implements report_handler_interface
* *
* @param \phpbb\db\driver\driver_interface $db * @param \phpbb\db\driver\driver_interface $db
* @param \phpbb\event\dispatcher_interface $dispatcher * @param \phpbb\event\dispatcher_interface $dispatcher
* @param \phpbb\config\db $config * @param \phpbb\config\config $config
* @param \phpbb\auth\auth $auth * @param \phpbb\auth\auth $auth
* @param \phpbb\user $user * @param \phpbb\user $user
* @param \phpbb\notification\manager $notification * @param \phpbb\notification\manager $notification

View file

@ -22,7 +22,7 @@ class report_handler_pm extends report_handler
{ {
/** /**
* {@inheritdoc} * {@inheritdoc}
* @throws \phpbb\report\exception\pm_reporting_disabled_exception when PM reporting is disabled on the board * @throws pm_reporting_disabled_exception when PM reporting is disabled on the board
*/ */
public function add_report($id, $reason_id, $report_text, $user_notify) public function add_report($id, $reason_id, $report_text, $user_notify)
{ {
@ -92,7 +92,7 @@ class report_handler_pm extends report_handler
/** /**
* {@inheritdoc} * {@inheritdoc}
* @throws \phpbb\report\exception\pm_reporting_disabled_exception when PM reporting is disabled on the board * @throws pm_reporting_disabled_exception when PM reporting is disabled on the board
*/ */
public function validate_report_request($id) public function validate_report_request($id)
{ {

View file

@ -28,7 +28,7 @@ class report_handler_post extends report_handler
/** /**
* {@inheritdoc} * {@inheritdoc}
* @throws \phpbb\report\exception\report_permission_denied_exception when the user does not have permission to report the post * @throws report_permission_denied_exception when the user does not have permission to report the post
*/ */
public function add_report($id, $reason_id, $report_text, $user_notify) public function add_report($id, $reason_id, $report_text, $user_notify)
{ {
@ -89,7 +89,7 @@ class report_handler_post extends report_handler
/** /**
* {@inheritdoc} * {@inheritdoc}
* @throws \phpbb\report\exception\report_permission_denied_exception when the user does not have permission to report the post * @throws report_permission_denied_exception when the user does not have permission to report the post
*/ */
public function validate_report_request($id) public function validate_report_request($id)
{ {

View file

@ -129,7 +129,7 @@ class twig extends \phpbb\template\base
* *
* @return array Style tree, most specific first * @return array Style tree, most specific first
* *
* @throws \phpbb\template\exception\user_object_not_available When user service was not set * @throws user_object_not_available When user service was not set
*/ */
public function get_user_style() public function get_user_style()
{ {

View file

@ -25,7 +25,7 @@ class bbcode_merger
protected $configurator; protected $configurator;
/** /**
* @param \phpbb\textformatter\s9e\factory $factory * @param factory $factory
*/ */
public function __construct(factory $factory) public function __construct(factory $factory)
{ {

View file

@ -207,7 +207,7 @@ class factory implements \phpbb\textformatter\cache_interface
* Modify the s9e\TextFormatter configurator before the default settings are set * Modify the s9e\TextFormatter configurator before the default settings are set
* *
* @event core.text_formatter_s9e_configure_before * @event core.text_formatter_s9e_configure_before
* @var \s9e\TextFormatter\Configurator configurator Configurator instance * @var Configurator configurator Configurator instance
* @since 3.2.0-a1 * @since 3.2.0-a1
*/ */
$vars = array('configurator'); $vars = array('configurator');
@ -368,7 +368,7 @@ class factory implements \phpbb\textformatter\cache_interface
* Modify the s9e\TextFormatter configurator after the default settings are set * Modify the s9e\TextFormatter configurator after the default settings are set
* *
* @event core.text_formatter_s9e_configure_after * @event core.text_formatter_s9e_configure_after
* @var \s9e\TextFormatter\Configurator configurator Configurator instance * @var Configurator configurator Configurator instance
* @since 3.2.0-a1 * @since 3.2.0-a1
*/ */
$vars = array('configurator'); $vars = array('configurator');
@ -446,7 +446,7 @@ class factory implements \phpbb\textformatter\cache_interface
/** /**
* Configure the Autolink / Autoemail plugins used to linkify text * Configure the Autolink / Autoemail plugins used to linkify text
* *
* @param \s9e\TextFormatter\Configurator $configurator * @param Configurator $configurator
* @return void * @return void
*/ */
protected function configure_autolink(Configurator $configurator) protected function configure_autolink(Configurator $configurator)