1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-16 19:14:01 +02:00

phpcs: enable psr2

This commit is contained in:
Elan Ruusamäe
2016-10-16 16:46:43 +03:00
parent 0cc631c5a9
commit 5fb7ea1ed1
44 changed files with 175 additions and 109 deletions

View File

@@ -1,6 +1,7 @@
<?php
class Minify_LessCssSource extends Minify_Source {
class Minify_LessCssSource extends Minify_Source
{
/**
* @var Minify_CacheInterface
*/
@@ -16,7 +17,8 @@ class Minify_LessCssSource extends Minify_Source {
/**
* @inheritdoc
*/
public function __construct(array $spec, Minify_CacheInterface $cache) {
public function __construct(array $spec, Minify_CacheInterface $cache)
{
parent::__construct($spec);
$this->cache = $cache;
@@ -27,7 +29,8 @@ class Minify_LessCssSource extends Minify_Source {
*
* @return int
*/
public function getLastModified() {
public function getLastModified()
{
$cache = $this->getCache();
return $cache['lastModified'];
@@ -38,7 +41,8 @@ class Minify_LessCssSource extends Minify_Source {
*
* @return string
*/
public function getContent() {
public function getContent()
{
$cache = $this->getCache();
return $cache['compiled'];
@@ -49,7 +53,8 @@ class Minify_LessCssSource extends Minify_Source {
*
* @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 @@ class Minify_LessCssSource extends Minify_Source {
*
* @return string
*/
private function getCacheId($prefix = 'minify') {
private function getCacheId($prefix = 'minify')
{
$md5 = md5($this->filepath);
return "{$prefix}_less2_{$md5}";
@@ -111,7 +117,8 @@ class Minify_LessCssSource extends Minify_Source {
*
* @return lessc
*/
private function getCompiler() {
private function getCompiler()
{
$less = new lessc();
// do not spend CPU time letting less doing minify
$less->setPreserveComments(true);