Editors & Tools
You can be a skilled programmer, but only with good tools will you become a master. In this chapter you will find tips on important tools, editors and plugins.
IDE Editor
We strongly recommend using a full-featured IDE for development, such as PhpStorm, NetBeans, VS Code, and not just a text editor with PHP support. The difference is really crucial. There is no reason to be satisfied with a classic editor with syntax highlighting, because it doesn't reach the capabilities of a IDE with accurate code suggestion, that can refactor code, and more. Some IDEs are paid, others are free.
NetBeans IDE has built-in support for Nette, Latte and NEON.
PhpStorm: install these plugins in Settings > Plugins > Marketplace
:
- Nette framework helpers
- Latte
- NEON support
- Nette Tester
VS Code: find the “Nette Latte + Neon” plugin in the marketplace.
Also connect Tracy with the editor. When the error page is displayed, you can click on the file names and they will open in the editor with the cursor on the corresponding line. Learn how to configure the system.
PHPStan
PHPStan is a tool that detects logical errors in your code before you run it.
Install it via Composer:
composer require --dev phpstan/phpstan-nette
Create a configuration file phpstan.neon
in the project:
includes:
- vendor/phpstan/phpstan-nette/extension.neon
parameters:
scanDirectories:
- app
level: 5
And then let it analyze the classes in the app/
folder:
vendor/bin/phpstan analyse app
You can find comprehensive documentation directly at PHPStan.
Code Checker
Code Checker checks and possibly repairs some of the formal errors in your source code.
- removes BOM
- checks validity of Latte templates
- checks validity of
.neon
,.php
and.json
files - checks for control characters
- checks whether the file is encoded in UTF-8
- controls misspelled
/* @annotations */
(second asterisk missing) - removes PHP ending tags
?>
in PHP files - removes trailing whitespace and unnecessary blank lines from the end of a file
- normalizes line endings to system-default (with the
-l
parameter)
Composer
Composer is a tool for managing your dependencies in PHP. It allows us to declare library dependencies and it will install them for us, into our project.
Requirements Checker
It was a tool that tested the server's running environment and informed whether (and to what extent) the framework could be used. Currently, Nette can be used on any server that has the minimum required version of PHP.