Plugin Directory

Changeset 3297378

Timestamp:
05/20/2025 12:24:41 PM (6 months ago)
Author:
timwhitlock
Message:

PHP 8.0 fix

Location:
loco-translate
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • loco-translate/tags/2.7.3/lib/compiled/gettext.php

    r3297124 r3297378  
    55 */
    66interface LocoArrayInterface extends ArrayAccess, Iterator, Countable, JsonSerializable {
    7 public function getArrayCopy():array; }
     7public function getArrayCopy(); }
    88class LocoHeaders extends ArrayIterator implements LocoArrayInterface {
    99private /*array*/ $map = [];
  • loco-translate/trunk/lib/compiled/gettext.php

    r3269005 r3297378  
    55 */
    66interface LocoArrayInterface extends ArrayAccess, Iterator, Countable, JsonSerializable {
    7 public function getArrayCopy():array; }
     7public function getArrayCopy(); }
    88class LocoHeaders extends ArrayIterator implements LocoArrayInterface {
    99private /*array*/ $map = [];
     
    241241final public function unescapeMatch( array $r ):string { $s = $r[0]; $c = $s[1]; if( isset($this->map[$c]) ){ return $this->map[$c]; } if( 'u' === $c ){ $str = ''; $surrogates = false; foreach( explode('\\u',$s) as $i => $h ){ if( '' !== $h ){ $h = ltrim( trim($h,'{}'),'0'); $u = intval($h,16); $str.= loco_utf8_chr($u); if( ! $surrogates ){ $surrogates = $u >= 0xD800 && $u <= 0xDBFF; } } } if( $surrogates ){ $str = loco_resolve_surrogates($str); } return $str; } if( 'U' === $c ){ return loco_utf8_chr( intval(substr($s,2),16) ); } if( 'x' === $c ){ return chr( intval(substr($s,2),16) ); } if( ctype_digit($c) ){ return chr( intval(substr($s,1),8) ); } return $s; }
    242242protected function stripSlashes( string $s ):string { return stripcslashes($s); } }
    243 class LocoJsTokens extends LocoTokenizer { const T_KWORD = 1; const T_REGEX = 2;
     243class LocoJsTokens extends LocoTokenizer {
    244244private static /*LocoEscapeParser*/ $lex = null;
    245245protected static /*array*/ $words = [ 'true' => 1, 'false' => 1, 'null' => 1, 'break' => T_BREAK, 'else' => T_ELSE, 'new' => T_NEW, 'var' => 1, 'case' => T_CASE, 'finally' => T_FINALLY, 'return' => T_RETURN, 'void' => 1, 'catch' => T_CATCH, 'for' => T_FOR, 'switch' => T_SWITCH, 'while' => T_WHILE, 'continue' => T_CONTINUE, 'function' => T_FUNCTION, 'this' => T_STRING, 'with' => 1, 'default' => T_DEFAULT, 'if' => T_IF, 'throw' => T_THROW, 'delete' => 1, 'in' => 1, 'try' => T_TRY, 'do' => T_DO, 'instanceof' => 1, 'typeof' => 1, ];
Note: See TracChangeset for help on using the changeset viewer.