|
1 | | -# 🏂 Laravel Package Template |
| 1 | +# LiveIntent code style rules for php-cs-fixer |
2 | 2 |
|
3 | | -> Use this template to quickly scafflod a new Laravel package |
| 3 | +[](https://packagist.org/packages/liveintent/php-cs-fixer) |
| 4 | +[](https://github.com/liveintent/php-cs-fixer/actions?query=workflow%3Arun-tests+branch%3Amain) |
| 5 | +[](https://github.com/liveintent/php-cs-fixer/actions?query=workflow%3Arun-lint+branch%3Amain) |
| 6 | +[](https://packagist.org/packages/liveintent/php-cs-fixer) |
4 | 7 |
|
5 | | -## Getting Started |
| 8 | +This is where your description should go. |
6 | 9 |
|
7 | | -Click the `Use this template` button at the top right of this page to create your new package. Once you've filled out the information and cloned your new project locally, run: |
| 10 | +## Installation |
8 | 11 |
|
| 12 | +You can install the package via composer: |
| 13 | + |
| 14 | +```bash |
| 15 | +composer require liveintent/php-cs-fixer |
| 16 | +``` |
| 17 | + |
| 18 | +## Usage |
| 19 | + |
| 20 | +```php |
| 21 | +$package = new LiveIntent\PhpCsFixer(); |
| 22 | +echo $package->echoPhrase('Hello, LiveIntent!'); |
| 23 | +``` |
| 24 | + |
| 25 | +## Development |
| 26 | + |
| 27 | +Clone this repository and install dependencies via: |
| 28 | +```sh |
| 29 | +composer install |
| 30 | +``` |
| 31 | + |
| 32 | +When developing a laravel package, it's often useful to be able to develop your package alongside a laravel app without. |
| 33 | + |
| 34 | +With composer you can symlink the package you are developing into the dependencies of your laravel package by updating your app's `composer.json` file. |
| 35 | + |
| 36 | +```json |
| 37 | +{ |
| 38 | + "repositories": [ |
| 39 | + { |
| 40 | + "type": "path", |
| 41 | + "url": "../../packages/my-package" |
| 42 | + } |
| 43 | + ], |
| 44 | + "require": { |
| 45 | + "my/package": "*" |
| 46 | + } |
| 47 | +} |
9 | 48 | ``` |
10 | | -php configure.php |
| 49 | + |
| 50 | +## Testing |
| 51 | + |
| 52 | +You can run the tests via: |
| 53 | + |
| 54 | +```sh |
| 55 | +composer test |
| 56 | + |
| 57 | +# or directly via |
| 58 | +vendor/bin/phpunit |
11 | 59 | ``` |
12 | 60 |
|
13 | | -from within your project and answer the questions at the prompts to finalize your project setup. |
| 61 | +Additionally, you may run the tests in 'watch' mode via: |
| 62 | + |
| 63 | +```sh |
| 64 | +composer test-watch |
| 65 | +``` |
| 66 | + |
| 67 | +## Linting |
| 68 | + |
| 69 | +The installed linter will auto-format your code to comply with our agreed [php coding standard](https://github.com/LiveIntent/php-cs-rules/blob/master/rules.php). |
| 70 | + |
| 71 | +You can run it via: |
| 72 | + |
| 73 | +```sh |
| 74 | +composer lint |
| 75 | +``` |
0 commit comments