Add PHP lint and PHP code sniffer
This commit is contained in:
14
RoboFile.php
14
RoboFile.php
@ -141,6 +141,20 @@ class RoboFile extends \Robo\Tasks {
|
|||||||
$this->_exec('vendor/bin/codecept run -g failed');
|
$this->_exec('vendor/bin/codecept run -g failed');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function qaLint() {
|
||||||
|
$this->_exec('./tasks/php_lint.sh lib/ tests/');
|
||||||
|
}
|
||||||
|
|
||||||
|
function qaCodeSniffer() {
|
||||||
|
$this->_exec(
|
||||||
|
'./vendor/bin/phpcs '.
|
||||||
|
'--standard=./tasks/code_sniffer/MailPoet '.
|
||||||
|
'--ignore=./lib/Util/Sudzy/*,./lib/Util/CSS.php,./lib/Util/XLSXWriter.php,'.
|
||||||
|
'./lib/Config/PopulatorData/Templates/* '.
|
||||||
|
'lib/'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
protected function loadEnv() {
|
protected function loadEnv() {
|
||||||
$dotenv = new Dotenv\Dotenv(__DIR__);
|
$dotenv = new Dotenv\Dotenv(__DIR__);
|
||||||
$dotenv->load();
|
$dotenv->load();
|
||||||
|
@ -25,7 +25,10 @@
|
|||||||
"codegyre/robo": "*",
|
"codegyre/robo": "*",
|
||||||
"vlucas/phpdotenv": "*",
|
"vlucas/phpdotenv": "*",
|
||||||
"umpirsky/twig-gettext-extractor": "1.1.*",
|
"umpirsky/twig-gettext-extractor": "1.1.*",
|
||||||
"raveren/kint": "^1.0"
|
"raveren/kint": "^1.0",
|
||||||
|
"sebastian/phpcpd": "*",
|
||||||
|
"phpmd/phpmd": "@stable",
|
||||||
|
"squizlabs/php_codesniffer": "2.*"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
392
composer.lock
generated
392
composer.lock
generated
@ -4,8 +4,8 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"hash": "1ca212f3a40d935947bfb9aee5a159d1",
|
"hash": "5a9cfb9c0ba8e5091659aefbe104b17a",
|
||||||
"content-hash": "a2bae80e75ebce4506fc6d7bd8394a04",
|
"content-hash": "7a265af08be4abb586601d498fbe4374",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "cerdic/css-tidy",
|
"name": "cerdic/css-tidy",
|
||||||
@ -1236,16 +1236,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "guzzlehttp/psr7",
|
"name": "guzzlehttp/psr7",
|
||||||
"version": "1.3.0",
|
"version": "1.3.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/guzzle/psr7.git",
|
"url": "https://github.com/guzzle/psr7.git",
|
||||||
"reference": "31382fef2889136415751badebbd1cb022a4ed72"
|
"reference": "5c6447c9df362e8f8093bda8f5d8873fe5c7f65b"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/31382fef2889136415751badebbd1cb022a4ed72",
|
"url": "https://api.github.com/repos/guzzle/psr7/zipball/5c6447c9df362e8f8093bda8f5d8873fe5c7f65b",
|
||||||
"reference": "31382fef2889136415751badebbd1cb022a4ed72",
|
"reference": "5c6447c9df362e8f8093bda8f5d8873fe5c7f65b",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -1261,7 +1261,7 @@
|
|||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "1.0-dev"
|
"dev-master": "1.4-dev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@ -1290,7 +1290,7 @@
|
|||||||
"stream",
|
"stream",
|
||||||
"uri"
|
"uri"
|
||||||
],
|
],
|
||||||
"time": "2016-04-13 19:56:01"
|
"time": "2016-06-24 23:00:38"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "henrikbjorn/lurker",
|
"name": "henrikbjorn/lurker",
|
||||||
@ -1393,6 +1393,46 @@
|
|||||||
],
|
],
|
||||||
"time": "2015-11-20 12:04:31"
|
"time": "2015-11-20 12:04:31"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "pdepend/pdepend",
|
||||||
|
"version": "2.2.4",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/pdepend/pdepend.git",
|
||||||
|
"reference": "b086687f3a01dc6bb92d633aef071d2c5dd0db06"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/pdepend/pdepend/zipball/b086687f3a01dc6bb92d633aef071d2c5dd0db06",
|
||||||
|
"reference": "b086687f3a01dc6bb92d633aef071d2c5dd0db06",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.3.7",
|
||||||
|
"symfony/config": "^2.3.0|^3",
|
||||||
|
"symfony/dependency-injection": "^2.3.0|^3",
|
||||||
|
"symfony/filesystem": "^2.3.0|^3"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "^4.4.0,<4.8",
|
||||||
|
"squizlabs/php_codesniffer": "^2.0.0"
|
||||||
|
},
|
||||||
|
"bin": [
|
||||||
|
"src/bin/pdepend"
|
||||||
|
],
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"PDepend\\": "src/main/php/PDepend"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"BSD-3-Clause"
|
||||||
|
],
|
||||||
|
"description": "Official version of pdepend to be handled with Composer",
|
||||||
|
"time": "2016-03-10 15:15:04"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "phpdocumentor/reflection-common",
|
"name": "phpdocumentor/reflection-common",
|
||||||
"version": "1.0",
|
"version": "1.0",
|
||||||
@ -1539,6 +1579,71 @@
|
|||||||
],
|
],
|
||||||
"time": "2016-06-10 07:14:17"
|
"time": "2016-06-10 07:14:17"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "phpmd/phpmd",
|
||||||
|
"version": "2.4.3",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/phpmd/phpmd.git",
|
||||||
|
"reference": "2b9c2417a18696dfb578b38c116cd0ddc19b256e"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/phpmd/phpmd/zipball/2b9c2417a18696dfb578b38c116cd0ddc19b256e",
|
||||||
|
"reference": "2b9c2417a18696dfb578b38c116cd0ddc19b256e",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"pdepend/pdepend": "^2.0.4",
|
||||||
|
"php": ">=5.3.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "^4.0",
|
||||||
|
"squizlabs/php_codesniffer": "^2.0"
|
||||||
|
},
|
||||||
|
"bin": [
|
||||||
|
"src/bin/phpmd"
|
||||||
|
],
|
||||||
|
"type": "project",
|
||||||
|
"autoload": {
|
||||||
|
"psr-0": {
|
||||||
|
"PHPMD\\": "src/main/php"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"BSD-3-Clause"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Manuel Pichler",
|
||||||
|
"email": "github@manuel-pichler.de",
|
||||||
|
"homepage": "https://github.com/manuelpichler",
|
||||||
|
"role": "Project Founder"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Other contributors",
|
||||||
|
"homepage": "https://github.com/phpmd/phpmd/graphs/contributors",
|
||||||
|
"role": "Contributors"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Marc Würth",
|
||||||
|
"email": "ravage@bluewin.ch",
|
||||||
|
"homepage": "https://github.com/ravage84",
|
||||||
|
"role": "Project Maintainer"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.",
|
||||||
|
"homepage": "http://phpmd.org/",
|
||||||
|
"keywords": [
|
||||||
|
"mess detection",
|
||||||
|
"mess detector",
|
||||||
|
"pdepend",
|
||||||
|
"phpmd",
|
||||||
|
"pmd"
|
||||||
|
],
|
||||||
|
"time": "2016-04-04 11:52:04"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "phpspec/prophecy",
|
"name": "phpspec/prophecy",
|
||||||
"version": "v1.6.1",
|
"version": "v1.6.1",
|
||||||
@ -2360,6 +2465,45 @@
|
|||||||
],
|
],
|
||||||
"time": "2016-06-17 09:04:28"
|
"time": "2016-06-17 09:04:28"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "sebastian/finder-facade",
|
||||||
|
"version": "1.2.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/sebastianbergmann/finder-facade.git",
|
||||||
|
"reference": "2a6f7f57efc0aa2d23297d9fd9e2a03111a8c0b9"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/sebastianbergmann/finder-facade/zipball/2a6f7f57efc0aa2d23297d9fd9e2a03111a8c0b9",
|
||||||
|
"reference": "2a6f7f57efc0aa2d23297d9fd9e2a03111a8c0b9",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"symfony/finder": "~2.3|~3.0",
|
||||||
|
"theseer/fdomdocument": "~1.3"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"classmap": [
|
||||||
|
"src/"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"BSD-3-Clause"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Sebastian Bergmann",
|
||||||
|
"email": "sebastian@phpunit.de",
|
||||||
|
"role": "lead"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "FinderFacade is a convenience wrapper for Symfony's Finder component.",
|
||||||
|
"homepage": "https://github.com/sebastianbergmann/finder-facade",
|
||||||
|
"time": "2016-02-17 07:02:23"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "sebastian/global-state",
|
"name": "sebastian/global-state",
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
@ -2457,6 +2601,57 @@
|
|||||||
"homepage": "https://github.com/sebastianbergmann/object-enumerator/",
|
"homepage": "https://github.com/sebastianbergmann/object-enumerator/",
|
||||||
"time": "2016-01-28 13:25:10"
|
"time": "2016-01-28 13:25:10"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "sebastian/phpcpd",
|
||||||
|
"version": "2.0.4",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/sebastianbergmann/phpcpd.git",
|
||||||
|
"reference": "24d9a880deadb0b8c9680e9cfe78e30b704225db"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/sebastianbergmann/phpcpd/zipball/24d9a880deadb0b8c9680e9cfe78e30b704225db",
|
||||||
|
"reference": "24d9a880deadb0b8c9680e9cfe78e30b704225db",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.3.3",
|
||||||
|
"phpunit/php-timer": ">=1.0.6",
|
||||||
|
"sebastian/finder-facade": "~1.1",
|
||||||
|
"sebastian/version": "~1.0|~2.0",
|
||||||
|
"symfony/console": "~2.7|^3.0",
|
||||||
|
"theseer/fdomdocument": "~1.4"
|
||||||
|
},
|
||||||
|
"bin": [
|
||||||
|
"phpcpd"
|
||||||
|
],
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "2.0-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"classmap": [
|
||||||
|
"src/"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"BSD-3-Clause"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Sebastian Bergmann",
|
||||||
|
"email": "sebastian@phpunit.de",
|
||||||
|
"role": "lead"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Copy/Paste Detector (CPD) for PHP code.",
|
||||||
|
"homepage": "https://github.com/sebastianbergmann/phpcpd",
|
||||||
|
"time": "2016-04-17 19:32:49"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "sebastian/recursion-context",
|
"name": "sebastian/recursion-context",
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
@ -2595,6 +2790,84 @@
|
|||||||
"homepage": "https://github.com/sebastianbergmann/version",
|
"homepage": "https://github.com/sebastianbergmann/version",
|
||||||
"time": "2016-02-04 12:56:52"
|
"time": "2016-02-04 12:56:52"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "squizlabs/php_codesniffer",
|
||||||
|
"version": "2.6.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
|
||||||
|
"reference": "fb72ed32f8418db5e7770be1653e62e0d6f5dd3d"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/fb72ed32f8418db5e7770be1653e62e0d6f5dd3d",
|
||||||
|
"reference": "fb72ed32f8418db5e7770be1653e62e0d6f5dd3d",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"ext-simplexml": "*",
|
||||||
|
"ext-tokenizer": "*",
|
||||||
|
"ext-xmlwriter": "*",
|
||||||
|
"php": ">=5.1.2"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "~4.0"
|
||||||
|
},
|
||||||
|
"bin": [
|
||||||
|
"scripts/phpcs",
|
||||||
|
"scripts/phpcbf"
|
||||||
|
],
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "2.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"classmap": [
|
||||||
|
"CodeSniffer.php",
|
||||||
|
"CodeSniffer/CLI.php",
|
||||||
|
"CodeSniffer/Exception.php",
|
||||||
|
"CodeSniffer/File.php",
|
||||||
|
"CodeSniffer/Fixer.php",
|
||||||
|
"CodeSniffer/Report.php",
|
||||||
|
"CodeSniffer/Reporting.php",
|
||||||
|
"CodeSniffer/Sniff.php",
|
||||||
|
"CodeSniffer/Tokens.php",
|
||||||
|
"CodeSniffer/Reports/",
|
||||||
|
"CodeSniffer/Tokenizers/",
|
||||||
|
"CodeSniffer/DocGenerators/",
|
||||||
|
"CodeSniffer/Standards/AbstractPatternSniff.php",
|
||||||
|
"CodeSniffer/Standards/AbstractScopeSniff.php",
|
||||||
|
"CodeSniffer/Standards/AbstractVariableSniff.php",
|
||||||
|
"CodeSniffer/Standards/IncorrectPatternException.php",
|
||||||
|
"CodeSniffer/Standards/Generic/Sniffs/",
|
||||||
|
"CodeSniffer/Standards/MySource/Sniffs/",
|
||||||
|
"CodeSniffer/Standards/PEAR/Sniffs/",
|
||||||
|
"CodeSniffer/Standards/PSR1/Sniffs/",
|
||||||
|
"CodeSniffer/Standards/PSR2/Sniffs/",
|
||||||
|
"CodeSniffer/Standards/Squiz/Sniffs/",
|
||||||
|
"CodeSniffer/Standards/Zend/Sniffs/"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"BSD-3-Clause"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Greg Sherwood",
|
||||||
|
"role": "lead"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
|
||||||
|
"homepage": "http://www.squizlabs.com/php-codesniffer",
|
||||||
|
"keywords": [
|
||||||
|
"phpcs",
|
||||||
|
"standards"
|
||||||
|
],
|
||||||
|
"time": "2016-05-30 22:24:32"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/browser-kit",
|
"name": "symfony/browser-kit",
|
||||||
"version": "v3.1.1",
|
"version": "v3.1.1",
|
||||||
@ -2818,6 +3091,66 @@
|
|||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"time": "2016-06-06 11:42:41"
|
"time": "2016-06-06 11:42:41"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "symfony/dependency-injection",
|
||||||
|
"version": "v3.1.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/symfony/dependency-injection.git",
|
||||||
|
"reference": "4b9645f5870e0b4ab35cc5b528422049946e8bec"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/4b9645f5870e0b4ab35cc5b528422049946e8bec",
|
||||||
|
"reference": "4b9645f5870e0b4ab35cc5b528422049946e8bec",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.5.9"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"symfony/config": "~2.8|~3.0",
|
||||||
|
"symfony/expression-language": "~2.8|~3.0",
|
||||||
|
"symfony/yaml": "~2.8|~3.0"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"symfony/config": "",
|
||||||
|
"symfony/expression-language": "For using expressions in service container configuration",
|
||||||
|
"symfony/proxy-manager-bridge": "Generate service proxies to lazy load them",
|
||||||
|
"symfony/yaml": ""
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "3.1-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Component\\DependencyInjection\\": ""
|
||||||
|
},
|
||||||
|
"exclude-from-classmap": [
|
||||||
|
"/Tests/"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Fabien Potencier",
|
||||||
|
"email": "fabien@symfony.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Symfony Community",
|
||||||
|
"homepage": "https://symfony.com/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Symfony DependencyInjection Component",
|
||||||
|
"homepage": "https://symfony.com",
|
||||||
|
"time": "2016-06-14 11:18:07"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/dom-crawler",
|
"name": "symfony/dom-crawler",
|
||||||
"version": "v3.1.1",
|
"version": "v3.1.1",
|
||||||
@ -3607,6 +3940,46 @@
|
|||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"time": "2016-06-14 11:18:07"
|
"time": "2016-06-14 11:18:07"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "theseer/fdomdocument",
|
||||||
|
"version": "1.6.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/theseer/fDOMDocument.git",
|
||||||
|
"reference": "d9ad139d6c2e8edf5e313ffbe37ff13344cf0684"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/theseer/fDOMDocument/zipball/d9ad139d6c2e8edf5e313ffbe37ff13344cf0684",
|
||||||
|
"reference": "d9ad139d6c2e8edf5e313ffbe37ff13344cf0684",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"ext-dom": "*",
|
||||||
|
"lib-libxml": "*",
|
||||||
|
"php": ">=5.3.3"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"classmap": [
|
||||||
|
"src/"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"BSD-3-Clause"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Arne Blankerts",
|
||||||
|
"email": "arne@blankerts.de",
|
||||||
|
"role": "lead"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "The classes contained within this repository extend the standard DOM to use exceptions at all occasions of errors instead of PHP warnings or notices. They also add various custom methods and shortcuts for convenience and to simplify the usage of DOM.",
|
||||||
|
"homepage": "https://github.com/theseer/fDOMDocument",
|
||||||
|
"time": "2015-05-27 22:58:02"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "twig/extensions",
|
"name": "twig/extensions",
|
||||||
"version": "v1.3.0",
|
"version": "v1.3.0",
|
||||||
@ -3811,7 +4184,8 @@
|
|||||||
"aliases": [],
|
"aliases": [],
|
||||||
"minimum-stability": "stable",
|
"minimum-stability": "stable",
|
||||||
"stability-flags": {
|
"stability-flags": {
|
||||||
"soundasleep/html2text": 20
|
"soundasleep/html2text": 20,
|
||||||
|
"phpmd/phpmd": 0
|
||||||
},
|
},
|
||||||
"prefer-stable": false,
|
"prefer-stable": false,
|
||||||
"prefer-lowest": false,
|
"prefer-lowest": false,
|
||||||
|
@ -0,0 +1,59 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Verifies spacing of control statements.
|
||||||
|
*
|
||||||
|
* PHP version 5
|
||||||
|
*
|
||||||
|
* @category PHP
|
||||||
|
* @package PHP_CodeSniffer
|
||||||
|
* @author Greg Sherwood <gsherwood@squiz.net>
|
||||||
|
* @author Marc McIntyre <mmcintyre@squiz.net>
|
||||||
|
* @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600)
|
||||||
|
* @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
|
||||||
|
* @link http://pear.php.net/package/PHP_CodeSniffer
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (class_exists('PHP_CodeSniffer_Standards_AbstractPatternSniff', true) === false) {
|
||||||
|
throw new PHP_CodeSniffer_Exception('Class PHP_CodeSniffer_Standards_AbstractPatternSniff not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verifies spacing of control statements.
|
||||||
|
*
|
||||||
|
* @category PHP
|
||||||
|
* @package PHP_CodeSniffer
|
||||||
|
* @author Greg Sherwood <gsherwood@squiz.net>
|
||||||
|
* @author Marc McIntyre <mmcintyre@squiz.net>
|
||||||
|
* @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600)
|
||||||
|
* @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
|
||||||
|
* @version Release: @package_version@
|
||||||
|
* @link http://pear.php.net/package/PHP_CodeSniffer
|
||||||
|
*/
|
||||||
|
class MailPoet_Sniffs_ControlStructures_ControlSignatureSniff extends PHP_CodeSniffer_Standards_AbstractPatternSniff {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If true, comments will be ignored if they are found in the code.
|
||||||
|
*
|
||||||
|
* @var boolean
|
||||||
|
*/
|
||||||
|
public $ignoreComments = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the patterns that this test wishes to verify.
|
||||||
|
*
|
||||||
|
* @return string[]
|
||||||
|
*/
|
||||||
|
protected function getPatterns() {
|
||||||
|
return array(
|
||||||
|
'do {EOL...} while(...);EOL',
|
||||||
|
'while(...) {EOL',
|
||||||
|
'for(...) {EOL',
|
||||||
|
'if(...) {EOL',
|
||||||
|
'foreach(...) {EOL',
|
||||||
|
'} else if(...) {EOL',
|
||||||
|
'} elseif(...) {EOL',
|
||||||
|
'} else {EOL',
|
||||||
|
'do {EOL',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
123
tasks/code_sniffer/MailPoet/ruleset.xml
Normal file
123
tasks/code_sniffer/MailPoet/ruleset.xml
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<ruleset name="MailPoet">
|
||||||
|
<description>MailPoet specific rule set</description>
|
||||||
|
|
||||||
|
<!-- Control structures must have at least one statement in the body -->
|
||||||
|
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
|
||||||
|
<!-- For loops with only second expression should be while loops -->
|
||||||
|
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/>
|
||||||
|
<!-- Same variable should not be used for two nested loops as incrementers -->
|
||||||
|
<rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
|
||||||
|
<!-- Shouldn't use if statements that are always evaluated -->
|
||||||
|
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
|
||||||
|
<!-- Final methods don't need final in classes marked as final -->
|
||||||
|
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
|
||||||
|
<!-- All parameters in function signature should be used within the function -->
|
||||||
|
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
|
||||||
|
<!-- Don't use methods that extend and only call the parent method -->
|
||||||
|
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
|
||||||
|
|
||||||
|
<!-- Disallow usage of BOMs -->
|
||||||
|
<rule ref="Generic.Files.ByteOrderMark"/>
|
||||||
|
<!-- Lines can be 80 chars long, show errors at 120 chars -->
|
||||||
|
<rule ref="Generic.Files.LineLength">
|
||||||
|
<properties>
|
||||||
|
<property name="lineLimit" value="80"/>
|
||||||
|
<property name="absoluteLineLimit" value="120"/>
|
||||||
|
</properties>
|
||||||
|
</rule>
|
||||||
|
<!-- Use Unix newlines -->
|
||||||
|
<rule ref="Generic.Files.LineEndings">
|
||||||
|
<properties>
|
||||||
|
<property name="eolChar" value="\n"/>
|
||||||
|
</properties>
|
||||||
|
</rule>
|
||||||
|
<!-- Limit classes to one per file -->
|
||||||
|
<rule ref="Generic.Files.OneClassPerFile"/>
|
||||||
|
<!-- Limit interfaces to one per file -->
|
||||||
|
<rule ref="Generic.Files.OneInterfacePerFile"/>
|
||||||
|
|
||||||
|
<!-- Disallow multiple statements on a single line -->
|
||||||
|
<rule ref="Generic.Formatting.DisallowMultipleStatements"/>
|
||||||
|
<!-- There should be no space after cast -->
|
||||||
|
<rule ref="Generic.Formatting.NoSpaceAfterCast"/>
|
||||||
|
|
||||||
|
<!-- Function calls should have one space after comma -->
|
||||||
|
<!-- And single spaces should surround equals sign for default values -->
|
||||||
|
<rule ref="Generic.Functions.FunctionCallArgumentSpacing"/>
|
||||||
|
<!-- Opening brace should be on the same line as the function declaration -->
|
||||||
|
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie"/>
|
||||||
|
|
||||||
|
<!-- Nesting level should be kept under 5, not more than 10 -->
|
||||||
|
<rule ref="Generic.Metrics.NestingLevel"/>
|
||||||
|
|
||||||
|
<!-- Function names should use camelCaps -->
|
||||||
|
<rule ref="Generic.NamingConventions.CamelCapsFunctionName">
|
||||||
|
<properties>
|
||||||
|
<property name="strict" value="false"/>
|
||||||
|
</properties>
|
||||||
|
</rule>
|
||||||
|
<!-- Constants should be all uppercase with underscores separating words -->
|
||||||
|
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
|
||||||
|
|
||||||
|
<!-- Disallow characters before PHP opening tag -->
|
||||||
|
<rule ref="Generic.PHP.CharacterBeforePHPOpeningTag"/>
|
||||||
|
<rule ref="Generic.PHP.DisallowShortOpenTag"/>
|
||||||
|
<!-- true, false, null should always be lower case -->
|
||||||
|
<rule ref="Generic.PHP.LowerCaseConstant"/>
|
||||||
|
<!-- System keywords should always be lower case -->
|
||||||
|
<rule ref="Generic.PHP.LowerCaseKeyword"/>
|
||||||
|
<!-- Disallow silencing errors with @ -->
|
||||||
|
<rule ref="Generic.PHP.NoSilencedErrors"/>
|
||||||
|
|
||||||
|
<!-- Disallow indenting with tabs -->
|
||||||
|
<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
|
||||||
|
<!-- Control structures, classes, functions indent 2 spaces per level -->
|
||||||
|
<rule ref="Generic.WhiteSpace.ScopeIndent">
|
||||||
|
<properties>
|
||||||
|
<property name="indent" value="2"/>
|
||||||
|
</properties>
|
||||||
|
</rule>
|
||||||
|
|
||||||
|
<!-- Closing brace should be at the same level as opening brace -->
|
||||||
|
<rule ref="PEAR.WhiteSpace.ScopeClosingBrace">
|
||||||
|
<properties>
|
||||||
|
<property name="indent" value="2"/>
|
||||||
|
</properties>
|
||||||
|
</rule>
|
||||||
|
|
||||||
|
<!-- Each class must be in a file by itself and must be under a namespace -->
|
||||||
|
<rule ref="PSR1.Classes.ClassDeclaration"/>
|
||||||
|
|
||||||
|
<!-- One namespace per use, one blank line after final use statement -->
|
||||||
|
<rule ref="PSR2.Namespaces.UseDeclaration"/>
|
||||||
|
|
||||||
|
<!-- When referencing arrays there should be no whitespace between brackets -->
|
||||||
|
<rule ref="Squiz.Arrays.ArrayBracketSpacing"/>
|
||||||
|
<!-- Class name and file name must match -->
|
||||||
|
<rule ref="Squiz.Classes.ClassFileName"/>
|
||||||
|
<!-- Classes should be named camel case with first letter capitalised -->
|
||||||
|
<rule ref="Squiz.Classes.ValidClassName"/>
|
||||||
|
<!-- Checks for empty catch statements. It must at least have a comment -->
|
||||||
|
<rule ref="Squiz.Commenting.EmptyCatchComment"/>
|
||||||
|
<!-- There should be a space between each foreach condition -->
|
||||||
|
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration"/>
|
||||||
|
<!-- There should be a space between each for condition -->
|
||||||
|
<rule ref="Squiz.ControlStructures.ForLoopDeclaration"/>
|
||||||
|
|
||||||
|
<!-- There should not be commented out code -->
|
||||||
|
<rule ref="Squiz.PHP.CommentedOutCode"/>
|
||||||
|
<!-- Discourage use of debug functions -->
|
||||||
|
<rule ref="Squiz.PHP.DiscouragedFunctions"/>
|
||||||
|
<!-- Discourage use of eval -->
|
||||||
|
<rule ref="Squiz.PHP.Eval"/>
|
||||||
|
<!-- Warn about non executable code -->
|
||||||
|
<rule ref="Squiz.PHP.NonExecutableCode"/>
|
||||||
|
|
||||||
|
<!-- Warn about usage of "$this" in static methods -->
|
||||||
|
<rule ref="Squiz.Scope.StaticThisUsage"/>
|
||||||
|
|
||||||
|
<!-- Remove space between if/for/while and opening parenthesis -->
|
||||||
|
<rule ref="MailPoet.ControlStructures.ControlSignature"/>
|
||||||
|
|
||||||
|
</ruleset>
|
31
tasks/php_lint.sh
Executable file
31
tasks/php_lint.sh
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
error=false
|
||||||
|
|
||||||
|
while test $# -gt 0; do
|
||||||
|
current=$1
|
||||||
|
shift
|
||||||
|
|
||||||
|
if [ ! -d $current ] && [ ! -f $current ] ; then
|
||||||
|
echo "Invalid directory or file: $current"
|
||||||
|
error=true
|
||||||
|
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
for file in `find $current -type f -name "*.php"` ; do
|
||||||
|
RESULTS=`php -l $file`
|
||||||
|
|
||||||
|
if [ "$RESULTS" != "No syntax errors detected in $file" ] ; then
|
||||||
|
echo $RESULTS
|
||||||
|
error=true
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
if [ "$error" = true ] ; then
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
exit 0
|
||||||
|
fi
|
Reference in New Issue
Block a user