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

Correct current failures with psalm 3.6.2 #520

Closed
Ocramius opened this issue Nov 3, 2019 · 2 comments
Closed

Correct current failures with psalm 3.6.2 #520

Ocramius opened this issue Nov 3, 2019 · 2 comments
Assignees
Labels
Milestone

Comments

@Ocramius
Copy link
Owner

Ocramius commented Nov 3, 2019

See #513

The command "./vendor/bin/phpcs || true" exited with 0.

6.42s$ ./vendor/bin/psalm

ERROR: PossiblyNullReference - tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/PropertyGenerator/ValueHolderPropertyTest.php:39:89 - Cannot call method generate on possibly null value

            (new ValueHolderProperty(new ReflectionClass(self::class)))->getDocBlock()->generate()

ERROR: ArgumentTypeCoercion - tests/static-analysis/access-interceptor-scope-localizer.php:54:9 - Argument 2 of ProxyManager\Proxy\AccessInterceptorInterface::setMethodPrefixInterceptor expects Closure((InterceptedObjectType as object)&ProxyManager\Proxy\AccessInterceptorInterface=, StaticAnalysis\AccessInterceptorScopeLocalizer\MyProxiedClass=, string=, array<string, mixed>=, bool=):mixed|null, parent type Closure(StaticAnalysis\AccessInterceptorScopeLocalizer\MyProxiedClass&ProxyManager\Proxy\AccessInterceptorInterface, StaticAnalysis\AccessInterceptorScopeLocalizer\MyProxiedClass, string, array<string, mixed>, bool):mixed provided

        static function (

            object $proxy,

            MyProxiedClass $realInstance,

            string $method,

            array $parameters,

            bool & $returnEarly

        ) {

            echo 'pre-';

        }

ERROR: ArgumentTypeCoercion - tests/static-analysis/access-interceptor-value-holder.php:54:9 - Argument 2 of ProxyManager\Proxy\AccessInterceptorInterface::setMethodPrefixInterceptor expects Closure((InterceptedObjectType as object)&ProxyManager\Proxy\AccessInterceptorInterface=, StaticAnalysis\AccessInterceptorValueHolder\MyProxiedClass=, string=, array<string, mixed>=, bool=):mixed|null, parent type Closure(StaticAnalysis\AccessInterceptorValueHolder\MyProxiedClass&ProxyManager\Proxy\AccessInterceptorInterface, StaticAnalysis\AccessInterceptorValueHolder\MyProxiedClass, string, array<string, mixed>, bool):mixed provided

        static function (

            object $proxy,

            MyProxiedClass $realInstance,

            string $method,

            array $parameters,

            bool & $returnEarly

        ) {

            echo 'pre-';

        }

ERROR: MixedArgumentTypeCoercion - tests/static-analysis/lazy-loading-value-holder.php:59:39 - Argument 1 of ProxyManager\Proxy\VirtualProxyInterface::setProxyInitializer expects Closure(null|object=, (LazilyLoadedObjectType as object)&ProxyManager\Proxy\LazyLoadingInterface<LazilyLoadedObjectType>=, string=, array<string, mixed>=, Closure|null=, array<string, mixed>=):bool|null, parent type Closure(null|object, ProxyManager\Proxy\LazyLoadingInterface<object>, string, array<string, mixed>, Closure|null):true provided

    $valueHolder->setProxyInitializer(static function (

        ?object & $instance,

        LazyLoadingInterface $proxy,

        string $method,

        array $parameters,

        ?\Closure & $initializer

    ) : bool {

        $instance    = new MyProxiedClass();

        $initializer = null; // disable initialization

        return true;

    });

------------------------------

4 errors found

------------------------------

Checks took 6.00 seconds and used 296.357MB of memory

Psalm was able to infer types for 99.7845% of the codebase

The command "./vendor/bin/psalm" exited with 1.
@Ocramius Ocramius added the bug label Nov 3, 2019
@Ocramius Ocramius added this to the 2.6.0 milestone Nov 3, 2019
@Ocramius Ocramius self-assigned this Nov 3, 2019
@Ocramius
Copy link
Owner Author

Ocramius commented Nov 4, 2019

Discussed directly with @muglug - some of these issues are solved in psalm master

@Ocramius
Copy link
Owner Author

Ocramius commented Nov 5, 2019

Handled by #521

@Ocramius Ocramius closed this as completed Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant