Style fixes
This commit is contained in:
parent
3920f11e22
commit
540d8a237e
4 changed files with 11 additions and 10 deletions
|
@ -11,11 +11,13 @@ $paths = [
|
|||
__FILE__,
|
||||
BASE."RoboFile.php",
|
||||
BASE."lib",
|
||||
BASE."perf",
|
||||
BASE."tests",
|
||||
];
|
||||
$rules = [
|
||||
'@PSR2' => true,
|
||||
'braces' => ['position_after_functions_and_oop_constructs' => "same"],
|
||||
'function_declaration' => ['closure_function_spacing' => "none"],
|
||||
];
|
||||
|
||||
$finder = \PhpCsFixer\Finder::create();
|
||||
|
|
|
@ -66,7 +66,7 @@ class UTF8 {
|
|||
/** Decodes the next character from the string and returns its code point number
|
||||
*
|
||||
* If the end of the string has been reached, false is returned
|
||||
*
|
||||
*
|
||||
* @return int|bool
|
||||
*/
|
||||
public function nextCode() {
|
||||
|
@ -188,8 +188,8 @@ class UTF8 {
|
|||
}
|
||||
}
|
||||
|
||||
/** Seeks to the start of the string
|
||||
*
|
||||
/** Seeks to the start of the string
|
||||
*
|
||||
* This is usually faster than using the seek method for the same purpose
|
||||
*/
|
||||
public function rewind() {
|
||||
|
@ -285,14 +285,14 @@ class UTF8 {
|
|||
|
||||
/** Sets the decoder's state to the values specified */
|
||||
protected function stateApply(array $state) {
|
||||
foreach($state as $key => $value) {
|
||||
foreach ($state as $key => $value) {
|
||||
$this->$key = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/** Handles decoding and encoding errors */
|
||||
protected static function err(int $mode, $data = null) {
|
||||
switch($mode) {
|
||||
switch ($mode) {
|
||||
case self::MODE_NULL:
|
||||
// used internally during backward seeking
|
||||
return null;
|
||||
|
|
|
@ -70,7 +70,7 @@ if (!file_exists(__DIR__."/docs/")) {
|
|||
mkdir(__DIR__."/docs/");
|
||||
}
|
||||
|
||||
foreach($files as $fName => $file) {
|
||||
foreach ($files as $fName => $file) {
|
||||
list($file, $make) = $file;
|
||||
$file = __DIR__."/docs/$file";
|
||||
if (!file_exists($file)) {
|
||||
|
@ -84,7 +84,7 @@ foreach($files as $fName => $file) {
|
|||
$text = file_get_contents($file);
|
||||
}
|
||||
echo str_pad("$fName:", 30, " ").compile_statistics($text)."\n";
|
||||
foreach($tests as $tName => $test) {
|
||||
foreach ($tests as $tName => $test) {
|
||||
list($req, $test) = $test;
|
||||
if ($req && !extension_loaded($req)) {
|
||||
continue;
|
||||
|
|
|
@ -46,7 +46,7 @@ class TestUTF8 extends \PHPUnit\Framework\TestCase {
|
|||
*/
|
||||
public function testDecodeMultipleCharactersAsStrings(string $input, array $exp) {
|
||||
$out = [];
|
||||
$exp = array_map(function ($v) {
|
||||
$exp = array_map(function($v) {
|
||||
return \IntlChar::chr($v);
|
||||
}, $exp);
|
||||
$s = new UTF8($input);
|
||||
|
@ -83,7 +83,7 @@ class TestUTF8 extends \PHPUnit\Framework\TestCase {
|
|||
}
|
||||
$this->assertSame(sizeof($exp), $a);
|
||||
|
||||
$exp = array_map(function ($v) {
|
||||
$exp = array_map(function($v) {
|
||||
return \IntlChar::chr($v);
|
||||
}, $exp);
|
||||
|
||||
|
@ -102,7 +102,6 @@ class TestUTF8 extends \PHPUnit\Framework\TestCase {
|
|||
$a++;
|
||||
}
|
||||
$this->assertSame(sizeof($exp), $a);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue