Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Fix internal phpstan error" #327

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions phpstan-without-extension-baseline.neon
Expand Up @@ -22,22 +22,22 @@ parameters:

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

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

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

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

-
Expand Down
4 changes: 4 additions & 0 deletions src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php
Expand Up @@ -65,6 +65,10 @@

$className = $argumentType->getValue();

if (!$returnType instanceof Type\TypeWithClassName) {
throw new ShouldNotHappenException();

Check failure on line 69 in src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (7.4, 6.0.0, lowest)

Instantiated class JanGregor\Prophecy\Type\Prophet\ShouldNotHappenException not found.

Check failure on line 69 in src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (7.4, 6.0.0, lowest)

Throwing object of an unknown class JanGregor\Prophecy\Type\Prophet\ShouldNotHappenException.

Check failure on line 69 in src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (7.4, 6.0.0, locked)

Instantiated class JanGregor\Prophecy\Type\Prophet\ShouldNotHappenException not found.

Check failure on line 69 in src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (7.4, 6.0.0, locked)

Throwing object of an unknown class JanGregor\Prophecy\Type\Prophet\ShouldNotHappenException.

Check failure on line 69 in src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (7.4, 6.0.0, highest)

Instantiated class JanGregor\Prophecy\Type\Prophet\ShouldNotHappenException not found.

Check failure on line 69 in src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (7.4, 6.0.0, highest)

Throwing object of an unknown class JanGregor\Prophecy\Type\Prophet\ShouldNotHappenException.

Check failure on line 69 in src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (7.4, 7.0.0, lowest)

Instantiated class JanGregor\Prophecy\Type\Prophet\ShouldNotHappenException not found.

Check failure on line 69 in src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (7.4, 7.0.0, lowest)

Throwing object of an unknown class JanGregor\Prophecy\Type\Prophet\ShouldNotHappenException.

Check failure on line 69 in src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (7.4, 7.0.0, locked)

Instantiated class JanGregor\Prophecy\Type\Prophet\ShouldNotHappenException not found.

Check failure on line 69 in src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (7.4, 7.0.0, locked)

Throwing object of an unknown class JanGregor\Prophecy\Type\Prophet\ShouldNotHappenException.

Check failure on line 69 in src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (7.4, 7.0.0, highest)

Instantiated class JanGregor\Prophecy\Type\Prophet\ShouldNotHappenException not found.

Check failure on line 69 in src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (7.4, 7.0.0, highest)

Throwing object of an unknown class JanGregor\Prophecy\Type\Prophet\ShouldNotHappenException.

Check failure on line 69 in src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (7.4, 8.0.0, lowest)

Instantiated class JanGregor\Prophecy\Type\Prophet\ShouldNotHappenException not found.

Check failure on line 69 in src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (7.4, 8.0.0, lowest)

Throwing object of an unknown class JanGregor\Prophecy\Type\Prophet\ShouldNotHappenException.

Check failure on line 69 in src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (7.4, 8.0.0, locked)

Instantiated class JanGregor\Prophecy\Type\Prophet\ShouldNotHappenException not found.

Check failure on line 69 in src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (7.4, 8.0.0, locked)

Throwing object of an unknown class JanGregor\Prophecy\Type\Prophet\ShouldNotHappenException.

Check failure on line 69 in src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (7.4, 8.0.0, highest)

Instantiated class JanGregor\Prophecy\Type\Prophet\ShouldNotHappenException not found.

Check failure on line 69 in src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (7.4, 8.0.0, highest)

Throwing object of an unknown class JanGregor\Prophecy\Type\Prophet\ShouldNotHappenException.

Check failure on line 69 in src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (7.4, 9.0.0, lowest)

Instantiated class JanGregor\Prophecy\Type\Prophet\ShouldNotHappenException not found.

Check failure on line 69 in src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (7.4, 9.0.0, lowest)

Throwing object of an unknown class JanGregor\Prophecy\Type\Prophet\ShouldNotHappenException.

Check failure on line 69 in src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (7.4, 9.0.0, locked)

Instantiated class JanGregor\Prophecy\Type\Prophet\ShouldNotHappenException not found.

Check failure on line 69 in src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (7.4, 9.0.0, locked)

Throwing object of an unknown class JanGregor\Prophecy\Type\Prophet\ShouldNotHappenException.

Check failure on line 69 in src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (7.4, 9.0.0, highest)

Instantiated class JanGregor\Prophecy\Type\Prophet\ShouldNotHappenException not found.

Check failure on line 69 in src/Type/Prophet/ProphesizeDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (7.4, 9.0.0, highest)

Throwing object of an unknown class JanGregor\Prophecy\Type\Prophet\ShouldNotHappenException.
}

if ('static' === $className) {
return $returnType;
}
Expand Down
19 changes: 0 additions & 19 deletions test/StaticAnalysis/Test/ObjectProphecy/ProphesizeTest.php
Expand Up @@ -16,7 +16,6 @@
use JanGregor\Prophecy\Test\StaticAnalysis\Src;
use PHPUnit\Framework;
use Prophecy\Argument;
use Prophecy\Prophet;

/**
* @internal
Expand Down Expand Up @@ -84,24 +83,6 @@ public function testCreateProphecyInHelperMethod(): void
self::assertEquals(5, $testDouble->doubleTheNumber(2));
}

public function testCreateProphecyInline(): void
{
$prophecy = (new Prophet())->prophesize(Src\BaseModel::class);

$prophecy
->getFoo()
->willReturn('bar');

$prophecy
->doubleTheNumber(Argument::is(2))
->willReturn(5);

$testDouble = $prophecy->reveal();

self::assertEquals('bar', $testDouble->getFoo());
self::assertEquals(5, $testDouble->doubleTheNumber(2));
}

private function createProphecy()
{
return $this->prophesize(Src\BaseModel::class);
Expand Down