mirror of
https://github.com/phpbb/phpbb.git
synced 2025-03-20 07:30:16 +01:00
Merge pull request #6171 from CHItA/ticket/16736
[ticket/16736] Fix static declarations on master
This commit is contained in:
commit
26285e2310
phpBB/phpbb
@ -15,7 +15,7 @@ namespace phpbb\composer\io;
|
||||
|
||||
class html_output_formatter extends \Composer\Console\HtmlOutputFormatter
|
||||
{
|
||||
protected static $availableForegroundColors = [
|
||||
static protected $availableForegroundColors = [
|
||||
30 => 'black',
|
||||
31 => 'red',
|
||||
32 => 'green',
|
||||
@ -26,7 +26,7 @@ class html_output_formatter extends \Composer\Console\HtmlOutputFormatter
|
||||
37 => 'white',
|
||||
];
|
||||
|
||||
protected static $availableBackgroundColors = [
|
||||
static protected $availableBackgroundColors = [
|
||||
40 => 'black',
|
||||
41 => 'red',
|
||||
42 => 'green',
|
||||
@ -37,7 +37,7 @@ class html_output_formatter extends \Composer\Console\HtmlOutputFormatter
|
||||
47 => 'white',
|
||||
];
|
||||
|
||||
protected static $availableOptions
|
||||
static protected $availableOptions
|
||||
= [
|
||||
1 => 'bold',
|
||||
4 => 'underscore',
|
||||
|
@ -121,7 +121,7 @@ class config_php_file
|
||||
* @return string driver class
|
||||
* @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
|
||||
// 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 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');
|
||||
$host = $config->get('dbhost');
|
||||
@ -71,7 +71,7 @@ class connection_factory
|
||||
* @throws runtime_exception If the database connection could not be established.
|
||||
* @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 $host,
|
||||
?string $user = null,
|
||||
|
@ -34,7 +34,7 @@ class connection_parameter_factory
|
||||
*
|
||||
* @throws InvalidArgumentException If a required parameter is empty or null.
|
||||
*/
|
||||
public static function get_configuration(
|
||||
static public function get_configuration(
|
||||
string $driver,
|
||||
string $host,
|
||||
?string $user = null,
|
||||
@ -70,7 +70,7 @@ class connection_parameter_factory
|
||||
*
|
||||
* @throws InvalidArgumentException If a required parameter is empty or null.
|
||||
*/
|
||||
private static function build_connection_parameters(
|
||||
static private function build_connection_parameters(
|
||||
array $params,
|
||||
string $host,
|
||||
?string $user = null,
|
||||
@ -119,7 +119,7 @@ class connection_parameter_factory
|
||||
*
|
||||
* @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;
|
||||
|
||||
@ -143,7 +143,7 @@ class connection_parameter_factory
|
||||
*
|
||||
* @return array The enriched parameter list.
|
||||
*/
|
||||
private static function enrich_parameters(array $params) : array
|
||||
static private function enrich_parameters(array $params) : array
|
||||
{
|
||||
$enrichment_tags = [
|
||||
'pdo_mysql' => [
|
||||
|
@ -29,7 +29,7 @@ trait driver_convertor
|
||||
*
|
||||
* @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.
|
||||
$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 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;
|
||||
foreach ($data as $key => $change)
|
||||
@ -262,7 +262,7 @@ class schema_generator
|
||||
* @param mixed $schema Reference to the schema entry.
|
||||
* @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;
|
||||
foreach ($data as $key)
|
||||
@ -278,7 +278,7 @@ class schema_generator
|
||||
* @param string $key The column name to add.
|
||||
* @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))
|
||||
{
|
||||
@ -317,7 +317,7 @@ class schema_generator
|
||||
*
|
||||
* @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')
|
||||
{
|
||||
|
@ -20,7 +20,7 @@ class helper
|
||||
/**
|
||||
* @var symfony_filesystem
|
||||
*/
|
||||
protected static $symfony_filesystem;
|
||||
static protected $symfony_filesystem;
|
||||
|
||||
/**
|
||||
* Eliminates useless . and .. components from specified path.
|
||||
@ -29,7 +29,7 @@ class helper
|
||||
*
|
||||
* @return string Cleaned path
|
||||
*/
|
||||
public static function clean_path($path)
|
||||
static public function clean_path($path)
|
||||
{
|
||||
$exploded = explode('/', $path);
|
||||
$filtered = array();
|
||||
@ -60,7 +60,7 @@ class helper
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
@ -71,7 +71,7 @@ class helper
|
||||
* @param string $path
|
||||
* @return bool|string
|
||||
*/
|
||||
protected static function phpbb_own_realpath($path)
|
||||
static protected function phpbb_own_realpath($path)
|
||||
{
|
||||
// Replace all directory separators with '/'
|
||||
$path = str_replace(DIRECTORY_SEPARATOR, '/', $path);
|
||||
@ -177,7 +177,7 @@ class helper
|
||||
*
|
||||
* @return string Resolved path
|
||||
*/
|
||||
public static function realpath($path)
|
||||
static public function realpath($path)
|
||||
{
|
||||
if (!function_exists('realpath'))
|
||||
{
|
||||
@ -210,7 +210,7 @@ class helper
|
||||
*
|
||||
* @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
|
||||
// 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
|
||||
* 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)
|
||||
{
|
||||
@ -385,7 +385,7 @@ class helper
|
||||
*
|
||||
* @return symfony_filesystem Symfony filesystem
|
||||
*/
|
||||
protected static function get_symfony_filesystem()
|
||||
static protected function get_symfony_filesystem()
|
||||
{
|
||||
if (self::$symfony_filesystem === null)
|
||||
{
|
||||
|
@ -187,7 +187,7 @@ abstract class database_task extends task_base
|
||||
*
|
||||
* @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 = $dbms[$config->get('dbms')]['DRIVER'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user