Browse Source

Style fixes

Because of the large arrays in the GBCommon class and its test suite,
memory limits had to be disabled in php-cs-fixer
span
J. King 6 years ago
parent
commit
e683167905
  1. 2
      .php_cs.dist
  2. 2
      lib/Encoding/GBCommon.php
  3. 3
      tests/lib/EncodingTest.php

2
.php_cs.dist

@ -7,6 +7,8 @@ namespace MensBeam\UTF8;
const BASE = __DIR__.DIRECTORY_SEPARATOR;
ini_set("memory_limit", "-1");
$paths = [
__FILE__,
BASE."RoboFile.php",

2
lib/Encoding/GBCommon.php

@ -26,7 +26,7 @@ abstract class GBCommon implements StatelessEncoding {
$second = 0;
$third = 0;
$this->posChar++;
while(($b = @$this->string[$this->posByte++]) !== "") {
while (($b = @$this->string[$this->posByte++]) !== "") {
$b = ord($b);
if ($first === 0) {
if ($b < 0x80) {

3
tests/lib/EncodingTest.php

@ -10,7 +10,6 @@ use MensBeam\Intl\Encoding\EncoderException;
use MensBeam\Intl\Encoding\DecoderException;
abstract class EncodingTest extends \PHPUnit\Framework\TestCase {
public function testEncodeCodePoints(bool $fatal, $input, $exp) {
$class = $this->testedClass;
if ($exp instanceof \Throwable) {
@ -60,7 +59,7 @@ abstract class EncodingTest extends \PHPUnit\Framework\TestCase {
$exp = array_reverse($exp);
$act = [];
while ($s->nextCode() !== false);
while($s->posByte()) {
while ($s->posByte()) {
$s->seek(-1);
$act[] = $s->nextCode();
$s->seek(-1);

Loading…
Cancel
Save