Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions classes/class-abilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,15 @@ class Abilities {

/**
* Holds instance of plugin object.
*
* @var Plugin
*/
public $plugin;
public Plugin $plugin;

/**
* Registered ability objects keyed by namespaced name.
*
* @var array<string, Ability>
*/
public $abilities = array();
public array $abilities = array();

/**
* Class constructor.
Expand Down
4 changes: 1 addition & 3 deletions classes/class-ability.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ abstract class Ability {

/**
* Holds instance of plugin object.
*
* @var Plugin
*/
protected $plugin;
protected Plugin $plugin;

/**
* Class constructor.
Expand Down
56 changes: 14 additions & 42 deletions classes/class-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,101 +85,73 @@ class Admin {

/**
* Holds Network class
*
* @var Network
*/
public $network;
public ?Network $network = null;

/**
* Holds Live Update class
*
* @var Live_Update
*/
public $live_update;
public ?Live_Update $live_update = null;

/**
* Holds Export class
*
* @var Export
*/
public $export;
public ?Export $export = null;

/**
* Menu page screen id
*
* @var string
*/
public $screen_id = array();
public array $screen_id = array();

/**
* List table object
*
* @var List_Table
*/
public $list_table = null;
public ?List_Table $list_table = null;

/**
* Option to disable access to Stream
*
* @var bool
*/
public $disable_access = false;
public bool $disable_access = false;

/**
* Class applied to the body of the admin screen
*
* @var string
*/
public $admin_body_class = 'wp_stream_screen';
public string $admin_body_class = 'wp_stream_screen';

/**
* Slug of the records page
*
* @var string
*/
public $records_page_slug = 'wp_stream';
public string $records_page_slug = 'wp_stream';

/**
* Slug of the settings page
*
* @var string
*/
public $settings_page_slug = 'wp_stream_settings';
public string $settings_page_slug = 'wp_stream_settings';

/**
* Parent page of the records and settings pages
*
* @var string
*/
public $admin_parent_page = 'admin.php';
public string $admin_parent_page = 'admin.php';

/**
* Capability name for viewing records
*
* @var string
*/
public $view_cap = 'view_stream';
public string $view_cap = 'view_stream';

/**
* Capability name for managing settings
*
* @var string
*/
public $settings_cap = WP_STREAM_SETTINGS_CAPABILITY;
public string $settings_cap = WP_STREAM_SETTINGS_CAPABILITY;

/**
* Total amount of authors to pre-load
*
* @var int
*/
public $preload_users_max = 50;
public int $preload_users_max = 50;

/**
* Admin notices, collected and displayed on proper action
*
* @var array
*/
public $notices = array();
public array $notices = array();

/**
* Class constructor.
Expand Down
4 changes: 1 addition & 3 deletions classes/class-alerts.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ class Alerts {

/**
* Post meta prefix
*
* @var string
*/
public $meta_prefix = 'wp_stream';
public string $meta_prefix = 'wp_stream';

/**
* Alert Types
Expand Down
20 changes: 6 additions & 14 deletions classes/class-connectors.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,48 +58,40 @@ class Connectors {
*
* @var string[]|null
*/
private $available_connectors = null;
private ?array $available_connectors = null;

/**
* Instantiated connectors, keyed by slug. Filled once by instantiate_connector_classes().
*
* @var array<string, Connector>|null
*/
private $connector_instances = null;
private ?array $connector_instances = null;

/**
* Registered connectors.
*
* @var array
*/
public $connectors = array();
public array $connectors = array();

/**
* Contexts registered to Connectors
*
* @var array
*/
public $contexts = array();
public array $contexts = array();

/**
* Action taxonomy terms
*
* Holds slug to localized label association
*
* @var array
*/
public $term_labels = array(
public array $term_labels = array(
'stream_connector' => array(),
'stream_context' => array(),
'stream_action' => array(),
);

/**
* Admin notice messages
*
* @var array
*/
protected $admin_notices = array();
protected array $admin_notices = array();

/**
* Class constructor.
Expand Down
14 changes: 4 additions & 10 deletions classes/class-db-driver-wpdb.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,18 @@
class DB_Driver_WPDB implements DB_Driver {
/**
* Holds Query class
*
* @var Query
*/
protected $query;
protected Query $query;

/**
* Hold records table name
*
* @var string
*/
public $table;
public string $table;

/**
* Hold meta table name
*
* @var string
*/
public $table_meta;
public string $table_meta;

/**
* Class constructor.
Expand Down Expand Up @@ -166,7 +160,7 @@ public function get_table_names() {
* @param \WP_Stream\Plugin $plugin Instance of the plugin.
* @return \WP_Stream\Install
*/
public function setup_storage( $plugin ) {
public function setup_storage( $plugin ): Install {
return new Install( $plugin );
}

Expand Down
4 changes: 3 additions & 1 deletion classes/class-db-driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ public function get_table_names();
* Init storage.
*
* @param \WP_Stream\Plugin $plugin Instance of the plugin.
*
* @return \WP_Stream\Install
*/
public function setup_storage( $plugin );
public function setup_storage( $plugin ): Install;

/**
* Purge storage.
Expand Down
4 changes: 1 addition & 3 deletions classes/class-filter-input.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ class Filter_Input {

/**
* Callbacks to be used for input validation/sanitation.
*
* @var array
*/
public static $filter_callbacks = array(
public static array $filter_callbacks = array(
FILTER_DEFAULT => null,
// Validate.
FILTER_VALIDATE_BOOLEAN => 'is_bool',
Expand Down
4 changes: 1 addition & 3 deletions classes/class-form-generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ class Form_Generator {

/**
* List of all registered fields.
*
* @var array
*/
public $fields = array();
public array $fields = array();

/**
* Adds a new field to the form.
Expand Down
8 changes: 2 additions & 6 deletions classes/class-install.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ class Install {

/**
* Option key to store database version
*
* @var string
*/
public $option_key = 'wp_stream_db';
public string $option_key = 'wp_stream_db';

/**
* Holds version of database at last update
Expand All @@ -48,10 +46,8 @@ class Install {

/**
* Holds status of whether it's safe to run Stream or not
*
* @var bool
*/
public $update_required = false;
public bool $update_required = false;

/**
* Holds status of whether the database update worked
Expand Down
8 changes: 2 additions & 6 deletions classes/class-live-update.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,13 @@ class Live_Update {

/**
* User meta key/identifier
*
* @var string
*/
public $user_meta_key = 'stream_live_update_records';
public string $user_meta_key = 'stream_live_update_records';

/**
* List table object instance
*
* @var List_Table
*/
public $list_table = null;
public ?List_Table $list_table = null;

/**
* Class constructor.
Expand Down
8 changes: 2 additions & 6 deletions classes/class-network.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,13 @@ class Network {

/**
* Network page slug
*
* @var string
*/
public $network_settings_page_slug = 'wp_stream_network_settings';
public string $network_settings_page_slug = 'wp_stream_network_settings';

/**
* The option name for the network settings.
*
* @var string
*/
public $network_settings_option = 'wp_stream_network';
public string $network_settings_option = 'wp_stream_network';

/**
* Class constructor
Expand Down
Loading
Loading