Skip to content

Commit 102cc0c

Browse files
authored
Improve (#8)
1 parent 7cc5598 commit 102cc0c

File tree

13 files changed

+34
-43
lines changed

13 files changed

+34
-43
lines changed

Makefile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ COVERAGE_OUTPUT_STYLE ?= html
66
BUILD_DIRECTORY ?= build
77
REPORTS_DIRECTORY ?= ${BUILD_DIRECTORY}/reports
88
COVERAGE_DIRECTORY ?= ${BUILD_DIRECTORY}/coverage
9+
BEHAT_COVERAGE_DIRECTORY ?= ${BUILD_DIRECTORY}/behat-coverage
910
COVERAGE_CLOVER_FILE_PATH ?= ${COVERAGE_DIRECTORY}/clover.xml
1011

1112
## Commands options
1213
### Composer
1314
#COMPOSER_OPTIONS=
1415
### Phpcs
1516
PHPCS_REPORT_STYLE ?= full
17+
PHPCS_DISABLE_WARNING ?= "false"
1618
#PHPCS_REPORT_FILE=
1719
#PHPCS_REPORT_FILE_OPTION=
1820

@@ -51,6 +53,12 @@ ifneq ("${PHPCS_REPORT_FILE}","")
5153
PHPCS_REPORT_FILE_OPTION ?= --report-file=${PHPCS_REPORT_FILE}
5254
endif
5355

56+
ifneq ("${PHPCS_DISABLE_WARNING}","true")
57+
PHPCS_DISABLE_WARNING_OPTION=
58+
else
59+
PHPCS_DISABLE_WARNING_OPTION=-n
60+
endif
61+
5462

5563
## Project build (install and configure)
5664
build: install configure
@@ -76,20 +84,26 @@ test-functional:
7684
./vendor/bin/behat ${BEHAT_COLOR_OPTION} ${BEHAT_OUTPUT_STYLE_OPTION} --no-snippets
7785

7886
codestyle: create-reports-directory
79-
./vendor/bin/phpcs --standard=phpcs.xml.dist ${PHPCS_COLOR_OPTION} ${PHPCS_REPORT_FILE_OPTION} --report=${PHPCS_REPORT_STYLE}
87+
./vendor/bin/phpcs ${PHPCS_DISABLE_WARNING_OPTION} --standard=phpcs.xml.dist ${PHPCS_COLOR_OPTION} ${PHPCS_REPORT_FILE_OPTION} --report=${PHPCS_REPORT_STYLE}
8088

8189
coverage: create-coverage-directory
8290
./vendor/bin/phpunit ${PHPUNIT_COLOR_OPTION} ${PHPUNIT_OUTPUT_STYLE_OPTION} ${PHPUNIT_COVERAGE_OPTION}
8391

92+
behat-coverage: create-behat-coverage-directory
93+
composer required leanphp/behat-code-coverage
94+
./vendor/bin/behat ${BEHAT_COLOR_OPTION} ${BEHAT_OUTPUT_STYLE_OPTION} --no-snippets --profile coverage
8495

8596

8697
# Internal commands
8798
create-coverage-directory:
8899
mkdir -p ${COVERAGE_DIRECTORY}
89100

101+
create-behat-coverage-directory:
102+
mkdir -p ${BEHAT_COVERAGE_DIRECTORY}
103+
90104
create-reports-directory:
91105
mkdir -p ${REPORTS_DIRECTORY}
92106

93107

94-
.PHONY: build install configure test test-technical test-functional codestyle coverage create-coverage-directory create-reports-directory
108+
.PHONY: build install configure test test-technical test-functional codestyle coverage behat-coverage create-coverage-directory create-behat-coverage-directory create-reports-directory
95109
.DEFAULT: build

behat.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,17 @@ default:
33
default:
44
contexts:
55
- Tests\Functional\BehatContext\DemoAppContext: ~
6+
coverage:
7+
extensions:
8+
LeanPHP\Behat\CodeCoverage\Extension:
9+
drivers:
10+
- local
11+
filter:
12+
whitelist:
13+
include:
14+
directories:
15+
'src': ~
16+
report:
17+
format: html
18+
options:
19+
target: build/behat-coverage

features/bootstrap/DemoAppContext.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22
namespace Tests\Functional\BehatContext;
33

4-
use Behat\Behat\Context\Context;
54
use Behat\Gherkin\Node\PyStringNode;
65
use DemoApp\AbstractKernel;
76
use DemoApp\DefaultKernel;

features/demo_app/src/Listener/ServerDocCreatedListener.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?php
22
namespace DemoApp\Listener;
33

4-
use DemoApp\Method\MethodB;
5-
use Yoanm\JsonRpcServerDoc\Domain\Model\Type\ArrayDoc;
64
use Yoanm\SymfonyJsonRpcHttpServerDoc\Event\ServerDocCreatedEvent;
75

86
/**

features/demo_app/src/Method/MethodA.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@
55

66
class MethodA implements JsonRpcMethodInterface
77
{
8-
/**
9-
* {@inheritdoc}
10-
*/
11-
public function validateParams(array $paramList) : array
12-
{
13-
return [];
14-
}
15-
168
/**
179
* {@inheritdoc}
1810
*/

features/demo_app/src/Method/MethodB.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@
55

66
class MethodB implements JsonRpcMethodInterface
77
{
8-
/**
9-
* {@inheritdoc}
10-
*/
11-
public function validateParams(array $paramList) : array
12-
{
13-
return [];
14-
}
15-
168
/**
179
* {@inheritdoc}
1810
*/

features/demo_app/src/Method/MethodC.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@
55

66
class MethodC implements JsonRpcMethodInterface
77
{
8-
/**
9-
* {@inheritdoc}
10-
*/
11-
public function validateParams(array $paramList) : array
12-
{
13-
return [];
14-
}
15-
168
/**
179
* {@inheritdoc}
1810
*/

features/demo_app/src/Method/MethodD.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@
55

66
class MethodD implements JsonRpcMethodInterface
77
{
8-
/**
9-
* {@inheritdoc}
10-
*/
11-
public function validateParams(array $paramList) : array
12-
{
13-
return [];
14-
}
15-
168
/**
179
* {@inheritdoc}
1810
*/

phpunit.xml.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
processIsolation="false"
99

1010
stopOnRisky="true"
11-
1211
stopOnError="true"
1312
stopOnFailure="true"
1413

src/Endpoint/DocumentationEndpoint.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ public function httpOptions() : Response
4949
* @param Request $request
5050
*
5151
* @return Response
52+
*
53+
* @throws \Exception
5254
*/
5355
public function httpGet(Request $request) : Response
5456
{

0 commit comments

Comments
 (0)