Skip to content

Commit 4c4ecee

Browse files
Reformat
1 parent cd306fc commit 4c4ecee

15 files changed

+33
-52
lines changed

.gitattributes

-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@
1111
/makefile export-ignore
1212
/phpunit.xml export-ignore
1313
/README.md export-ignore
14-
/ruleset.xml.dist export-ignore

.php-cs-fixer.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@
99
return $config
1010
->setRules(array(
1111
'@Symfony' => true,
12+
'@PER-CS' => true,
1213
'array_syntax' => array('syntax' => 'long'),
14+
'concat_space' => array('spacing' => 'one'),
1315
'single_line_throw' => false,
1416
'yoda_style' => array('equal' => false, 'identical' => false, 'less_and_greater' => false),
15-
'@PSR12' => true,
16-
'class_definition' => false, // @see https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/5463
1717
'visibility_required' => array('elements' => array('property', 'method')),
18+
'phpdoc_align' => array('align' => 'left'),
19+
'trailing_comma_in_multiline' => array('elements' => array('arrays')),
1820
))
1921
->setFinder($finder)
2022
->setUsingCache(false);

composer.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
"require-dev": {
2222
"friendsofphp/php-cs-fixer": ">=2.0",
2323
"matthiasmullie/scrapbook": ">=1.3",
24-
"phpunit/phpunit": ">=4.8",
25-
"squizlabs/php_codesniffer": ">=3.0"
24+
"phpunit/phpunit": ">=4.8"
2625
},
2726
"suggest": {
2827
"psr/cache-implementation": "Cache implementation to use with Minify::cache"

makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PHP ?=
22
TEST ?=
3-
VOLUME_BINDS ?= src,tests,build,.php-cs-fixer.php,phpunit.xml,ruleset.xml
3+
VOLUME_BINDS ?= src,tests,build,.php-cs-fixer.php,phpunit.xml
44

55
docs:
66
docker run --rm -v $$(pwd)/src:/data/src -v $$(pwd)/docs:/data/docs -w /data php:cli bash -c "\
@@ -18,6 +18,6 @@ format:
1818
VOLUMES=""
1919
for VOLUME in $$(echo "$(VOLUME_BINDS)" | tr "," "\n"); do VOLUMES="$$VOLUMES -v $$(pwd)/$$VOLUME:/var/www/$$VOLUME"; done;\
2020
test $$(docker images -q matthiasmullie/minify:cli) || docker build -t matthiasmullie/minify:cli .;\
21-
docker run $$VOLUMES matthiasmullie/minify:cli sh -c "PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix && vendor/bin/phpcbf --standard=ruleset.xml"
21+
docker run $$VOLUMES matthiasmullie/minify:cli sh -c "PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix"
2222

2323
.PHONY: docs

ruleset.xml

-10
This file was deleted.

src/CSS.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ protected function moveImportsToTop($content)
109109
* \@import's will be loaded and their content merged into the original file,
110110
* to save HTTP requests.
111111
*
112-
* @param string $source The file to combine imports for
113-
* @param string $content The CSS content to combine imports for
112+
* @param string $source The file to combine imports for
113+
* @param string $content The CSS content to combine imports for
114114
* @param string[] $parents Parent paths, for circular reference checks
115115
*
116116
* @return string
@@ -245,7 +245,7 @@ protected function combineImports($source, $content, $parents)
245245
* @url(image.jpg) images will be loaded and their content merged into the
246246
* original file, to save HTTP requests.
247247
*
248-
* @param string $source The file to import files for
248+
* @param string $source The file to import files for
249249
* @param string $content The CSS content to import files for
250250
*
251251
* @return string
@@ -357,7 +357,7 @@ public function execute($path = null, $parents = array())
357357
* (e.g. ../../images/image.gif, if the new CSS file is 1 folder deeper).
358358
*
359359
* @param ConverterInterface $converter Relative path converter
360-
* @param string $content The CSS content to update relative urls for
360+
* @param string $content The CSS content to update relative urls for
361361
*
362362
* @return string
363363
*/
@@ -590,6 +590,7 @@ protected function convertLegacyColors($content)
590590

591591
// convert `rgb` to `hex`
592592
$dec = '([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])';
593+
593594
return preg_replace_callback(
594595
"/rgb\($dec $dec $dec\)/i",
595596
function ($match) {

src/Exception.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,4 @@
1717
*
1818
* @author Matthias Mullie <[email protected]>
1919
*/
20-
abstract class Exception extends \Exception
21-
{
22-
}
20+
abstract class Exception extends \Exception {}

src/Exceptions/BasicException.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,4 @@
1919
*
2020
* @author Matthias Mullie <[email protected]>
2121
*/
22-
abstract class BasicException extends Exception
23-
{
24-
}
22+
abstract class BasicException extends Exception {}

src/Exceptions/FileImportException.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,4 @@
1717
*
1818
* @author Matthias Mullie <[email protected]>
1919
*/
20-
class FileImportException extends BasicException
21-
{
22-
}
20+
class FileImportException extends BasicException {}

src/Exceptions/IOException.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,4 @@
1717
*
1818
* @author Matthias Mullie <[email protected]>
1919
*/
20-
class IOException extends BasicException
21-
{
22-
}
20+
class IOException extends BasicException {}

src/JS.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ protected function stripWhitespace($content)
450450
* This will prepare the given array by escaping all characters.
451451
*
452452
* @param string[] $operators
453-
* @param string $delimiter
453+
* @param string $delimiter
454454
*
455455
* @return string[]
456456
*/
@@ -481,7 +481,7 @@ protected function getOperatorsForRegex(array $operators, $delimiter = '/')
481481
* This will prepare the given array by escaping all characters.
482482
*
483483
* @param string[] $keywords
484-
* @param string $delimiter
484+
* @param string $delimiter
485485
*
486486
* @return string[]
487487
*/

src/Minify.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ protected function load($data)
230230
* Save to file.
231231
*
232232
* @param string $content The minified data
233-
* @param string $path The path to save the minified data to
233+
* @param string $path The path to save the minified data to
234234
*
235235
* @throws IOException
236236
*/
@@ -249,7 +249,7 @@ protected function save($content, $path)
249249
* If $replacement is a string, it must be plain text. Placeholders like $1 or \2 don't work.
250250
* If you need that functionality, use a callback instead.
251251
*
252-
* @param string $pattern PCRE pattern
252+
* @param string $pattern PCRE pattern
253253
* @param string|callable $replacement Replacement value for matched pattern
254254
*/
255255
protected function registerPattern($pattern, $replacement = '')
@@ -390,7 +390,7 @@ protected function replace($content)
390390
* If it's a string, just pass it through.
391391
*
392392
* @param string|callable $replacement Replacement value
393-
* @param array $match Match data, in PREG_OFFSET_CAPTURE form
393+
* @param array $match Match data, in PREG_OFFSET_CAPTURE form
394394
*
395395
* @return string
396396
*/
@@ -532,8 +532,8 @@ protected function openFileForWriting($path)
532532
* Attempts to write $content to the file specified by $handler. $path is used for printing exceptions.
533533
*
534534
* @param resource $handler The resource to write to
535-
* @param string $content The content to write
536-
* @param string $path The path to the file (for exception printing only)
535+
* @param string $content The content to write
536+
* @param string $path The path to the file (for exception printing only)
537537
*
538538
* @throws IOException
539539
*/

tests/CSS/CSSTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public static function dataProvider()
203203
);
204204

205205
$tests[] = array(
206-
<<<'JS'
206+
<<<'JS'
207207
p * i , html
208208
/* remove spaces */
209209
@@ -222,7 +222,7 @@ public static function dataProvider()
222222
margin-right : 10px;
223223
}
224224
JS
225-
,
225+
,
226226
'p * i,html body p,p [remove~=" spaces "] :nth-child(3+2n)>b span i,div::after{content:" escapes \\" allowed \\\\";content:" /* string */ "!important;width:calc(100% - 3em + 5px);margin-top:0;margin-bottom:0;margin-left:10px;margin-right:10px}',
227227
);
228228

@@ -486,13 +486,13 @@ public static function dataProvider()
486486

487487
// https://github.com/matthiasmullie/minify/issues/274
488488
$tests[] = array(
489-
'.cvp-live-filter select {
489+
'.cvp-live-filter select {
490490
background-position:
491491
calc(100% - 20px) calc(1em + 2px),
492492
calc(100% - 15px) calc(1em + 2px),
493493
calc(100% - 2.5em) 0.5em;
494494
}',
495-
'.cvp-live-filter select{background-position:calc(100% - 20px) calc(1em + 2px),calc(100% - 15px) calc(1em + 2px),calc(100% - 2.5em) .5em}',
495+
'.cvp-live-filter select{background-position:calc(100% - 20px) calc(1em + 2px),calc(100% - 15px) calc(1em + 2px),calc(100% - 2.5em) .5em}',
496496
);
497497

498498
// https://github.com/matthiasmullie/minify/issues/301

tests/CompatTestCase.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
method_exists('PHPUnit\\Framework\\TestCase', 'expectException')
99
|| !method_exists('PHPUnit\\Framework\\TestCase', 'setExpectedException')
1010
) {
11-
class CompatTestCase extends PHPUnitTestCase
12-
{
13-
}
11+
class CompatTestCase extends PHPUnitTestCase {}
1412
} else {
1513
class CompatTestCase extends PHPUnitTestCase
1614
{

tests/JS/JSTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -208,16 +208,16 @@ public static function dataProvider()
208208
);
209209

210210
$tests[] = array(
211-
'for ( i = 0; ; i++ ) statement',
212-
'for(i=0;;i++)statement',
211+
'for ( i = 0; ; i++ ) statement',
212+
'for(i=0;;i++)statement',
213213
);
214214
$tests[] = array(
215215
'for (i = 0; (i < 10); i++) statement',
216216
'for(i=0;(i<10);i++)statement',
217217
);
218218
$tests[] = array(
219-
'alert("test");;alert("test2")',
220-
'alert("test");alert("test2")',
219+
'alert("test");;alert("test2")',
220+
'alert("test");alert("test2")',
221221
);
222222
$tests[] = array(
223223
'-1
@@ -710,7 +710,7 @@ function isJSON() {
710710
str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']');
711711
}
712712
BUG
713-
,
713+
,
714714
<<<'BUG'
715715
function inspect(){escapedString.replace(/abc/g,'\\\'')}
716716
function isJSON(){str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']')}

0 commit comments

Comments
 (0)