DynamicCallOnStaticMethodsRule warns when both dynamic and static methods exist

Open
#140 5 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
php
Domain
tooling

Research direction

Locate DynamicCallOnStaticMethodsRule and first inspect how it handles calls such as Request->validate() when a static method with the same name also exists. Reproduce that case and confirm that the rule no longer reports it while preserving warnings for other invalid dynamic calls.

Written by the indexing model from the issue text.

Description

In Laravel we have Request->validate() and Request::validate() too.

DynamicCallOnStaticMethodsRule emit an error when it sees Request->validate().

Could you add one more if-s?

Dominant language
PHP
Stars
709
Forks
62
Avg merge
5d 19h
Merged PRs (30d)
3

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from phpstan/phpstan-strict-rules

All issues in phpstan/phpstan-strict-rules

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.