CS fixes.
Plus add config for StyleCI.
This commit is contained in:
@@ -6,7 +6,7 @@ use Symfony\CS\FixerInterface;
|
|||||||
$config = Config::create()
|
$config = Config::create()
|
||||||
// use symfony level and extra fixers:
|
// use symfony level and extra fixers:
|
||||||
->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL)
|
->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL)
|
||||||
->fixers(array('-concat_without_spaces', 'concat_with_spaces', 'strict'))
|
->fixers(array('align_double_arrow', '-concat_without_spaces', 'concat_with_spaces', 'ordered_use', 'strict'))
|
||||||
->setUsingLinter(false);
|
->setUsingLinter(false);
|
||||||
|
|
||||||
$finder = $config->getFinder()
|
$finder = $config->getFinder()
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
preset: symfony
|
||||||
|
|
||||||
|
enabled:
|
||||||
|
- align_double_arrow
|
||||||
|
- concat_with_spaces
|
||||||
|
- ordered_use
|
||||||
|
- strict
|
||||||
|
|
||||||
|
disabled:
|
||||||
|
- concat_without_spaces
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A shell script to create a single-file class cache of the entire Mustache
|
* A shell script to create a single-file class cache of the entire Mustache
|
||||||
* library:
|
* library.
|
||||||
*
|
*
|
||||||
* $ bin/build_bootstrap.php
|
* $ bin/build_bootstrap.php
|
||||||
*
|
*
|
||||||
@@ -72,7 +72,6 @@ SymfonyClassCollectionLoader::load(array(
|
|||||||
* the unnecessary bits removed.
|
* the unnecessary bits removed.
|
||||||
*
|
*
|
||||||
* @license http://www.opensource.org/licenses/MIT
|
* @license http://www.opensource.org/licenses/MIT
|
||||||
*
|
|
||||||
* @author Fabien Potencier <fabien@symfony.com>
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
*/
|
*/
|
||||||
class SymfonyClassCollectionLoader
|
class SymfonyClassCollectionLoader
|
||||||
|
|||||||
+19
-10
@@ -2,7 +2,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A commandline script to create an example and the needed files:
|
* A commandline script to create an example and the needed files.
|
||||||
*
|
*
|
||||||
* $ bin/create_example.php my_new_example
|
* $ bin/create_example.php my_new_example
|
||||||
*
|
*
|
||||||
@@ -26,6 +26,7 @@ define('EXAMPLE_PATH', realpath(dirname(__FILE__) . '/../test/fixtures/examples'
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* transform a string to lowercase using underlines.
|
* transform a string to lowercase using underlines.
|
||||||
|
*
|
||||||
* Examples:
|
* Examples:
|
||||||
* String -> string
|
* String -> string
|
||||||
* AString -> a_string
|
* AString -> a_string
|
||||||
@@ -34,6 +35,7 @@ define('EXAMPLE_PATH', realpath(dirname(__FILE__) . '/../test/fixtures/examples'
|
|||||||
*
|
*
|
||||||
* @param string $name
|
* @param string $name
|
||||||
* @access public
|
* @access public
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getLowerCaseName($name)
|
function getLowerCaseName($name)
|
||||||
@@ -45,7 +47,8 @@ function getLowerCaseName($name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* transform a string to Uppercase (camelcase)
|
* transform a string to Uppercase (camelcase).
|
||||||
|
*
|
||||||
* Examples
|
* Examples
|
||||||
* string -> String
|
* string -> String
|
||||||
* a_string -> AString
|
* a_string -> AString
|
||||||
@@ -54,6 +57,7 @@ function getLowerCaseName($name)
|
|||||||
*
|
*
|
||||||
* @param string $name
|
* @param string $name
|
||||||
* @access public
|
* @access public
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getUpperCaseName($name)
|
function getUpperCaseName($name)
|
||||||
@@ -65,10 +69,11 @@ function getUpperCaseName($name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return the given value and echo it out appending "\n"
|
* return the given value and echo it out appending "\n".
|
||||||
*
|
*
|
||||||
* @param mixed $value
|
* @param mixed $value
|
||||||
* @access public
|
* @access public
|
||||||
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
function out($value)
|
function out($value)
|
||||||
@@ -79,15 +84,17 @@ function out($value)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create Path for certain files in an example
|
* create Path for certain files in an example.
|
||||||
|
*
|
||||||
* returns the directory name if only $directory is given.
|
* returns the directory name if only $directory is given.
|
||||||
* if an extension is given a complete filename is returned.
|
* if an extension is given a complete filename is returned.
|
||||||
* the returned filename will be echoed out
|
* the returned filename will be echoed out.
|
||||||
*
|
*
|
||||||
* @param string $directory directory without / at the end
|
* @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 $extension extension of the file without "."
|
||||||
* @access public
|
* @access public
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function buildPath($directory, $filename = null, $extension = null)
|
function buildPath($directory, $filename = null, $extension = null)
|
||||||
@@ -97,8 +104,9 @@ function buildPath($directory, $filename = null, $extension = null)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* creates the directory for the example
|
* creates the directory for the example.
|
||||||
* the script die()'s if mkdir() fails
|
*
|
||||||
|
* the script die()'s if mkdir() fails.
|
||||||
*
|
*
|
||||||
* @param string $directory
|
* @param string $directory
|
||||||
* @access public
|
* @access public
|
||||||
@@ -111,8 +119,9 @@ function createDirectory($directory)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create a file for the example with the given $content
|
* create a file for the example with the given $content.
|
||||||
* the script die()'s if fopen() fails
|
*
|
||||||
|
* the script die()'s if fopen() fails.
|
||||||
*
|
*
|
||||||
* @param string $directory directory without / at the end
|
* @param string $directory directory without / at the end
|
||||||
* @param string $filename filename without path and extension
|
* @param string $filename filename without path and extension
|
||||||
@@ -132,7 +141,7 @@ function createFile($directory, $filename, $extension, $content = "")
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* routine to create the example directory and 3 files
|
* routine to create the example directory and 3 files.
|
||||||
*
|
*
|
||||||
* if the $example_name is "SomeThing" the following files will be created
|
* if the $example_name is "SomeThing" the following files will be created
|
||||||
* examples/some_thing
|
* examples/some_thing
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ class Mustache_Cache_FilesystemCache extends Mustache_Cache_AbstractCache
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cache and load the compiled class
|
* Cache and load the compiled class.
|
||||||
*
|
*
|
||||||
* @param string $key
|
* @param string $key
|
||||||
* @param string $value
|
* @param string $value
|
||||||
@@ -89,7 +89,7 @@ class Mustache_Cache_FilesystemCache extends Mustache_Cache_AbstractCache
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create cache directory
|
* Create cache directory.
|
||||||
*
|
*
|
||||||
* @throws Mustache_Exception_RuntimeException If unable to create directory
|
* @throws Mustache_Exception_RuntimeException If unable to create directory
|
||||||
*
|
*
|
||||||
@@ -117,7 +117,7 @@ class Mustache_Cache_FilesystemCache extends Mustache_Cache_AbstractCache
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write cache file
|
* Write cache file.
|
||||||
*
|
*
|
||||||
* @throws Mustache_Exception_RuntimeException If unable to write file
|
* @throws Mustache_Exception_RuntimeException If unable to write file
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class Mustache_Loader_CascadingLoader implements Mustache_Loader
|
|||||||
private $loaders;
|
private $loaders;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a CascadingLoader with an array of loaders:
|
* Construct a CascadingLoader with an array of loaders.
|
||||||
*
|
*
|
||||||
* $loader = new Mustache_Loader_CascadingLoader(array(
|
* $loader = new Mustache_Loader_CascadingLoader(array(
|
||||||
* new Mustache_Loader_InlineLoader(__FILE__, __COMPILER_HALT_OFFSET__),
|
* new Mustache_Loader_InlineLoader(__FILE__, __COMPILER_HALT_OFFSET__),
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ class Mustache_Loader_InlineLoader implements Mustache_Loader
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The InlineLoader requires a filename and offset to process templates.
|
* The InlineLoader requires a filename and offset to process templates.
|
||||||
|
*
|
||||||
* The magic constants `__FILE__` and `__COMPILER_HALT_OFFSET__` are usually
|
* The magic constants `__FILE__` and `__COMPILER_HALT_OFFSET__` are usually
|
||||||
* perfectly suited to the job:
|
* perfectly suited to the job:
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes a Mustache logger instance
|
* Describes a Mustache logger instance.
|
||||||
*
|
*
|
||||||
* This is identical to the Psr\Log\LoggerInterface.
|
* This is identical to the Psr\Log\LoggerInterface.
|
||||||
*
|
*
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
interface Mustache_Logger
|
interface Mustache_Logger
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Psr\Log compatible log levels
|
* Psr\Log compatible log levels.
|
||||||
*/
|
*/
|
||||||
const EMERGENCY = 'emergency';
|
const EMERGENCY = 'emergency';
|
||||||
const ALERT = 'alert';
|
const ALERT = 'alert';
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ abstract class Mustache_Template
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mustache Template instances can be treated as a function and rendered by simply calling them:
|
* Mustache Template instances can be treated as a function and rendered by simply calling them.
|
||||||
*
|
*
|
||||||
* $m = new Mustache_Engine;
|
* $m = new Mustache_Engine;
|
||||||
* $tpl = $m->loadTemplate('Hello, {{ name }}!');
|
* $tpl = $m->loadTemplate('Hello, {{ name }}!');
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A PHPUnit test case wrapping the Mustache Spec
|
* A PHPUnit test case wrapping the Mustache Spec.
|
||||||
*
|
*
|
||||||
* @group mustache-spec
|
* @group mustache-spec
|
||||||
* @group functional
|
* @group functional
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A PHPUnit test case wrapping the Mustache Spec
|
* A PHPUnit test case wrapping the Mustache Spec.
|
||||||
*
|
*
|
||||||
* @group mustache-spec
|
* @group mustache-spec
|
||||||
* @group functional
|
* @group functional
|
||||||
|
|||||||
Reference in New Issue
Block a user