Merge "Fix CodeSniffer errors and warnings"
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
* @licence MIT License
|
* @licence MIT License
|
||||||
*/
|
*/
|
||||||
class LanguageNameSearch {
|
class LanguageNameSearch {
|
||||||
static $languagenames;
|
protected static $languagenames;
|
||||||
|
|
||||||
public static function init() {
|
public static function init() {
|
||||||
self::$languagenames = unserialize( file_get_contents( __DIR__ . '/langnames.ser' ) );
|
self::$languagenames = unserialize( file_get_contents( __DIR__ . '/langnames.ser' ) );
|
||||||
@@ -74,11 +74,12 @@ class LanguageNameSearch {
|
|||||||
static function getCodepoint( $str ) {
|
static function getCodepoint( $str ) {
|
||||||
$values = array();
|
$values = array();
|
||||||
$lookingFor = 1;
|
$lookingFor = 1;
|
||||||
for ( $i = 0; $i < strlen( $str ); $i++ ) {
|
$strLen = strlen( $str );
|
||||||
|
for ( $i = 0; $i < $strLen; $i++ ) {
|
||||||
$thisValue = ord( $str[$i] );
|
$thisValue = ord( $str[$i] );
|
||||||
if ( $thisValue < 128 ) {
|
if ( $thisValue < 128 ) {
|
||||||
return $thisValue;
|
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 ) {
|
if ( count( $values ) === 0 ) {
|
||||||
// 224 is the lowest non-overlong-encoded codepoint.
|
// 224 is the lowest non-overlong-encoded codepoint.
|
||||||
$lookingFor = ( $thisValue < 224 ) ? 2 : 3;
|
$lookingFor = ( $thisValue < 224 ) ? 2 : 3;
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ foreach ( glob( '../fonts/*/font.ini' ) as $inifile ) {
|
|||||||
$dir = dirname( $inifile );
|
$dir = dirname( $inifile );
|
||||||
|
|
||||||
if ( isset( $font['ttf'] ) ) {
|
if ( isset( $font['ttf'] ) ) {
|
||||||
$list['fonts'][$fontname]['ttf'] = basename( $dir ) . '/' . $font['ttf'] ;
|
$list['fonts'][$fontname]['ttf'] = basename( $dir ) . '/' . $font['ttf'];
|
||||||
}
|
}
|
||||||
if ( isset( $font['svg'] ) ) {
|
if ( isset( $font['svg'] ) ) {
|
||||||
$list['fonts'][$fontname]['svg'] = basename( $dir ) . '/' . $font['svg'];
|
$list['fonts'][$fontname]['svg'] = basename( $dir ) . '/' . $font['svg'];
|
||||||
@@ -89,7 +89,7 @@ ksort( $list['fonts'] );
|
|||||||
|
|
||||||
$json = json_encode( $list );
|
$json = json_encode( $list );
|
||||||
$js = <<<JAVASCRIPT
|
$js = <<<JAVASCRIPT
|
||||||
// Please do not edit. This file is generated from data/fontrepo by data/fontrepo/scripts/compile.php
|
// Do not edit! This file is generated from data/fontrepo by data/fontrepo/scripts/compile.php
|
||||||
( function ( $ ) {
|
( function ( $ ) {
|
||||||
$.webfonts = $.webfonts || {};
|
$.webfonts = $.webfonts || {};
|
||||||
$.webfonts.repository = $json;
|
$.webfonts.repository = $json;
|
||||||
|
|||||||
@@ -32,8 +32,8 @@
|
|||||||
/* RTL text direction here (bug 45142). x:-o-prefocus won't match anything, */
|
/* RTL text direction here (bug 45142). x:-o-prefocus won't match anything, */
|
||||||
/* but will make other browsers ignore this rule. */
|
/* but will make other browsers ignore this rule. */
|
||||||
x:-o-prefocus, body.rtl li#pt-uls {
|
x:-o-prefocus, body.rtl li#pt-uls {
|
||||||
/* @noflip */
|
/* @noflip */
|
||||||
direction: ltr;
|
direction: ltr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#settings-block {
|
#settings-block {
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ div.display-settings-block {
|
|||||||
.uls-font-item {
|
.uls-font-item {
|
||||||
border-bottom: 1px solid #EEEEEE;
|
border-bottom: 1px solid #EEEEEE;
|
||||||
background: #FBFBFB;
|
background: #FBFBFB;
|
||||||
margin: 0 ;
|
margin: 0;
|
||||||
padding: 10px 0;
|
padding: 10px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
* @licence GNU General Public Licence 2.0 or later
|
* @licence GNU General Public Licence 2.0 or later
|
||||||
* @licence MIT License
|
* @licence MIT License
|
||||||
*/
|
*/
|
||||||
require_once( __DIR__ . '/../../data/LanguageNameSearch.php' );
|
require_once __DIR__ . '/../../data/LanguageNameSearch.php';
|
||||||
class LanguageSearchTest extends PHPUnit_Framework_TestCase {
|
class LanguageSearchTest extends PHPUnit_Framework_TestCase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user