use flyeralarm/php-code-validator to validate PHP code

This commit is contained in:
Dominik Liebler
2019-08-26 06:31:47 +02:00
parent 87f8eb1983
commit 92482c29bc
5 changed files with 54 additions and 7 deletions

View File

@@ -22,3 +22,4 @@ install:
script:
- vendor/bin/phpunit
- vendor/bin/phpcs .

View File

@@ -1,9 +1,8 @@
<?php
namespace DesignPatterns\Structural\Registry;
class Service {
class Service
{
}

View File

@@ -14,7 +14,8 @@
},
"require-dev": {
"phpunit/phpunit": "^8",
"squizlabs/php_codesniffer": "^3"
"squizlabs/php_codesniffer": "^3",
"flyeralarm/php-code-validator": "^2.2"
},
"autoload": {
"psr-4": {

40
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "7ded2124a559b6f94b21d8bb99c89e7a",
"content-hash": "d5270aabf0cc9417cf99d27e6819f0ad",
"packages": [
{
"name": "psr/http-message",
@@ -114,6 +114,44 @@
],
"time": "2019-03-17T17:37:11+00:00"
},
{
"name": "flyeralarm/php-code-validator",
"version": "2.2.0",
"source": {
"type": "git",
"url": "https://github.com/flyeralarm/php-code-validator.git",
"reference": "a663524e57ae92da51dd0afc62e58a8f678b2066"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/flyeralarm/php-code-validator/zipball/a663524e57ae92da51dd0afc62e58a8f678b2066",
"reference": "a663524e57ae92da51dd0afc62e58a8f678b2066",
"shasum": ""
},
"require": {
"squizlabs/php_codesniffer": "^3.0"
},
"bin": [
"bin/php-code-validator"
],
"type": "config",
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Daniel Müller",
"email": "daniel.mueller@flyeralarm.com"
},
{
"name": "Maximilian Grosch",
"email": "maximilian.grosch@flyeralarm.com"
}
],
"description": "A custom coding standard for FLYERALARM",
"time": "2019-08-22T07:12:50+00:00"
},
{
"name": "myclabs/deep-copy",
"version": "1.9.3",

8
phpcs.xml.dist Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ruleset name="Project Rules">
<directory>**/*.php</directory>
<exclude-pattern>vendor</exclude-pattern>
<arg value="sp"/>
<rule ref="vendor/flyeralarm/php-code-validator/ruleset.xml"/>
</ruleset>