You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This [VScode extension](https://marketplace.visualstudio.com/items?itemName=hakcorp.php-awesome-snippets) provide a fullset of snippets for PHP devs. It's pretty simple !
14
+
**This [VScode extension](https://marketplace.visualstudio.com/items?itemName=hakcorp.php-awesome-snippets) provide a fullset of snippets for PHP devs. It's pretty simple !**
15
15
16
16
You can use it to avoid wasting time typing Class blocks, function signatures or other common PHP statements.
17
17
18
18

19
19
20
-
The code generated is as compliant as possible with [PSR-1](https://www.php-fig.org/psr/psr-1/), [PSR-2](https://www.php-fig.org/psr/psr-2/) and [PSR-12](https://github.com/php-fig/fig-standards/blob/master/proposed/extended-coding-style-guide.md) (*Review* stage) coding standard provided by [PHP-FIG](https://www.php-fig.org/).
20
+
The code generated is **as compliant as possible** with [PSR-1](https://www.php-fig.org/psr/psr-1/), [PSR-2](https://www.php-fig.org/psr/psr-2/) and [PSR-12](https://github.com/php-fig/fig-standards/blob/master/proposed/extended-coding-style-guide.md) (*Review* stage) coding standards provided by [PHP-FIG](https://www.php-fig.org/).
21
21
22
22
Snippets are PHP7 oriented (type hinting and return type) but PHP5 compatibility is also provided (see [Functions](#function-snip) and [Methods](#method-snip) sections).
23
23
@@ -28,7 +28,7 @@ Type a snippet (or part of it), press `Enter` or `Tab` (if `editor.tabCompletion
28
28
29
29
> ***Tip :*** Snippets provided in this extension support `tab` to next/previous placeholder.
30
30
31
-
These snippets are meant to work in *PHP* context (VScode file). However there are also available in *Plain Text* files for convenience and PHP tags are available in *HTML* ones.
31
+
These snippets are meant to work in **PHP context** (VScode file). However there are also available in **Plain Text context**for convenience and PHP tags are available in **HTML** one.
32
32
33
33
## Features
34
34
@@ -73,7 +73,7 @@ Placeholders are quite *'easy to use'* though some need optimizations.
73
73
| kv |`'key' => value,`**[1]**|
74
74
| va |`value, `**[1]**|
75
75
76
-
***[1]** Addon snippet: use with `arr` or `ark` snippet to add `value` or `key => value` if needed.
76
+
***[1]** Addon snippet: use with `arr` or `ark` snippet to add `value` or `key => value` if needed.
77
77
78
78
----
79
79
### Statements and common functions calls
@@ -99,7 +99,7 @@ Placeholders are quite *'easy to use'* though some need optimizations.
99
99
| fna |`function (Type $args): void {...}`|
100
100
| fnu |`function (Type $args) use ($vars): void {...}`|
101
101
102
-
***Tip :*** You can call `functions` snippets above without type hinting and return type (**PHP5 compatible**) by using **`-`** as prefix.
102
+
***Tip :*** You can call `functions` snippets above without type hinting and return type (**PHP5 compatibility**) by using **`-`** as prefix.
103
103
> *`-fna` for `function ($args) {...}`*(anonymous function block)*
104
104
105
105
----
@@ -114,15 +114,15 @@ Placeholders are quite *'easy to use'* though some need optimizations.
114
114
| cs |`case 'label': ... break;`**[1]**|
115
115
| tern |`condition ? if_true : if_false;`|
116
116
117
-
***[1]** Addon snippet: use with `sw` snippet to add `case` if needed.
117
+
***[1]** Addon snippet: use with `sw` snippet to add `case` if needed.
118
118
119
-
***Tip :***The others `if``else`forms are also available if needed:
119
+
***Tip :***Other `if ... else`form is also available if needed:
@@ -135,7 +135,7 @@ Placeholders are quite *'easy to use'* though some need optimizations.
135
135
| wl |`while ($variable <= $limit) {...}`|
136
136
| dowl |`do {...} while ($variable <= $limit);`|
137
137
138
-
***Tip :***The others loop forms are also available if needed:
138
+
***Tip :***Other loops form is also available if needed:
139
139
140
140
> | Snippet | Output |
141
141
> | --- | --- |
@@ -191,7 +191,7 @@ Placeholders are quite *'easy to use'* though some need optimizations.
191
191
> *`fpubsf` for `final public static function methodName(Type $args): void {...}`
192
192
193
193
***Tip :*** You can call `methods` snippets above without type hinting
194
-
and return type (**PHP5 compatible**) by using **`-`** as prefix.
194
+
and return type (**PHP5 compatibility**) by using **`-`** as prefix.
195
195
> *`-apubf` for `abstract public function methodName(parameters) {...}`
196
196
197
197
----
@@ -205,14 +205,14 @@ and return type (**PHP5 compatible**) by using **`-`** as prefix.
205
205
| fy |`finally {...}`**[2]**|
206
206
| thr |`throw new SomeException("Error statement");`|
207
207
208
-
***[1]** Addon snippet: use with `tryc` or `tryf` snippet to add `catch` if needed.
209
-
***[2]** Addon snippet: use with `tryc` snippet to add `finally` if needed.
208
+
***[1]** Addon snippet: use with `tryc` or `tryf` snippet to add `catch` if needed.
209
+
***[2]** Addon snippet: use with `tryc` snippet to add `finally` if needed.
210
210
211
211
## Requirements
212
212
213
213
All you need is VScode installed on your machine.
214
214
215
-
* Install the extension from extension menu.
215
+
* Install the extension from `Extensions` menu.
216
216
217
217
* You can also press `F1` then type:
218
218
@@ -221,6 +221,7 @@ All you need is VScode installed on your machine.
221
221
## <aid="ext-settings"></a>Extension Settings
222
222
223
223
The VScode default behavior deactivate IntelliSense suggestions when you're filling placeholders. However if you want to use completion and snippets inside placeholders :
224
+
224
225
* Open your settings.json file ( **{ }** icon at the top right corner of the settings tab).
225
226
226
227
* Add this line anywhere you want: `"editor.suggest.snippetsPreventQuickSuggestions": false`
@@ -229,7 +230,9 @@ Now you can call snippets and any suggestion in placeholders without typing `Ctr
229
230
230
231
## Known Issues
231
232
232
-
Sometimes IntelliSense freezes loading or simply don't select the called snippet. Backspace and try again, it should work.
233
+
If suggestions menu does not open, press `Ctrl+space` to open it manually.
234
+
235
+
Sometimes IntelliSense freezes loading or simply doesn't select the called snippet. Backspace and try again, it should work.
0 commit comments