@@ -31,7 +31,7 @@ class PluginUpdater {
3131 * These properties are passed in when instantiating to identify the plugin and it's update location.
3232 * @var array
3333 */
34- private $ properties ;
34+ private $ properties = [] ;
3535
3636 /**
3737 * Get the class constructed.
@@ -53,7 +53,7 @@ public function __construct( $properties ) {
5353
5454 $ this ->properties = $ this ->get_full_plugin_properties ( $ properties , $ this ->api_url );
5555
56- if ( ! $ this ->properties ) {
56+ if ( empty ( $ this ->properties ) ) {
5757 return ;
5858 }
5959
@@ -65,9 +65,9 @@ public function __construct( $properties ) {
6565 *
6666 * @param array $properties These properties are passed in when instantiating to identify the plugin and it's update location.
6767 * @param string $api_url The URL where the api is located.
68- * @return array|null
68+ * @return array
6969 */
70- public function get_full_plugin_properties ( $ properties , $ api_url ) {
70+ public function get_full_plugin_properties ( $ properties , $ api_url ) : array {
7171 $ plugins = \get_plugins ();
7272
7373 // Scan through all plugins installed and find the one which matches this one in question.
@@ -86,7 +86,7 @@ public function get_full_plugin_properties( $properties, $api_url ) {
8686 }
8787
8888 // No matching plugin was found installed.
89- return null ;
89+ return [] ;
9090 }
9191
9292 /**
@@ -105,7 +105,7 @@ public function register() {
105105 * @param ?object $transient_value The value of the `site_transient_update_plugins` transient.
106106 *
107107 * @handles site_transient_update_plugins
108- * @return object
108+ * @return object|null
109109 */
110110 public function filter_plugin_update_transient ( $ transient_value ) {
111111 // No update object exists. Return early.
0 commit comments