Skip to content

Commit e2d698d

Browse files
committed
refactored DI into one file
1 parent 7314623 commit e2d698d

File tree

6 files changed

+63
-73
lines changed

6 files changed

+63
-73
lines changed

package.json

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,7 @@
5656
},
5757
{
5858
"language": "xml",
59-
"path": "./snippets/di/preference.json"
60-
},
61-
{
62-
"language": "xml",
63-
"path": "./snippets/di/scaffold.json"
64-
},
65-
{
66-
"language": "xml",
67-
"path": "./snippets/di/type.json"
68-
},
69-
{
70-
"language": "xml",
71-
"path": "./snippets/di/virtualtype.json"
59+
"path": "./snippets/di.json"
7260
},
7361
{
7462
"language": "xml",

snippets/di.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"DI Scaffold": {
3+
"prefix": "m2.di",
4+
"body": [
5+
"<?xml version=\"1.0\"?>",
6+
"<config xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ",
7+
"\t\txsi:noNamespaceSchemaLocation=\"urn:magento:framework:ObjectManager/etc/config.xsd\">",
8+
"\t$0",
9+
"</config>"
10+
],
11+
"description": "Magento 2 DI scaffold"
12+
},
13+
"DI Preference": {
14+
"prefix": "m2.di.pref",
15+
"body": [
16+
"<preference for=\"${1:Fully Qualified Classname}\" type=\"${2:Fully Qualified Classname}\" />$0"
17+
],
18+
"description": "Magento 2 DI preference"
19+
},
20+
"DI Type": {
21+
"prefix": "m2.di.type",
22+
"body": [
23+
"<type name=\"${1:Fully Qualified Classname}\">",
24+
"\t$0",
25+
"</type>"
26+
],
27+
"description": "Magento 2 DI type"
28+
},
29+
"DI Plugin": {
30+
"prefix": "m2.di.plugin",
31+
"body": [
32+
"<plugin name=\"${1:plugin_name}\" ",
33+
"\ttype=\"${2:Fully Qualified Classname}\"",
34+
"\tsortOrder=\"${3}\"/>$0"
35+
]
36+
},
37+
"DI Type Arguments": {
38+
"prefix": "m2.di.args",
39+
"body": [
40+
"<arguments>",
41+
"\t<argument name=\"${1:Constructor Argument}\" xsi:type=\"${2|array,boolean,number,null,object,string|}\">$3</argument>",
42+
"</arguments>$0"
43+
],
44+
"description": "Magento 2 DI type arguments"
45+
},
46+
"DI Type Argument Item": {
47+
"prefix": "m2.di.args.item",
48+
"body": [
49+
"<item name=\"${1}\" xsi:type=\"${2|array,boolean,number,null,object,string|}\">$3</item>$0"
50+
],
51+
"description": "Magento 2 DI type argument item"
52+
},
53+
"DI Virtual Type": {
54+
"prefix": "m2.di.virtualtype",
55+
"body": [
56+
"<virtualType name=\"${1:Virtual Type Name}\" type=\"${2:Fully Qualified Classname}\">",
57+
"\t$0",
58+
"</virtualType>"
59+
],
60+
"description": "Magento 2 DI type"
61+
}
62+
}

snippets/di/preference.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

snippets/di/scaffold.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

snippets/di/type.json

Lines changed: 0 additions & 27 deletions
This file was deleted.

snippets/di/virtualtype.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)