Skip to content

Commit

Permalink
Fix: Revert unrelated changes
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Nov 8, 2021
1 parent bbec708 commit 70c8d8c
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 57 deletions.
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ $ make static-code-analysis-baseline

to regenerate the baselines in

- [`../phpstan-with-extension-baseline.neon`](../phpstan-with-extension-baseline.neon)
- [`../phpstan-without-extension-baseline.neon`](../phpstan-without-extension-baseline.neon)
- [`../phpstan-baseline-with-extension.neon`](../phpstan-baseline-with-extension.neon)
- [`../phpstan-baseline-without-extension.neon`](../phpstan-baseline-without-extension.neon)

:exclamation: Ideally, the baselines should shrink over time.

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ static-code-analysis: vendor ## Runs a static code analysis with phpstan/phpstan
.PHONY: static-code-analysis-baseline
static-code-analysis-baseline: vendor ## Generates a baseline for static code analysis with phpstan/phpstan and vimeo/psalm
mkdir -p .build/phpstan
vendor/bin/phpstan analyze --configuration=phpstan-with-extension.neon --generate-baseline=phpstan-with-extension-baseline.neon --memory-limit=-1
vendor/bin/phpstan analyze --configuration=phpstan-without-extension.neon --generate-baseline=phpstan-without-extension-baseline.neon --memory-limit=-1
vendor/bin/phpstan analyze --configuration=phpstan-with-extension.neon --generate-baseline=phpstan-baseline-with-extension.neon --memory-limit=-1
vendor/bin/phpstan analyze --configuration=phpstan-without-extension.neon --generate-baseline=phpstan-baseline-without-extension.neon --memory-limit=-1

.PHONY: tests
tests: vendor ## Runs tests with phpunit/phpunit
Expand Down
32 changes: 32 additions & 0 deletions phpstan-baseline-with-extension.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
parameters:
ignoreErrors:
-
message: "#^Method JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Test\\\\ObjectProphecy\\\\ProphesizeTest\\:\\:createProphecy\\(\\) has no return type specified\\.$#"
count: 1
path: test/StaticAnalysis/Test/ObjectProphecy/ProphesizeTest.php

-
message: "#^Property JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Test\\\\ObjectProphecy\\\\ProphesizeTest\\:\\:\\$prophecy has no type specified\\.$#"
count: 1
path: test/StaticAnalysis/Test/ObjectProphecy/ProphesizeTest.php

-
message: "#^Method JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Test\\\\ObjectProphecy\\\\WillExtendTest\\:\\:createProphecy\\(\\) has no return type specified\\.$#"
count: 1
path: test/StaticAnalysis/Test/ObjectProphecy/WillExtendTest.php

-
message: "#^Property JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Test\\\\ObjectProphecy\\\\WillExtendTest\\:\\:\\$prophecy has no type specified\\.$#"
count: 1
path: test/StaticAnalysis/Test/ObjectProphecy/WillExtendTest.php

-
message: "#^Method JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Test\\\\ObjectProphecy\\\\WillImplementTest\\:\\:createProphecy\\(\\) has no return type specified\\.$#"
count: 1
path: test/StaticAnalysis/Test/ObjectProphecy/WillImplementTest.php

-
message: "#^Property JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Test\\\\ObjectProphecy\\\\WillImplementTest\\:\\:\\$prophecy has no type specified\\.$#"
count: 1
path: test/StaticAnalysis/Test/ObjectProphecy/WillImplementTest.php

Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,23 @@ parameters:
count: 1
path: test/StaticAnalysis/Test/ObjectProphecy/ProphesizeTest.php

-
message: "#^Call to an undefined method Prophecy\\\\Prophecy\\\\ObjectProphecy\\<JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Src\\\\BaseModel\\>\\:\\:doubleTheNumber\\(\\)\\.$#"
count: 2
path: test/StaticAnalysis/Test/ObjectProphecy/ProphesizeTest.php

-
message: "#^Call to an undefined method Prophecy\\\\Prophecy\\\\ObjectProphecy\\<JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Src\\\\BaseModel\\>\\:\\:getFoo\\(\\)\\.$#"
count: 2
path: test/StaticAnalysis/Test/ObjectProphecy/ProphesizeTest.php

-
message: "#^Call to an undefined method object\\:\\:doubleTheNumber\\(\\)\\.$#"
count: 3
count: 1
path: test/StaticAnalysis/Test/ObjectProphecy/ProphesizeTest.php

-
message: "#^Call to an undefined method object\\:\\:getFoo\\(\\)\\.$#"
count: 3
count: 1
path: test/StaticAnalysis/Test/ObjectProphecy/ProphesizeTest.php

-
message: "#^PHPDoc tag @return contains generic type Prophecy\\\\Prophecy\\\\ObjectProphecy\\<JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Src\\\\BaseModel\\> but class Prophecy\\\\Prophecy\\\\ObjectProphecy is not generic\\.$#"
message: "#^Method JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Test\\\\ObjectProphecy\\\\ProphesizeTest\\:\\:createProphecy\\(\\) has no return type specified\\.$#"
count: 1
path: test/StaticAnalysis/Test/ObjectProphecy/ProphesizeTest.php

-
message: "#^PHPDoc tag @var for property JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Test\\\\ObjectProphecy\\\\ProphesizeTest\\:\\:\\$prophecy contains generic type Prophecy\\\\Prophecy\\\\ObjectProphecy\\<JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Src\\\\BaseModel\\> but class Prophecy\\\\Prophecy\\\\ObjectProphecy is not generic\\.$#"
message: "#^Property JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Test\\\\ObjectProphecy\\\\ProphesizeTest\\:\\:\\$prophecy has no type specified\\.$#"
count: 1
path: test/StaticAnalysis/Test/ObjectProphecy/ProphesizeTest.php

Expand All @@ -66,23 +56,18 @@ parameters:
path: test/StaticAnalysis/Test/ObjectProphecy/WillExtendTest.php

-
message: "#^Call to an undefined method Prophecy\\\\Prophecy\\\\ObjectProphecy\\<JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Src\\\\Baz\\>\\:\\:baz\\(\\)\\.$#"
count: 2
path: test/StaticAnalysis/Test/ObjectProphecy/WillExtendTest.php

-
message: "#^PHPDoc tag @return contains generic type Prophecy\\\\Prophecy\\\\ObjectProphecy\\<JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Src\\\\Baz\\> but class Prophecy\\\\Prophecy\\\\ObjectProphecy is not generic\\.$#"
message: "#^Method JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Test\\\\ObjectProphecy\\\\WillExtendTest\\:\\:createProphecy\\(\\) has no return type specified\\.$#"
count: 1
path: test/StaticAnalysis/Test/ObjectProphecy/WillExtendTest.php

-
message: "#^PHPDoc tag @var for property JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Test\\\\ObjectProphecy\\\\WillExtendTest\\:\\:\\$prophecy contains generic type Prophecy\\\\Prophecy\\\\ObjectProphecy\\<JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Src\\\\Baz\\> but class Prophecy\\\\Prophecy\\\\ObjectProphecy is not generic\\.$#"
message: "#^Parameter \\#1 \\$baz of method JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Src\\\\BaseModel\\:\\:baz\\(\\) expects JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Src\\\\Baz, object given\\.$#"
count: 1
path: test/StaticAnalysis/Test/ObjectProphecy/WillExtendTest.php

-
message: "#^Parameter \\#1 \\$baz of method JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Src\\\\BaseModel\\:\\:baz\\(\\) expects JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Src\\\\Baz, object given\\.$#"
count: 3
message: "#^Property JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Test\\\\ObjectProphecy\\\\WillExtendTest\\:\\:\\$prophecy has no type specified\\.$#"
count: 1
path: test/StaticAnalysis/Test/ObjectProphecy/WillExtendTest.php

-
Expand All @@ -91,23 +76,18 @@ parameters:
path: test/StaticAnalysis/Test/ObjectProphecy/WillImplementTest.php

-
message: "#^Call to an undefined method Prophecy\\\\Prophecy\\\\ObjectProphecy\\<JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Src\\\\Bar&JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Src\\\\Foo\\>\\:\\:bar\\(\\)\\.$#"
count: 2
path: test/StaticAnalysis/Test/ObjectProphecy/WillImplementTest.php

-
message: "#^PHPDoc tag @return contains generic type Prophecy\\\\Prophecy\\\\ObjectProphecy\\<JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Src\\\\Bar&JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Src\\\\Foo\\> but class Prophecy\\\\Prophecy\\\\ObjectProphecy is not generic\\.$#"
message: "#^Method JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Test\\\\ObjectProphecy\\\\WillImplementTest\\:\\:createProphecy\\(\\) has no return type specified\\.$#"
count: 1
path: test/StaticAnalysis/Test/ObjectProphecy/WillImplementTest.php

-
message: "#^PHPDoc tag @var for property JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Test\\\\ObjectProphecy\\\\WillImplementTest\\:\\:\\$prophecy contains generic type Prophecy\\\\Prophecy\\\\ObjectProphecy\\<JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Src\\\\Bar&JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Src\\\\Foo\\> but class Prophecy\\\\Prophecy\\\\ObjectProphecy is not generic\\.$#"
message: "#^Parameter \\#1 \\$bar of method JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Src\\\\BaseModel\\:\\:bar\\(\\) expects JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Src\\\\Bar, object given\\.$#"
count: 1
path: test/StaticAnalysis/Test/ObjectProphecy/WillImplementTest.php

-
message: "#^Parameter \\#1 \\$bar of method JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Src\\\\BaseModel\\:\\:bar\\(\\) expects JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Src\\\\Bar, object given\\.$#"
count: 3
message: "#^Property JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Test\\\\ObjectProphecy\\\\WillImplementTest\\:\\:\\$prophecy has no type specified\\.$#"
count: 1
path: test/StaticAnalysis/Test/ObjectProphecy/WillImplementTest.php

-
Expand Down
32 changes: 31 additions & 1 deletion phpstan-with-extension-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,2 +1,32 @@
parameters:
ignoreErrors: []
ignoreErrors:
-
message: "#^Method JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Test\\\\ObjectProphecy\\\\ProphesizeTest\\:\\:createProphecy\\(\\) has no return type specified\\.$#"
count: 1
path: test/StaticAnalysis/Test/ObjectProphecy/ProphesizeTest.php

-
message: "#^Property JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Test\\\\ObjectProphecy\\\\ProphesizeTest\\:\\:\\$prophecy has no type specified\\.$#"
count: 1
path: test/StaticAnalysis/Test/ObjectProphecy/ProphesizeTest.php

-
message: "#^Method JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Test\\\\ObjectProphecy\\\\WillExtendTest\\:\\:createProphecy\\(\\) has no return type specified\\.$#"
count: 1
path: test/StaticAnalysis/Test/ObjectProphecy/WillExtendTest.php

-
message: "#^Property JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Test\\\\ObjectProphecy\\\\WillExtendTest\\:\\:\\$prophecy has no type specified\\.$#"
count: 1
path: test/StaticAnalysis/Test/ObjectProphecy/WillExtendTest.php

-
message: "#^Method JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Test\\\\ObjectProphecy\\\\WillImplementTest\\:\\:createProphecy\\(\\) has no return type specified\\.$#"
count: 1
path: test/StaticAnalysis/Test/ObjectProphecy/WillImplementTest.php

-
message: "#^Property JanGregor\\\\Prophecy\\\\Test\\\\StaticAnalysis\\\\Test\\\\ObjectProphecy\\\\WillImplementTest\\:\\:\\$prophecy has no type specified\\.$#"
count: 1
path: test/StaticAnalysis/Test/ObjectProphecy/WillImplementTest.php

2 changes: 1 addition & 1 deletion phpstan-with-extension.neon
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
includes:
- extension.neon
- phpstan-with-extension-baseline.neon
- phpstan-baseline-with-extension.neon

parameters:
inferPrivatePropertyTypeFromConstructor: true
Expand Down
2 changes: 1 addition & 1 deletion phpstan-without-extension.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
includes:
- phpstan-without-extension-baseline.neon
- phpstan-baseline-without-extension.neon

parameters:
inferPrivatePropertyTypeFromConstructor: true
Expand Down
6 changes: 0 additions & 6 deletions test/StaticAnalysis/Test/ObjectProphecy/ProphesizeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
*/
final class ProphesizeTest extends Framework\TestCase
{
/**
* @var \Prophecy\Prophecy\ObjectProphecy<Src\BaseModel>
*/
private $prophecy;

protected function setUp(): void
Expand Down Expand Up @@ -86,9 +83,6 @@ public function testCreateProphecyInHelperMethod(): void
self::assertEquals(5, $testDouble->doubleTheNumber(2));
}

/**
* @return \Prophecy\Prophecy\ObjectProphecy<Src\BaseModel>
*/
private function createProphecy()
{
return $this->prophesize(Src\BaseModel::class);
Expand Down
6 changes: 0 additions & 6 deletions test/StaticAnalysis/Test/ObjectProphecy/WillExtendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
*/
final class WillExtendTest extends Framework\TestCase
{
/**
* @var \Prophecy\Prophecy\ObjectProphecy<Src\Baz>
*/
private $prophecy;

protected function setUp(): void
Expand Down Expand Up @@ -73,9 +70,6 @@ public function testCreateProphecyInHelperMethod(): void
self::assertSame('Hmm', $subject->baz($prophecy->reveal()));
}

/**
* @return \Prophecy\Prophecy\ObjectProphecy<Src\Baz>
*/
private function createProphecy()
{
return $this->prophesize()->willExtend(Src\Baz::class);
Expand Down
6 changes: 0 additions & 6 deletions test/StaticAnalysis/Test/ObjectProphecy/WillImplementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
*/
final class WillImplementTest extends Framework\TestCase
{
/**
* @var \Prophecy\Prophecy\ObjectProphecy<Src\Foo&Src\Bar>
*/
private $prophecy;

protected function setUp(): void
Expand Down Expand Up @@ -73,9 +70,6 @@ public function testCreateProphecyInHelperMethod(): void
self::assertSame('Oh', $subject->bar($prophecy->reveal()));
}

/**
* @return \Prophecy\Prophecy\ObjectProphecy<Src\Foo&Src\Bar>
*/
private function createProphecy()
{
return $this->prophesize(Src\Foo::class)->willImplement(Src\Bar::class);
Expand Down

0 comments on commit 70c8d8c

Please sign in to comment.