Skip to content

Commit 32c6e96

Browse files
committed
added snippets for DI
1 parent c7922be commit 32c6e96

File tree

4 files changed

+59
-0
lines changed

4 files changed

+59
-0
lines changed

snippets/di/preference.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"DI Preference": {
3+
"prefix": "m2.di.pref",
4+
"body": [
5+
"<preference for=\"${1:Fully Qualified Classname}\" type=\"${2:Fully Qualified Classname}\" />$0",
6+
],
7+
"description": "Magento 2 DI preference"
8+
}
9+
}

snippets/di/scaffold.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"DI Scaffold": {
3+
"prefix": "m2.di",
4+
"body": [
5+
"<?xml version=\"1.0\"?>",
6+
"<page xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:ObjectManager/etc/config.xsd\">",
7+
"\t$0",
8+
"</page>"
9+
],
10+
"description": "Magento 2 DI scaffold"
11+
}
12+
}

snippets/di/type.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"DI Type": {
3+
"prefix": "m2.di.type",
4+
"body": [
5+
"<type name=\"${1:Fully Qualified Classname}\">",
6+
"\t$0",
7+
"</type>"
8+
],
9+
"description": "Magento 2 DI type"
10+
},
11+
"DI Type Arguments": {
12+
"prefix": "m2.di.type.args",
13+
"body": [
14+
"<arguments>",
15+
"\t<argument name=\"${1:Constructor Argument}\" xsi:type=\"${2|array,boolean,number,null,object,string|}\">$0</argument>",
16+
"</arguments>"
17+
],
18+
"description": "Magento 2 DI type arguments"
19+
},
20+
"DI Type Argument Item": {
21+
"prefix": "m2.di.type.args.item",
22+
"body": [
23+
"<item name=\"${1}\" xsi:type=\"${2|array,boolean,number,null,object,string|}\">$0</item>"
24+
],
25+
"description": "Magento 2 DI type argument item"
26+
}
27+
}

snippets/di/virtualtype.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"DI Virtual Type": {
3+
"prefix": "m2.di.virtualtype",
4+
"body": [
5+
"<virtualType name=\"${1:Virtual Type Name}\" type=\"${2:Fully Qualified Classname}\">",
6+
"\t$0",
7+
"</virtualType>"
8+
],
9+
"description": "Magento 2 DI type"
10+
}
11+
}

0 commit comments

Comments
 (0)