@@ -76,24 +76,24 @@ protected function loadResource($resource)
7676 while ($ line = fgets ($ stream )) {
7777 $ line = trim ($ line );
7878
79- if ($ line === '' ) {
79+ if ('' === $ line ) {
8080 // Whitespace indicated current item is done
8181 if (!in_array ('fuzzy ' , $ flags )) {
8282 $ this ->addMessage ($ messages , $ item );
8383 }
8484 $ item = $ defaults ;
8585 $ flags = array ();
86- } elseif (substr ($ line , 0 , 2 ) === ' #, ' ) {
86+ } elseif (' #, ' === substr ($ line , 0 , 2 )) {
8787 $ flags = array_map ('trim ' , explode (', ' , substr ($ line , 2 )));
88- } elseif (substr ($ line , 0 , 7 ) === ' msgid " ' ) {
88+ } elseif (' msgid " ' === substr ($ line , 0 , 7 )) {
8989 // We start a new msg so save previous
9090 // TODO: this fails when comments or contexts are added
9191 $ this ->addMessage ($ messages , $ item );
9292 $ item = $ defaults ;
9393 $ item ['ids ' ]['singular ' ] = substr ($ line , 7 , -1 );
94- } elseif (substr ($ line , 0 , 8 ) === ' msgstr " ' ) {
94+ } elseif (' msgstr " ' === substr ($ line , 0 , 8 )) {
9595 $ item ['translated ' ] = substr ($ line , 8 , -1 );
96- } elseif ($ line [ 0 ] === ' " ' ) {
96+ } elseif (' " ' === $ line [ 0 ] ) {
9797 $ continues = isset ($ item ['translated ' ]) ? 'translated ' : 'ids ' ;
9898
9999 if (is_array ($ item [$ continues ])) {
@@ -102,9 +102,9 @@ protected function loadResource($resource)
102102 } else {
103103 $ item [$ continues ] .= substr ($ line , 1 , -1 );
104104 }
105- } elseif (substr ($ line , 0 , 14 ) === ' msgid_plural " ' ) {
105+ } elseif (' msgid_plural " ' === substr ($ line , 0 , 14 )) {
106106 $ item ['ids ' ]['plural ' ] = substr ($ line , 14 , -1 );
107- } elseif (substr ($ line , 0 , 7 ) === ' msgstr[ ' ) {
107+ } elseif (' msgstr[ ' === substr ($ line , 0 , 7 )) {
108108 $ size = strpos ($ line , '] ' );
109109 $ item ['translated ' ][(int ) substr ($ line , 7 , 1 )] = substr ($ line , $ size + 3 , -1 );
110110 }
0 commit comments