Code sniffer, fix php standard violations

This commit is contained in:
Ernest 2021-01-18 09:51:37 +01:00
parent bc83dc6289
commit bfd0a872eb
37 changed files with 393 additions and 1038 deletions

View file

@ -1,21 +1,12 @@
import Vue from 'vue';
import VueTest from './components/VueTest'
import './styles/app.scss';
/*
* Welcome to your app's main JavaScript file!
*
* We recommend including the built version of this JavaScript file
* (and its CSS file) in your base layout (base.html.twig).
*/
require('bootstrap');
// any CSS you import will output into a single css file (app.css in this case)
import './styles/app.css';
// start the Stimulus application
import './bootstrap';
// Vuejs
Vue.options.delimiters = ['${', '}$']
new Vue({
el: '#kbin',
data: {
message: 'test'
},
components: {
VueTest
},
});

View file

@ -0,0 +1,16 @@
import { Controller } from 'stimulus';
/*
* This is an example Stimulus controller!
*
* Any element with a data-controller="hello" attribute will cause
* this controller to be executed. The name "hello" comes from the filename:
* hello_controller.js -> "hello"
*
* Delete this file or adapt it for your use!
*/
export default class extends Controller {
connect() {
this.element.textContent = 'Hello Stimulus! Edit me in assets/controllers/hello_controller.js';
}
}

3
assets/styles/app.css Normal file
View file

@ -0,0 +1,3 @@
body {
background-color: lightgray;
}

View file

@ -12,6 +12,8 @@
"doctrine/doctrine-migrations-bundle": "^3.0",
"doctrine/orm": "^2.8",
"sensio/framework-extra-bundle": "^5.6",
"slevomat/coding-standard": "^6.4",
"squizlabs/php_codesniffer": "^3.5",
"symfony/console": "5.2.*",
"symfony/dotenv": "5.2.*",
"symfony/flex": "^1.3.1",

242
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": "4d7640699055b115f2ca2d872bf9edb2",
"content-hash": "4d50118b59dfaf3bd546f2d2f68dd62f",
"packages": [
{
"name": "composer/package-versions-deprecated",
@ -79,6 +79,76 @@
],
"time": "2020-11-11T10:22:58+00:00"
},
{
"name": "dealerdirect/phpcodesniffer-composer-installer",
"version": "v0.7.1",
"source": {
"type": "git",
"url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git",
"reference": "fe390591e0241955f22eb9ba327d137e501c771c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/fe390591e0241955f22eb9ba327d137e501c771c",
"reference": "fe390591e0241955f22eb9ba327d137e501c771c",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0 || ^2.0",
"php": ">=5.3",
"squizlabs/php_codesniffer": "^2.0 || ^3.0 || ^4.0"
},
"require-dev": {
"composer/composer": "*",
"phpcompatibility/php-compatibility": "^9.0",
"sensiolabs/security-checker": "^4.1.0"
},
"type": "composer-plugin",
"extra": {
"class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin"
},
"autoload": {
"psr-4": {
"Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Franck Nijhof",
"email": "franck.nijhof@dealerdirect.com",
"homepage": "http://www.frenck.nl",
"role": "Developer / IT Manager"
}
],
"description": "PHP_CodeSniffer Standards Composer Installer Plugin",
"homepage": "http://www.dealerdirect.com",
"keywords": [
"PHPCodeSniffer",
"PHP_CodeSniffer",
"code quality",
"codesniffer",
"composer",
"installer",
"phpcs",
"plugin",
"qa",
"quality",
"standard",
"standards",
"style guide",
"stylecheck",
"tests"
],
"support": {
"issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues",
"source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer"
},
"time": "2020-12-07T18:04:37+00:00"
},
{
"name": "doctrine/annotations",
"version": "1.11.1",
@ -1778,6 +1848,59 @@
],
"time": "2020-12-14T13:15:25+00:00"
},
{
"name": "phpstan/phpdoc-parser",
"version": "0.4.9",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpdoc-parser.git",
"reference": "98a088b17966bdf6ee25c8a4b634df313d8aa531"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/98a088b17966bdf6ee25c8a4b634df313d8aa531",
"reference": "98a088b17966bdf6ee25c8a4b634df313d8aa531",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"require-dev": {
"consistence/coding-standard": "^3.5",
"ergebnis/composer-normalize": "^2.0.2",
"jakub-onderka/php-parallel-lint": "^0.9.2",
"phing/phing": "^2.16.0",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^0.12.26",
"phpstan/phpstan-strict-rules": "^0.12",
"phpunit/phpunit": "^6.3",
"slevomat/coding-standard": "^4.7.2",
"symfony/process": "^4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "0.4-dev"
}
},
"autoload": {
"psr-4": {
"PHPStan\\PhpDocParser\\": [
"src/"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "PHPDoc parser with support for nullable, intersection and generic types",
"support": {
"issues": "https://github.com/phpstan/phpdoc-parser/issues",
"source": "https://github.com/phpstan/phpdoc-parser/tree/master"
},
"time": "2020-08-03T20:32:43+00:00"
},
{
"name": "psr/cache",
"version": "1.0.1",
@ -2060,6 +2183,123 @@
},
"time": "2020-08-25T19:10:18+00:00"
},
{
"name": "slevomat/coding-standard",
"version": "6.4.1",
"source": {
"type": "git",
"url": "https://github.com/slevomat/coding-standard.git",
"reference": "696dcca217d0c9da2c40d02731526c1e25b65346"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/slevomat/coding-standard/zipball/696dcca217d0c9da2c40d02731526c1e25b65346",
"reference": "696dcca217d0c9da2c40d02731526c1e25b65346",
"shasum": ""
},
"require": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7",
"php": "^7.1 || ^8.0",
"phpstan/phpdoc-parser": "0.4.5 - 0.4.9",
"squizlabs/php_codesniffer": "^3.5.6"
},
"require-dev": {
"phing/phing": "2.16.3",
"php-parallel-lint/php-parallel-lint": "1.2.0",
"phpstan/phpstan": "0.12.48",
"phpstan/phpstan-deprecation-rules": "0.12.5",
"phpstan/phpstan-phpunit": "0.12.16",
"phpstan/phpstan-strict-rules": "0.12.5",
"phpunit/phpunit": "7.5.20|8.5.5|9.4.0"
},
"type": "phpcodesniffer-standard",
"extra": {
"branch-alias": {
"dev-master": "6.x-dev"
}
},
"autoload": {
"psr-4": {
"SlevomatCodingStandard\\": "SlevomatCodingStandard"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.",
"support": {
"issues": "https://github.com/slevomat/coding-standard/issues",
"source": "https://github.com/slevomat/coding-standard/tree/6.4.1"
},
"funding": [
{
"url": "https://github.com/kukulich",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard",
"type": "tidelift"
}
],
"time": "2020-10-05T12:39:37+00:00"
},
{
"name": "squizlabs/php_codesniffer",
"version": "3.5.8",
"source": {
"type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
"reference": "9d583721a7157ee997f235f327de038e7ea6dac4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/9d583721a7157ee997f235f327de038e7ea6dac4",
"reference": "9d583721a7157ee997f235f327de038e7ea6dac4",
"shasum": ""
},
"require": {
"ext-simplexml": "*",
"ext-tokenizer": "*",
"ext-xmlwriter": "*",
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
},
"bin": [
"bin/phpcs",
"bin/phpcbf"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.x-dev"
}
},
"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": "https://github.com/squizlabs/PHP_CodeSniffer",
"keywords": [
"phpcs",
"standards"
],
"support": {
"issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues",
"source": "https://github.com/squizlabs/PHP_CodeSniffer",
"wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki"
},
"time": "2020-10-23T02:01:07+00:00"
},
{
"name": "symfony/asset",
"version": "v5.2.1",

View file

@ -4,6 +4,11 @@ webpack_encore:
# If multiple builds are defined (as shown below), you can disable the default build:
# output_path: false
# Set attributes that will be rendered on all script and link tags
script_attributes:
defer: true
# link_attributes:
# If using Encore.enableIntegrityHashes() and need the crossorigin attribute (default: false, or use 'anonymous' or 'use-credentials')
# crossorigin: 'anonymous'

View file

@ -2,14 +2,9 @@
"devDependencies": {
"@symfony/stimulus-bridge": "^1.1.0",
"@symfony/webpack-encore": "^0.32.0",
"bootstrap": "^5.0.0-beta1",
"core-js": "^3.0.0",
"node-sass": "^4.0.0",
"regenerator-runtime": "^0.13.2",
"sass-loader": "^9.0.1",
"stimulus": "^2.0.0",
"vue-loader": "^15",
"vue-template-compiler": "^2.6.12",
"webpack-notifier": "^1.6.0"
},
"license": "UNLICENSED",
@ -19,9 +14,5 @@
"dev": "encore dev",
"watch": "encore dev --watch",
"build": "encore production --progress"
},
"dependencies": {
"@popperjs/core": "^2.6.0",
"vue": "^2.6.12"
}
}

5
phpcs.xml Normal file
View file

@ -0,0 +1,5 @@
<?xml version="1.0"?>
<ruleset name="name-of-your-project">
<config name="installed_paths" value="vendor/slevomat/coding-standard"/>
<rule ref="vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/DeclareStrictTypesSniff.php" />
</ruleset>

View file

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace App\Controller;

View file

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace App\Controller;

View file

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace App\Controller;

View file

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace App\Controller;

View file

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace App\Controller;

View file

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace App\DTO;

View file

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace App\DTO;

View file

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace App\DataFixtures;

View file

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace App\DataFixtures;

View file

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace App\Entity;

View file

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace App\Entity;

View file

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace App\Entity;

View file

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace App\Entity;

View file

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace App\Factory;

View file

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace App\Factory;

View file

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace App\Form;

View file

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace App\Form\Extension;

View file

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace App\Form;

View file

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace App;

View file

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace App\Repository;

View file

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace App\Repository;

View file

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace App\Repository;

View file

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace App\Repository;

View file

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace App\Security;

View file

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace App\Service;

View file

@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
namespace App\Service;

View file

@ -14,6 +14,9 @@
"config/packages/test/dama_doctrine_test_bundle.yaml"
]
},
"dealerdirect/phpcodesniffer-composer-installer": {
"version": "v0.7.1"
},
"doctrine/annotations": {
"version": "1.0",
"recipe": {
@ -129,6 +132,9 @@
"nikic/php-parser": {
"version": "v4.10.4"
},
"phpstan/phpdoc-parser": {
"version": "0.4.9"
},
"psr/cache": {
"version": "1.0.1"
},
@ -153,6 +159,18 @@
"config/packages/sensio_framework_extra.yaml"
]
},
"slevomat/coding-standard": {
"version": "6.4.1"
},
"squizlabs/php_codesniffer": {
"version": "3.0",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "master",
"version": "3.0",
"ref": "0dc9cceda799fd3a08b96987e176a261028a3709"
}
},
"symfony/asset": {
"version": "v5.2.1"
},
@ -439,12 +457,12 @@
]
},
"symfony/webpack-encore-bundle": {
"version": "1.6",
"version": "1.9",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "1.6",
"ref": "f362ed8e8aa99a8cb216e6bdb2ac833dfb7643dd"
"version": "1.9",
"ref": "579d8de06df2ceb34d39e84e84c0c051b9b5ac68"
},
"files": [
"assets/app.js",

View file

@ -2,7 +2,6 @@
namespace App\Tests\Controller;
use Doctrine\ORM\EntityManagerInterface;
use App\Tests\WebTestCase;
class EntryControllerTest extends WebTestCase
@ -22,7 +21,6 @@ class EntryControllerTest extends WebTestCase
'entry[magazine]' => $magazine->getId()
]));
var_dump($magazine->getId());
self::assertResponseRedirects();
$crawler = $client->followRedirect();

1046
yarn.lock

File diff suppressed because it is too large Load diff