Ideas for additional strict rules

Open
#7 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
php
Domain
testing

Research direction

No files, tests, or entry points are named. Review the four proposed PHPUnit assertion rules and locate the existing rule implementations and tests before deciding how each suggestion should be handled; done means the intended patterns are implemented and covered by tests.

Written by the indexing model from the issue text.

Description

Here is a list of a ideas that may be implemented in the future:

  • suggest assertInstanceOf(Foo::class, $a) instead of assertTrue($a instanceof Foo)
  • suggest assertNotInstanceOf(Foo::class, $a) instead of assertFalse($a instanceof Foo)
  • suggest assertArrayHasKey() instead of assertTrue(array_key_exists(..))
  • suggest assertFileExists() instead of assertTrue(file_exists($filePath))
Dominant language
PHP
Stars
544
Forks
58
Avg merge
2d 1h
Merged PRs (30d)
5

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-phpunit

All issues in phpstan/phpstan-phpunit

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.