--- a/wp/wp-includes/pomo/translations.php Wed Sep 21 18:19:35 2022 +0200
+++ b/wp/wp-includes/pomo/translations.php Tue Sep 27 16:37:53 2022 +0200
@@ -21,7 +21,7 @@
* @param array|Translation_Entry $entry
* @return bool true on success, false if the entry doesn't have a key
*/
- function add_entry( $entry ) {
+ public function add_entry( $entry ) {
if ( is_array( $entry ) ) {
$entry = new Translation_Entry( $entry );
}
@@ -37,7 +37,7 @@
* @param array|Translation_Entry $entry
* @return bool
*/
- function add_entry_or_merge( $entry ) {
+ public function add_entry_or_merge( $entry ) {
if ( is_array( $entry ) ) {
$entry = new Translation_Entry( $entry );
}
@@ -63,14 +63,14 @@
* @param string $header header name, without trailing :
* @param string $value header value, without trailing \n
*/
- function set_header( $header, $value ) {
+ public function set_header( $header, $value ) {
$this->headers[ $header ] = $value;
}
/**
* @param array $headers
*/
- function set_headers( $headers ) {
+ public function set_headers( $headers ) {
foreach ( $headers as $header => $value ) {
$this->set_header( $header, $value );
}
@@ -79,14 +79,14 @@
/**
* @param string $header
*/
- function get_header( $header ) {
+ public function get_header( $header ) {
return isset( $this->headers[ $header ] ) ? $this->headers[ $header ] : false;
}
/**
* @param Translation_Entry $entry
*/
- function translate_entry( &$entry ) {
+ public function translate_entry( &$entry ) {
$key = $entry->key();
return isset( $this->entries[ $key ] ) ? $this->entries[ $key ] : false;
}
@@ -96,7 +96,7 @@
* @param string $context
* @return string
*/
- function translate( $singular, $context = null ) {
+ public function translate( $singular, $context = null ) {
$entry = new Translation_Entry(
array(
'singular' => $singular,
@@ -118,14 +118,14 @@
*
* @param int $count number of items
*/
- function select_plural_form( $count ) {
+ public function select_plural_form( $count ) {
return 1 == $count ? 0 : 1;
}
/**
* @return int
*/
- function get_plural_forms_count() {
+ public function get_plural_forms_count() {
return 2;
}
@@ -135,7 +135,7 @@
* @param int $count
* @param string $context
*/
- function translate_plural( $singular, $plural, $count, $context = null ) {
+ public function translate_plural( $singular, $plural, $count, $context = null ) {
$entry = new Translation_Entry(
array(
'singular' => $singular,
@@ -159,9 +159,8 @@
* Merge $other in the current object.
*
* @param Object $other Another Translation object, whose translations will be merged in this one (passed by reference).
- * @return void
*/
- function merge_with( &$other ) {
+ public function merge_with( &$other ) {
foreach ( $other->entries as $entry ) {
$this->entries[ $entry->key() ] = $entry;
}
@@ -170,7 +169,7 @@
/**
* @param object $other
*/
- function merge_originals_with( &$other ) {
+ public function merge_originals_with( &$other ) {
foreach ( $other->entries as $entry ) {
if ( ! isset( $this->entries[ $entry->key() ] ) ) {
$this->entries[ $entry->key() ] = $entry;
@@ -190,7 +189,7 @@
*
* @param int $count
*/
- function gettext_select_plural_form( $count ) {
+ public function gettext_select_plural_form( $count ) {
if ( ! isset( $this->_gettext_select_plural_form ) || is_null( $this->_gettext_select_plural_form ) ) {
list( $nplurals, $expression ) = $this->nplurals_and_expression_from_header( $this->get_header( 'Plural-Forms' ) );
$this->_nplurals = $nplurals;
@@ -203,7 +202,7 @@
* @param string $header
* @return array
*/
- function nplurals_and_expression_from_header( $header ) {
+ public function nplurals_and_expression_from_header( $header ) {
if ( preg_match( '/^\s*nplurals\s*=\s*(\d+)\s*;\s+plural\s*=\s*(.+)$/', $header, $matches ) ) {
$nplurals = (int) $matches[1];
$expression = trim( $matches[2] );
@@ -220,7 +219,7 @@
* @param int $nplurals
* @param string $expression
*/
- function make_plural_form_function( $nplurals, $expression ) {
+ public function make_plural_form_function( $nplurals, $expression ) {
try {
$handler = new Plural_Forms( rtrim( $expression, ';' ) );
return array( $handler, 'get' );
@@ -237,7 +236,7 @@
* @param string $expression the expression without parentheses
* @return string the expression with parentheses added
*/
- function parenthesize_plural_exression( $expression ) {
+ public function parenthesize_plural_exression( $expression ) {
$expression .= ';';
$res = '';
$depth = 0;
@@ -266,7 +265,7 @@
* @param string $translation
* @return array
*/
- function make_headers( $translation ) {
+ public function make_headers( $translation ) {
$headers = array();
// Sometimes \n's are used instead of real new lines.
$translation = str_replace( '\n', "\n", $translation );
@@ -285,7 +284,7 @@
* @param string $header
* @param string $value
*/
- function set_header( $header, $value ) {
+ public function set_header( $header, $value ) {
parent::set_header( $header, $value );
if ( 'Plural-Forms' === $header ) {
list( $nplurals, $expression ) = $this->nplurals_and_expression_from_header( $this->get_header( 'Plural-Forms' ) );
@@ -304,7 +303,7 @@
public $entries = array();
public $headers = array();
- function add_entry( $entry ) {
+ public function add_entry( $entry ) {
return true;
}
@@ -312,20 +311,20 @@
* @param string $header
* @param string $value
*/
- function set_header( $header, $value ) {
+ public function set_header( $header, $value ) {
}
/**
* @param array $headers
*/
- function set_headers( $headers ) {
+ public function set_headers( $headers ) {
}
/**
* @param string $header
* @return false
*/
- function get_header( $header ) {
+ public function get_header( $header ) {
return false;
}
@@ -333,7 +332,7 @@
* @param Translation_Entry $entry
* @return false
*/
- function translate_entry( &$entry ) {
+ public function translate_entry( &$entry ) {
return false;
}
@@ -341,7 +340,7 @@
* @param string $singular
* @param string $context
*/
- function translate( $singular, $context = null ) {
+ public function translate( $singular, $context = null ) {
return $singular;
}
@@ -349,14 +348,14 @@
* @param int $count
* @return bool
*/
- function select_plural_form( $count ) {
+ public function select_plural_form( $count ) {
return 1 == $count ? 0 : 1;
}
/**
* @return int
*/
- function get_plural_forms_count() {
+ public function get_plural_forms_count() {
return 2;
}
@@ -366,14 +365,14 @@
* @param int $count
* @param string $context
*/
- function translate_plural( $singular, $plural, $count, $context = null ) {
+ public function translate_plural( $singular, $plural, $count, $context = null ) {
return 1 == $count ? $singular : $plural;
}
/**
* @param object $other
*/
- function merge_with( &$other ) {
+ public function merge_with( &$other ) {
}
}
endif;