From 6381604484166af3f91bd20c79b1c01fdaefa194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dariusz=20Rumi=C5=84ski?= Date: Wed, 23 Jul 2014 20:13:24 +0200 Subject: [PATCH 1/3] .php_cs add file for php-cs-fixer configuration --- .php_cs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .php_cs diff --git a/.php_cs b/.php_cs new file mode 100644 index 0000000..8d3b7d8 --- /dev/null +++ b/.php_cs @@ -0,0 +1,11 @@ +finder(Symfony\CS\Finder\DefaultFinder::create() + ->notName('LICENSE') + ->notName('README.md') + ->notName('composer.*') + ->notName('phpunit.xml.*') + ->notName('*.phar') + ->exclude('vendor') + ->in(__DIR__) +); From 3d25e12fe11f22d8a3491987b8657af183a617af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dariusz=20Rumi=C5=84ski?= Date: Wed, 23 Jul 2014 20:15:57 +0200 Subject: [PATCH 2/3] cs fixes --- bin/build_bootstrap.php | 8 ++++---- test/Mustache/Test/Functional/ExamplesTest.php | 2 +- .../section_magic_objects/SectionMagicObjects.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/build_bootstrap.php b/bin/build_bootstrap.php index 7863efc..b40b501 100755 --- a/bin/build_bootstrap.php +++ b/bin/build_bootstrap.php @@ -95,10 +95,10 @@ EOS; /** * Loads a list of classes and caches them in one big file. * - * @param array $classes An array of classes to load - * @param string $cacheDir A cache directory - * @param string $name The cache name prefix - * @param string $extension File extension of the resulting file + * @param array $classes An array of classes to load + * @param string $cacheDir A cache directory + * @param string $name The cache name prefix + * @param string $extension File extension of the resulting file * * @throws InvalidArgumentException When class can't be loaded */ diff --git a/test/Mustache/Test/Functional/ExamplesTest.php b/test/Mustache/Test/Functional/ExamplesTest.php index 43eab61..cc5b09d 100644 --- a/test/Mustache/Test/Functional/ExamplesTest.php +++ b/test/Mustache/Test/Functional/ExamplesTest.php @@ -92,7 +92,7 @@ class Mustache_Test_Functional_ExamplesTest extends PHPUnit_Framework_TestCase // load other files switch ($info['extension']) { case 'php': - require_once($fullpath); + require_once $fullpath; $context = new $info['filename']; break; diff --git a/test/fixtures/examples/section_magic_objects/SectionMagicObjects.php b/test/fixtures/examples/section_magic_objects/SectionMagicObjects.php index c03e228..2d9b464 100644 --- a/test/fixtures/examples/section_magic_objects/SectionMagicObjects.php +++ b/test/fixtures/examples/section_magic_objects/SectionMagicObjects.php @@ -21,7 +21,7 @@ class MagicObject public function __get($key) { - return isset($this->_data[$key]) ? $this->_data[$key] : NULL; + return isset($this->_data[$key]) ? $this->_data[$key] : null; } public function __isset($key) From 80d724f5f3ba762af16bc8f85470e0f2fbd9925f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dariusz=20Rumi=C5=84ski?= Date: Thu, 24 Jul 2014 19:03:27 +0200 Subject: [PATCH 3/3] .php_cs - simplify --- .php_cs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.php_cs b/.php_cs index 8d3b7d8..f34252f 100644 --- a/.php_cs +++ b/.php_cs @@ -1,11 +1,6 @@ finder(Symfony\CS\Finder\DefaultFinder::create() - ->notName('LICENSE') - ->notName('README.md') - ->notName('composer.*') - ->notName('phpunit.xml.*') - ->notName('*.phar') - ->exclude('vendor') - ->in(__DIR__) -); +$config = new Symfony\CS\Config\Config(); +$config->getFinder()->exclude('bin'); + +return $config;