diff options
Diffstat (limited to 'phpBB/phpbb')
24 files changed, 59 insertions, 50 deletions
| diff --git a/phpBB/phpbb/auth/provider/ldap.php b/phpBB/phpbb/auth/provider/ldap.php index 9d29789567..2123a587cb 100644 --- a/phpBB/phpbb/auth/provider/ldap.php +++ b/phpBB/phpbb/auth/provider/ldap.php @@ -97,7 +97,6 @@ class ldap extends \phpbb\auth\provider\base  		@ldap_close($ldap); -  		if (!is_array($result) || sizeof($result) < 2)  		{  			return sprintf($this->user->lang['LDAP_NO_IDENTITY'], $this->user->data['username']); diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php index de81ac0d04..5df56db00a 100644 --- a/phpBB/phpbb/auth/provider/oauth/oauth.php +++ b/phpBB/phpbb/auth/provider/oauth/oauth.php @@ -179,7 +179,7 @@ class oauth extends \phpbb\auth\provider\base  		$storage = new \phpbb\auth\provider\oauth\token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table);  		$query = 'mode=login&login=external&oauth_service=' . $service_name_original; -		$service = $this->get_service($service_name_original, $storage, $service_credentials, $this->service_providers[$service_name]->get_auth_scope(), $query); +		$service = $this->get_service($service_name_original, $storage, $service_credentials, $query, $this->service_providers[$service_name]->get_auth_scope());  		if ($this->request->is_set('code', \phpbb\request\request_interface::GET))  		{ @@ -273,13 +273,13 @@ class oauth extends \phpbb\auth\provider\base  	* @param	string	$service_name			The name of the service  	* @param	\phpbb\auth\provider\oauth\token_storage $storage  	* @param	array	$service_credentials	{@see \phpbb\auth\provider\oauth\oauth::get_service_credentials} -	* @param	array	$scope					The scope of the request against -	*											the api.  	* @param	string	$query					The query string of the  	*											current_uri used in redirection +	* @param	array	$scope					The scope of the request against +	*											the api.  	* @return	\OAuth\Common\Service\ServiceInterface  	*/ -	protected function get_service($service_name, \phpbb\auth\provider\oauth\token_storage $storage, array $service_credentials, array $scopes = array(), $query) +	protected function get_service($service_name, \phpbb\auth\provider\oauth\token_storage $storage, array $service_credentials, $query, array $scopes = array())  	{  		$current_uri = $this->get_current_uri($service_name, $query); @@ -458,7 +458,7 @@ class oauth extends \phpbb\auth\provider\base  		// Prepare for an authentication request  		$service_credentials = $this->service_providers[$service_name]->get_service_credentials();  		$scopes = $this->service_providers[$service_name]->get_auth_scope(); -		$service = $this->get_service(strtolower($link_data['oauth_service']), $storage, $service_credentials, $scopes, $query); +		$service = $this->get_service(strtolower($link_data['oauth_service']), $storage, $service_credentials, $query, $scopes);  		$this->service_providers[$service_name]->set_external_service_provider($service);  		// The user has already authenticated successfully, request to authenticate again @@ -491,7 +491,7 @@ class oauth extends \phpbb\auth\provider\base  		$query = 'i=ucp_auth_link&mode=auth_link&link=1&oauth_service=' . strtolower($link_data['oauth_service']);  		$service_credentials = $this->service_providers[$service_name]->get_service_credentials();  		$scopes = $this->service_providers[$service_name]->get_auth_scope(); -		$service = $this->get_service(strtolower($link_data['oauth_service']), $storage, $service_credentials, $scopes, $query); +		$service = $this->get_service(strtolower($link_data['oauth_service']), $storage, $service_credentials, $query, $scopes);  		if ($this->request->is_set('code', \phpbb\request\request_interface::GET))  		{ diff --git a/phpBB/phpbb/auth/provider/oauth/token_storage.php b/phpBB/phpbb/auth/provider/oauth/token_storage.php index 2ce0e32da3..cc912abf6d 100644 --- a/phpBB/phpbb/auth/provider/oauth/token_storage.php +++ b/phpBB/phpbb/auth/provider/oauth/token_storage.php @@ -78,7 +78,7 @@ class token_storage implements TokenStorageInterface  	{  		$service = $this->get_service_name_for_db($service); -		if ($this->cachedToken instanceOf TokenInterface) +		if ($this->cachedToken instanceof TokenInterface)  		{  			return $this->cachedToken;  		} @@ -238,7 +238,7 @@ class token_storage implements TokenStorageInterface  	{  		$service = $this->get_service_name_for_db($service); -		if ($this->cachedToken instanceOf TokenInterface) { +		if ($this->cachedToken instanceof TokenInterface) {  			return $this->cachedToken;  		} diff --git a/phpBB/phpbb/avatar/manager.php b/phpBB/phpbb/avatar/manager.php index c28380a401..7c26bce5ae 100644 --- a/phpBB/phpbb/avatar/manager.php +++ b/phpBB/phpbb/avatar/manager.php @@ -42,12 +42,6 @@ class manager  	protected $avatar_drivers;  	/** -	* Service container object -	* @var object -	*/ -	protected $container; - -	/**  	* Default avatar data row  	* @var array  	*/ @@ -63,13 +57,27 @@ class manager  	*  	* @param \phpbb\config\config $config phpBB configuration  	* @param array $avatar_drivers Avatar drivers passed via the service container -	* @param object $container Container object  	*/ -	public function __construct(\phpbb\config\config $config, $avatar_drivers, $container) +	public function __construct(\phpbb\config\config $config, $avatar_drivers)  	{  		$this->config = $config; -		$this->avatar_drivers = $avatar_drivers; -		$this->container = $container; +		$this->register_avatar_drivers($avatar_drivers); +	} + +	/** +	* Register avatar drivers +	* +	* @param array $avatar_drivers Service collection of avatar drivers +	*/ +	protected function register_avatar_drivers($avatar_drivers) +	{ +		if (!empty($avatar_drivers)) +		{ +			foreach ($avatar_drivers as $driver) +			{ +				$this->avatar_drivers[$driver->get_name()] = $driver; +			} +		}  	}  	/** @@ -112,7 +120,7 @@ class manager  		* There is no need to handle invalid avatar types as the following code  		* will cause a ServiceNotFoundException if the type does not exist  		*/ -		$driver = $this->container->get($avatar_type); +		$driver = $this->avatar_drivers[$avatar_type];  		return $driver;  	} diff --git a/phpBB/phpbb/db/driver/mssql.php b/phpBB/phpbb/db/driver/mssql.php index 50096deded..e1b41461e2 100644 --- a/phpBB/phpbb/db/driver/mssql.php +++ b/phpBB/phpbb/db/driver/mssql.php @@ -259,7 +259,7 @@ class mssql extends \phpbb\db\driver\driver  		{  			foreach ($row as $key => $value)  			{ -				$row[$key] = ($value === ' ' || $value === NULL) ? '' : $value; +				$row[$key] = ($value === ' ' || $value === null) ? '' : $value;  			}  		} diff --git a/phpBB/phpbb/db/driver/mssqlnative.php b/phpBB/phpbb/db/driver/mssqlnative.php index aade311bcb..2eb625fb11 100644 --- a/phpBB/phpbb/db/driver/mssqlnative.php +++ b/phpBB/phpbb/db/driver/mssqlnative.php @@ -195,7 +195,7 @@ class result_mssqlnative  */  class mssqlnative extends \phpbb\db\driver\mssql_base  { -	var $m_insert_id = NULL; +	var $m_insert_id = null;  	var $last_query_text = '';  	var $query_options = array();  	var $connect_error = ''; @@ -427,7 +427,7 @@ class mssqlnative extends \phpbb\db\driver\mssql_base  		{  			foreach ($row as $key => $value)  			{ -				$row[$key] = ($value === ' ' || $value === NULL) ? '' : $value; +				$row[$key] = ($value === ' ' || $value === null) ? '' : $value;  			}  			// remove helper values from LIMIT queries diff --git a/phpBB/phpbb/db/driver/mysqli.php b/phpBB/phpbb/db/driver/mysqli.php index 4d0e43b464..6144dba0c4 100644 --- a/phpBB/phpbb/db/driver/mysqli.php +++ b/phpBB/phpbb/db/driver/mysqli.php @@ -47,11 +47,11 @@ class mysqli extends \phpbb\db\driver\mysql_base  		$this->server = ($this->persistency) ? 'p:' . (($sqlserver) ? $sqlserver : 'localhost') : $sqlserver;  		$this->dbname = $database; -		$port = (!$port) ? NULL : $port; +		$port = (!$port) ? null : $port;  		// If port is set and it is not numeric, most likely mysqli socket is set.  		// Try to map it to the $socket parameter. -		$socket = NULL; +		$socket = null;  		if ($port)  		{  			if (is_numeric($port)) @@ -61,7 +61,7 @@ class mysqli extends \phpbb\db\driver\mysql_base  			else  			{  				$socket = $port; -				$port = NULL; +				$port = null;  			}  		} diff --git a/phpBB/phpbb/db/driver/postgres.php b/phpBB/phpbb/db/driver/postgres.php index 9cbb1ecb07..5cd6578d87 100644 --- a/phpBB/phpbb/db/driver/postgres.php +++ b/phpBB/phpbb/db/driver/postgres.php @@ -328,7 +328,7 @@ class postgres extends \phpbb\db\driver\driver  					return false;  				} -				$temp_result = @pg_fetch_assoc($temp_q_id, NULL); +				$temp_result = @pg_fetch_assoc($temp_q_id, null);  				@pg_free_result($query_id);  				return ($temp_result) ? $temp_result['last_value'] : false; @@ -456,7 +456,7 @@ class postgres extends \phpbb\db\driver\driver  					if ($result = @pg_query($this->db_connect_id, "EXPLAIN $explain_query"))  					{ -						while ($row = @pg_fetch_assoc($result, NULL)) +						while ($row = @pg_fetch_assoc($result, null))  						{  							$html_table = $this->sql_report('add_select_row', $query, $html_table, $row);  						} @@ -476,7 +476,7 @@ class postgres extends \phpbb\db\driver\driver  				$endtime = $endtime[0] + $endtime[1];  				$result = @pg_query($this->db_connect_id, $query); -				while ($void = @pg_fetch_assoc($result, NULL)) +				while ($void = @pg_fetch_assoc($result, null))  				{  					// Take the time spent on parsing rows into account  				} diff --git a/phpBB/phpbb/db/migration/data/v310/notifications.php b/phpBB/phpbb/db/migration/data/v310/notifications.php index 10f1392094..61be25bb5f 100644 --- a/phpBB/phpbb/db/migration/data/v310/notifications.php +++ b/phpBB/phpbb/db/migration/data/v310/notifications.php @@ -34,7 +34,7 @@ class notifications extends \phpbb\db\migration\migration  				),  				$this->table_prefix . 'notifications'		=> array(  					'COLUMNS'			=> array( -						'notification_id'  				=> array('UINT', NULL, 'auto_increment'), +						'notification_id'  				=> array('UINT', null, 'auto_increment'),  						'item_type'			   			=> array('VCHAR:255', ''),  						'item_id'		  				=> array('UINT', 0),  						'item_parent_id'   				=> array('UINT', 0), diff --git a/phpBB/phpbb/db/migration/data/v310/notifications_schema_fix.php b/phpBB/phpbb/db/migration/data/v310/notifications_schema_fix.php index 8ed626d8a6..eb2eb361ee 100644 --- a/phpBB/phpbb/db/migration/data/v310/notifications_schema_fix.php +++ b/phpBB/phpbb/db/migration/data/v310/notifications_schema_fix.php @@ -26,7 +26,7 @@ class notifications_schema_fix extends \phpbb\db\migration\migration  			'add_tables'		=> array(  				$this->table_prefix . 'notification_types'	=> array(  					'COLUMNS'			=> array( -						'notification_type_id'		=> array('USINT', NULL, 'auto_increment'), +						'notification_type_id'		=> array('USINT', null, 'auto_increment'),  						'notification_type_name'	=> array('VCHAR:255', ''),  						'notification_type_enabled'	=> array('BOOL', 1),  					), @@ -37,7 +37,7 @@ class notifications_schema_fix extends \phpbb\db\migration\migration  				),  				$this->table_prefix . 'notifications'		=> array(  					'COLUMNS'			=> array( -						'notification_id'				=> array('UINT:10', NULL, 'auto_increment'), +						'notification_id'				=> array('UINT:10', null, 'auto_increment'),  						'notification_type_id'			=> array('USINT', 0),  						'item_id'						=> array('UINT', 0),  						'item_parent_id'				=> array('UINT', 0), @@ -73,7 +73,7 @@ class notifications_schema_fix extends \phpbb\db\migration\migration  				),  				$this->table_prefix . 'notifications'		=> array(  					'COLUMNS'			=> array( -						'notification_id'  				=> array('UINT', NULL, 'auto_increment'), +						'notification_id'  				=> array('UINT', null, 'auto_increment'),  						'item_type'			   			=> array('VCHAR:255', ''),  						'item_id'		  				=> array('UINT', 0),  						'item_parent_id'   				=> array('UINT', 0), diff --git a/phpBB/phpbb/db/migration/data/v310/style_update_p2.php b/phpBB/phpbb/db/migration/data/v310/style_update_p2.php index 202a8409fb..c5b45d9dc9 100644 --- a/phpBB/phpbb/db/migration/data/v310/style_update_p2.php +++ b/phpBB/phpbb/db/migration/data/v310/style_update_p2.php @@ -56,7 +56,7 @@ class style_update_p2 extends \phpbb\db\migration\migration  			'add_tables'	=> array(  				$this->table_prefix . 'styles_imageset'		=> array(  					'COLUMNS'		=> array( -						'imageset_id'				=> array('UINT', NULL, 'auto_increment'), +						'imageset_id'				=> array('UINT', null, 'auto_increment'),  						'imageset_name'				=> array('VCHAR_UNI:255', ''),  						'imageset_copyright'		=> array('VCHAR_UNI', ''),  						'imageset_path'				=> array('VCHAR:100', ''), @@ -68,7 +68,7 @@ class style_update_p2 extends \phpbb\db\migration\migration  				),  				$this->table_prefix . 'styles_imageset_data'	=> array(  					'COLUMNS'		=> array( -						'image_id'				=> array('UINT', NULL, 'auto_increment'), +						'image_id'				=> array('UINT', null, 'auto_increment'),  						'image_name'			=> array('VCHAR:200', ''),  						'image_filename'		=> array('VCHAR:200', ''),  						'image_lang'			=> array('VCHAR:30', ''), @@ -83,7 +83,7 @@ class style_update_p2 extends \phpbb\db\migration\migration  				),  				$this->table_prefix . 'styles_template'		=> array(  					'COLUMNS'		=> array( -						'template_id'			=> array('UINT', NULL, 'auto_increment'), +						'template_id'			=> array('UINT', null, 'auto_increment'),  						'template_name'			=> array('VCHAR_UNI:255', ''),  						'template_copyright'	=> array('VCHAR_UNI', ''),  						'template_path'			=> array('VCHAR:100', ''), @@ -112,7 +112,7 @@ class style_update_p2 extends \phpbb\db\migration\migration  				),  				$this->table_prefix . 'styles_theme'			=> array(  					'COLUMNS'		=> array( -						'theme_id'				=> array('UINT', NULL, 'auto_increment'), +						'theme_id'				=> array('UINT', null, 'auto_increment'),  						'theme_name'			=> array('VCHAR_UNI:255', ''),  						'theme_copyright'		=> array('VCHAR_UNI', ''),  						'theme_path'			=> array('VCHAR:100', ''), diff --git a/phpBB/phpbb/db/migration/data/v310/teampage.php b/phpBB/phpbb/db/migration/data/v310/teampage.php index 80cc4be1c0..172435c672 100644 --- a/phpBB/phpbb/db/migration/data/v310/teampage.php +++ b/phpBB/phpbb/db/migration/data/v310/teampage.php @@ -27,7 +27,7 @@ class teampage extends \phpbb\db\migration\migration  			'add_tables'		=> array(  				$this->table_prefix . 'teampage'	=> array(  					'COLUMNS'		=> array( -						'teampage_id'		=> array('UINT', NULL, 'auto_increment'), +						'teampage_id'		=> array('UINT', null, 'auto_increment'),  						'group_id'			=> array('UINT', 0),  						'teampage_name'		=> array('VCHAR_UNI:255', ''),  						'teampage_position'	=> array('UINT', 0), diff --git a/phpBB/phpbb/db/tools.php b/phpBB/phpbb/db/tools.php index 1f156fbb04..d9bd8cf568 100644 --- a/phpBB/phpbb/db/tools.php +++ b/phpBB/phpbb/db/tools.php @@ -33,7 +33,7 @@ class tools  	/**  	* @var object DB object  	*/ -	var $db = NULL; +	var $db = null;  	/**  	* The Column types for every database we support diff --git a/phpBB/phpbb/event/kernel_exception_subscriber.php b/phpBB/phpbb/event/kernel_exception_subscriber.php index 09103680e8..7003e73b38 100644 --- a/phpBB/phpbb/event/kernel_exception_subscriber.php +++ b/phpBB/phpbb/event/kernel_exception_subscriber.php @@ -72,7 +72,6 @@ class kernel_exception_subscriber implements EventSubscriberInterface  		page_footer(true, false, false); -  		$status_code = $exception instanceof HttpException ? $exception->getStatusCode() : 500;  		$response = new Response($this->template->assign_display('body'), $status_code);  		$event->setResponse($response); diff --git a/phpBB/phpbb/extension/manager.php b/phpBB/phpbb/extension/manager.php index ce6d7e05c8..f8beb963ba 100644 --- a/phpBB/phpbb/extension/manager.php +++ b/phpBB/phpbb/extension/manager.php @@ -234,7 +234,9 @@ class manager  	*/  	public function enable($name)  	{ +		// @codingStandardsIgnoreStart  		while ($this->enable_step($name)); +		// @codingStandardsIgnoreEnd  	}  	/** @@ -311,7 +313,9 @@ class manager  	*/  	public function disable($name)  	{ +		// @codingStandardsIgnoreStart  		while ($this->disable_step($name)); +		// @codingStandardsIgnoreEnd  	}  	/** @@ -388,7 +392,9 @@ class manager  	*/  	public function purge($name)  	{ +		// @codingStandardsIgnoreStart  		while ($this->purge_step($name)); +		// @codingStandardsIgnoreEnd  	}  	/** diff --git a/phpBB/phpbb/extension/metadata_manager.php b/phpBB/phpbb/extension/metadata_manager.php index 19c6288e96..ff5d55c7f2 100644 --- a/phpBB/phpbb/extension/metadata_manager.php +++ b/phpBB/phpbb/extension/metadata_manager.php @@ -169,7 +169,7 @@ class metadata_manager      			throw new \phpbb\extension\exception('file_get_contents failed on ' . $this->metadata_file);  			} -			if (($metadata = json_decode($file_contents, true)) === NULL) +			if (($metadata = json_decode($file_contents, true)) === null)  			{      			throw new \phpbb\extension\exception('json_decode failed on ' . $this->metadata_file);  			} diff --git a/phpBB/phpbb/feed/base.php b/phpBB/phpbb/feed/base.php index de7dd41df4..8245b849a1 100644 --- a/phpBB/phpbb/feed/base.php +++ b/phpBB/phpbb/feed/base.php @@ -150,7 +150,7 @@ abstract class base  	*/  	function get($key)  	{ -		return (isset($this->keys[$key])) ? $this->keys[$key] : NULL; +		return (isset($this->keys[$key])) ? $this->keys[$key] : null;  	}  	function get_readable_forums() diff --git a/phpBB/phpbb/notification/type/approve_topic.php b/phpBB/phpbb/notification/type/approve_topic.php index ca5bb67754..9f061b8be1 100644 --- a/phpBB/phpbb/notification/type/approve_topic.php +++ b/phpBB/phpbb/notification/type/approve_topic.php @@ -34,7 +34,7 @@ class approve_topic extends \phpbb\notification\type\topic  	{  		return 'approve_topic';  	} -	 +  	/**  	* Language key used to output the text  	* diff --git a/phpBB/phpbb/search/fulltext_native.php b/phpBB/phpbb/search/fulltext_native.php index 33326f2882..024b8f441b 100644 --- a/phpBB/phpbb/search/fulltext_native.php +++ b/phpBB/phpbb/search/fulltext_native.php @@ -850,7 +850,6 @@ class fulltext_native extends \phpbb\search\base  		}  		$this->db->sql_freeresult($result); -  		// if we use mysql and the total result count is not cached yet, retrieve it from the db  		if (!$total_results && $is_mysql)  		{ diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php index 5e4380bfc8..214ab8fd33 100644 --- a/phpBB/phpbb/session.php +++ b/phpBB/phpbb/session.php @@ -1235,7 +1235,6 @@ class session  				$this->session_create(ANONYMOUS);  			} -  			// Determine which message to output  			$till_date = ($ban_row['ban_end']) ? $this->format_date($ban_row['ban_end']) : '';  			$message = ($ban_row['ban_end']) ? 'BOARD_BAN_TIME' : 'BOARD_BAN_PERM'; diff --git a/phpBB/phpbb/template/context.php b/phpBB/phpbb/template/context.php index 24234c1e4a..decd1c7956 100644 --- a/phpBB/phpbb/template/context.php +++ b/phpBB/phpbb/template/context.php @@ -285,7 +285,7 @@ class context  			// Search array to get correct position  			list($search_key, $search_value) = @each($key); -			$key = NULL; +			$key = null;  			foreach ($block as $i => $val_ary)  			{  				if ($val_ary[$search_key] === $search_value) @@ -296,7 +296,7 @@ class context  			}  			// key/value pair not found -			if ($key === NULL) +			if ($key === null)  			{  				return false;  			} diff --git a/phpBB/phpbb/template/twig/node/includephp.php b/phpBB/phpbb/template/twig/node/includephp.php index 4024cf0cc8..70dcf85d62 100644 --- a/phpBB/phpbb/template/twig/node/includephp.php +++ b/phpBB/phpbb/template/twig/node/includephp.php @@ -23,7 +23,7 @@ class includephp extends \Twig_Node  	/** @var Twig_Environment */  	protected $environment; -	public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $ignoreMissing = false, $lineno, $tag = null) +	public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $ignoreMissing = false,  $tag = null)  	{  		$this->environment = $environment; diff --git a/phpBB/phpbb/template/twig/tokenparser/includephp.php b/phpBB/phpbb/template/twig/tokenparser/includephp.php index d906837590..25170e7214 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includephp.php +++ b/phpBB/phpbb/template/twig/tokenparser/includephp.php @@ -43,7 +43,7 @@ class includephp extends \Twig_TokenParser  		$stream->expect(\Twig_Token::BLOCK_END_TYPE); -		return new \phpbb\template\twig\node\includephp($expr, $this->parser->getEnvironment(), $ignoreMissing, $token->getLine(), $this->getTag()); +		return new \phpbb\template\twig\node\includephp($expr, $this->parser->getEnvironment(), $token->getLine(), $ignoreMissing, $this->getTag());  	}  	/** diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php index f97cc94d40..d82acbf501 100644 --- a/phpBB/phpbb/user.php +++ b/phpBB/phpbb/user.php @@ -343,7 +343,6 @@ class user extends \phpbb\session  			}  		} -  		// Does the user need to change their password? If so, redirect to the  		// ucp profile reg_details page ... of course do not redirect if we're already in the ucp  		if (!defined('IN_ADMIN') && !defined('ADMIN_START') && $config['chg_passforce'] && !empty($this->data['is_registered']) && $auth->acl_get('u_chgpasswd') && $this->data['user_passchg'] < time() - ($config['chg_passforce'] * 86400)) | 
