Skip to content

Commit 0255ac7

Browse files
authored
Improve (#5)
1 parent f09f9fc commit 0255ac7

File tree

8 files changed

+25
-26
lines changed

8 files changed

+25
-26
lines changed

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ 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
@@ -88,15 +89,21 @@ codestyle: create-reports-directory
8889
coverage: create-coverage-directory
8990
./vendor/bin/phpunit ${PHPUNIT_COLOR_OPTION} ${PHPUNIT_OUTPUT_STYLE_OPTION} ${PHPUNIT_COVERAGE_OPTION}
9091

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
9195

9296

9397
# Internal commands
9498
create-coverage-directory:
9599
mkdir -p ${COVERAGE_DIRECTORY}
96100

101+
create-behat-coverage-directory:
102+
mkdir -p ${BEHAT_COVERAGE_DIRECTORY}
103+
97104
create-reports-directory:
98105
mkdir -p ${REPORTS_DIRECTORY}
99106

100107

101-
.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
102109
.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

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"symfony/dependency-injection": "^3.0 || ^4.0"
3737
},
3838
"require-dev": {
39+
"ext-json": "*",
3940
"behat/behat": "~3.0",
4041
"squizlabs/php_codesniffer": "3.*",
4142
"phpunit/phpunit": "^6.0 || ^7.0",

features/demo_app/src/Method/MethodA.php

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

1010
class MethodA implements JsonRpcMethodInterface, MethodWithValidatedParamsInterface
1111
{
12-
/**
13-
* {@inheritdoc}
14-
*/
15-
public function validateParams(array $paramList) : array
16-
{
17-
return [];
18-
}
19-
2012
/**
2113
* {@inheritdoc}
2214
*/

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
@@ -10,14 +10,6 @@
1010

1111
class MethodC implements JsonRpcMethodInterface, MethodWithValidatedParamsInterface
1212
{
13-
/**
14-
* {@inheritdoc}
15-
*/
16-
public function validateParams(array $paramList) : array
17-
{
18-
return [];
19-
}
20-
2113
/**
2214
* {@inheritdoc}
2315
*/

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/Listener/MethodDocCreatedListener.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ public function __construct(ConstraintToParamsDocTransformer $paramDocConverter)
2323

2424
/**
2525
* @param MethodDocCreatedEvent $event
26+
*
27+
* @throws \ReflectionException
2628
*/
2729
public function enhanceMethodDoc(MethodDocCreatedEvent $event)
2830
{

0 commit comments

Comments
 (0)