Skip to content

Commit

Permalink
Merge pull request #682 from WordPress/fix-misc-docs-issues
Browse files Browse the repository at this point in the history
Fix misc docs issues
  • Loading branch information
davidperezgar authored Oct 1, 2024
2 parents b554c2d + 63b347b commit 1126053
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
11 changes: 6 additions & 5 deletions docs/creating-a-static-check.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use WordPress\Plugin_Check\Traits\Stable_Check;
class My_Custom_Check implements Static_Check {

use Stable_Check;

public function get_categories() {
// Return an array of check categories.
// See the `WordPress\Plugin_Check\Checker\Check_Categories` class for available categories.
Expand Down Expand Up @@ -45,7 +45,7 @@ use WordPress\Plugin_Check\Traits\Stable_Check;
* Check for detecting incorrect casing of the word "WordPress" using PHP CodeSniffer.
*/
class My_Custom_Check extends Abstract_PHP_CodeSniffer_Check {

use Stable_Check;

/**
Expand All @@ -64,9 +64,10 @@ class My_Custom_Check extends Abstract_PHP_CodeSniffer_Check {
/**
* Returns an associative array of arguments to pass to PHPCS.
*
* @param Check_Result $result The check result to amend, including the plugin context to check.
* @return array An associative array of PHPCS CLI arguments.
*/
protected function get_args() {
protected function get_args( Check_Result $result ) {
return array(
'extensions' => 'php',
'standard' => 'WordPress',
Expand Down Expand Up @@ -173,8 +174,8 @@ public function run( Check_Result $result ) {

// When an issue is found add a warning.
$result->add_message(
false,
'Warning message content.',
false,
'Warning message content.',
array(
'code' => 'warning_code',
'file' => $plugin_file,
Expand Down
2 changes: 1 addition & 1 deletion includes/Checker/Abstract_Check_Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ final public function get_checks_to_run() {
/**
* Checks whether the current environment allows for runtime checks to be used.
*
* @since n.e.x.t
* @since 1.2.0
*
* @return bool True if runtime checks are allowed, false otherwise.
*/
Expand Down
2 changes: 1 addition & 1 deletion includes/Checker/CLI_Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ protected function get_slug_param() {
/**
* Checks whether the current environment allows for runtime checks to be used.
*
* @since n.e.x.t
* @since 1.2.0
*
* @return bool True if runtime checks are allowed, false otherwise.
*/
Expand Down
10 changes: 5 additions & 5 deletions includes/Checker/Checks/Plugin_Repo/Offloading_Files_Check.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/**
* Check to detect loading files from external sites.
*
* @since n.e.x.t.
* @since 1.2.0.
*/
class Offloading_Files_Check extends Abstract_PHP_CodeSniffer_Check {

Expand All @@ -26,7 +26,7 @@ class Offloading_Files_Check extends Abstract_PHP_CodeSniffer_Check {
/**
* Bitwise flags to control check behavior.
*
* @since n.e.x.t.
* @since 1.2.0.
* @var int
*/
protected $flags = 0;
Expand All @@ -36,7 +36,7 @@ class Offloading_Files_Check extends Abstract_PHP_CodeSniffer_Check {
*
* Every check must have at least one category.
*
* @since n.e.x.t.
* @since 1.2.0.
*
* @return array The categories for the check.
*/
Expand Down Expand Up @@ -65,7 +65,7 @@ protected function get_args( Check_Result $result ) {
*
* Every check must have a short description explaining what the check does.
*
* @since n.e.x.t.
* @since 1.2.0.
*
* @return string Description.
*/
Expand All @@ -78,7 +78,7 @@ public function get_description(): string {
*
* Every check must have a URL with further information about the check.
*
* @since n.e.x.t.
* @since 1.2.0.
*
* @return string The documentation URL.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* Class for an exception thrown when an invalid check slug is provided.
*
* @since n.e.x.t
* @since 1.2.0
*/
class Invalid_Check_Slug_Exception extends InvalidArgumentException {

Expand Down

0 comments on commit 1126053

Please sign in to comment.