Changeset 51919 for trunk/src/wp-includes/pomo/streams.php
- Timestamp:
- 10/18/2021 05:51:17 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/pomo/streams.php
r51032 r51919 18 18 * PHP5 constructor. 19 19 */ 20 function __construct() {20 public function __construct() { 21 21 if ( function_exists( 'mb_substr' ) 22 22 && ( (int) ini_get( 'mbstring.func_overload' ) & 2 ) // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated … … 47 47 * @param string $endian Set the endianness of the file. Accepts 'big', or 'little'. 48 48 */ 49 function setEndian( $endian ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid49 public function setEndian( $endian ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid 50 50 $this->endian = $endian; 51 51 } … … 57 57 * the stream of false if there are not enough bytes or on error 58 58 */ 59 function readint32() {59 public function readint32() { 60 60 $bytes = $this->read( 4 ); 61 61 if ( 4 != $this->strlen( $bytes ) ) { … … 74 74 * enough data or on error 75 75 */ 76 function readint32array( $count ) {76 public function readint32array( $count ) { 77 77 $bytes = $this->read( 4 * $count ); 78 78 if ( 4 * $count != $this->strlen( $bytes ) ) { … … 89 89 * @return string 90 90 */ 91 function substr( $string, $start, $length ) {91 public function substr( $string, $start, $length ) { 92 92 if ( $this->is_overloaded ) { 93 93 return mb_substr( $string, $start, $length, 'ascii' ); … … 101 101 * @return int 102 102 */ 103 function strlen( $string ) {103 public function strlen( $string ) { 104 104 if ( $this->is_overloaded ) { 105 105 return mb_strlen( $string, 'ascii' ); … … 114 114 * @return array 115 115 */ 116 function str_split( $string, $chunk_size ) {116 public function str_split( $string, $chunk_size ) { 117 117 if ( ! function_exists( 'str_split' ) ) { 118 118 $length = $this->strlen( $string ); … … 130 130 * @return int 131 131 */ 132 function pos() {132 public function pos() { 133 133 return $this->_pos; 134 134 } … … 137 137 * @return true 138 138 */ 139 function is_resource() {139 public function is_resource() { 140 140 return true; 141 141 } … … 144 144 * @return true 145 145 */ 146 function close() {146 public function close() { 147 147 return true; 148 148 } … … 156 156 * @param string $filename 157 157 */ 158 function __construct( $filename ) {158 public function __construct( $filename ) { 159 159 parent::__construct(); 160 160 $this->_f = fopen( $filename, 'rb' ); … … 177 177 * @return string|false Returns read string, otherwise false. 178 178 */ 179 function read( $bytes ) {179 public function read( $bytes ) { 180 180 return fread( $this->_f, $bytes ); 181 181 } … … 185 185 * @return bool 186 186 */ 187 function seekto( $pos ) {187 public function seekto( $pos ) { 188 188 if ( -1 == fseek( $this->_f, $pos, SEEK_SET ) ) { 189 189 return false; … … 196 196 * @return bool 197 197 */ 198 function is_resource() {198 public function is_resource() { 199 199 return is_resource( $this->_f ); 200 200 } … … 203 203 * @return bool 204 204 */ 205 function feof() {205 public function feof() { 206 206 return feof( $this->_f ); 207 207 } … … 210 210 * @return bool 211 211 */ 212 function close() {212 public function close() { 213 213 return fclose( $this->_f ); 214 214 } … … 217 217 * @return string 218 218 */ 219 function read_all() {219 public function read_all() { 220 220 $all = ''; 221 221 while ( ! $this->feof() ) { … … 239 239 * PHP5 constructor. 240 240 */ 241 function __construct( $str = '' ) {241 public function __construct( $str = '' ) { 242 242 parent::__construct(); 243 243 $this->_str = $str; … … 261 261 * @return string 262 262 */ 263 function read( $bytes ) {263 public function read( $bytes ) { 264 264 $data = $this->substr( $this->_str, $this->_pos, $bytes ); 265 265 $this->_pos += $bytes; … … 274 274 * @return int 275 275 */ 276 function seekto( $pos ) {276 public function seekto( $pos ) { 277 277 $this->_pos = $pos; 278 278 if ( $this->strlen( $this->_str ) < $this->_pos ) { … … 285 285 * @return int 286 286 */ 287 function length() {287 public function length() { 288 288 return $this->strlen( $this->_str ); 289 289 } … … 292 292 * @return string 293 293 */ 294 function read_all() {294 public function read_all() { 295 295 return $this->substr( $this->_str, $this->_pos, $this->strlen( $this->_str ) ); 296 296 } … … 307 307 * PHP5 constructor. 308 308 */ 309 function __construct( $filename ) {309 public function __construct( $filename ) { 310 310 parent::__construct(); 311 311 $this->_str = file_get_contents( $filename ); … … 349 349 * @see POMO_CachedIntFileReader::__construct() 350 350 */ 351 function POMO_CachedIntFileReader( $filename ) {351 public function POMO_CachedIntFileReader( $filename ) { 352 352 _deprecated_constructor( self::class, '5.4.0', static::class ); 353 353 self::__construct( $filename );
Note: See TracChangeset
for help on using the changeset viewer.