tedious / JShrink

Javascript Minifier built in PHP
http://www.tedivm.com
BSD 3-Clause "New" or "Revised" License
751 stars 152 forks source link

JShrink doesn't work on PHP 7.3 #77

Closed morozov closed 6 years ago

morozov commented 6 years ago
$ phpunit 
PHPUnit 6.5.13 by Sebastian Bergmann and contributors.

E....E...E....E......EEE.EE..                                                     29 / 29 (100%)

Time: 275 ms, Memory: 6.00MB

There were 9 errors:

1) JShrink\Test\JShrinkTest::testUnclosedCommentException
"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

/home/morozov/JShrink/src/JShrink/Minifier.php:234
/home/morozov/JShrink/tests/JShrink/Test/JShrinkTest.php:24

2) JShrink\Test\JShrinkTest::testJShrink with data set #2 ('prefix_increment.js', 'do{div.innerHTML="<!--[if gt ...ile(1)', 'do{div.innerHTML="<!--[if gt ...ile(1)')
strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

/home/morozov/JShrink/src/JShrink/Minifier.php:186
/home/morozov/JShrink/src/JShrink/Minifier.php:147
/home/morozov/JShrink/src/JShrink/Minifier.php:115
/home/morozov/JShrink/tests/JShrink/Test/JShrinkTest.php:52

3) JShrink\Test\JShrinkTest::testJShrink with data set #6 ('remove-brace-lines.js', 'if ( dtMonth < 1 || dtMonth >...   }\n', 'if(dtMonth<1||dtMonth>12){ret...alse;}')
strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

/home/morozov/JShrink/src/JShrink/Minifier.php:186
/home/morozov/JShrink/src/JShrink/Minifier.php:147
/home/morozov/JShrink/src/JShrink/Minifier.php:115
/home/morozov/JShrink/tests/JShrink/Test/JShrinkTest.php:52

4) JShrink\Test\JShrinkTest::testJShrink with data set #11 ('utf_chars.js', 'var π = Math.PI,\n    ε = 1e-... 0;\n}', 'var π=Math.PI,ε=1e-6,radians=...-1:0;}')
strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

/home/morozov/JShrink/src/JShrink/Minifier.php:186
/home/morozov/JShrink/src/JShrink/Minifier.php:147
/home/morozov/JShrink/src/JShrink/Minifier.php:115
/home/morozov/JShrink/tests/JShrink/Test/JShrinkTest.php:52

5) JShrink\Test\JShrinkTest::testUglify with data set #6 ('empty-blocks.js', 'var x = 5;\nfunction bar() { ...); }\n', 'var x=5;function bar(){return...(;;);}')
strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

/home/morozov/JShrink/src/JShrink/Minifier.php:186
/home/morozov/JShrink/src/JShrink/Minifier.php:147
/home/morozov/JShrink/src/JShrink/Minifier.php:115
/home/morozov/JShrink/tests/JShrink/Test/JShrinkTest.php:61

6) JShrink\Test\JShrinkTest::testUglify with data set #7 ('forstatement.js', 'a=func();\nb=z;\nfor (a++; i ...); }\n', 'a=func();b=z;for(a++;i<10;i++...t(i);}')
strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

/home/morozov/JShrink/src/JShrink/Minifier.php:186
/home/morozov/JShrink/src/JShrink/Minifier.php:147
/home/morozov/JShrink/src/JShrink/Minifier.php:115
/home/morozov/JShrink/tests/JShrink/Test/JShrinkTest.php:61

7) JShrink\Test\JShrinkTest::testUglify with data set #8 ('if.js', 'var a = 1;\r\nif (a == 1) {\r...n}\r\n', 'var a=1;if(a==1){a=2;}else{a=17;}')
strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

/home/morozov/JShrink/src/JShrink/Minifier.php:186
/home/morozov/JShrink/src/JShrink/Minifier.php:147
/home/morozov/JShrink/src/JShrink/Minifier.php:115
/home/morozov/JShrink/tests/JShrink/Test/JShrinkTest.php:61

8) JShrink\Test\JShrinkTest::testUglify with data set #10 ('null_string.js', 'var nullString = "\0"', 'var nullString="\0"')
strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

/home/morozov/JShrink/src/JShrink/Minifier.php:186
/home/morozov/JShrink/src/JShrink/Minifier.php:147
/home/morozov/JShrink/src/JShrink/Minifier.php:115
/home/morozov/JShrink/tests/JShrink/Test/JShrinkTest.php:61

9) JShrink\Test\JShrinkTest::testUglify with data set #11 ('strict-equals.js', 'typeof a === 'string'\nb + ""... < g\n', 'typeof a==='string'\nb+""!==c...===f<g')
strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

/home/morozov/JShrink/src/JShrink/Minifier.php:186
/home/morozov/JShrink/src/JShrink/Minifier.php:147
/home/morozov/JShrink/src/JShrink/Minifier.php:115
/home/morozov/JShrink/tests/JShrink/Test/JShrinkTest.php:61

ERRORS!
Tests: 29, Assertions: 22, Errors: 9.