Skip to content

Commit

Permalink
Remove PHP 7.4 types, add method return types
Browse files Browse the repository at this point in the history
  • Loading branch information
defunctl committed Nov 29, 2023
1 parent 35d7044 commit 3f3f8d0
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/Uplink/Admin/Plugins_Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Plugins_Page {
*
* @var array<mixed>
*/
public array $plugin_notice = [];
public $plugin_notice = [];

/**
* Displays messages on the plugins page in the dashboard.
Expand All @@ -26,7 +26,7 @@ class Plugins_Page {
*
* @return void
*/
public function display_plugin_messages( string $page ) {
public function display_plugin_messages( string $page ): void {
if ( 'plugins.php' !== $page ) {
return;
}
Expand Down Expand Up @@ -126,7 +126,7 @@ public function get_plugin_notice() {
*
* @return void
*/
public function store_admin_notices( string $page ) {
public function store_admin_notices( string $page ): void {
if ( 'plugins.php' !== $page ) {
return;
}
Expand All @@ -141,8 +141,8 @@ public function store_admin_notices( string $page ) {
*
* @return void
*/
public function output_notices_script() {
$slug = $this->get_plugin()->get_slug();
public function output_notices_script(): void {
$slug = $this->get_plugin()->get_slug();
$notice = $this->get_plugin_notice();

if ( empty( $notice ) ) {
Expand Down Expand Up @@ -203,7 +203,7 @@ public function get_plugin_message( Plugin $resource ) {
*
* @return void
*/
public function remove_default_inline_update_msg() {
public function remove_default_inline_update_msg(): void {
remove_action( "after_plugin_row_{$this->get_plugin()->get_path()}", 'wp_plugin_update_row' );
}

Expand Down Expand Up @@ -235,13 +235,13 @@ protected function get_plugin() {
*
* @see plugins_api()
*
* @param mixed $result
* @param string $action
* @param array<mixed>|object $args
* @param mixed $result
* @param string|null $action
* @param array<mixed>|object|null $args
*
* @return mixed
*/
public function inject_info( $result, string $action = null, $args = null ) {
public function inject_info( $result, ?string $action = null, $args = null ) {
$relevant = ( 'plugin_information' === $action ) && is_object( $args ) && isset( $args->slug ) && ( $args->slug === $this->get_plugin()->get_slug() );

if ( ! $relevant ) {
Expand Down

0 comments on commit 3f3f8d0

Please sign in to comment.