The workspace refers to the working directory where Chevere is developed.
Chevere provides snippets and recommendation on extensions that goes better for development, this includes the provisioning IDE resources.
🧔🏾 The default IDE of choice is Visual Studio Code
Workspace settings are at
- Bracket Pair Colorizer
- Coverage Gutters
- php cs fixer
- PHP Debug
- PHP Intelephense
- PHP Namespace Resolver
- PHPUnit Test Explorer
Snippets provide an easy way to define templates for code. It is a productivity tool that allows to rapidly create source code just typing a keyword in the IDE.
👍🏾 Built-in snippets are at
# Working with Snippets
Snippets are designed to be context-aware, to parse information from the file system. That way, a lot of code can be autocompleted and prompt for easier editing.
In the following two-steps, a new test will be created following the snippets workflow.
# Step 1: Create the file
ExampleTest.php file must be created at
Tests/Example/ExampleTest.php. The tree should look like as below.
Tests └── Example └── ExampleTest.php
Examplewill be implemented in the namespace path and
ExampleTestwill be taken used as class name.
# Step 2: Inserting the snippet
Triggering snippets is easy as typing the snippet prefix in the editor. Alternatively, snippets can be triggered by using the command palette.
The screen below shows triggering
test right after typing it, then the
test-method snippet is triggered, which prompt to edit method's
Class name and namespace path is automatically resolved by the IDE.
🧙🏾 Header comment and
strict_typesdeclaration are automatically formatted on save
Table below shows the prefix and description for built-in snippets.
| ||Insert a docblock boolean|
| ||Insert a docblock construct|
| ||Insert a docblock immutable|
| ||Insert a docblock instance|
| ||Create a component|
| ||Create an exception|
| ||Create an interface|
| ||Create a test method|
| ||Create a test|
| ||Create a trait|
# Coding Standards
🧙🏾 Formatting can be configured on save and or typing
PHPUnit Test Explorer provides inline tools for code execution and reviewing. It allows to easily handle all tests.
phpunit.xmlfor development purposes
phpunit-coverage.xmlfor reporting code coverage
# Running tests
vendor/bin/phpunit -c <configuration file>