Skip to content

Side effects ruleΒ #28

@pdewouters

Description

@pdewouters

We should add a sniff for https://www.php-fig.org/psr/psr-1/#23-side-effects given https://dekode.atlassian.net/wiki/spaces/doc/pages/1604452353/File+structure+and+naming+conventions

Note that files should either declare code, or run code, but in general, should not do both. This increases re-usability since a class will then not automatically initiate when its file is loaded up. The primary plugin or theme file should instead instantiate any classes needed to be ran.

https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/PSR1/ruleset.xml#L24

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions