diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..176a458 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto diff --git a/.scrutinizer.yml b/.scrutinizer.yml new file mode 100644 index 0000000..5839f87 --- /dev/null +++ b/.scrutinizer.yml @@ -0,0 +1,9 @@ +tools: + php_mess_detector: + enabled: true + config: + rulesets: [phpmd.xml] + php_cpd: + enabled: true + php_pdepend: + enabled: true diff --git a/CHANGELOG.md b/CHANGELOG.md index b93aebf..f38f2b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ CHANGE LOG ========== +## V0.2 Alpha (25/08/2013) +#### Major Release + +* Updated the providers +* Scrutinizer updates +* Minor tweaks + + ## V0.1 Alpha (15/08/2013) #### Major Release diff --git a/README.md b/README.md index f697073..cc75f8c 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,14 @@ Laravel HTMLMin =============== -[![Latest Stable Version](https://poser.pugx.org/graham-campbell/htmlmin/v/stable.png)](https://packagist.org/packages/graham-campbell/htmlmin) +[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/GrahamCampbell/laravel-htmlmin/trend.png)](https://bitdeli.com/free "Bitdeli Badge") [![Build Status](https://travis-ci.org/GrahamCampbell/Laravel-HTMLMin.png?branch=master)](https://travis-ci.org/GrahamCampbell/Laravel-HTMLMin) -[![Latest Unstable Version](https://poser.pugx.org/graham-campbell/htmlmin/v/unstable.png)](https://packagist.org/packages/graham-campbell/htmlmin) -[![Build Status](https://travis-ci.org/GrahamCampbell/Laravel-HTMLMin.png?branch=develop)](https://travis-ci.org/GrahamCampbell/Laravel-HTMLMin) +[![Latest Version](https://poser.pugx.org/graham-campbell/htmlmin/v/stable.png)](https://packagist.org/packages/graham-campbell/htmlmin) [![Total Downloads](https://poser.pugx.org/graham-campbell/htmlmin/downloads.png)](https://packagist.org/packages/graham-campbell/htmlmin) +[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/GrahamCampbell/Laravel-HTMLMin/badges/quality-score.png?s=b56aacf6a0c1b2e612c3d7dab63d212084e6b83b)](https://scrutinizer-ci.com/g/GrahamCampbell/Laravel-HTMLMin) [![Still Maintained](http://stillmaintained.com/GrahamCampbell/Laravel-HTMLMin.png)](http://stillmaintained.com/GrahamCampbell/Laravel-HTMLMin) -[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/GrahamCampbell/laravel-htmlmin/trend.png)](https://bitdeli.com/free "Bitdeli Badge") - - Copyright © [Graham Campbell](https://github.com/GrahamCampbell) 2013 @@ -25,6 +22,7 @@ Laravel HTMLMin is a simple HTML minifier for [Laravel 4](http://laravel.com). * Laravel HTMLMin was created by, and is maintained by [Graham Campbell](https://github.com/GrahamCampbell). * Laravel HTMLMin uses [Travis CI](https://travis-ci.org/GrahamCampbell/Laravel-HTMLMin) to run tests to check if it's working as it should. +* Laravel HTMLMin uses [Scrutinizer CI](https://scrutinizer-ci.com/g/GrahamCampbell/Laravel-HTMLMin) to run additional tests and checks. * Laravel HTMLMin uses [Composer](https://getcomposer.org) to load and manage dependencies. * Laravel HTMLMin provides a [change log](https://github.com/GrahamCampbell/Laravel-HTMLMin/blob/master/CHANGELOG.md), [releases](https://github.com/GrahamCampbell/Laravel-HTMLMin/releases), and a [wiki](https://github.com/GrahamCampbell/Laravel-HTMLMin/wiki). * Laravel HTMLMin is licensed under the MIT, available [here](https://github.com/GrahamCampbell/Laravel-HTMLMin/blob/master/LICENSE.md). diff --git a/composer.json b/composer.json index 6639398..4248f32 100644 --- a/composer.json +++ b/composer.json @@ -11,10 +11,10 @@ ], "require": { "php": ">=5.3.3", - "illuminate/support": "4.0.*" + "illuminate/support": "4.0.*@stable" }, "require-dev": { - "mockery/mockery": "dev-master", + "mockery/mockery": "0.8.*@stable", "phpunit/phpunit": "3.7.*@stable" }, "autoload": { @@ -22,10 +22,5 @@ "GrahamCampbell\\HTMLMin": "src/" } }, - "extra": { - "branch-alias": { - "dev-master": "0.1.x-dev" - } - }, "minimum-stability": "dev" } diff --git a/phpmd.xml b/phpmd.xml new file mode 100644 index 0000000..2fa7b6b --- /dev/null +++ b/phpmd.xml @@ -0,0 +1,719 @@ + + + + Bootstrap CMS Rules + + + + + + 3 + + + + + + + + + + + + +The NPath complexity of a method is the number of acyclic execution paths through that method. +A threshold of 200 is generally considered the point where measures should be taken to reduce complexity. + + 3 + + + + + + + + + + +Violations of this rule usually indicate that the method is doing +too much. Try to reduce the method size by creating helper methods and removing any copy/pasted code. + + 3 + + + + + + + + + + +Long Class files are indications that the class may be trying to +do too much. Try to break it down, and reduce the size to something +manageable. + + 3 + + + + + + + + + + +Long parameter lists can indicate that a new object should be created to +wrap the numerous parameters. Basically, try to group the parameters together. + + 3 + + + + + + + + + + + +A large number of public methods and attributes declared in a class can indicate +the class may need to be broken up as increased effort will be required to +thoroughly test it. + + 3 + + + + + + + + + + +Classes that have too many fields could be redesigned to have fewer fields, +possibly through some nested object grouping of some of the information. For +example, a class with city/state/zip fields could instead have one Address +field. + + 3 + + + + + + + + + + + + + 3 + + + + + + + + + + 3 + + + + + + + + + + + + + 1 + + + + + + + + + + + 1 + + + + + + + + + + + 1 + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + + 2 + + + + + + + + + + +Detects when a field, local, or parameter has a very short name. + + 3 + + + + + + q; // VIOLATION - Local + for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR) + $r += $this->q; + } + } +} + ]]> + + + + + +Detects when a field, formal or local variable is declared with a long name. + + 3 + + + + + + + + + + +Detects when very short method names are used. + + 3 + + + + + + + + + + + +A constructor method should not have the same name as the enclosing class, consider +to use the PHP 5 __construct method. + + 3 + + + + + + + +Class/Interface constant names should always be defined in uppercase. + + 4 + + + + + + + + +Looks for methods named 'getX()' with 'boolean' as the return type. The convention +is to name these methods 'isX()' or 'hasX()'. + + 4 + + + + + + + + + + +Detects when a private field is declared and/or assigned a value, but not used. + + 3 + +j++; + } +} +]]> + + + + + +Detects when a local variable is declared and/or assigned, but not used. + + 3 + + + + + + + +Unused Private Method detects when a private method is declared but is unused. + + 3 + + + + + + + +Avoid passing parameters to methods or constructors and then not using those parameters. + + 3 + + + + + + diff --git a/src/GrahamCampbell/HTMLMin/Classes/HTMLMin.php b/src/GrahamCampbell/HTMLMin/Classes/HTMLMin.php index 362096f..508ea19 100644 --- a/src/GrahamCampbell/HTMLMin/Classes/HTMLMin.php +++ b/src/GrahamCampbell/HTMLMin/Classes/HTMLMin.php @@ -5,6 +5,7 @@ class HTMLMin { /** * Get the minified html. * + * @param string $render * @return string */ public static function render($render) { diff --git a/src/GrahamCampbell/HTMLMin/HTMLMinServiceProvider.php b/src/GrahamCampbell/HTMLMin/HTMLMinServiceProvider.php index 007b063..a0d2535 100644 --- a/src/GrahamCampbell/HTMLMin/HTMLMinServiceProvider.php +++ b/src/GrahamCampbell/HTMLMin/HTMLMinServiceProvider.php @@ -37,6 +37,6 @@ public function register() { * @return array */ public function provides() { - return array(); + return array('htmlmin'); } }