Merge pull request #238 from keradus/php-cs-fixer-1.0
update PHP-CS-Fixer to 1.0
This commit is contained in:
+2
-1
@@ -1,3 +1,4 @@
|
|||||||
|
.php_cs.cache
|
||||||
composer.lock
|
composer.lock
|
||||||
vendor
|
|
||||||
mustache.php
|
mustache.php
|
||||||
|
vendor
|
||||||
|
|||||||
@@ -1,34 +1,21 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Symfony\CS\Config\Config;
|
use Symfony\CS\Config\Config;
|
||||||
use Symfony\CS\Fixer;
|
|
||||||
use Symfony\CS\FixerInterface;
|
use Symfony\CS\FixerInterface;
|
||||||
|
|
||||||
$fixer = new Fixer();
|
$config = Config::create()
|
||||||
$fixer->registerBuiltInFixers();
|
// use default level and extra fixers:
|
||||||
|
->fixers(array('-concat_without_spaces', 'concat_with_spaces', 'strict', 'strict_param'))
|
||||||
|
->setUsingCache(true)
|
||||||
|
->setUsingLinter(false);
|
||||||
|
|
||||||
$fixers = array();
|
$finder = $config->getFinder()
|
||||||
|
->in(__DIR__)
|
||||||
|
->exclude('bin');
|
||||||
|
|
||||||
foreach ($fixer->getFixers() as $fixer) {
|
// exclude file due to error on PHP 5.3 that ignore content after __halt_compiler when using token_get_all
|
||||||
$level = $fixer->getLevel();
|
if (version_compare(PHP_VERSION, '5.4', '<')) {
|
||||||
|
$finder->notPath('test/Mustache/Test/Loader/InlineLoaderTest.php');
|
||||||
if (!isset($fixers[$level])) {
|
|
||||||
$fixers[$level] = array();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$fixers[$level][] = $fixer->getName();
|
|
||||||
}
|
|
||||||
|
|
||||||
$fixers = array_merge(
|
|
||||||
$fixers[FixerInterface::PSR0_LEVEL],
|
|
||||||
$fixers[FixerInterface::PSR1_LEVEL],
|
|
||||||
$fixers[FixerInterface::PSR2_LEVEL],
|
|
||||||
$fixers[FixerInterface::ALL_LEVEL],
|
|
||||||
array('concat_with_spaces', 'strict')
|
|
||||||
);
|
|
||||||
|
|
||||||
$config = new Config();
|
|
||||||
$config->fixers($fixers);
|
|
||||||
$config->getFinder()->in(__DIR__)->exclude('bin');
|
|
||||||
|
|
||||||
return $config;
|
return $config;
|
||||||
|
|||||||
+2
-2
@@ -1,11 +1,11 @@
|
|||||||
language: php
|
language: php
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- curl http://cs.sensiolabs.org/get/php-cs-fixer.phar -o php-cs-fixer.phar
|
- curl http://get.sensiolabs.org/php-cs-fixer.phar -o php-cs-fixer.phar
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- phpunit
|
- phpunit
|
||||||
- if [[ `php -r "echo version_compare(PHP_VERSION, '5.3.6', '>=');"` ]]; then php php-cs-fixer.phar --dry-run -v fix .; fi
|
- if [[ `php -r "echo version_compare(PHP_VERSION, '5.3.6', '>=') && !defined('HHVM_VERSION');"` ]]; then php php-cs-fixer.phar --diff --dry-run -vv fix; fi
|
||||||
|
|
||||||
php:
|
php:
|
||||||
- 5.2
|
- 5.2
|
||||||
|
|||||||
@@ -268,8 +268,7 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|||||||
public function testInheritIndentationWhenOverridingAPartial()
|
public function testInheritIndentationWhenOverridingAPartial()
|
||||||
{
|
{
|
||||||
$partials = array(
|
$partials = array(
|
||||||
'partial' =>
|
'partial' => 'stop:
|
||||||
'stop:
|
|
||||||
{{$nineties}}collaborate and listen{{/nineties}}',
|
{{$nineties}}collaborate and listen{{/nineties}}',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user