Skip to content

Commit

Permalink
Sync classes (#29)
Browse files Browse the repository at this point in the history
Sync classes from WordPress.org repository.
  • Loading branch information
tfirdaus authored Aug 4, 2024
1 parent 57baf21 commit 9137630
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/Markdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Markdown extends MarkdownExtra
{
/**
* @param string $text
*
* @return string
*/
public function transform($text)
Expand All @@ -41,6 +42,7 @@ public function transform($text)

/**
* @param string $text
*
* @return string
*
* @access protected
Expand All @@ -62,6 +64,7 @@ protected function code_trick($text)

/**
* @param array $matches
*
* @return string
*
* @access protected
Expand All @@ -76,6 +79,7 @@ protected function code_trick_indent_cb($matches)

/**
* @param array $matches
*
* @return string
*
* @access protected
Expand Down
16 changes: 16 additions & 0 deletions app/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ public function __construct($string = '')

/**
* @param string $file_or_url
*
* @return bool
*/
protected function parse_readme($file_or_url)
Expand All @@ -228,6 +229,7 @@ protected function parse_readme($file_or_url)

/**
* @param string $contents The contents of the readme to parse.
*
* @return bool
*/
protected function parse_readme_contents($contents)
Expand Down Expand Up @@ -559,6 +561,7 @@ protected function parse_readme_contents($contents)

/**
* @param string $contents
*
* @return string
*
* @access protected
Expand All @@ -577,6 +580,7 @@ protected function get_first_nonwhitespace(&$contents)

/**
* @param string $line
*
* @return string
*
* @access protected
Expand All @@ -590,6 +594,7 @@ protected function strip_newlines($line)
* @param string $desc
* @param int $length
* @param string $type The type of the length, 'char' or 'words'.
*
* @return string
*
* @access protected
Expand Down Expand Up @@ -646,6 +651,7 @@ protected function trim_length($desc, $length = 150, $type = 'char')
*
* @param string $line The line from the readme to parse.
* @param bool $only_valid Whether to only return a valid known header.
*
* @return false|array
*
* @access protected
Expand All @@ -669,6 +675,7 @@ protected function parse_possible_header($line, $only_valid = false)

/**
* @param string $text
*
* @return string
*
* @access protected
Expand Down Expand Up @@ -715,6 +722,7 @@ protected function filter_text($text)

/**
* @param string $text
*
* @return string
*
* @access protected
Expand All @@ -733,6 +741,7 @@ protected function sanitize_text($text)
* Sanitize provided contributors to valid WordPress users
*
* @param array $users Array of user_login's or user_nicename's.
*
* @return array Array of user_logins.
*/
protected function sanitize_contributors($users)
Expand Down Expand Up @@ -768,6 +777,7 @@ protected function sanitize_contributors($users)
* Sanitize the provided stable tag to something we expect.
*
* @param string $stable_tag the raw Stable Tag line from the readme.
*
* @return string The sanitized $stable_tag.
*/
protected function sanitize_stable_tag($stable_tag)
Expand All @@ -789,6 +799,7 @@ protected function sanitize_stable_tag($stable_tag)
* Sanitizes the Requires PHP header to ensure that it's a valid version header.
*
* @param string $version
*
* @return string The sanitized $version
*/
protected function sanitize_requires_php($version)
Expand All @@ -809,6 +820,7 @@ protected function sanitize_requires_php($version)
* Sanitizes the Tested header to ensure that it's a valid version header.
*
* @param string $version
*
* @return string The sanitized $version
*/
protected function sanitize_tested_version($version)
Expand Down Expand Up @@ -848,6 +860,7 @@ protected function sanitize_tested_version($version)
* Sanitizes the Requires at least header to ensure that it's a valid version header.
*
* @param string $version
*
* @return string The sanitized $version
*/
protected function sanitize_requires_version($version)
Expand Down Expand Up @@ -890,6 +903,7 @@ protected function sanitize_requires_version($version)
* We support headings which are either `= Heading`, `# Heading` or `** Heading`.
*
* @param string|array $lines The lines of the section to parse.
*
* @return array
*/
protected function parse_section($lines)
Expand Down Expand Up @@ -955,6 +969,7 @@ protected function parse_section($lines)

/**
* @param string $text
*
* @return string
*/
protected function parse_markdown($text)
Expand All @@ -979,6 +994,7 @@ protected function parse_markdown($text)
* NOTE: This does not require a SPDX license to be specified, but it should be a valid license nonetheless.
*
* @param string $license The specified license.
*
* @return string|bool True if it looks good, error code on failure.
*/
public function validate_license($license)
Expand Down

0 comments on commit 9137630

Please sign in to comment.