Make WordPress Core

Changeset 30663


Ignore:
Timestamp:
11/30/2014 09:40:53 PM (12 years ago)
Author:
wonderboymusic
Message:

Add missing @params to src/wp-includes/pomo files.

See #30224.

Location:
trunk/src/wp-includes/pomo
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/pomo/mo.php

    r28806 r30663  
    140140        }
    141141
     142        /**
     143         * @param POMO_FileReader $reader
     144         */
    142145        function import_from_reader($reader) {
    143146                $endian_string = MO::get_byteorder($reader->readint32());
  • trunk/src/wp-includes/pomo/po.php

    r26500 r30663  
    190190         *
    191191         * @static
    192          * @param object &$entry the entry to convert to po string
    193          * @return string|bool PO-style formatted string for the entry or
     192         * @param Translation_Entry &$entry the entry to convert to po string
     193         * @return false|string PO-style formatted string for the entry or
    194194         *      false if the entry is empty
    195195         */
    … …  
    216216        }
    217217
     218        /**
     219         * @param string $filename
     220         * @return boolean
     221         */
    218222        function import_from_file($filename) {
    219223                $f = fopen($filename, 'r');
    … …  
    239243        }
    240244
     245        /**
     246         * @param resource $f
     247         * @param int      $lineno
     248         * @return null|false|array
     249         */
    241250        function read_entry($f, $lineno = 0) {
    242251                $entry = new Translation_Entry();
    … …  
    344353        }
    345354
     355        /**
     356         * @staticvar string   $last_line
     357         * @staticvar boolean  $use_last_line
     358         * @param     resource $f
     359         * @param     string   $action
     360         * @return boolean
     361         */
    346362        function read_line($f, $action = 'read') {
    347363                static $last_line = '';
    … …  
    362378        }
    363379
     380        /**
     381         * @param Translation_Entry $entry
     382         * @param string            $po_comment_line
     383         */
    364384        function add_comment_to_entry(&$entry, $po_comment_line) {
    365385                $first_two = substr($po_comment_line, 0, 2);
    … …  
    376396        }
    377397
     398        /**
     399         * @param string $s
     400         * @return sring
     401         */
    378402        function trim_quotes($s) {
    379403                if ( substr($s, 0, 1) == '"') $s = substr($s, 1);
  • trunk/src/wp-includes/pomo/streams.php

    r22349 r30663  
    5959        }
    6060
    61 
     61        /**
     62         * @param string $string
     63         * @param int    $start
     64         * @param int    $length
     65         * @return string
     66         */
    6267        function substr($string, $start, $length) {
    6368                if ($this->is_overloaded) {
    … …  
    6873        }
    6974
     75        /**
     76         * @param string $string
     77         * @return int
     78         */
    7079        function strlen($string) {
    7180                if ($this->is_overloaded) {
    … …  
    7685        }
    7786
     87        /**
     88         * @param string $string
     89         * @param int    $chunk_size
     90         * @return array
     91         */
    7892        function str_split($string, $chunk_size) {
    7993                if (!function_exists('str_split')) {
    … …  
    105119if ( !class_exists( 'POMO_FileReader' ) ):
    106120class POMO_FileReader extends POMO_Reader {
     121
     122        /**
     123         * @param string $filename
     124         */
    107125        function POMO_FileReader($filename) {
    108126                parent::POMO_Reader();
    … …  
    110128        }
    111129
     130        /**
     131         * @param int $bytes
     132         */
    112133        function read($bytes) {
    113134                return fread($this->_f, $bytes);
    114135        }
    115136
     137        /**
     138         * @param int $pos
     139         * @return boolean
     140         */
    116141        function seekto($pos) {
    117142                if ( -1 == fseek($this->_f, $pos, SEEK_SET)) {
    … …  
    158183        }
    159184
    160 
     185        /**
     186         * @param string $bytes
     187         * @return string
     188         */
    161189        function read($bytes) {
    162190                $data = $this->substr($this->_str, $this->_pos, $bytes);
    … …  
    166194        }
    167195
     196        /**
     197         * @param int $pos
     198         * @return int
     199         */
    168200        function seekto($pos) {
    169201                $this->_pos = $pos;
  • trunk/src/wp-includes/pomo/translations.php

    r29479 r30663  
    1818         * Add entry to the PO structure
    1919         *
    20          * @param object &$entry
     20         * @param array|Translation_Entry &$entry
    2121         * @return bool true on success, false if the entry doesn't have a key
    2222         */
    … …  
    3131        }
    3232
     33        /**
     34         * @param array|Translation_Entry $entry
     35         * @return bool
     36         */
    3337        function add_entry_or_merge($entry) {
    3438                if (is_array($entry)) {
    … …  
    5862        }
    5963
     64        /**
     65         * @param array $headers
     66         */
    6067        function set_headers($headers) {
    6168                foreach($headers as $header => $value) {
    … …  
    6471        }
    6572
     73        /**
     74         * @param string $header
     75         */
    6676        function get_header($header) {
    6777                return isset($this->headers[$header])? $this->headers[$header] : false;
    6878        }
    6979
     80        /**
     81         * @param Translation_Entry $entry
     82         */
    7083        function translate_entry(&$entry) {
    7184                $key = $entry->key();
    … …  
    7386        }
    7487
     88        /**
     89         * @param string $singular
     90         * @param string $context
     91         * @return string
     92         */
    7593        function translate($singular, $context=null) {
    7694                $entry = new Translation_Entry(array('singular' => $singular, 'context' => $context));
    … …  
    98116        }
    99117
     118        /**
     119         * @param string $singular
     120         * @param string $plural
     121         * @param int    $count
     122         * @param string $context
     123         */
    100124        function translate_plural($singular, $plural, $count, $context = null) {
    101125                $entry = new Translation_Entry(array('singular' => $singular, 'plural' => $plural, 'context' => $context));
    … …  
    140164         * they can't share it effectively.
    141165         *
     166         * @param int $count
    142167         */
    143168        function gettext_select_plural_form($count) {
    … …  
    150175        }
    151176
     177        /**
     178         * @param string $header
     179         * @return array
     180         */
    152181        function nplurals_and_expression_from_header($header) {
    153182                if (preg_match('/^\s*nplurals\s*=\s*(\d+)\s*;\s+plural\s*=\s*(.+)$/', $header, $matches)) {
    … …  
    163192         * Makes a function, which will return the right translation index, according to the
    164193         * plural forms header
     194         * @param int    $nplurals
     195         * @param string $expression
    165196         */
    166197        function make_plural_form_function($nplurals, $expression) {
    … …  
    204235        }
    205236
     237        /**
     238         * @param string $translation
     239         * @return array
     240         */
    206241        function make_headers($translation) {
    207242                $headers = array();
    … …  
    217252        }
    218253
     254        /**
     255         * @param string $header
     256         * @param string $value
     257         */
    219258        function set_header($header, $value) {
    220259                parent::set_header($header, $value);
    … …  
    254293        }
    255294
     295        /**
     296         * @param string $singular
     297         * @param string $context
     298         */
    256299        function translate($singular, $context=null) {
    257300                return $singular;
    … …  
    266309        }
    267310
     311        /**
     312         * @param string $singular
     313         * @param string $plural
     314         * @param int    $count
     315         * @param string $context
     316         */
    268317        function translate_plural($singular, $plural, $count, $context = null) {
    269318                        return 1 == $count? $singular : $plural;
Note: See TracChangeset for help on using the changeset viewer.