From 0709ebb93c2975f72826828b5a1dac0d899a3e99 Mon Sep 17 00:00:00 2001 From: mamazu <14860264+mamazu@users.noreply.github.com> Date: Fri, 10 Apr 2020 15:50:07 +0200 Subject: [PATCH] Fixing composer json --- composer.json | 8 +++++++- .../Validator/ValidatorAggregatorSpec.php | 4 ++-- src/Error/Error.php | 2 +- tests/test.md | 1 - 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 7130657..7c9f252 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "php": "^7.2", "ext-dom": "*", "ext-libxml": "*", - "ext-json": "*" + "ext-json": "*", "thecodingmachine/safe": "^0.1.16", "nikic/php-parser": "^4.2", @@ -37,5 +37,11 @@ "spec\\": "spec/" } }, + "scripts": { + "analyse": [ + "vendor/bin/phpspec run", + "vendor/bin/phpstan analyse" + ] + }, "bin": [ "bin/doc-parser" ] } diff --git a/spec/Mamazu/DocumentationParser/Validator/ValidatorAggregatorSpec.php b/spec/Mamazu/DocumentationParser/Validator/ValidatorAggregatorSpec.php index 8bccbd5..ee83b8b 100644 --- a/spec/Mamazu/DocumentationParser/Validator/ValidatorAggregatorSpec.php +++ b/spec/Mamazu/DocumentationParser/Validator/ValidatorAggregatorSpec.php @@ -30,12 +30,12 @@ public function it_delegates_the_validation( ValidatorInterface $validator1, ValidatorInterface $validator2, Block $block - ) { + ): void { $block->getType()->willReturn('php'); $this->beConstructedWith(['php' => $validator1, 'python' => $validator2]); - $validator1->validate($block)->willReturn([new Error('hello.md', 0, 'Error',)]); + $validator1->validate($block)->willReturn([new Error('hello.md', 0, 'Error')]); $validator2->validate(Argument::any())->shouldNotBeCalled(); $this->validate($block)->shouldHaveCount(1); diff --git a/src/Error/Error.php b/src/Error/Error.php index a54854f..c9d1ad3 100644 --- a/src/Error/Error.php +++ b/src/Error/Error.php @@ -52,7 +52,7 @@ public function getType(): ?string return $this->type; } - public function jsonSerialize() + public function jsonSerialize(): array { return [ 'fileName' => $this->getFileName(), diff --git a/tests/test.md b/tests/test.md index 9db7084..73d8dea 100644 --- a/tests/test.md +++ b/tests/test.md @@ -29,7 +29,6 @@ $b = new Block('/tmp','test',1,'txt'); And a little piece of valid yaml: ```yaml hello: -ll i_am_groot: true colors: ['red', 'green', 'blue'] ``` \ No newline at end of file