signifly/php-config

Signifly PHP Config

v1.0.0 2021-05-22 07:41 UTC

This package is auto-updated.

Last update: 2024-04-07 18:36:44 UTC


README

This repository contains the default configuration files for various services.

Code formatting

We use php-cs-fixer to format our code in order to standardize the styling across projects. There should be a plugin that formats the file on save to the most popular editors, such as: VS Code, Sublime Text, PHP Storm

Optionally, add the following to the scripts section in the project's composer.json file:

"format": [
    "vendor/bin/php-cs-fixer fix"
],

This allows you to run composer format from your terminal to format the entire code base.

Usage

Install the package by pulling it in from Composer:

composer require signifly/php-config --dev

Then update the .php-cs-fixer.php file:

$finder = (new PhpCsFixer\Finder)
    ->notPath('bootstrap')
    ->notPath('storage')
    ->notPath('vendor')
    ->notPath('docker')
    ->in(getcwd())
    ->name('*.php')
    ->notName('*.blade.php')
    ->notName('index.php')
    ->notName('server.php')
    ->ignoreDotFiles(true)
    ->ignoreVCS(true);

return Signifly\styles($finder);

Remember to update the Finder according to the project setup.