Skip to content

Commit a4428b0

Browse files
Merge pull request #212 from MarcinOrlowski/dev
Improved Github Actions
2 parents d50fef1 + 2c346c8 commit a4428b0

File tree

12 files changed

+46
-49
lines changed

12 files changed

+46
-49
lines changed

.github/workflows/coding-standards.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ on:
1717
push:
1818
branches:
1919
- "master"
20-
pull_request:
21-
branches:
22-
- "master"
2320
- "dev"
2421

2522
jobs:
@@ -50,10 +47,6 @@ jobs:
5047
php_version: "${{ matrix.php }}"
5148
dev: yes
5249

53-
- name: "Checking coding standards for 'src/'..."
54-
shell: bash
55-
run: vendor/bin/phpcs -s --basepath="$(pwd)" --standard="vendor/marcin-orlowski/coding-standard/coding-standard/MarcinOrlowski/" "src/"
56-
57-
- name: "Checking coding standards for 'tests/'..."
50+
- name: "Checking Coding Standards..."
5851
shell: bash
59-
run: vendor/bin/phpcs -s --basepath="$(pwd)" --standard="vendor/marcin-orlowski/coding-standard/coding-standard/MarcinOrlowski/" "tests/"
52+
run: vendor/bin/phpcs

.scrutinizer.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ Development branch:
5656
* [Easy to use](docs/examples.md#usage-examples),
5757
* [Stable and production ready](https://travis-ci.org/MarcinOrlowski/laravel-api-response-builder),
5858
* [On-the-fly data object conversion](docs/conversion.md),
59-
* API chaining support,
59+
* [API chaining support](docs/docs.md#code-ranges),
6060
* [Localization support](docs/docs.md#messages-and-localization),
6161
* Provides traits to help [unit test your API code](docs/testing.md),
6262
* Comes with [exception handler helper](docs/exceptions.md) to ensure your API stays consumable even in case of unexpected,
63-
* No additional dependencies.
63+
* [No additional dependencies](src/composer.json).
6464

6565

6666
## License ##

config/response_builder.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
* @copyright 2016-2021 Marcin Orlowski
1111
* @license http://www.opensource.org/licenses/mit-license.php MIT
1212
* @link https://github.com/MarcinOrlowski/laravel-api-response-builder
13+
*
14+
* @noinspection PhpCSValidationInspection
15+
* phpcs:disable Squiz.PHP.CommentedOutCode.Found
1316
*/
1417

1518
return [

phpcs.xml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
* Laravel API Response Builder - PHP Code Sniffer config file
4+
*
5+
* @author Marcin Orlowski <mail (#) marcinOrlowski (.) com>
6+
* @copyright 2016-2021 Marcin Orlowski
7+
* @license http://www.opensource.org/licenses/mit-license.php MIT
8+
* @link https://github.com/MarcinOrlowski/laravel-api-response-builder
9+
*
10+
-->
11+
<ruleset name="Custom Standard" namespace="MyProject\CS\Standard">
12+
13+
<!-- what to sniff -->
14+
<file>src/</file>
15+
<file>tests/</file>
16+
<file>config/</file>
17+
18+
<!-- let's make shown paths relative -->
19+
<arg name="basepath" value="."/>
20+
21+
<arg name="report" value="full"/>
22+
23+
<!-- Include full Sniff name in report (like -s) -->
24+
<arg value="s"/>
25+
26+
<autoload>vendor/autoload.php</autoload>
27+
28+
<!-- import rules from MarcinOrlowski/coding-standard package -->
29+
<rule ref="vendor/marcin-orlowski/coding-standard/coding-standard/MarcinOrlowski/"/>
30+
31+
</ruleset>

src/Converters/ArrayableConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ final class ArrayableConverter implements ConverterContract
3434
*
3535
* phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInImplementedInterfaceAfterLastUsed
3636
*/
37-
public function convert(object $obj, /** @scrutinizer ignore-unused */ array $config): array
37+
public function convert(object $obj, array $config): array
3838
{
3939
Validator::assertInstanceOf('obj', $obj, Arrayable::class);
4040

src/Converters/JsonSerializableConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ final class JsonSerializableConverter implements ConverterContract
3434
*
3535
* @return array
3636
*/
37-
public function convert(object $obj, /** @scrutinizer ignore-unused */ array $config): array
37+
public function convert(object $obj, array $config): array
3838
{
3939
Validator::assertInstanceOf('obj', $obj, \JsonSerializable::class);
4040

src/Converters/ToArrayConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ final class ToArrayConverter implements ConverterContract
3636
*
3737
* phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInImplementedInterfaceAfterLastUsed
3838
*/
39-
public function convert(object $obj, /** @scrutinizer ignore-unused */ array $config): array
39+
public function convert(object $obj, array $config): array
4040
{
4141
Validator::assertIsObject('obj', $obj);
4242

src/ExceptionHandlerHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class ExceptionHandlerHelper
5252
* @noinspection PhpUnusedParameterInspection
5353
* phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundBeforeLastUsed
5454
*/
55-
public static function render(/** @scrutinizer ignore-unused */ $request, \Throwable $ex): HttpResponse
55+
public static function render($request, \Throwable $ex): HttpResponse
5656
{
5757
$result = null;
5858

@@ -197,7 +197,7 @@ protected static function getErrorMessageForException(\Throwable $ex, int $http_
197197
* @noinspection PhpMissingParamTypeInspection
198198
* phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundBeforeLastUsed
199199
*/
200-
protected function unauthenticated(/** @scrutinizer ignore-unused */ $request,
200+
protected function unauthenticated($request,
201201
AuthException $exception): HttpResponse
202202
{
203203
$cfg = self::getExceptionHandlerConfig();

src/ExceptionHandlers/DefaultExceptionHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ final class DefaultExceptionHandler implements ExceptionHandlerContract
3535
*
3636
* phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInImplementedInterfaceAfterLastUsed
3737
*/
38-
public function handle(array $user_config, /** @scrutinizer ignore-unused */ \Throwable $ex): ?array
38+
public function handle(array $user_config, \Throwable $ex): ?array
3939
{
4040
/** @noinspection PhpUnhandledExceptionInspection */
4141
$defaults = [

0 commit comments

Comments
 (0)