An open API service indexing awesome lists of open source software.

https://github.com/backdevs/php-coding-standard

Backdevs' PHP Coding Standard
https://github.com/backdevs/php-coding-standard

coding-standard php php8

Last synced: about 1 month ago
JSON representation

Backdevs' PHP Coding Standard

Awesome Lists containing this project

README

          

# Backdevs' PHP Coding Standard

A [PHP_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) coding standard and other static analysis tools configuration files for Backdevs' PHP projects.

## Included default configurations
- [PHP_CodeSniffer](./phpcs/phpcs.xml)
- [PHP Mess Detector](./phpmd/phpmd.xml)

## Installation

Composer:
```shell
composer require --dev backdevs/coding-standard
```

## Usage

### PHP_CodeSniffer:

In your project's `phpcs.xml` file add the following line:
```xml

```

If you don't have a `phpcs.xml` file, here's an example for a Laravel project:
```xml

Backdevs Coding Standard.


app
bootstrap
config
database
routes
tests

cache/*

```

Now you should be able to run:
```shell
vendor/bin/phpcs
```

### PHP Mess Detector:
If you don't have the `phpmd/phpmd` package installed, you can install it by running:
```shell
composer require --dev phpmd/phpmd
```

Then, in your project's `phpmd.xml` file add the following line:
```xml

```

If you don't have a `phpmd.xml` file, here's a simple example:
```xml

Backdevs Coding Standard.

```

Now you can run:
```shell
vendor/bin/phpmd app,bootstrap,config,database,routes,tests text phpmd.xml
```