All Projects → phpstan → phpstan-nette

phpstan / phpstan-nette

Licence: MIT license
Nette Framework class reflection extension for PHPStan & framework-specific rules

Programming Languages

PHP
23972 projects - #3 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to phpstan-nette

Phpstan
PHP Static Analysis Tool - discover bugs in your code without running it!
Stars: ✭ 10,534 (+12008.05%)
Mutual labels:  static-code-analysis, static-analysis, static-analyzer, phpstan
eba
EBA is a static bug finder for C.
Stars: ✭ 14 (-83.91%)
Mutual labels:  static-code-analysis, static-analysis, static-analyzer
Dg
[LLVM Static Slicer] Various program analyses, construction of dependence graphs and program slicing of LLVM bitcode.
Stars: ✭ 242 (+178.16%)
Mutual labels:  static-code-analysis, static-analysis, static-analyzer
Sonar Dotnet
Code analyzer for C# and VB.NET projects https://redirect.sonarsource.com/plugins/vbnet.html
Stars: ✭ 466 (+435.63%)
Mutual labels:  static-code-analysis, static-analysis, static-analyzer
unimport
unimport is a Go static analysis tool to find unnecessary import aliases.
Stars: ✭ 64 (-26.44%)
Mutual labels:  static-code-analysis, static-analysis, static-analyzer
identypo
identypo is a Go static analysis tool to find typos in identifiers (functions, function calls, variables, constants, type declarations, packages, labels).
Stars: ✭ 26 (-70.11%)
Mutual labels:  static-code-analysis, static-analysis, static-analyzer
Prealloc
prealloc is a Go static analysis tool to find slice declarations that could potentially be preallocated.
Stars: ✭ 419 (+381.61%)
Mutual labels:  static-code-analysis, static-analysis, static-analyzer
Phpstan Doctrine
Doctrine extensions for PHPStan
Stars: ✭ 338 (+288.51%)
Mutual labels:  static-code-analysis, static-analysis, static-analyzer
Sonarjs
SonarSource Static Analyzer for JavaScript and TypeScript
Stars: ✭ 696 (+700%)
Mutual labels:  static-code-analysis, static-analysis, static-analyzer
Sonar Java
☕️ SonarSource Static Analyzer for Java Code Quality and Security
Stars: ✭ 745 (+756.32%)
Mutual labels:  static-code-analysis, static-analysis, static-analyzer
lints
Lint all your JavaScript, CSS, HTML, Markdown and Dockerfiles with a single command
Stars: ✭ 14 (-83.91%)
Mutual labels:  static-code-analysis, static-analysis, static-analyzer
phpstan-webmozart-assert
PHPStan extension for webmozart/assert
Stars: ✭ 132 (+51.72%)
Mutual labels:  static-code-analysis, static-analysis, phpstan
sonarlint4netbeans
SonarLint integration for Apache Netbeans
Stars: ✭ 23 (-73.56%)
Mutual labels:  static-code-analysis, static-analysis, static-analyzer
nakedret
nakedret is a Go static analysis tool to find naked returns in functions greater than a specified function length.
Stars: ✭ 82 (-5.75%)
Mutual labels:  static-code-analysis, static-analysis, static-analyzer
Phpdoc Parser
Next-gen phpDoc parser with support for intersection types and generics
Stars: ✭ 569 (+554.02%)
Mutual labels:  static-code-analysis, static-analysis, static-analyzer
Cfmt
cfmt is a tool to wrap Go comments over a certain length to a new line.
Stars: ✭ 28 (-67.82%)
Mutual labels:  static-code-analysis, static-analysis, static-analyzer
Phpinspectionsea
A Static Code Analyzer for PHP (a PhpStorm/Idea Plugin)
Stars: ✭ 1,211 (+1291.95%)
Mutual labels:  static-code-analysis, static-analysis, static-analyzer
Forbidden Apis
Policeman's Forbidden API Checker
Stars: ✭ 216 (+148.28%)
Mutual labels:  static-code-analysis, static-analysis
Spotbugs
SpotBugs is FindBugs' successor. A tool for static analysis to look for bugs in Java code.
Stars: ✭ 2,569 (+2852.87%)
Mutual labels:  static-code-analysis, static-analysis
Revive
🔥 ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint
Stars: ✭ 3,139 (+3508.05%)
Mutual labels:  static-code-analysis, static-analysis

Nette Framework class reflection extension for PHPStan

Build Latest Stable Version License

This extension provides following features:

  • Nette\ComponentModel\Container::getComponent() knows type of the component because it reads the return type on createComponent* (this works best in presenters and controls)
  • Nette\DI\Container::getByType and createInstance return type based on first parameter (Foo::class).
  • Nette\Forms\Container::getValues return type based on $asArray parameter.
  • Nette\ComponentModel\Component::lookup return type based on $throw parameter.
  • Nette\Application\UI\Component::getPresenter return type based on $throw parameter.
  • Dynamic methods of Nette\Utils\Html
  • Magic Nette\Object and Nette\SmartObject properties
  • Event listeners through the on* properties
  • Defines early terminating method calls for Presenter methods to prevent Undefined variable errors

It also contains these framework-specific rules (can be enabled separately):

  • Do not extend Nette\Object, use Nette\SmartObject trait instead
  • Rethrow exceptions that are always meant to be rethrown (like AbortException)

Installation

To use this extension, require it in Composer:

composer require --dev phpstan/phpstan-nette

If you also install phpstan/extension-installer then you're all set!

Manual installation

If you don't want to use phpstan/extension-installer, include extension.neon in your project's PHPStan config:

includes:
    - vendor/phpstan/phpstan-nette/extension.neon

To perform framework-specific checks, include also this file:

    - vendor/phpstan/phpstan-nette/rules.neon
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].