Check inspirations

Ideas for your next Checks.

This page might not be much, but here you can find some inspirations for some custom phecks your team could implement:

📜 Namings

  • Check that classes under a specific folder, or classes that extend a particular parent class, have a specific prefix or suffix.

  • Check that get methods always return something.

  • Check that set methods always return self/void.

✋ Prevent usage of deprecated

  • Prevent classes from extending deprecated classes

  • Prevent classes from importing deprecated classes

✅ Tests

  • Check that test classes use snake_case methods.

  • Check that test classes belong to a @group

  • Check that test classes are under the correct namespace

🧰​ Laravel (frameworks)

  • Check that models are using the Attribute approach for mutators and accessors.

  • Check that migrations are anonymous classes.

  • Check that commands only have the handle method as public.

  • Check that Listeners don't have the same name as the Event (ModelCreatedEvent -> UpdateChildrenListener)

Don't forget to check the Spatie example with actually working checks.

Last updated