Skip to content

Commit

Permalink
Merge pull request #49 from roberto-butti/feature/composer-run
Browse files Browse the repository at this point in the history
composer run for launching code quality
  • Loading branch information
joaokamun authored Apr 19, 2022
2 parents 7beb863 + 3ead63c commit a0e456c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.git
.phpunit.result.cache
.phpunit.result.cache
.php-cs-fixer.cache
8 changes: 7 additions & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<?php

$finder = PhpCsFixer\Finder::create();
$finder = PhpCsFixer\Finder::create()
->in([
__DIR__ . '/src',
])
->name('*.php')
->ignoreDotFiles(true)
->ignoreVCS(true);

$config = new PhpCsFixer\Config();
$config->setRiskyAllowed(true);
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,21 @@ When using the CDN API V1, you can't resolve relationships of resolved entries a
When using the CDN API V2 you can resolve also nested relationships in the resolved entries (just 2 levels deep), but the resolved entries are not injected in the fields, they are inserted in an array called `rels` which is in the root object. The resolved links will be placed in an array called `links`.
In case you are using the API V2, to keep a consistent behaviour with the API V1, this client will inject the resolved entries and links inside the fields for you.

## Code Quality

The package includes tools for tests and code formatting:
- [PestPHP](https://pestphp.com/)
- [PHP CS Fixer](https://cs.symfony.com/)
To execute the code quality suite you can use:
```shell
composer run all-check
```
that executes:
- vendor/bin/php-cs-fixer fix
- vendor/bin/pest



## 🔗 Related Links

* **[Storyblok & PHP on GitHub](https://github.com/search?q=org%3Astoryblok+topic%3Aphp)**: Check all of our PHP open source repos;
Expand Down
9 changes: 9 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,14 @@
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"scripts": {
"test": "vendor/bin/pest",
"test-coverage": "vendor/bin/pest --coverage",
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes",
"all-check": [
"@format",
"@test"
]
}
}

0 comments on commit a0e456c

Please sign in to comment.