diff --git a/.php_cs b/.php_cs index ddae0949..8f257737 100644 --- a/.php_cs +++ b/.php_cs @@ -5,7 +5,7 @@ $finder = Symfony\CS\Finder\DefaultFinder::create() ; return Symfony\CS\Config\Config::create() - ->level(Symfony\CS\FixerInterface::NONE_LEVEL) + ->level(Symfony\CS\FixerInterface::PSR2_LEVEL) ->setUsingCache(true) ->fixers(array( 'linefeed', @@ -21,6 +21,7 @@ return Symfony\CS\Config\Config::create() 'controls_spaces', 'elseif', '-eof_ending', + '-method_argument_space', )) ->finder($finder) ; diff --git a/lib/HTTP/ConditionalGet.php b/lib/HTTP/ConditionalGet.php index 72d11c8a..0f251ee3 100644 --- a/lib/HTTP/ConditionalGet.php +++ b/lib/HTTP/ConditionalGet.php @@ -60,7 +60,8 @@ * @subpackage HTTP * @author Stephen Clay */ -class HTTP_ConditionalGet { +class HTTP_ConditionalGet +{ /** * Does the client have a valid copy of the requested resource? @@ -340,7 +341,8 @@ protected function resourceMatchedEtag() * * @return string */ - protected function normalizeEtag($etag) { + protected function normalizeEtag($etag) + { $etag = trim($etag); return $this->_stripEtag diff --git a/lib/HTTP/Encoder.php b/lib/HTTP/Encoder.php index 6e236eec..3bd788cc 100644 --- a/lib/HTTP/Encoder.php +++ b/lib/HTTP/Encoder.php @@ -43,7 +43,8 @@ * @subpackage HTTP * @author Stephen Clay */ -class HTTP_Encoder { +class HTTP_Encoder +{ /** * Should the encoder allow HTTP encoding to IE6? @@ -97,8 +98,7 @@ public function __construct($spec) $this->_headers['Content-Type'] = $spec['type']; } if (isset($spec['method']) - && in_array($spec['method'], array('gzip', 'deflate', 'compress', ''))) - { + && in_array($spec['method'], array('gzip', 'deflate', 'compress', ''))) { $this->_encodeMethod = array($spec['method'], $spec['method']); } else { $this->_encodeMethod = self::getAcceptedEncoding(); @@ -192,8 +192,7 @@ public static function getAcceptedEncoding($allowCompress = true, $allowDeflate // @link http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html if (! isset($_SERVER['HTTP_ACCEPT_ENCODING']) - || self::isBuggyIe()) - { + || self::isBuggyIe()) { return array('', ''); } $ae = $_SERVER['HTTP_ACCEPT_ENCODING']; @@ -259,8 +258,7 @@ public function encode($compressionLevel = null) } if ('' === $this->_encodeMethod[0] || ($compressionLevel == 0) - || !extension_loaded('zlib')) - { + || !extension_loaded('zlib')) { return false; } if ($this->_encodeMethod[0] === 'deflate') { diff --git a/lib/Minify.php b/lib/Minify.php index eb3061e2..f6a532bb 100644 --- a/lib/Minify.php +++ b/lib/Minify.php @@ -24,7 +24,8 @@ * @license http://opensource.org/licenses/bsd-license.php New BSD License * @link https://github.com/mrclay/minify */ -class Minify { +class Minify +{ /** * API version @@ -87,7 +88,8 @@ class Minify { * @param Minify_CacheInterface $cache * @param LoggerInterface $logger */ - public function __construct(Minify_CacheInterface $cache, LoggerInterface $logger = null) { + public function __construct(Minify_CacheInterface $cache, LoggerInterface $logger = null) + { $this->cache = $cache; $this->logger = $logger; } @@ -492,7 +494,8 @@ public function errorExit($header, $url = '', $msgHtml = '') * @param string $content * @return string */ - public static function nullMinifier($content) { + public static function nullMinifier($content) + { if (isset($content[0]) && $content[0] === "\xef") { $content = substr($content, 3); } @@ -506,7 +509,7 @@ public static function nullMinifier($content) { */ protected function setupUriRewrites() { - foreach($this->sources as $key => $source) { + foreach ($this->sources as $key => $source) { $file = $this->env->normalizePath($source->getFilePath()); $minifyOptions = $source->getMinifierOptions(); @@ -594,8 +597,7 @@ protected function combineMinify() || $type === self::TYPE_CSS // yes, to process CSS individually (avoiding PCRE bugs/limits) || $minifier !== $lastMinifier // yes, minifier changed || $options !== $lastOptions) // yes, options changed - ) - { + ) { // minify previous sources with last settings $imploded = implode($implodeSeparator, $groupToProcessTogether); $groupToProcessTogether = array(); @@ -718,7 +720,6 @@ protected function analyzeSources($options = array()) if (!empty($options['contentType'])) { // just verify sources have null content type or match the options if ($sourceType !== null && $sourceType !== $options['contentType']) { - $this->logger && $this->logger->warning('ContentType mismatch'); $this->sources = array(); @@ -732,7 +733,6 @@ protected function analyzeSources($options = array()) if ($type === null) { $type = $sourceType; } elseif ($sourceType !== $type) { - $this->logger && $this->logger->warning('ContentType mismatch'); $this->sources = array(); diff --git a/lib/Minify/App.php b/lib/Minify/App.php index f4ce31c7..ecab7efe 100644 --- a/lib/Minify/App.php +++ b/lib/Minify/App.php @@ -21,7 +21,8 @@ * @property \Minify_Source_Factory $sourceFactory * @property array $sourceFactoryOptions */ -class App extends Container { +class App extends Container +{ /** * Constructor @@ -249,7 +250,8 @@ public function __construct($dir) }; } - public function runServer() { + public function runServer() + { if (!$this->env->get('f') && $this->env->get('g') === null) { // no spec given $msg = '

No "f" or "g" parameters were detected.

'; @@ -265,7 +267,8 @@ public function runServer() { * @param mixed $var * @return string */ - private function typeOf($var) { + private function typeOf($var) + { $type = gettype($var); return $type === 'object' ? get_class($var) : $type; diff --git a/lib/Minify/Build.php b/lib/Minify/Build.php index e4428e02..dcfd8e21 100644 --- a/lib/Minify/Build.php +++ b/lib/Minify/Build.php @@ -34,7 +34,8 @@ * @package Minify * @author Stephen Clay */ -class Minify_Build { +class Minify_Build +{ /** * Last modification time of all files in the build @@ -67,7 +68,8 @@ class Minify_Build { * append the timestamp to the URI. * @return string */ - public function uri($uri, $forceAmpersand = false) { + public function uri($uri, $forceAmpersand = false) + { $sep = ($forceAmpersand || strpos($uri, '?') !== false) ? self::$ampersand : '?'; @@ -75,7 +77,7 @@ public function uri($uri, $forceAmpersand = false) { return "{$uri}{$sep}{$this->lastModified}"; } - /** + /** * Create a build object * * @param array $sources array of Minify_Source objects and/or file paths diff --git a/lib/Minify/CSS.php b/lib/Minify/CSS.php index da389ea5..bc3a3ad8 100644 --- a/lib/Minify/CSS.php +++ b/lib/Minify/CSS.php @@ -16,7 +16,8 @@ * * @deprecated Use Minify_CSSmin */ -class Minify_CSS { +class Minify_CSS +{ /** * Minify a CSS string diff --git a/lib/Minify/CSS/Compressor.php b/lib/Minify/CSS/Compressor.php index aa9f81f1..5fba8440 100644 --- a/lib/Minify/CSS/Compressor.php +++ b/lib/Minify/CSS/Compressor.php @@ -26,7 +26,8 @@ * * @deprecated Use CSSmin (tubalmartin/cssmin) */ -class Minify_CSS_Compressor { +class Minify_CSS_Compressor +{ /** * Minify a CSS string @@ -61,7 +62,8 @@ public static function process($css, $options = array()) * * @param array $options (currently ignored) */ - private function __construct($options) { + private function __construct($options) + { $this->_options = $options; } diff --git a/lib/Minify/CSS/UriRewriter.php b/lib/Minify/CSS/UriRewriter.php index 93bf3214..4fe7b46a 100644 --- a/lib/Minify/CSS/UriRewriter.php +++ b/lib/Minify/CSS/UriRewriter.php @@ -10,7 +10,8 @@ * @package Minify * @author Stephen Clay */ -class Minify_CSS_UriRewriter { +class Minify_CSS_UriRewriter +{ /** * rewrite() and rewriteRelative() append debugging information here @@ -326,7 +327,8 @@ private static function _processUriCB($m) * @param string $css * @return string */ - private static function _owlifySvgPaths($css) { + private static function _owlifySvgPaths($css) + { return preg_replace('~\b((?:clip-path|mask|-webkit-mask)\s*\:\s*)url(\(\s*#\w+\s*\))~', '$1owl$2', $css); } @@ -338,7 +340,8 @@ private static function _owlifySvgPaths($css) { * @param string $css * @return string */ - private static function _unOwlify($css) { + private static function _unOwlify($css) + { return preg_replace('~\b((?:clip-path|mask|-webkit-mask)\s*\:\s*)owl~', '$1url', $css); } } diff --git a/lib/Minify/CSSmin.php b/lib/Minify/CSSmin.php index 8c3a64f5..ad5cdbf1 100644 --- a/lib/Minify/CSSmin.php +++ b/lib/Minify/CSSmin.php @@ -12,7 +12,8 @@ * @package Minify * @author Stephen Clay */ -class Minify_CSSmin { +class Minify_CSSmin +{ /** * Minify a CSS string diff --git a/lib/Minify/Cache/APC.php b/lib/Minify/Cache/APC.php index 2e655018..94c28719 100644 --- a/lib/Minify/Cache/APC.php +++ b/lib/Minify/Cache/APC.php @@ -14,7 +14,8 @@ * @package Minify * @author Chris Edwards **/ -class Minify_Cache_APC implements Minify_CacheInterface { +class Minify_Cache_APC implements Minify_CacheInterface +{ /** * Create a Minify_Cache_APC object, to be passed to diff --git a/lib/Minify/Cache/File.php b/lib/Minify/Cache/File.php index 4a4f33b5..eeba3057 100644 --- a/lib/Minify/Cache/File.php +++ b/lib/Minify/Cache/File.php @@ -6,7 +6,8 @@ use Psr\Log\LoggerInterface; -class Minify_Cache_File implements Minify_CacheInterface { +class Minify_Cache_File implements Minify_CacheInterface +{ /** * @var string @@ -117,7 +118,7 @@ public function display($id) } } - /** + /** * Fetch the cached content * * @param string $id cache id (e.g. a filename) diff --git a/lib/Minify/Cache/Memcache.php b/lib/Minify/Cache/Memcache.php index ad6c4801..180b6075 100644 --- a/lib/Minify/Cache/Memcache.php +++ b/lib/Minify/Cache/Memcache.php @@ -17,7 +17,8 @@ * } * **/ -class Minify_Cache_Memcache implements Minify_CacheInterface { +class Minify_Cache_Memcache implements Minify_CacheInterface +{ /** * Create a Minify_Cache_Memcache object, to be passed to @@ -92,7 +93,7 @@ public function display($id) : ''; } - /** + /** * Fetch the cached content * * @param string $id cache id @@ -114,7 +115,7 @@ public function fetch($id) private $_data = null; private $_id = null; - /** + /** * Fetch data and timestamp from memcache, store in instance * * @param string $id diff --git a/lib/Minify/Cache/Null.php b/lib/Minify/Cache/Null.php index 38c77c79..4f654a6c 100644 --- a/lib/Minify/Cache/Null.php +++ b/lib/Minify/Cache/Null.php @@ -8,7 +8,8 @@ * * @package Minify */ -class Minify_Cache_Null implements Minify_CacheInterface { +class Minify_Cache_Null implements Minify_CacheInterface +{ /** * Write data to cache. * diff --git a/lib/Minify/Cache/WinCache.php b/lib/Minify/Cache/WinCache.php index 40975008..26132bfd 100644 --- a/lib/Minify/Cache/WinCache.php +++ b/lib/Minify/Cache/WinCache.php @@ -99,12 +99,12 @@ public function fetch($id) return $this->_fetch($id) ? $this->_data : ''; } - private $_exp = NULL; + private $_exp = null; // cache of most recently fetched id - private $_lm = NULL; - private $_data = NULL; - private $_id = NULL; + private $_lm = null; + private $_data = null; + private $_id = null; /** * Fetch data and timestamp from WinCache, store in instance @@ -121,7 +121,7 @@ private function _fetch($id) $suc = false; $ret = wincache_ucache_get($id, $suc); if (!$suc) { - $this->_id = NULL; + $this->_id = null; return false; } diff --git a/lib/Minify/Cache/XCache.php b/lib/Minify/Cache/XCache.php index 4edd2619..a5585bbe 100644 --- a/lib/Minify/Cache/XCache.php +++ b/lib/Minify/Cache/XCache.php @@ -17,7 +17,8 @@ * @package Minify * @author Elan Ruusamäe **/ -class Minify_Cache_XCache implements Minify_CacheInterface { +class Minify_Cache_XCache implements Minify_CacheInterface +{ /** * Create a Minify_Cache_XCache object, to be passed to diff --git a/lib/Minify/Cache/ZendPlatform.php b/lib/Minify/Cache/ZendPlatform.php index 9e5d248d..b1f6d22b 100644 --- a/lib/Minify/Cache/ZendPlatform.php +++ b/lib/Minify/Cache/ZendPlatform.php @@ -16,7 +16,8 @@ * @package Minify * @author Patrick van Dissel */ -class Minify_Cache_ZendPlatform implements Minify_CacheInterface { +class Minify_Cache_ZendPlatform implements Minify_CacheInterface +{ /** * Create a Minify_Cache_ZendPlatform object, to be passed to diff --git a/lib/Minify/CacheInterface.php b/lib/Minify/CacheInterface.php index 56b79b81..1b891b19 100644 --- a/lib/Minify/CacheInterface.php +++ b/lib/Minify/CacheInterface.php @@ -9,7 +9,8 @@ * * @package Minify */ -interface Minify_CacheInterface { +interface Minify_CacheInterface +{ /** * Write data to cache. * diff --git a/lib/Minify/CommentPreserver.php b/lib/Minify/CommentPreserver.php index 00db9ffc..f2958391 100644 --- a/lib/Minify/CommentPreserver.php +++ b/lib/Minify/CommentPreserver.php @@ -10,7 +10,8 @@ * @package Minify * @author Stephen Clay */ -class Minify_CommentPreserver { +class Minify_CommentPreserver +{ /** * String to be prepended to each preserved comment diff --git a/lib/Minify/Controller/Base.php b/lib/Minify/Controller/Base.php index e95e6e94..54a60c91 100644 --- a/lib/Minify/Controller/Base.php +++ b/lib/Minify/Controller/Base.php @@ -15,7 +15,8 @@ * @package Minify * @author Stephen Clay */ -abstract class Minify_Controller_Base implements Minify_ControllerInterface { +abstract class Minify_Controller_Base implements Minify_ControllerInterface +{ /** * @var Minify_Env diff --git a/lib/Minify/Controller/Files.php b/lib/Minify/Controller/Files.php index db67d33c..85a76d0e 100644 --- a/lib/Minify/Controller/Files.php +++ b/lib/Minify/Controller/Files.php @@ -28,7 +28,8 @@ * @package Minify * @author Stephen Clay */ -class Minify_Controller_Files extends Minify_Controller_Base { +class Minify_Controller_Files extends Minify_Controller_Base +{ /** * Set up file sources @@ -40,7 +41,8 @@ class Minify_Controller_Files extends Minify_Controller_Base { * * 'files': (required) array of complete file paths, or a single path */ - public function createConfiguration(array $options) { + public function createConfiguration(array $options) + { // strip controller options $files = $options['files']; diff --git a/lib/Minify/Controller/Groups.php b/lib/Minify/Controller/Groups.php index 5c415e01..a115a00e 100644 --- a/lib/Minify/Controller/Groups.php +++ b/lib/Minify/Controller/Groups.php @@ -23,7 +23,8 @@ * @package Minify * @author Stephen Clay */ -class Minify_Controller_Groups extends Minify_Controller_Files { +class Minify_Controller_Groups extends Minify_Controller_Files +{ /** * Set up groups of files as sources @@ -35,7 +36,8 @@ class Minify_Controller_Groups extends Minify_Controller_Files { * * @return array Minify options */ - public function createConfiguration(array $options) { + public function createConfiguration(array $options) + { // strip controller options $groups = $options['groups']; unset($options['groups']); diff --git a/lib/Minify/Controller/MinApp.php b/lib/Minify/Controller/MinApp.php index 80a05c5c..b09ac81c 100644 --- a/lib/Minify/Controller/MinApp.php +++ b/lib/Minify/Controller/MinApp.php @@ -10,7 +10,8 @@ * @package Minify * @author Stephen Clay */ -class Minify_Controller_MinApp extends Minify_Controller_Base { +class Minify_Controller_MinApp extends Minify_Controller_Base +{ /** * Set up groups of files as sources @@ -19,7 +20,8 @@ class Minify_Controller_MinApp extends Minify_Controller_Base { * * @return array Minify options */ - public function createConfiguration(array $options) { + public function createConfiguration(array $options) + { // PHP insecure by default: realpath() and other FS functions can't handle null bytes. $get = $this->env->get(); foreach (array('g', 'b', 'f') as $key) { diff --git a/lib/Minify/Controller/Page.php b/lib/Minify/Controller/Page.php index 81204796..36d97146 100644 --- a/lib/Minify/Controller/Page.php +++ b/lib/Minify/Controller/Page.php @@ -11,7 +11,8 @@ * @package Minify * @author Stephen Clay */ -class Minify_Controller_Page extends Minify_Controller_Base { +class Minify_Controller_Page extends Minify_Controller_Base +{ /** * Set up source of HTML content @@ -31,7 +32,8 @@ class Minify_Controller_Page extends Minify_Controller_Base { * 'minifyAll': should all CSS and Javascript blocks be individually * minified? (default false) */ - public function createConfiguration(array $options) { + public function createConfiguration(array $options) + { if (isset($options['file'])) { $sourceSpec = array( 'filepath' => $options['file'] diff --git a/lib/Minify/ControllerInterface.php b/lib/Minify/ControllerInterface.php index ddefd75b..35b4de3f 100644 --- a/lib/Minify/ControllerInterface.php +++ b/lib/Minify/ControllerInterface.php @@ -1,7 +1,8 @@ */ -class Minify_DebugDetector { +class Minify_DebugDetector +{ public static function shouldDebugRequest(Minify_Env $env) { if ($env->get('debug') !== null) { diff --git a/lib/Minify/Env.php b/lib/Minify/Env.php index decb718e..d8274e54 100644 --- a/lib/Minify/Env.php +++ b/lib/Minify/Env.php @@ -1,6 +1,7 @@ */ -class Minify_HTML { +class Minify_HTML +{ /** * @var boolean */ @@ -40,7 +41,8 @@ class Minify_HTML { * * @return string */ - public static function minify($html, $options = array()) { + public static function minify($html, $options = array()) + { $min = new self($html, $options); return $min->process(); diff --git a/lib/Minify/HTML/Helper.php b/lib/Minify/HTML/Helper.php index f07e5d97..498d3c7f 100644 --- a/lib/Minify/HTML/Helper.php +++ b/lib/Minify/HTML/Helper.php @@ -10,7 +10,8 @@ * @package Minify * @author Stephen Clay */ -class Minify_HTML_Helper { +class Minify_HTML_Helper +{ public $rewriteWorks = true; public $minAppUri = '/min'; public $groupsConfigFile = ''; @@ -190,7 +191,8 @@ public static function app(\Minify\App $app = null) * @param int $pos index to check * @return mixed a common char or '' if any do not match */ - protected static function _getCommonCharAtPos($arr, $pos) { + protected static function _getCommonCharAtPos($arr, $pos) + { if (!isset($arr[0][$pos])) { return ''; } @@ -215,7 +217,8 @@ protected static function _getCommonCharAtPos($arr, $pos) { * @param string $minRoot root-relative URI of the "min" application * @return string */ - protected static function _getShortestUri($paths, $minRoot = '/min/') { + protected static function _getShortestUri($paths, $minRoot = '/min/') + { $pos = 0; $base = ''; while (true) { diff --git a/lib/Minify/ImportProcessor.php b/lib/Minify/ImportProcessor.php index 715a9bf9..1ed707bb 100644 --- a/lib/Minify/ImportProcessor.php +++ b/lib/Minify/ImportProcessor.php @@ -18,8 +18,8 @@ * @author Stephen Clay * @author Simon Schick */ -class Minify_ImportProcessor { - +class Minify_ImportProcessor +{ public static $filesIncluded = array(); public static function process($file) @@ -173,8 +173,7 @@ private function getPathDiff($from, $to, $ps = DIRECTORY_SEPARATOR) $arFrom = explode($ps, rtrim($realFrom, $ps)); $arTo = explode($ps, rtrim($realTo, $ps)); - while (count($arFrom) && count($arTo) && ($arFrom[0] == $arTo[0])) - { + while (count($arFrom) && count($arTo) && ($arFrom[0] == $arTo[0])) { array_shift($arFrom); array_shift($arTo); } @@ -191,18 +190,21 @@ private function getPathDiff($from, $to, $ps = DIRECTORY_SEPARATOR) private function truepath($path) { // whether $path is unix or not - $unipath = strlen($path) == 0 || $path{0} != '/'; + $unipath = strlen($path) == 0 || $path{0} + != '/'; // attempts to detect if path is relative in which case, add cwd - if (strpos($path, ':') === false && $unipath) + if (strpos($path, ':') === false && $unipath) { $path = $this->_currentDir . DIRECTORY_SEPARATOR . $path; + } // resolve path parts (single dot, double dot and double delimiters) $path = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $path); $parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen'); $absolutes = array(); foreach ($parts as $part) { - if ('.' == $part) + if ('.' == $part) { continue; + } if ('..' == $part) { array_pop($absolutes); } else { @@ -211,8 +213,9 @@ private function truepath($path) } $path = implode(DIRECTORY_SEPARATOR, $absolutes); // resolve any symlinks - if (file_exists($path) && linkinfo($path) > 0) + if (file_exists($path) && linkinfo($path) > 0) { $path = readlink($path); + } // put initial separator that could have been lost $path = !$unipath ? '/' . $path : $path; diff --git a/lib/Minify/JS/ClosureCompiler.php b/lib/Minify/JS/ClosureCompiler.php index ade3c2f4..20381a2e 100644 --- a/lib/Minify/JS/ClosureCompiler.php +++ b/lib/Minify/JS/ClosureCompiler.php @@ -13,7 +13,8 @@ * * @todo can use a stream wrapper to unit test this? */ -class Minify_JS_ClosureCompiler { +class Minify_JS_ClosureCompiler +{ /** * @var string The option key for the maximum POST byte size @@ -228,4 +229,6 @@ protected function buildPostBody($js, $returnErrors = false) } } -class Minify_JS_ClosureCompiler_Exception extends Exception {} +class Minify_JS_ClosureCompiler_Exception extends Exception +{ +} diff --git a/lib/Minify/LessCssSource.php b/lib/Minify/LessCssSource.php index 249f9dcb..8fa2e638 100644 --- a/lib/Minify/LessCssSource.php +++ b/lib/Minify/LessCssSource.php @@ -1,6 +1,7 @@ cache = $cache; @@ -27,7 +29,8 @@ public function __construct(array $spec, Minify_CacheInterface $cache) { * * @return int */ - public function getLastModified() { + public function getLastModified() + { $cache = $this->getCache(); return $cache['lastModified']; @@ -38,7 +41,8 @@ public function getLastModified() { * * @return string */ - public function getContent() { + public function getContent() + { $cache = $this->getCache(); return $cache['compiled']; @@ -49,7 +53,8 @@ public function getContent() { * * @return array */ - private function getCache() { + private function getCache() + { // cache for single run // so that getLastModified and getContent in single request do not add additional cache roundtrips (i.e memcache) if (isset($this->parsed)) { @@ -100,7 +105,8 @@ private function getMaxLastModified($cache) * * @return string */ - private function getCacheId($prefix = 'minify') { + private function getCacheId($prefix = 'minify') + { $md5 = md5($this->filepath); return "{$prefix}_less2_{$md5}"; @@ -111,7 +117,8 @@ private function getCacheId($prefix = 'minify') { * * @return lessc */ - private function getCompiler() { + private function getCompiler() + { $less = new lessc(); // do not spend CPU time letting less doing minify $less->setPreserveComments(true); diff --git a/lib/Minify/Lines.php b/lib/Minify/Lines.php index 92bc4a48..db85d851 100644 --- a/lib/Minify/Lines.php +++ b/lib/Minify/Lines.php @@ -11,7 +11,8 @@ * @author Stephen Clay * @author Adam Pedersen (Issue 55 fix) */ -class Minify_Lines { +class Minify_Lines +{ /** * Add line numbers in C-style comments @@ -156,7 +157,8 @@ private static function _addNote($line, $note, $inComment, $padTo) * @param string $token Token being checked * @return bool */ - private static function _find($str, $token) { + private static function _find($str, $token) + { switch ($token) { case '//': $fakes = array( diff --git a/lib/Minify/Packer.php b/lib/Minify/Packer.php index f6fbcd8e..7ddca79e 100644 --- a/lib/Minify/Packer.php +++ b/lib/Minify/Packer.php @@ -19,7 +19,8 @@ * * @package Minify */ -class Minify_Packer { +class Minify_Packer +{ public static function minify($code, $options = array()) { // @todo: set encoding options based on $options :) diff --git a/lib/Minify/ScssCssSource.php b/lib/Minify/ScssCssSource.php index 038a03fe..9aa58f07 100644 --- a/lib/Minify/ScssCssSource.php +++ b/lib/Minify/ScssCssSource.php @@ -8,7 +8,8 @@ * * @link https://github.com/leafo/scssphp/ */ -class Minify_ScssCssSource extends Minify_Source { +class Minify_ScssCssSource extends Minify_Source +{ /** * @var Minify_CacheInterface */ @@ -146,12 +147,12 @@ private function compile($filename) $start = microtime(true); $scss = new Compiler(); - // set import path directory the input filename resides - // otherwise @import statements will not find the files + // set import path directory the input filename resides + // otherwise @import statements will not find the files // and will treat the @import line as css import - $scss->setImportPaths(dirname($filename)); + $scss->setImportPaths(dirname($filename)); - $css = $scss->compile(file_get_contents($filename), $filename); + $css = $scss->compile(file_get_contents($filename), $filename); $elapsed = round((microtime(true) - $start), 4); $v = Version::VERSION; diff --git a/lib/Minify/ServeConfiguration.php b/lib/Minify/ServeConfiguration.php index a2938a13..12d9d2f3 100644 --- a/lib/Minify/ServeConfiguration.php +++ b/lib/Minify/ServeConfiguration.php @@ -9,7 +9,8 @@ * * @package Minify */ -class Minify_ServeConfiguration { +class Minify_ServeConfiguration +{ /** * @var Minify_SourceInterface[] diff --git a/lib/Minify/Source.php b/lib/Minify/Source.php index b44107e8..39597a62 100644 --- a/lib/Minify/Source.php +++ b/lib/Minify/Source.php @@ -13,7 +13,8 @@ * @package Minify * @author Stephen Clay */ -class Minify_Source implements Minify_SourceInterface { +class Minify_Source implements Minify_SourceInterface +{ /** * @var int time of last modification @@ -70,13 +71,13 @@ public function __construct($spec) if (isset($spec['filepath'])) { $ext = pathinfo($spec['filepath'], PATHINFO_EXTENSION); switch ($ext) { - case 'js' : $this->contentType = Minify::TYPE_JS; + case 'js': $this->contentType = Minify::TYPE_JS; break; - case 'less' : // fallthrough - case 'css' : $this->contentType = Minify::TYPE_CSS; + case 'less': // fallthrough + case 'css': $this->contentType = Minify::TYPE_CSS; break; - case 'htm' : // fallthrough - case 'html' : $this->contentType = Minify::TYPE_HTML; + case 'htm': // fallthrough + case 'html': $this->contentType = Minify::TYPE_HTML; break; } $this->filepath = $spec['filepath']; @@ -203,7 +204,8 @@ public function getFilePath() /** * {@inheritdoc} */ - public function setupUriRewrites() { + public function setupUriRewrites() + { if ($this->filepath && !isset($this->minifyOptions['currentDir']) && !isset($this->minifyOptions['prependRelativePath']) diff --git a/lib/Minify/Source/Factory.php b/lib/Minify/Source/Factory.php index 71d7f086..f36d1b25 100644 --- a/lib/Minify/Source/Factory.php +++ b/lib/Minify/Source/Factory.php @@ -1,6 +1,7 @@ */ -class Minify_YUICompressor { +class Minify_YUICompressor +{ /** * Filepath of the YUI Compressor jar file. This must be set before @@ -112,15 +113,15 @@ private static function _getCmd($userOptions, $type, $tmpFile) ,'nomunge' => false ,'preserve-semi' => false ,'disable-optimizations' => false - ,'stack-size' => '' + ,'stack-size' => '' ) ,$userOptions ); $cmd = self::$javaExecutable - . (!empty($o['stack-size']) - ? ' -Xss' . $o['stack-size'] - : '') - . ' -jar ' . escapeshellarg(self::$jarFile) + . (!empty($o['stack-size']) + ? ' -Xss' . $o['stack-size'] + : '') + . ' -jar ' . escapeshellarg(self::$jarFile) . " --type {$type}" . (preg_match('/^[\\da-zA-Z0-9\\-]+$/', $o['charset']) ? " --charset {$o['charset']}" diff --git a/lib/MrClay/Cli.php b/lib/MrClay/Cli.php index f382c828..e9ef3b3b 100644 --- a/lib/MrClay/Cli.php +++ b/lib/MrClay/Cli.php @@ -18,7 +18,8 @@ * @author Steve Clay * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -class Cli { +class Cli +{ /** * @var array validation errors diff --git a/lib/MrClay/Cli/Arg.php b/lib/MrClay/Cli/Arg.php index 9c8b0e36..b7a46e92 100644 --- a/lib/MrClay/Cli/Arg.php +++ b/lib/MrClay/Cli/Arg.php @@ -43,7 +43,8 @@ * @author Steve Clay * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -class Arg { +class Arg +{ /** * @return array */