Skip to content

Commit

Permalink
Replace placeholder @since annotations.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterwilsoncc committed Jun 15, 2023
1 parent eb39cda commit e5ed007
Show file tree
Hide file tree
Showing 12 changed files with 68 additions and 68 deletions.
2 changes: 1 addition & 1 deletion bin/generate-pot-with-wpcli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# https://developer.wordpress.org/block-editor/packages/packages-scripts/#files
# This script will run with npm run makepot command.
#
# @since x.x.x
# @since 2.0.0

if ! command -v wp &>/dev/null; then
echo "Error: wp cli could not be found. Please install wp cli and try again."
Expand Down
8 changes: 4 additions & 4 deletions distributor.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
/**
* Get the minimum version of WordPress required by this plugin.
*
* @since x.x.x
* @since 2.0.0
*
* @return string Minimum version required.
*/
Expand All @@ -56,7 +56,7 @@ function minimum_wp_requirement() {
/**
* Get the minimum version of PHP required by this plugin.
*
* @since x.x.x
* @since 2.0.0
*
* @return string Minimum version required.
*/
Expand All @@ -67,7 +67,7 @@ function minimum_php_requirement() {
/**
* Whether WP installation meets the minimum requirements
*
* @since x.x.x
* @since 2.0.0
*
* @return bool True if meets minimum requirements, false otherwise.
*/
Expand All @@ -79,7 +79,7 @@ function site_meets_wp_requirements() {
/**
* Whether PHP installation meets the minimum requirements
*
* @since x.x.x
* @since 2.0.0
*
* @return bool True if meets minimum requirements, false otherwise.
*/
Expand Down
48 changes: 24 additions & 24 deletions includes/classes/EnqueueScript.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* It also handles script translation registration.
*
* @package distributor
* @since x.x.x
* @since 2.0.0
*/

namespace Distributor;
Expand All @@ -20,109 +20,109 @@
/**
* Class EnqueueScript
*
* @since x.x.x
* @since 2.0.0
*/
class EnqueueScript {
/**
* Script Handle.
*
* @since x.x.x
* @since 2.0.0
* @var string
*/
private string $script_handle;

/**
* Script path relative to plugin root directory.
*
* @since x.x.x
* @since 2.0.0
* @var string
*/
private string $relative_script_path;

/**
* Script path absolute to plugin root directory.
*
* @since x.x.x
* @since 2.0.0
* @var string
*/
private string $absolute_script_path;

/**
* Script dependencies.
*
* @since x.x.x
* @since 2.0.0
* @var array
*/
private array $script_dependencies = [];

/**
* Script version.
*
* @since x.x.x
* @since 2.0.0
* @var string
*/
private string $version = DT_VERSION;

/**
* Flag to decide whether load script in footer.
*
* @since x.x.x
* @since 2.0.0
* @var bool
*/
private bool $load_script_in_footer = false;

/**
* Flag to decide whether register script translation.
*
* @since x.x.x
* @since 2.0.0
* @var bool
*/
private bool $register_translations = false;

/**
* Script localization parameter name.
*
* @since x.x.x
* @since 2.0.0
* @var string|null
*/
private ?string $localize_script_param_name = null;

/**
* Script localization parameter data.
*
* @since x.x.x
* @since 2.0.0
* @var array|null
*/
private ?array $localize_script_param_data = null;

/**
* Plugin root directory path.
*
* @since x.x.x
* @since 2.0.0
* @var string
*/
private string $plugin_dir_path;

/**
* Plugin root directory URL.
*
* @since x.x.x
* @since 2.0.0
* @var string
*/
private string $plugin_dir_url;

/**
* Plugin text domain.
*
* @since x.x.x
* @since 2.0.0
* @var string
*/
private string $text_domain;

/**
* EnqueueScript constructor.
*
* @since x.x.x
* @since 2.0.0
*
* @param string $script_handle Script handle.
* @param string $script_file_name Script file name.
Expand All @@ -141,7 +141,7 @@ public function __construct( string $script_handle, string $script_file_name ) {
/**
* Flag to decide whether load script in footer.
*
* @since x.x.x
* @since 2.0.0
*/
public function load_in_footer(): EnqueueScript {
$this->load_script_in_footer = true;
Expand All @@ -152,7 +152,7 @@ public function load_in_footer(): EnqueueScript {
/**
* Set script dependencies.
*
* @since x.x.x
* @since 2.0.0
*
* @param array $script_dependencies Script dependencies.
*/
Expand All @@ -165,7 +165,7 @@ public function dependencies( array $script_dependencies ): EnqueueScript {
/**
* Register script.
*
* @since x.x.x
* @since 2.0.0
*/
public function register(): EnqueueScript {
$script_url = $this->plugin_dir_url . $this->relative_script_path;
Expand Down Expand Up @@ -203,7 +203,7 @@ public function register(): EnqueueScript {
/**
* This function should be called before enqueue or register method.
*
* @since x.x.x
* @since 2.0.0
*/
public function register_translations(): EnqueueScript {
$this->register_translations = true;
Expand All @@ -214,7 +214,7 @@ public function register_translations(): EnqueueScript {
/**
* This function should be called after enqueue or register method.
*
* @since x.x.x
* @since 2.0.0
*
* @param string $js_variable_name JS variable name.
* @param array $data Data to be localized.
Expand All @@ -229,7 +229,7 @@ public function register_localize_data( string $js_variable_name, array $data ):
/**
* Enqueue script.
*
* @since x.x.x
* @since 2.0.0
*/
public function enqueue(): EnqueueScript {
if ( ! wp_script_is( $this->script_handle, 'registered' ) ) {
Expand All @@ -243,7 +243,7 @@ public function enqueue(): EnqueueScript {
/**
* Should return script handle.
*
* @since x.x.x
* @since 2.0.0
*
* @return string
*/
Expand All @@ -254,7 +254,7 @@ public function get_script_handle(): string {
/**
* Get asset file data.
*
* @since x.x.x
* @since 2.0.0
*
* @return array
*/
Expand Down Expand Up @@ -282,7 +282,7 @@ public function get_asset_file_data(): array {
/**
* Should return script version.
*
* @since x.x.x
* @since 2.0.0
*
* @return string
*/
Expand Down
6 changes: 3 additions & 3 deletions includes/global-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function distributor_sanitize_connection( $connection ) {
* Performs a case-sensitive check indicating if needle is
* contained in haystack.
*
* @since x.x.x
* @since 2.0.0
*
* @param string $haystack The string to search in.
* @param string $needle The substring to search for in the haystack.
Expand All @@ -74,7 +74,7 @@ function str_contains( $haystack, $needle ) {
* Performs a case-sensitive check indicating if
* the haystack begins with needle.
*
* @since x.x.x
* @since 2.0.0
*
* @param string $haystack The string to search in.
* @param string $needle The substring to search for in the `$haystack`.
Expand All @@ -96,7 +96,7 @@ function str_starts_with( $haystack, $needle ) {
* Performs a case-sensitive check indicating if
* the haystack ends with needle.
*
* @since x.x.x
* @since 2.0.0
*
* @param string $haystack The string to search in.
* @param string $needle The substring to search for in the `$haystack`.
Expand Down
14 changes: 7 additions & 7 deletions includes/hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function setup() {
/**
* Filter the canonical URL for a distributed post.
*
* @since x.x.x
* @since 2.0.0
*
* @param string $canonical_url Canonical URL.
* @param WP_Post $post Post object.
Expand All @@ -47,7 +47,7 @@ function get_canonical_url( $canonical_url, $post ) {
/**
* Filter the Yoast SEO canonical URL for a distributed post.
*
* @since x.x.x
* @since 2.0.0
*
* @param string $canonical_url Canonical URL.
* @param Yoast\WP\SEO\Presentations\Indexable_Presentation|false $presentation Yoast SEO meta tag presenter. False: filter applied in legacy format.
Expand All @@ -73,7 +73,7 @@ function wpseo_canonical( $canonical_url, $presentation = false ) {
/**
* Filter the Yoast SEO OpenGraph URL for a distributed post.
*
* @since x.x.x
* @since 2.0.0
*
* @param string $og_url OpenGraph URL.
* @param Yoast\WP\SEO\Presentations\Indexable_Presentation|false $presentation Yoast SEO meta tag presenter. False: filter applied in legacy format.
Expand Down Expand Up @@ -101,7 +101,7 @@ function wpseo_opengraph_url( $og_url, $presentation = false ) {
/**
* Filter the author name via the_author() for a distributed post.
*
* @since x.x.x
* @since 2.0.0
*
* @param string $display_name Author display name.
* @return string Modified author display name.
Expand All @@ -119,7 +119,7 @@ function filter_the_author( $display_name ) {
/**
* Filter the author display name via get_the_author() for a distributed post.
*
* @since x.x.x
* @since 2.0.0
*
* @param string $display_name Author display name.
* @param int $user_id User ID.
Expand All @@ -142,7 +142,7 @@ function get_the_author_display_name( $display_name, $user_id, $original_user_id
/**
* Filter the author link for a distributed post.
*
* @since x.x.x
* @since 2.0.0
*
* @param string $link Author link.
* @return string Modified author link.
Expand All @@ -160,7 +160,7 @@ function filter_author_link( $link ) {
/**
* Filter the author page URL via get_the_author() for a distributed post.
*
* @since x.x.x
* @since 2.0.0
*
* @param string $author_url Author page URL.
* @param int $user_id User ID.
Expand Down
2 changes: 1 addition & 1 deletion includes/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ function handle_network_settings() {
*
* Runs on the hook `clean_post_cache`.
*
* @since x.x.x
* @since 2.0.0
*
* @param int $post_id Post ID.
*/
Expand Down
2 changes: 1 addition & 1 deletion includes/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -1200,7 +1200,7 @@ function remote_http_request( $url, $args = array(), $fallback = '', $threshold
/**
* Determines if a post is distributed.
*
* @since x.x.x
* @since 2.0.0
*
* @param int|\WP_Post $post The post object or ID been checked.
* @return bool True if the post is distributed, false otherwise.
Expand Down
2 changes: 1 addition & 1 deletion tests/php/DistributorPostTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class DistributorPostTest extends TestCase {
*
* Set up common mocks required for multiple tests.
*
* @since x.x.x
* @since 2.0.0
*/
public function setUp(): void {
parent::setUp();
Expand Down
2 changes: 1 addition & 1 deletion tests/php/EnqueueScriptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use WP_Mock\Tools\TestCase;

/**
* @since x.x.x
* @since 2.0.0
*/
class EnqueueScriptTest extends TestCase {
public function test_script_registration(): void {
Expand Down
Loading

0 comments on commit e5ed007

Please sign in to comment.