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

test covered by psalm #1

Draft
wants to merge 1 commit into
base: 5.5.x
Choose a base branch
from
Draft

test covered by psalm #1

wants to merge 1 commit into from

Conversation

sasezaki
Copy link
Owner

No description provided.

@sasezaki
Copy link
Owner Author

😢

./vendor/bin/psalm --debug --php-version=8.1.0

would show

Deep scanning /home/sasezaki/dev/BetterReflection/test/unit/Fixture/PHP81ClassForSourceStubber.php
Uncaught UnexpectedValueException: Intersection types not yet supported in /home/sasezaki/dev/BetterReflection/vendor/vimeo/psalm/src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php:427
Stack trace:

@sasezaki
Copy link
Owner Author

vimeo/psalm#7454

native intersection types support is available on master.

so, test on psalm.dev

<?php

namespace Roave\BetterReflectionTest\Fixture;

use ArrayIterator;
use stdClass;

class PHP81ClassForSourceStubber
{
    public final const FINAL_CONST = 'finalConst';

    public readonly int $readOnly;

    public function getIntersectionType(): ArrayIterator&stdClass
    {
    }
}

https://psalm.dev/r/2d9f1d25d8

Psalm runner output: 

Internal Psalm error on line 46 - /vendor/vimeo/psalm/src/Psalm/Internal/Provider/ClassLikeStorageProvider.php: Could not get class storage for arrayiterator

😿

@sasezaki sasezaki changed the title covered test by psalm test covered by psalm Jun 11, 2022
@sasezaki
Copy link
Owner Author

test/unit/Fixture/PHP81ClassForSourceStubber.php is just stub. so it should be add as stub file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant