From 0464e9276e5362378c7365bfdbed280b0e4f73f3 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sun, 24 Sep 2023 04:43:56 +0200 Subject: [PATCH 1/2] Docs: improve type specificity --- inc/configuration/configuration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/configuration/configuration.php b/inc/configuration/configuration.php index 4e53123c..ad28c078 100644 --- a/inc/configuration/configuration.php +++ b/inc/configuration/configuration.php @@ -373,7 +373,7 @@ public function get_field_order() { /** * Retrieves an array representation of the current object. * - * @return array + * @return array */ public function to_array() { return [ From 050dd5deeddd63c3b354857e2d41e91cae14eb42 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sat, 16 Dec 2023 04:08:02 +0100 Subject: [PATCH 2/2] Docs: add missing return type void annotations --- inc/assets.php | 4 ++++ inc/dependencies/dependency-acf.php | 4 ++++ inc/dependencies/dependency-yoast-seo.php | 6 ++++++ inc/registry.php | 2 ++ inc/requirements.php | 2 ++ tests/Unit/Requirements_Test.php | 2 ++ tests/js/system/data/test-data-loader-functions.php | 2 ++ yoast-acf-analysis.php | 4 ++++ 8 files changed, 26 insertions(+) diff --git a/inc/assets.php b/inc/assets.php index e1657267..612779a7 100644 --- a/inc/assets.php +++ b/inc/assets.php @@ -19,6 +19,8 @@ class Yoast_ACF_Analysis_Assets { /** * Initialize. + * + * @return void */ public function init() { $this->plugin_data = get_plugin_data( AC_SEO_ACF_ANALYSIS_PLUGIN_FILE ); @@ -28,6 +30,8 @@ public function init() { /** * Enqueue JavaScript file to feed data to Yoast Content Analyses. + * + * @return void */ public function enqueue_scripts() { /** diff --git a/inc/dependencies/dependency-acf.php b/inc/dependencies/dependency-acf.php index a29d27b9..e0fc3ea1 100644 --- a/inc/dependencies/dependency-acf.php +++ b/inc/dependencies/dependency-acf.php @@ -31,6 +31,8 @@ public function is_met() { /** * Registers the notification to show when the conditions are not met. + * + * @return void */ public function register_notifications() { add_action( 'admin_notices', [ $this, 'message_plugin_not_activated' ] ); @@ -38,6 +40,8 @@ public function register_notifications() { /** * Notify that we need ACF to be installed and active. + * + * @return void */ public function message_plugin_not_activated() { $message = sprintf( diff --git a/inc/dependencies/dependency-yoast-seo.php b/inc/dependencies/dependency-yoast-seo.php index 5a7b3314..b3cfbf96 100644 --- a/inc/dependencies/dependency-yoast-seo.php +++ b/inc/dependencies/dependency-yoast-seo.php @@ -31,6 +31,8 @@ public function is_met() { /** * Registers the notifications to be shown. + * + * @return void */ public function register_notifications() { if ( ! defined( 'WPSEO_VERSION' ) ) { @@ -45,6 +47,8 @@ public function register_notifications() { /** * Notify that we need Yoast SEO for WordPress to be installed and active. + * + * @return void */ public function message_plugin_not_activated() { $message = sprintf( @@ -59,6 +63,8 @@ public function message_plugin_not_activated() { /** * Notify that we need Yoast SEO for WordPress to be installed and active. + * + * @return void */ public function message_minimum_version() { $message = sprintf( diff --git a/inc/registry.php b/inc/registry.php index 32604817..bb43f685 100644 --- a/inc/registry.php +++ b/inc/registry.php @@ -22,6 +22,8 @@ class Yoast_ACF_Analysis_Registry { * * @param string|int $id Registry index. * @param mixed $item Item to store in the registry. + * + * @return void */ public function add( $id, $item ) { $this->storage[ $id ] = $item; diff --git a/inc/requirements.php b/inc/requirements.php index d56e1d71..126db5a6 100644 --- a/inc/requirements.php +++ b/inc/requirements.php @@ -21,6 +21,8 @@ class Yoast_ACF_Analysis_Requirements { * Adds a dependency. * * @param Yoast_ACF_Analysis_Dependency $dependency Dependency to add. + * + * @return void */ public function add_dependency( Yoast_ACF_Analysis_Dependency $dependency ) { $this->dependencies[] = $dependency; diff --git a/tests/Unit/Requirements_Test.php b/tests/Unit/Requirements_Test.php index 54e58599..576c8af8 100644 --- a/tests/Unit/Requirements_Test.php +++ b/tests/Unit/Requirements_Test.php @@ -15,6 +15,8 @@ class Requirements_Test extends TestCase { /** * Sets up test fixtures. + * + * @return void */ protected function set_up() { parent::set_up(); diff --git a/tests/js/system/data/test-data-loader-functions.php b/tests/js/system/data/test-data-loader-functions.php index 06777261..e194aaf9 100644 --- a/tests/js/system/data/test-data-loader-functions.php +++ b/tests/js/system/data/test-data-loader-functions.php @@ -12,6 +12,8 @@ /** * Loads ACF test data for the ACF version being tested. + * + * @return void */ function yoast_acf_analysis_test_data_loader() { diff --git a/yoast-acf-analysis.php b/yoast-acf-analysis.php index 5c05eb6f..4f15d755 100755 --- a/yoast-acf-analysis.php +++ b/yoast-acf-analysis.php @@ -49,6 +49,8 @@ /** * Show admin notice when ACF is missing. + * + * @return void */ function yoast_acf_report_missing_acf() { echo '

'; @@ -67,6 +69,8 @@ function yoast_acf_report_missing_acf() { * * @deprecated 2.0.1 * @codeCoverageIgnore + * + * @return void */ function yoast_acf_analysis_load_textdomain() { // As we require WordPress 4.6 and higher, we don't need to load the translation files manually anymore.