Download the PHP package ergebnis/phpstan-rules without Composer

On this page you can find all versions of the php package ergebnis/phpstan-rules. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package phpstan-rules

phpstan-rules

Integrate Merge Release Renew

Code Coverage Type Coverage

Latest Stable Version Total Downloads Monthly Downloads

This project provides a composer package with rules for phpstan/phpstan.

Installation

Run

Usage

All of the rules provided (and used) by this library are included in rules.neon.

When you are using phpstan/extension-installer, rules.neon will be automatically included.

Otherwise you need to include rules.neon in your phpstan.neon:

:bulb: You probably want to use these rules on top of the rules provided by:

Rules

This package provides the following rules for use with phpstan/phpstan:

Classes

Classes\FinalRule

This rule reports an error when a non-anonymous class is not final.

:bulb: This rule ignores classes that

on the class level.

Disabling the rule

You can set the the enabled parameter to false to disable this rule.

Disallowing abstract classes

By default, this rule allows to declare abstract classes.

You can set the allowAbstractClasses parameter to false to disallow abstract classes.

Excluding classes from inspection

You can set the classesNotRequiredToBeAbstractOrFinal parameter to a list of class names that you want to exclude from inspection.

Classes\NoExtendsRule

This rule reports an error when a class extends another class.

Defaults

By default, this rule allows the following classes to be extended:

Disabling the rule

You can set the the enabled parameter to false to disable this rule.

Allowing classes to be extended

You can set the classesAllowedToBeExtended parameter to a list of class names that you want to allow to be extended.

Classes\PHPUnit\Framework\TestCaseWithSuffixRule

This rule reports an error when a concrete class is a sub-class of PHPUnit\Framework\TestCase but does not have a Test suffix.

Disabling the rule

You can set the the enabled parameter to false to disable this rule.

Closures

Closures\NoNullableReturnTypeDeclarationRule

This rule reports an error when a closure uses a nullable return type declaration.

Disabling the rule

You can set the the enabled parameter to false to disable this rule.

Closures\NoParameterWithNullableTypeDeclarationRule

This rule reports an error when a closure has a parameter with a nullable type declaration.

Disabling the rule

You can set the the enabled parameter to false to disable this rule.

Closures\NoParameterWithNullDefaultValueRule

This rule reports an error when a closure has a parameter with null as default value.

Disabling the rule

You can set the the enabled parameter to false to disable this rule.

Expressions

Expressions\NoCompactRule

This rule reports an error when the function compact() is used.

Disabling the rule

You can set the the enabled parameter to false to disable this rule.

Expressions\NoEvalRule

This rule reports an error when the language construct eval() is used.

Disabling the rule

You can set the the enabled parameter to false to disable this rule.

Expressions\NoErrorSuppressionRule

This rule reports an error when @ is used to suppress errors.

Disabling the rule

You can set the the enabled parameter to false to disable this rule.

Expressions\NoIssetRule

This rule reports an error when the language construct isset() is used.

Disabling the rule

You can set the the enabled parameter to false to disable this rule.

Files

Files\DeclareStrictTypesRule

This rule reports an error when a non-empty file does not contain a declare(strict_types=1) declaration.

Disabling the rule

You can set the the enabled parameter to false to disable this rule.

Functions

Functions\NoNullableReturnTypeDeclarationRule

This rule reports an error when a function uses a nullable return type declaration.

Disabling the rule

You can set the the enabled parameter to false to disable this rule.

Functions\NoParameterWithNullableTypeDeclarationRule

This rule reports an error when a function has a parameter with a nullable type declaration.

Disabling the rule

You can set the the enabled parameter to false to disable this rule.

Functions\NoParameterWithNullDefaultValueRule

This rule reports an error when a function has a parameter with null as default value.

Disabling the rule

You can set the the enabled parameter to false to disable this rule.

Methods

Methods\FinalInAbstractClassRule

This rule reports an error when a concrete public or protectedmethod in an abstract class is not final.

Disabling the rule

You can set the the enabled parameter to false to disable this rule.

Methods\NoConstructorParameterWithDefaultValueRule

This rule reports an error when a constructor declared in

has a default value.

Disabling the rule

You can set the the enabled parameter to false to disable this rule.

Methods\NoNullableReturnTypeDeclarationRule

This rule reports an error when a method declared in

uses a nullable return type declaration.

Disabling the rule

You can set the the enabled parameter to false to disable this rule.

Methods\NoParameterWithContainerTypeDeclarationRule

This rule reports an error when a method has a type declaration for a known dependency injection container or service locator.

Defaults

By default, this rule disallows the use of type declarations indicating an implementation of

is expected to be injected into a method.

Disabling the rule

You can set the the enabled parameter to false to disable this rule.

Configuring container interfaces

You can set the interfacesImplementedByContainers parameter to a list of interface names of additional containers and service locators.

Configuring methods allowed to use parameters with container type declarations

You can set the methodsAllowedToUseContainerTypeDeclarations parameter to a list of method names that are allowed to use parameters with container type declarations.

Methods\NoParameterWithNullableTypeDeclarationRule

This rule reports an error when a method declared in

has a parameter with a nullable type declaration.

Disabling the rule

You can set the the enabled parameter to false to disable this rule.

Methods\NoParameterWithNullDefaultValueRule

This rule reports an error when a method declared in

has a parameter with null as default value.

Disabling the rule

You can set the the enabled parameter to false to disable this rule.

Methods\PrivateInFinalClassRule

This rule reports an error when a method in a final class is protected but could be private.

Disabling the rule

You can set the the enabled parameter to false to disable this rule.

Statements

Statements\NoSwitchRule

This rule reports an error when the statement switch() is used.

Disabling the rule

You can set the the enabled parameter to false to disable this rule.

Changelog

The maintainers of this project record notable changes to this project in a changelog.

Contributing

The maintainers of this project suggest following the contribution guide.

Code of Conduct

The maintainers of this project ask contributors to follow the code of conduct.

General Support Policy

The maintainers of this project provide limited support.

You can support the maintenance of this project by sponsoring @localheinz or requesting an invoice for services related to this project.

PHP Version Support Policy

This project supports PHP versions with active and security support.

The maintainers of this project add support for a PHP version following its initial release and drop support for a PHP version when it has reached the end of security support.

Security Policy

This project has a security policy.

License

This project uses the MIT license.

Credits

The method friendsofphp/php-cs-fixer (originally licensed under MIT).

Social

Follow @localheinz and @ergebnis on Twitter.


All versions of phpstan-rules with dependencies

PHP Build Version
Package Version
Requires php Version ~8.1.0 || ~8.2.0 || ~8.3.0
ext-mbstring Version *
nikic/php-parser Version ^4.2.3 || ^5.0.0
phpstan/phpstan Version ^1.10.21
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ergebnis/phpstan-rules contains the following files

Loading the files please wait ....