wp/wp-includes/pomo/streams.php
changeset 21 48c4eec2b7e6
parent 19 3d72ae0968f4
--- a/wp/wp-includes/pomo/streams.php	Thu Sep 29 08:06:27 2022 +0200
+++ b/wp/wp-includes/pomo/streams.php	Fri Sep 05 18:40:08 2025 +0200
@@ -9,10 +9,12 @@
  */
 
 if ( ! class_exists( 'POMO_Reader', false ) ) :
+	#[AllowDynamicProperties]
 	class POMO_Reader {
 
 		public $endian = 'little';
-		public $_post  = '';
+		public $_pos;
+		public $is_overloaded;
 
 		/**
 		 * PHP5 constructor.
@@ -58,7 +60,7 @@
 		 */
 		public function readint32() {
 			$bytes = $this->read( 4 );
-			if ( 4 != $this->strlen( $bytes ) ) {
+			if ( 4 !== $this->strlen( $bytes ) ) {
 				return false;
 			}
 			$endian_letter = ( 'big' === $this->endian ) ? 'N' : 'V';
@@ -75,7 +77,7 @@
 		 */
 		public function readint32array( $count ) {
 			$bytes = $this->read( 4 * $count );
-			if ( 4 * $count != $this->strlen( $bytes ) ) {
+			if ( 4 * $count !== $this->strlen( $bytes ) ) {
 				return false;
 			}
 			$endian_letter = ( 'big' === $this->endian ) ? 'N' : 'V';
@@ -83,46 +85,46 @@
 		}
 
 		/**
-		 * @param string $string
+		 * @param string $input_string
 		 * @param int    $start
 		 * @param int    $length
 		 * @return string
 		 */
-		public function substr( $string, $start, $length ) {
+		public function substr( $input_string, $start, $length ) {
 			if ( $this->is_overloaded ) {
-				return mb_substr( $string, $start, $length, 'ascii' );
+				return mb_substr( $input_string, $start, $length, 'ascii' );
 			} else {
-				return substr( $string, $start, $length );
+				return substr( $input_string, $start, $length );
 			}
 		}
 
 		/**
-		 * @param string $string
+		 * @param string $input_string
 		 * @return int
 		 */
-		public function strlen( $string ) {
+		public function strlen( $input_string ) {
 			if ( $this->is_overloaded ) {
-				return mb_strlen( $string, 'ascii' );
+				return mb_strlen( $input_string, 'ascii' );
 			} else {
-				return strlen( $string );
+				return strlen( $input_string );
 			}
 		}
 
 		/**
-		 * @param string $string
+		 * @param string $input_string
 		 * @param int    $chunk_size
 		 * @return array
 		 */
-		public function str_split( $string, $chunk_size ) {
+		public function str_split( $input_string, $chunk_size ) {
 			if ( ! function_exists( 'str_split' ) ) {
-				$length = $this->strlen( $string );
+				$length = $this->strlen( $input_string );
 				$out    = array();
 				for ( $i = 0; $i < $length; $i += $chunk_size ) {
-					$out[] = $this->substr( $string, $i, $chunk_size );
+					$out[] = $this->substr( $input_string, $i, $chunk_size );
 				}
 				return $out;
 			} else {
-				return str_split( $string, $chunk_size );
+				return str_split( $input_string, $chunk_size );
 			}
 		}
 
@@ -153,6 +155,13 @@
 	class POMO_FileReader extends POMO_Reader {
 
 		/**
+		 * File pointer resource.
+		 *
+		 * @var resource|false
+		 */
+		public $_f;
+
+		/**
 		 * @param string $filename
 		 */
 		public function __construct( $filename ) {
@@ -185,7 +194,7 @@
 		 * @return bool
 		 */
 		public function seekto( $pos ) {
-			if ( -1 == fseek( $this->_f, $pos, SEEK_SET ) ) {
+			if ( -1 === fseek( $this->_f, $pos, SEEK_SET ) ) {
 				return false;
 			}
 			$this->_pos = $pos;
@@ -290,7 +299,6 @@
 		public function read_all() {
 			return $this->substr( $this->_str, $this->_pos, $this->strlen( $this->_str ) );
 		}
-
 	}
 endif;
 
@@ -350,4 +358,3 @@
 		}
 	}
 endif;
-