[ticket/13725] Coding guidelines: static public

PHPBB3-13725
This commit is contained in:
Matt Friedman 2015-03-27 00:02:20 -07:00
parent 9a9a665a0a
commit dbb538afbd
21 changed files with 34 additions and 34 deletions

View file

@ -40,7 +40,7 @@ class tools implements tools_interface
* *
* @return array * @return array
*/ */
public static function get_dbms_type_map() static public function get_dbms_type_map()
{ {
return array( return array(
'mysql_41' => array( 'mysql_41' => array(

View file

@ -106,7 +106,7 @@ class kernel_exception_subscriber implements EventSubscriberInterface
$event->setResponse($response); $event->setResponse($response);
} }
public static function getSubscribedEvents() static public function getSubscribedEvents()
{ {
return array( return array(
KernelEvents::EXCEPTION => 'on_kernel_exception', KernelEvents::EXCEPTION => 'on_kernel_exception',

View file

@ -32,7 +32,7 @@ class kernel_terminate_subscriber implements EventSubscriberInterface
exit_handler(); exit_handler();
} }
public static function getSubscribedEvents() static public function getSubscribedEvents()
{ {
return array( return array(
KernelEvents::TERMINATE => array('on_kernel_terminate', ~PHP_INT_MAX), KernelEvents::TERMINATE => array('on_kernel_terminate', ~PHP_INT_MAX),

View file

@ -36,7 +36,7 @@ class admin_activate_user extends \phpbb\notification\type\base
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static $notification_option = array( static public $notification_option = array(
'lang' => 'NOTIFICATION_TYPE_ADMIN_ACTIVATE_USER', 'lang' => 'NOTIFICATION_TYPE_ADMIN_ACTIVATE_USER',
'group' => 'NOTIFICATION_GROUP_ADMINISTRATION', 'group' => 'NOTIFICATION_GROUP_ADMINISTRATION',
); );
@ -52,7 +52,7 @@ class admin_activate_user extends \phpbb\notification\type\base
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static function get_item_id($user) static public function get_item_id($user)
{ {
return (int) $user['user_id']; return (int) $user['user_id'];
} }
@ -60,7 +60,7 @@ class admin_activate_user extends \phpbb\notification\type\base
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static function get_item_parent_id($post) static public function get_item_parent_id($post)
{ {
return 0; return 0;
} }

View file

@ -50,7 +50,7 @@ class approve_post extends \phpbb\notification\type\post
* @var bool|array False if the service should use it's default data * @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group') * Array of data (including keys 'id', 'lang', and 'group')
*/ */
public static $notification_option = array( static public $notification_option = array(
'id' => 'moderation_queue', 'id' => 'moderation_queue',
'lang' => 'NOTIFICATION_TYPE_MODERATION_QUEUE', 'lang' => 'NOTIFICATION_TYPE_MODERATION_QUEUE',
'group' => 'NOTIFICATION_GROUP_POSTING', 'group' => 'NOTIFICATION_GROUP_POSTING',

View file

@ -50,7 +50,7 @@ class approve_topic extends \phpbb\notification\type\topic
* @var bool|array False if the service should use it's default data * @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group') * Array of data (including keys 'id', 'lang', and 'group')
*/ */
public static $notification_option = array( static public $notification_option = array(
'id' => 'moderation_queue', 'id' => 'moderation_queue',
'lang' => 'NOTIFICATION_TYPE_MODERATION_QUEUE', 'lang' => 'NOTIFICATION_TYPE_MODERATION_QUEUE',
'group' => 'NOTIFICATION_GROUP_POSTING', 'group' => 'NOTIFICATION_GROUP_POSTING',

View file

@ -63,7 +63,7 @@ abstract class base implements \phpbb\notification\type\type_interface
* @var bool|array False if the service should use its default data * @var bool|array False if the service should use its default data
* Array of data (including keys 'id', 'lang', and 'group') * Array of data (including keys 'id', 'lang', and 'group')
*/ */
public static $notification_option = false; static public $notification_option = false;
/** /**
* The notification_type_id, set upon creation of the class * The notification_type_id, set upon creation of the class

View file

@ -43,7 +43,7 @@ class bookmark extends \phpbb\notification\type\post
* @var bool|array False if the service should use it's default data * @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group') * Array of data (including keys 'id', 'lang', and 'group')
*/ */
public static $notification_option = array( static public $notification_option = array(
'lang' => 'NOTIFICATION_TYPE_BOOKMARK', 'lang' => 'NOTIFICATION_TYPE_BOOKMARK',
'group' => 'NOTIFICATION_GROUP_POSTING', 'group' => 'NOTIFICATION_GROUP_POSTING',
); );

View file

@ -60,7 +60,7 @@ class disapprove_post extends \phpbb\notification\type\approve_post
* @var bool|array False if the service should use it's default data * @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group') * Array of data (including keys 'id', 'lang', and 'group')
*/ */
public static $notification_option = array( static public $notification_option = array(
'id' => 'moderation_queue', 'id' => 'moderation_queue',
'lang' => 'NOTIFICATION_TYPE_MODERATION_QUEUE', 'lang' => 'NOTIFICATION_TYPE_MODERATION_QUEUE',
'group' => 'NOTIFICATION_GROUP_POSTING', 'group' => 'NOTIFICATION_GROUP_POSTING',

View file

@ -60,7 +60,7 @@ class disapprove_topic extends \phpbb\notification\type\approve_topic
* @var bool|array False if the service should use it's default data * @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group') * Array of data (including keys 'id', 'lang', and 'group')
*/ */
public static $notification_option = array( static public $notification_option = array(
'id' => 'moderation_queue', 'id' => 'moderation_queue',
'lang' => 'NOTIFICATION_TYPE_MODERATION_QUEUE', 'lang' => 'NOTIFICATION_TYPE_MODERATION_QUEUE',
'group' => 'NOTIFICATION_GROUP_POSTING', 'group' => 'NOTIFICATION_GROUP_POSTING',

View file

@ -26,7 +26,7 @@ class group_request extends \phpbb\notification\type\base
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static $notification_option = array( static public $notification_option = array(
'lang' => 'NOTIFICATION_TYPE_GROUP_REQUEST', 'lang' => 'NOTIFICATION_TYPE_GROUP_REQUEST',
); );
@ -50,7 +50,7 @@ class group_request extends \phpbb\notification\type\base
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static function get_item_id($group) static public function get_item_id($group)
{ {
return (int) $group['user_id']; return (int) $group['user_id'];
} }
@ -58,7 +58,7 @@ class group_request extends \phpbb\notification\type\base
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static function get_item_parent_id($group) static public function get_item_parent_id($group)
{ {
// Group id is the parent // Group id is the parent
return (int) $group['group_id']; return (int) $group['group_id'];

View file

@ -34,7 +34,7 @@ class group_request_approved extends \phpbb\notification\type\base
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static function get_item_id($group) static public function get_item_id($group)
{ {
return (int) $group['group_id']; return (int) $group['group_id'];
} }
@ -42,7 +42,7 @@ class group_request_approved extends \phpbb\notification\type\base
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static function get_item_parent_id($group) static public function get_item_parent_id($group)
{ {
return 0; return 0;
} }

View file

@ -36,7 +36,7 @@ class pm extends \phpbb\notification\type\base
* @var bool|array False if the service should use it's default data * @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group') * Array of data (including keys 'id', 'lang', and 'group')
*/ */
public static $notification_option = array( static public $notification_option = array(
'lang' => 'NOTIFICATION_TYPE_PM', 'lang' => 'NOTIFICATION_TYPE_PM',
); );
@ -53,7 +53,7 @@ class pm extends \phpbb\notification\type\base
* *
* @param array $pm The data from the private message * @param array $pm The data from the private message
*/ */
public static function get_item_id($pm) static public function get_item_id($pm)
{ {
return (int) $pm['msg_id']; return (int) $pm['msg_id'];
} }
@ -63,7 +63,7 @@ class pm extends \phpbb\notification\type\base
* *
* @param array $pm The data from the pm * @param array $pm The data from the pm
*/ */
public static function get_item_parent_id($pm) static public function get_item_parent_id($pm)
{ {
// No parent // No parent
return 0; return 0;

View file

@ -50,7 +50,7 @@ class post extends \phpbb\notification\type\base
* @var bool|array False if the service should use it's default data * @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group') * Array of data (including keys 'id', 'lang', and 'group')
*/ */
public static $notification_option = array( static public $notification_option = array(
'lang' => 'NOTIFICATION_TYPE_POST', 'lang' => 'NOTIFICATION_TYPE_POST',
'group' => 'NOTIFICATION_GROUP_POSTING', 'group' => 'NOTIFICATION_GROUP_POSTING',
); );
@ -68,7 +68,7 @@ class post extends \phpbb\notification\type\base
* *
* @param array $post The data from the post * @param array $post The data from the post
*/ */
public static function get_item_id($post) static public function get_item_id($post)
{ {
return (int) $post['post_id']; return (int) $post['post_id'];
} }
@ -78,7 +78,7 @@ class post extends \phpbb\notification\type\base
* *
* @param array $post The data from the post * @param array $post The data from the post
*/ */
public static function get_item_parent_id($post) static public function get_item_parent_id($post)
{ {
return (int) $post['topic_id']; return (int) $post['topic_id'];
} }

View file

@ -43,7 +43,7 @@ class post_in_queue extends \phpbb\notification\type\post
* @var bool|array False if the service should use it's default data * @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group') * Array of data (including keys 'id', 'lang', and 'group')
*/ */
public static $notification_option = array( static public $notification_option = array(
'id' => 'notification.type.needs_approval', 'id' => 'notification.type.needs_approval',
'lang' => 'NOTIFICATION_TYPE_IN_MODERATION_QUEUE', 'lang' => 'NOTIFICATION_TYPE_IN_MODERATION_QUEUE',
'group' => 'NOTIFICATION_GROUP_MODERATION', 'group' => 'NOTIFICATION_GROUP_MODERATION',

View file

@ -50,7 +50,7 @@ class quote extends \phpbb\notification\type\post
* @var bool|array False if the service should use it's default data * @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group') * Array of data (including keys 'id', 'lang', and 'group')
*/ */
public static $notification_option = array( static public $notification_option = array(
'lang' => 'NOTIFICATION_TYPE_QUOTE', 'lang' => 'NOTIFICATION_TYPE_QUOTE',
'group' => 'NOTIFICATION_GROUP_POSTING', 'group' => 'NOTIFICATION_GROUP_POSTING',
); );

View file

@ -60,7 +60,7 @@ class report_pm extends \phpbb\notification\type\pm
* @var bool|array False if the service should use it's default data * @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group') * Array of data (including keys 'id', 'lang', and 'group')
*/ */
public static $notification_option = array( static public $notification_option = array(
'id' => 'notification.type.report', 'id' => 'notification.type.report',
'lang' => 'NOTIFICATION_TYPE_REPORT', 'lang' => 'NOTIFICATION_TYPE_REPORT',
'group' => 'NOTIFICATION_GROUP_MODERATION', 'group' => 'NOTIFICATION_GROUP_MODERATION',
@ -71,7 +71,7 @@ class report_pm extends \phpbb\notification\type\pm
* *
* @param array $pm The data from the pm * @param array $pm The data from the pm
*/ */
public static function get_item_parent_id($pm) static public function get_item_parent_id($pm)
{ {
return (int) $pm['report_id']; return (int) $pm['report_id'];
} }

View file

@ -66,7 +66,7 @@ class report_post extends \phpbb\notification\type\post_in_queue
* @var bool|array False if the service should use it's default data * @var bool|array False if the service should use it's default data
* Array of data (including keys 'id' and 'lang') * Array of data (including keys 'id' and 'lang')
*/ */
public static $notification_option = array( static public $notification_option = array(
'id' => 'notification.type.report', 'id' => 'notification.type.report',
'lang' => 'NOTIFICATION_TYPE_REPORT', 'lang' => 'NOTIFICATION_TYPE_REPORT',
'group' => 'NOTIFICATION_GROUP_MODERATION', 'group' => 'NOTIFICATION_GROUP_MODERATION',

View file

@ -50,7 +50,7 @@ class topic extends \phpbb\notification\type\base
* @var bool|array False if the service should use it's default data * @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group') * Array of data (including keys 'id', 'lang', and 'group')
*/ */
public static $notification_option = array( static public $notification_option = array(
'lang' => 'NOTIFICATION_TYPE_TOPIC', 'lang' => 'NOTIFICATION_TYPE_TOPIC',
'group' => 'NOTIFICATION_GROUP_POSTING', 'group' => 'NOTIFICATION_GROUP_POSTING',
); );
@ -68,7 +68,7 @@ class topic extends \phpbb\notification\type\base
* *
* @param array $post The data from the post * @param array $post The data from the post
*/ */
public static function get_item_id($post) static public function get_item_id($post)
{ {
return (int) $post['topic_id']; return (int) $post['topic_id'];
} }
@ -78,7 +78,7 @@ class topic extends \phpbb\notification\type\base
* *
* @param array $post The data from the post * @param array $post The data from the post
*/ */
public static function get_item_parent_id($post) static public function get_item_parent_id($post)
{ {
return (int) $post['forum_id']; return (int) $post['forum_id'];
} }

View file

@ -43,7 +43,7 @@ class topic_in_queue extends \phpbb\notification\type\topic
* @var bool|array False if the service should use it's default data * @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group') * Array of data (including keys 'id', 'lang', and 'group')
*/ */
public static $notification_option = array( static public $notification_option = array(
'id' => 'notification.type.needs_approval', 'id' => 'notification.type.needs_approval',
'lang' => 'NOTIFICATION_TYPE_IN_MODERATION_QUEUE', 'lang' => 'NOTIFICATION_TYPE_IN_MODERATION_QUEUE',
'group' => 'NOTIFICATION_GROUP_MODERATION', 'group' => 'NOTIFICATION_GROUP_MODERATION',

View file

@ -37,14 +37,14 @@ interface type_interface
* *
* @param array $type_data The type specific data * @param array $type_data The type specific data
*/ */
public static function get_item_id($type_data); static public function get_item_id($type_data);
/** /**
* Get the id of the parent * Get the id of the parent
* *
* @param array $type_data The type specific data * @param array $type_data The type specific data
*/ */
public static function get_item_parent_id($type_data); static public function get_item_parent_id($type_data);
/** /**
* Is this type available to the current user (defines whether or not it will be shown in the UCP Edit notification options) * Is this type available to the current user (defines whether or not it will be shown in the UCP Edit notification options)