wp/wp-includes/pomo/streams.php
changeset 16 a86126ab1dd4
parent 9 177826044cd9
child 18 be944660c56a
--- a/wp/wp-includes/pomo/streams.php	Tue Oct 22 16:11:46 2019 +0200
+++ b/wp/wp-includes/pomo/streams.php	Tue Dec 15 13:49:49 2020 +0100
@@ -18,14 +18,19 @@
 		 * PHP5 constructor.
 		 */
 		function __construct() {
-			$this->is_overloaded = ( ( ini_get( 'mbstring.func_overload' ) & 2 ) != 0 ) && function_exists( 'mb_substr' );
+			$this->is_overloaded = ( ( ini_get( 'mbstring.func_overload' ) & 2 ) != 0 ) && function_exists( 'mb_substr' ); // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated
 			$this->_pos          = 0;
 		}
 
 		/**
 		 * PHP4 constructor.
+		 *
+		 * @deprecated 5.4.0 Use __construct() instead.
+		 *
+		 * @see POMO_Reader::__construct()
 		 */
 		public function POMO_Reader() {
+			_deprecated_constructor( self::class, '5.4.0', static::class );
 			self::__construct();
 		}
 
@@ -34,7 +39,7 @@
 		 *
 		 * @param string $endian Set the endianness of the file. Accepts 'big', or 'little'.
 		 */
-		function setEndian( $endian ) {
+		function setEndian( $endian ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
 			$this->endian = $endian;
 		}
 
@@ -49,7 +54,7 @@
 			if ( 4 != $this->strlen( $bytes ) ) {
 				return false;
 			}
-			$endian_letter = ( 'big' == $this->endian ) ? 'N' : 'V';
+			$endian_letter = ( 'big' === $this->endian ) ? 'N' : 'V';
 			$int           = unpack( $endian_letter, $bytes );
 			return reset( $int );
 		}
@@ -66,7 +71,7 @@
 			if ( 4 * $count != $this->strlen( $bytes ) ) {
 				return false;
 			}
-			$endian_letter = ( 'big' == $this->endian ) ? 'N' : 'V';
+			$endian_letter = ( 'big' === $this->endian ) ? 'N' : 'V';
 			return unpack( $endian_letter . $count, $bytes );
 		}
 
@@ -144,14 +149,19 @@
 		 * @param string $filename
 		 */
 		function __construct( $filename ) {
-			parent::POMO_Reader();
+			parent::__construct();
 			$this->_f = fopen( $filename, 'rb' );
 		}
 
 		/**
 		 * PHP4 constructor.
+		 *
+		 * @deprecated 5.4.0 Use __construct() instead.
+		 *
+		 * @see POMO_FileReader::__construct()
 		 */
 		public function POMO_FileReader( $filename ) {
+			_deprecated_constructor( self::class, '5.4.0', static::class );
 			self::__construct( $filename );
 		}
 
@@ -222,15 +232,20 @@
 		 * PHP5 constructor.
 		 */
 		function __construct( $str = '' ) {
-			parent::POMO_Reader();
+			parent::__construct();
 			$this->_str = $str;
 			$this->_pos = 0;
 		}
 
 		/**
 		 * PHP4 constructor.
+		 *
+		 * @deprecated 5.4.0 Use __construct() instead.
+		 *
+		 * @see POMO_StringReader::__construct()
 		 */
 		public function POMO_StringReader( $str = '' ) {
+			_deprecated_constructor( self::class, '5.4.0', static::class );
 			self::__construct( $str );
 		}
 
@@ -285,7 +300,7 @@
 		 * PHP5 constructor.
 		 */
 		function __construct( $filename ) {
-			parent::POMO_StringReader();
+			parent::__construct();
 			$this->_str = file_get_contents( $filename );
 			if ( false === $this->_str ) {
 				return false;
@@ -295,8 +310,13 @@
 
 		/**
 		 * PHP4 constructor.
+		 *
+		 * @deprecated 5.4.0 Use __construct() instead.
+		 *
+		 * @see POMO_CachedFileReader::__construct()
 		 */
 		public function POMO_CachedFileReader( $filename ) {
+			_deprecated_constructor( self::class, '5.4.0', static::class );
 			self::__construct( $filename );
 		}
 	}
@@ -311,13 +331,18 @@
 		 * PHP5 constructor.
 		 */
 		public function __construct( $filename ) {
-			parent::POMO_CachedFileReader( $filename );
+			parent::__construct( $filename );
 		}
 
 		/**
 		 * PHP4 constructor.
+		 *
+		 * @deprecated 5.4.0 Use __construct() instead.
+		 *
+		 * @see POMO_CachedIntFileReader::__construct()
 		 */
 		function POMO_CachedIntFileReader( $filename ) {
+			_deprecated_constructor( self::class, '5.4.0', static::class );
 			self::__construct( $filename );
 		}
 	}