Pārlūkot izejas kodu

Update to latest php-cs-fixer config.

Update to corresponding style-ci config options. Fix a few code style issues in the process.
Justin Hileman 10 gadi atpakaļ
vecāks
revīzija
27a8bf0b69
4 mainītis faili ar 22 papildinājumiem un 15 dzēšanām
  1. 13 2
      .php_cs
  2. 4 1
      .styleci.yml
  3. 3 10
      bin/create_example.php
  4. 2 2
      test/Mustache/Test/EngineTest.php

+ 13 - 2
.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;

+ 4 - 1
.styleci.yml

@@ -7,4 +7,7 @@ enabled:
   - strict
 
 disabled:
-  - concat_without_spaces
+  - concat_without_spaces
+  - pre_increment
+  - unalign_double_arrow
+  - unalign_equals

+ 3 - 10
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)
 {

+ 2 - 2
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);
     }
 
     /**