From 27a8bf0b698e6cc2eec71cf02261b5001210888a Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sat, 18 Jul 2015 07:23:23 -0700 Subject: [PATCH] Update to latest php-cs-fixer config. Update to corresponding style-ci config options. Fix a few code style issues in the process. --- .php_cs | 15 +++++++++++++-- .styleci.yml | 5 ++++- bin/create_example.php | 13 +++---------- test/Mustache/Test/EngineTest.php | 4 ++-- 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/.php_cs b/.php_cs index 8ea84c3..d924712 100644 --- a/.php_cs +++ b/.php_cs @@ -6,10 +6,21 @@ use Symfony\CS\FixerInterface; $config = Config::create() // use symfony level and extra fixers: ->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL) - ->fixers(array('align_double_arrow', '-concat_without_spaces', 'concat_with_spaces', 'ordered_use', 'strict')) + ->fixers(array( + '-concat_without_spaces', + '-pre_increment', + '-unalign_double_arrow', + '-unalign_equals', + 'align_double_arrow', + 'concat_with_spaces', + 'ordered_use', + 'strict', + )) ->setUsingLinter(false); $finder = $config->getFinder() - ->in(__DIR__); + ->in('bin') + ->in('src') + ->in('test'); return $config; diff --git a/.styleci.yml b/.styleci.yml index a871cfe..1aebcc3 100644 --- a/.styleci.yml +++ b/.styleci.yml @@ -7,4 +7,7 @@ enabled: - strict disabled: - - concat_without_spaces \ No newline at end of file + - concat_without_spaces + - pre_increment + - unalign_double_arrow + - unalign_equals diff --git a/bin/create_example.php b/bin/create_example.php index cca36f3..0c41f47 100755 --- a/bin/create_example.php +++ b/bin/create_example.php @@ -34,7 +34,6 @@ define('EXAMPLE_PATH', realpath(dirname(__FILE__) . '/../test/fixtures/examples' * AStringMore -> a_string_more * * @param string $name - * @access public * * @return string */ @@ -56,7 +55,6 @@ function getLowerCaseName($name) * a_string_more -> AStringMore -> a_string_more * * @param string $name - * @access public * * @return string */ @@ -72,7 +70,6 @@ function getUpperCaseName($name) * return the given value and echo it out appending "\n". * * @param mixed $value - * @access public * * @return mixed */ @@ -91,9 +88,8 @@ function out($value) * the returned filename will be echoed out. * * @param string $directory directory without / at the end - * @param string $filename filename without path and extension + * @param string $filename filename without path and extension * @param string $extension extension of the file without "." - * @access public * * @return string */ @@ -109,7 +105,6 @@ function buildPath($directory, $filename = null, $extension = null) * the script die()'s if mkdir() fails. * * @param string $directory - * @access public */ function createDirectory($directory) { @@ -124,10 +119,9 @@ function createDirectory($directory) * the script die()'s if fopen() fails. * * @param string $directory directory without / at the end - * @param string $filename filename without path and extension + * @param string $filename filename without path and extension * @param string $extension extension of the file without "." - * @param string $content the content of the file - * @access public + * @param string $content the content of the file */ function createFile($directory, $filename, $extension, $content = '') { @@ -150,7 +144,6 @@ function createFile($directory, $filename, $extension, $content = '') * examples/some_thing/SomeThing.php * * @param mixed $example_name - * @access public */ function main($example_name) { diff --git a/test/Mustache/Test/EngineTest.php b/test/Mustache/Test/EngineTest.php index c4c8890..f34db4b 100644 --- a/test/Mustache/Test/EngineTest.php +++ b/test/Mustache/Test/EngineTest.php @@ -317,8 +317,8 @@ class Mustache_Test_EngineTest extends Mustache_Test_FunctionalTestCase list($name, $mustache) = $this->getLoggedMustache(Mustache_Logger::DEBUG); $mustache->render('{{ foo }}{{> bar }}', array('foo' => 'FOO')); $log = file_get_contents($name); - $this->assertContains('DEBUG: Instantiating template: ', $log); - $this->assertContains("WARNING: Partial not found: \"bar\"", $log); + $this->assertContains('DEBUG: Instantiating template: ', $log); + $this->assertContains('WARNING: Partial not found: "bar"', $log); } /**