File tree Expand file tree Collapse file tree
src/main/php/util/log/layout Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ s Logging change log
33
44## ?.?.? / ????-??-??
55
6+ * Made compatible with PHP 7.4 - refrain using ` {} ` for string offsets
7+ (@thekid )
68* Replaced all calls to the deprecated ` xp::stringOf() ` to use the method
79 from ` util.Objects ` .
810 (@thekid )
Original file line number Diff line number Diff line change 11<?php namespace util \log \layout ;
22
33use lang \IllegalArgumentException ;
4- use util \log \LoggingEvent ;
54use util \log \LogLevel ;
5+ use util \log \LoggingEvent ;
66
77/**
88 * Pattern layout
@@ -37,11 +37,11 @@ class PatternLayout extends \util\log\Layout {
3737 */
3838 public function __construct ($ format ) {
3939 for ($ i = 0 , $ s = strlen ($ format ); $ i < $ s ; $ i ++) {
40- if ('% ' === $ format{ $ i } ) {
40+ if ('% ' === $ format[ $ i ] ) {
4141 if (++$ i >= $ s ) {
4242 throw new IllegalArgumentException ('Not enough input at position ' .($ i - 1 ));
4343 }
44- switch ($ format{ $ i } ) {
44+ switch ($ format[ $ i ] ) {
4545 case '% ' : { // Literal percent
4646 $ this ->format []= '% ' ;
4747 break ;
@@ -51,14 +51,14 @@ public function __construct($format) {
5151 break ;
5252 }
5353 default : { // Any other character - verify it's supported
54- if (!strspn ($ format{ $ i } , 'mclLtdpx ' )) {
55- throw new IllegalArgumentException ('Unknown format token " ' .$ format{ $ i } .'" ' );
54+ if (!strspn ($ format[ $ i ] , 'mclLtdpx ' )) {
55+ throw new IllegalArgumentException ('Unknown format token " ' .$ format[ $ i ] .'" ' );
5656 }
57- $ this ->format []= '% ' .$ format{ $ i } ;
57+ $ this ->format []= '% ' .$ format[ $ i ] ;
5858 }
5959 }
6060 } else {
61- $ this ->format []= $ format{ $ i } ;
61+ $ this ->format []= $ format[ $ i ] ;
6262 }
6363 }
6464 }
You can’t perform that action at this time.
0 commit comments