This extension provides you with a set of handy code snippets inspired by PHPStorm, a popular integrated development environment (IDE) for PHP development. With these snippets, you can increase your productivity and speed up your coding process while working with PHP code in Visual Studio Code.
This extension includes the following PHPStorm-inspired code snippets:
Trigger | Snippet | Description |
---|---|---|
it |
it('', function () { ... }); |
Create a pest it test |
test |
test('', function () { ... }); |
Create a pest it test |
ctor |
public function __construct() { ... } |
Constructor method |
eco |
echo ''; |
Echo statement |
t |
$this-> |
$this reference |
thr |
throw new |
Throw statement |
fore |
foreach ( as $item) { ... } |
foreach loop |
forek |
foreach (interable_expr as $key => $value) { ... } |
foreach loop with key and value |
fori |
for ($i = 0; $i < $length; $i++) { ... } |
for loop |
rer |
require ''; |
Require statement |
rero |
require_once ''; |
Require_once statement |
inc |
include ''; |
Include statement |
inco |
include_once ''; |
Include_once statement |
__invoke |
public function __invoke() { ... } |
Magic __invoke method |
__construct |
public function __construct() { ... } |
Constructor method |
fun |
function () { ... } |
Generic function declaration |
prif |
private function () { ... } |
Private function declaration |
prisf |
private static function () { ... } |
Private static function declaration |
prosf |
protected static function () { ... } |
Protected static function declaration |
prof |
protected function () { ... } |
Protected function declaration |
pubf |
public function () { ... } |
Public function declaration |
pubsf |
public static function () { ... } |
Public static function declaration |
PHPStorm Snippets is open-sourced software licensed under the MIT license.