krusemedien / codestyle
Set of codestyle definitions.
1.0.1
2019-02-13 15:13 UTC
Requires
This package is auto-updated.
Last update: 2019-02-26 07:52:53 UTC
README
Set of code style definitions.
Installation
To install this package enter the following lines in the base directory of your composer project:
composer require krusemedien/codestyle --dev
Usage
To run a code style test run (where src/ is the target directory to check):
php vendor/bin/phpcs --standard=KrmeShopware src/
By default the test will check PHP 7.1 and up. You can define the php version using:
php vendor/bin/phpcs --runtime-set testVersion 7.2 --standard=KrmeShopware src/
Alternative usage
If your project is more complex you can define advanced settings in a `phpcs.xml? configuration file in the root directory of your project. Ex:
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="Coding standard" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<description>Project coding standard</description>
<file>src</file>
<file>bootstrap</file>
<exclude-pattern>*/cache/*</exclude-pattern>
<arg value="s" />
<arg name="parallel" value="50" />
<config name="testVersion" value="7.1-" />
<rule ref="KrmeShopware">
<exclude name="Squiz.Commenting.BlockComment.LineIndent"/>
</rule>
</ruleset>
License
This project is open-source software licensed under the MIT License.