mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/16736] Fix static declarations on master
PHPBB3-16736
This commit is contained in:
parent
46d2a93ae6
commit
4737da3ec7
8 changed files with 24 additions and 24 deletions
|
@ -15,7 +15,7 @@ namespace phpbb\composer\io;
|
||||||
|
|
||||||
class html_output_formatter extends \Composer\Console\HtmlOutputFormatter
|
class html_output_formatter extends \Composer\Console\HtmlOutputFormatter
|
||||||
{
|
{
|
||||||
protected static $availableForegroundColors = [
|
static protected $availableForegroundColors = [
|
||||||
30 => 'black',
|
30 => 'black',
|
||||||
31 => 'red',
|
31 => 'red',
|
||||||
32 => 'green',
|
32 => 'green',
|
||||||
|
@ -26,7 +26,7 @@ class html_output_formatter extends \Composer\Console\HtmlOutputFormatter
|
||||||
37 => 'white',
|
37 => 'white',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected static $availableBackgroundColors = [
|
static protected $availableBackgroundColors = [
|
||||||
40 => 'black',
|
40 => 'black',
|
||||||
41 => 'red',
|
41 => 'red',
|
||||||
42 => 'green',
|
42 => 'green',
|
||||||
|
@ -37,7 +37,7 @@ class html_output_formatter extends \Composer\Console\HtmlOutputFormatter
|
||||||
47 => 'white',
|
47 => 'white',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected static $availableOptions
|
static protected $availableOptions
|
||||||
= [
|
= [
|
||||||
1 => 'bold',
|
1 => 'bold',
|
||||||
4 => 'underscore',
|
4 => 'underscore',
|
||||||
|
|
|
@ -121,7 +121,7 @@ class config_php_file
|
||||||
* @return string driver class
|
* @return string driver class
|
||||||
* @throws \RuntimeException
|
* @throws \RuntimeException
|
||||||
*/
|
*/
|
||||||
public static function convert_30_dbms_to_31($dbms)
|
static public function convert_30_dbms_to_31($dbms)
|
||||||
{
|
{
|
||||||
// Note: this check is done first because mysqli extension
|
// Note: this check is done first because mysqli extension
|
||||||
// supplies a mysqli class, and class_exists($dbms) would return
|
// supplies a mysqli class, and class_exists($dbms) would return
|
||||||
|
|
|
@ -37,7 +37,7 @@ class connection_factory
|
||||||
* @throws runtime_exception If the database connection could not be established.
|
* @throws runtime_exception If the database connection could not be established.
|
||||||
* @throws InvalidArgumentException If the provided driver name is not a valid phpBB database driver.
|
* @throws InvalidArgumentException If the provided driver name is not a valid phpBB database driver.
|
||||||
*/
|
*/
|
||||||
public static function get_connection(config_php_file $config) : Connection
|
static public function get_connection(config_php_file $config) : Connection
|
||||||
{
|
{
|
||||||
$driver = $config->get('dbms');
|
$driver = $config->get('dbms');
|
||||||
$host = $config->get('dbhost');
|
$host = $config->get('dbhost');
|
||||||
|
@ -71,7 +71,7 @@ class connection_factory
|
||||||
* @throws runtime_exception If the database connection could not be established.
|
* @throws runtime_exception If the database connection could not be established.
|
||||||
* @throws InvalidArgumentException If $driver is not a valid phpBB database driver.
|
* @throws InvalidArgumentException If $driver is not a valid phpBB database driver.
|
||||||
*/
|
*/
|
||||||
public static function get_connection_from_params(
|
static public function get_connection_from_params(
|
||||||
string $driver,
|
string $driver,
|
||||||
string $host,
|
string $host,
|
||||||
?string $user = null,
|
?string $user = null,
|
||||||
|
|
|
@ -34,7 +34,7 @@ class connection_parameter_factory
|
||||||
*
|
*
|
||||||
* @throws InvalidArgumentException If a required parameter is empty or null.
|
* @throws InvalidArgumentException If a required parameter is empty or null.
|
||||||
*/
|
*/
|
||||||
public static function get_configuration(
|
static public function get_configuration(
|
||||||
string $driver,
|
string $driver,
|
||||||
string $host,
|
string $host,
|
||||||
?string $user = null,
|
?string $user = null,
|
||||||
|
@ -70,7 +70,7 @@ class connection_parameter_factory
|
||||||
*
|
*
|
||||||
* @throws InvalidArgumentException If a required parameter is empty or null.
|
* @throws InvalidArgumentException If a required parameter is empty or null.
|
||||||
*/
|
*/
|
||||||
private static function build_connection_parameters(
|
static private function build_connection_parameters(
|
||||||
array $params,
|
array $params,
|
||||||
string $host,
|
string $host,
|
||||||
?string $user = null,
|
?string $user = null,
|
||||||
|
@ -119,7 +119,7 @@ class connection_parameter_factory
|
||||||
*
|
*
|
||||||
* @return array Doctrine's DBAL configuration for SQLite.
|
* @return array Doctrine's DBAL configuration for SQLite.
|
||||||
*/
|
*/
|
||||||
private static function build_sqlite_parameters(array $params, string $path, ?string $user, ?string $password) : array
|
static private function build_sqlite_parameters(array $params, string $path, ?string $user, ?string $password) : array
|
||||||
{
|
{
|
||||||
$params['path'] = $path;
|
$params['path'] = $path;
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ class connection_parameter_factory
|
||||||
*
|
*
|
||||||
* @return array The enriched parameter list.
|
* @return array The enriched parameter list.
|
||||||
*/
|
*/
|
||||||
private static function enrich_parameters(array $params) : array
|
static private function enrich_parameters(array $params) : array
|
||||||
{
|
{
|
||||||
$enrichment_tags = [
|
$enrichment_tags = [
|
||||||
'pdo_mysql' => [
|
'pdo_mysql' => [
|
||||||
|
|
|
@ -29,7 +29,7 @@ trait driver_convertor
|
||||||
*
|
*
|
||||||
* @throws InvalidArgumentException If $driver_name is not a valid phpBB database driver.
|
* @throws InvalidArgumentException If $driver_name is not a valid phpBB database driver.
|
||||||
*/
|
*/
|
||||||
public static function to_doctrine_driver(string $driver_name) : string
|
static public function to_doctrine_driver(string $driver_name) : string
|
||||||
{
|
{
|
||||||
// Normalize driver name.
|
// Normalize driver name.
|
||||||
$name = str_replace('phpbb\db\driver', '', $driver_name);
|
$name = str_replace('phpbb\db\driver', '', $driver_name);
|
||||||
|
|
|
@ -240,7 +240,7 @@ class schema_generator
|
||||||
* @param mixed $data Array of values to be set.
|
* @param mixed $data Array of values to be set.
|
||||||
* @param callable|null $value_transform Callback to transform the value being set.
|
* @param callable|null $value_transform Callback to transform the value being set.
|
||||||
*/
|
*/
|
||||||
private static function set_all(&$schema, $data, ?callable $value_transform = null)
|
static private function set_all(&$schema, $data, ?callable $value_transform = null)
|
||||||
{
|
{
|
||||||
$data = (!is_array($data)) ? [$data] : $data;
|
$data = (!is_array($data)) ? [$data] : $data;
|
||||||
foreach ($data as $key => $change)
|
foreach ($data as $key => $change)
|
||||||
|
@ -262,7 +262,7 @@ class schema_generator
|
||||||
* @param mixed $schema Reference to the schema entry.
|
* @param mixed $schema Reference to the schema entry.
|
||||||
* @param mixed $data Array of values to be removed.
|
* @param mixed $data Array of values to be removed.
|
||||||
*/
|
*/
|
||||||
private static function unset_all(&$schema, $data)
|
static private function unset_all(&$schema, $data)
|
||||||
{
|
{
|
||||||
$data = (!is_array($data)) ? [$data] : $data;
|
$data = (!is_array($data)) ? [$data] : $data;
|
||||||
foreach ($data as $key)
|
foreach ($data as $key)
|
||||||
|
@ -278,7 +278,7 @@ class schema_generator
|
||||||
* @param string $key The column name to add.
|
* @param string $key The column name to add.
|
||||||
* @param array $change The column data.
|
* @param array $change The column data.
|
||||||
*/
|
*/
|
||||||
private static function handle_add_column(array &$value, string $key, array $change)
|
static private function handle_add_column(array &$value, string $key, array $change)
|
||||||
{
|
{
|
||||||
if (!array_key_exists('after', $change))
|
if (!array_key_exists('after', $change))
|
||||||
{
|
{
|
||||||
|
@ -317,7 +317,7 @@ class schema_generator
|
||||||
*
|
*
|
||||||
* @return Closure|null The value transformation callback or null if it is not needed.
|
* @return Closure|null The value transformation callback or null if it is not needed.
|
||||||
*/
|
*/
|
||||||
private static function get_value_transform(string $change_type, string $schema_type) : ?Closure
|
static private function get_value_transform(string $change_type, string $schema_type) : ?Closure
|
||||||
{
|
{
|
||||||
if ($change_type !== 'add')
|
if ($change_type !== 'add')
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,7 +20,7 @@ class helper
|
||||||
/**
|
/**
|
||||||
* @var symfony_filesystem
|
* @var symfony_filesystem
|
||||||
*/
|
*/
|
||||||
protected static $symfony_filesystem;
|
static protected $symfony_filesystem;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Eliminates useless . and .. components from specified path.
|
* Eliminates useless . and .. components from specified path.
|
||||||
|
@ -29,7 +29,7 @@ class helper
|
||||||
*
|
*
|
||||||
* @return string Cleaned path
|
* @return string Cleaned path
|
||||||
*/
|
*/
|
||||||
public static function clean_path($path)
|
static public function clean_path($path)
|
||||||
{
|
{
|
||||||
$exploded = explode('/', $path);
|
$exploded = explode('/', $path);
|
||||||
$filtered = array();
|
$filtered = array();
|
||||||
|
@ -60,7 +60,7 @@ class helper
|
||||||
*
|
*
|
||||||
* @return bool true if the path is absolute, false otherwise
|
* @return bool true if the path is absolute, false otherwise
|
||||||
*/
|
*/
|
||||||
public static function is_absolute_path($path)
|
static public function is_absolute_path($path)
|
||||||
{
|
{
|
||||||
return (isset($path[0]) && $path[0] === '/' || preg_match('#^[a-z]:[/\\\]#i', $path)) ? true : false;
|
return (isset($path[0]) && $path[0] === '/' || preg_match('#^[a-z]:[/\\\]#i', $path)) ? true : false;
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ class helper
|
||||||
* @param string $path
|
* @param string $path
|
||||||
* @return bool|string
|
* @return bool|string
|
||||||
*/
|
*/
|
||||||
protected static function phpbb_own_realpath($path)
|
static protected function phpbb_own_realpath($path)
|
||||||
{
|
{
|
||||||
// Replace all directory separators with '/'
|
// Replace all directory separators with '/'
|
||||||
$path = str_replace(DIRECTORY_SEPARATOR, '/', $path);
|
$path = str_replace(DIRECTORY_SEPARATOR, '/', $path);
|
||||||
|
@ -177,7 +177,7 @@ class helper
|
||||||
*
|
*
|
||||||
* @return string Resolved path
|
* @return string Resolved path
|
||||||
*/
|
*/
|
||||||
public static function realpath($path)
|
static public function realpath($path)
|
||||||
{
|
{
|
||||||
if (!function_exists('realpath'))
|
if (!function_exists('realpath'))
|
||||||
{
|
{
|
||||||
|
@ -210,7 +210,7 @@ class helper
|
||||||
*
|
*
|
||||||
* @return string Path of target relative to starting path
|
* @return string Path of target relative to starting path
|
||||||
*/
|
*/
|
||||||
public static function make_path_relative($end_path, $start_path)
|
static public function make_path_relative($end_path, $start_path)
|
||||||
{
|
{
|
||||||
// Ensure paths are absolute as passing relative paths to the
|
// Ensure paths are absolute as passing relative paths to the
|
||||||
// Symsony's Filesystem::makePathRelative() method is removed since Symfony 4.0
|
// Symsony's Filesystem::makePathRelative() method is removed since Symfony 4.0
|
||||||
|
@ -238,7 +238,7 @@ class helper
|
||||||
* @return string|array|bool returns the resolved path or an array of parts of the path if $return_array is true
|
* @return string|array|bool returns the resolved path or an array of parts of the path if $return_array is true
|
||||||
* or false if path cannot be resolved
|
* or false if path cannot be resolved
|
||||||
*/
|
*/
|
||||||
public static function resolve_path($path, $prefix = '', $absolute = false, $return_array = false)
|
static public function resolve_path($path, $prefix = '', $absolute = false, $return_array = false)
|
||||||
{
|
{
|
||||||
if ($return_array)
|
if ($return_array)
|
||||||
{
|
{
|
||||||
|
@ -385,7 +385,7 @@ class helper
|
||||||
*
|
*
|
||||||
* @return symfony_filesystem Symfony filesystem
|
* @return symfony_filesystem Symfony filesystem
|
||||||
*/
|
*/
|
||||||
protected static function get_symfony_filesystem()
|
static protected function get_symfony_filesystem()
|
||||||
{
|
{
|
||||||
if (self::$symfony_filesystem === null)
|
if (self::$symfony_filesystem === null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -187,7 +187,7 @@ abstract class database_task extends task_base
|
||||||
*
|
*
|
||||||
* @return Connection Doctrine DBAL connection object.
|
* @return Connection Doctrine DBAL connection object.
|
||||||
*/
|
*/
|
||||||
protected static function get_doctrine_connection(database $db_helper, config $config) : Connection
|
static protected function get_doctrine_connection(database $db_helper, config $config) : Connection
|
||||||
{
|
{
|
||||||
$dbms = $db_helper->get_available_dbms($config->get('dbms'));
|
$dbms = $db_helper->get_available_dbms($config->get('dbms'));
|
||||||
$dbms = $dbms[$config->get('dbms')]['DRIVER'];
|
$dbms = $dbms[$config->get('dbms')]['DRIVER'];
|
||||||
|
|
Loading…
Add table
Reference in a new issue