Fix CodeSniffer errors and warnings

More fixes will be submitted upstream.

Change-Id: Ib22997f8756537b063fd6eed3f1f74f3eda315d7
This commit is contained in:
Siebrand Mazeland
2013-08-02 14:23:20 +02:00
parent b3677810c4
commit 102f257427
5 changed files with 10 additions and 9 deletions

View File

@@ -18,7 +18,7 @@
* @licence MIT License
*/
class LanguageNameSearch {
static $languagenames;
protected static $languagenames;
public static function init() {
self::$languagenames = unserialize( file_get_contents( __DIR__ . '/langnames.ser' ) );
@@ -74,11 +74,12 @@ class LanguageNameSearch {
static function getCodepoint( $str ) {
$values = array();
$lookingFor = 1;
for ( $i = 0; $i < strlen( $str ); $i++ ) {
$strLen = strlen( $str );
for ( $i = 0; $i < $strLen; $i++ ) {
$thisValue = ord( $str[$i] );
if ( $thisValue < 128 ) {
return $thisValue;
} else { // Codepoints larger than 127 are represented by multi-byte sequences,
} else { // Codepoints larger than 127 are represented by multi-byte sequences
if ( count( $values ) === 0 ) {
// 224 is the lowest non-overlong-encoded codepoint.
$lookingFor = ( $thisValue < 224 ) ? 2 : 3;