Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
e4950d10
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e4950d10
编写于
5月 09, 2017
作者:
R
Rob Lourens
提交者:
GitHub
5月 09, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #22354 from Nais777/master
Update PHP snippets
上级
3c5918c2
9f8dd87d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
67 addition
and
58 deletion
+67
-58
extensions/php/snippets/php.json
extensions/php/snippets/php.json
+67
-58
未找到文件。
extensions/php/snippets/php.json
浏览文件 @
e4950d10
{
"Class Variable"
:
{
"prefix"
:
"doc_v"
,
"class …"
:
{
"prefix"
:
"class"
,
"body"
:
[
"class ${1:ClassName} ${2:extends ${3:AnotherClass}} ${4:implements ${5:Interface}}"
,
"{"
,
"
\t
$0"
,
"}"
,
""
],
"description"
:
"Class definition"
},
"PHPDoc class …"
:
{
"prefix"
:
"doc_class"
,
"body"
:
[
"/**"
,
" * ${1:undocumented class variable}"
,
" *"
,
" * @var ${2:string}"
,
" **/"
,
"${3:var} $$2;$0"
" * ${6:undocumented class}"
,
" */"
,
"class ${1:ClassName} ${2:extends ${3:AnotherClass}} ${4:implements ${5:Interface}}"
,
"{"
,
"
\t
$0"
,
"}"
,
""
],
"description"
:
"Documented Class
Variable
"
"description"
:
"Documented Class
Declaration
"
},
"function __construct"
:
{
"prefix"
:
"con"
,
"body"
:
[
"
function __construct(${1:$${2:foo} ${3:= ${4
:null}}}) {"
,
"
\t
${2:$this->$0 = $$0;}
"
,
"}"
"
${1:public} function __construct(${2:${3:Type} $${4:var}${5: = ${6
:null}}}) {"
,
"
\t\\
$this->${4:var} = $${4:var};$0
"
,
"}"
]
},
"
class …
"
:
{
"prefix"
:
"
class
"
,
"
PHPDoc property
"
:
{
"prefix"
:
"
doc_v
"
,
"body"
:
[
"/**"
,
" * $1"
,
" */"
,
"class ${2:ClassName} ${3:extends ${4:AnotherClass}}"
,
"{"
,
"
\t
$5"
,
"
\t
function ${6:__construct}(${7:argument})"
,
"
\t
{"
,
"
\t\t
${0:# code...}"
,
"
\t
}"
,
"}"
,
""
"/** @var ${1:Type} $${2:var} ${3:description} */"
,
"${4:protected} $${2:var}${5: = ${6:null}};$0"
],
"description"
:
"
Class definition
"
"description"
:
"
Documented Class Variable
"
},
"PHPDoc function …"
:
{
"prefix"
:
"doc_f"
,
"body"
:
[
"/**"
,
" * ${
6
:undocumented function summary}"
,
" * ${
1
:undocumented function summary}"
,
" *"
,
" * ${
7
:Undocumented function long description}"
,
" * ${
2
:Undocumented function long description}"
,
" *"
,
" * @param ${8:type} ${9:var} ${10:Description}"
,
"${3: * @param ${4:Type} $${5:var} ${6:Description}}"
,
"${7: * @return ${8:type}}"
,
"${9: * @throws ${10:conditon}}"
,
" **/"
,
"${1
:public }function ${2:FunctionName}(${3:$${4:value}${5:=''
}})"
,
"${1
1:public }function ${12:FunctionName}(${13:${14:${4:Type} }$${5:var}${15: = ${16:null}
}})"
,
"{"
,
"
\t
${0:# code...}"
,
"}"
],
"description"
:
"Documented function"
},
"PHPDoc param …"
:
{
"prefix"
:
"param"
,
"body"
:
[
"* @param ${1:Type} ${2:var} ${3:Description}$0"
],
"description"
:
"Paramater documentation"
},
"function …"
:
{
"prefix"
:
"fun"
,
"body"
:
[
"${1:public }function ${2:FunctionName}(${3:$
${4:value}${5:=''
}})"
,
"${1:public }function ${2:FunctionName}(${3:$
{4:${5:Type} }$${6:var}${7: = ${8:null}
}})"
,
"{"
,
"
\t
${0:# code...}"
,
"}"
...
...
@@ -72,10 +84,7 @@
" */"
,
"trait ${2:TraitName}"
,
"{"
,
"
\t
function ${3:functionName}(${4:argument})"
,
"
\t
{"
,
"
\t\t
${5:# code...}"
,
"
\t
}"
,
"
\t
$0"
,
"}"
,
""
],
...
...
@@ -94,21 +103,18 @@
"body"
:
[
"do {"
,
"
\t
${0:# code...}"
,
"} while (${1:$
{2:$
a} <= ${3:10}});"
"} while (${1:$
${2:
a} <= ${3:10}});"
],
"description"
:
"Do-While loop"
},
"if … els
e …"
:
{
"prefix"
:
"
ifels
e"
,
"whil
e …"
:
{
"prefix"
:
"
whil
e"
,
"body"
:
[
"if (${1:condition}) {"
,
"
\t
${2:# code...}"
,
"} else {"
,
"
\t
${3:# code...}"
,
"}"
,
"$0"
"while (${1:$${2:a} <= ${3:10}}) {"
,
"
\t
${0:# code...}"
,
"}"
],
"description"
:
"
If Else block
"
"description"
:
"
While-loop
"
},
"if …"
:
{
"prefix"
:
"if"
,
...
...
@@ -119,6 +125,18 @@
],
"description"
:
"If block"
},
"if … else …"
:
{
"prefix"
:
"ifelse"
,
"body"
:
[
"if (${1:condition}) {"
,
"
\t
${2:# code...}"
,
"} else {"
,
"
\t
${3:# code...}"
,
"}"
,
"$0"
],
"description"
:
"If Else block"
},
"$… = ( … ) ? … : …"
:
{
"prefix"
:
"if?"
,
"body"
:
"$${1:retVal} = (${2:condition}) ? ${3:a} : ${4:b} ;"
,
...
...
@@ -178,7 +196,7 @@
"switch …"
:
{
"prefix"
:
"switch"
,
"body"
:
[
"switch (${1:variable}) {"
,
"switch (
\\
$
${1:variable}) {"
,
"
\t
case '${2:value}':"
,
"
\t\t
${3:# code...}"
,
"
\t\t
break;"
,
...
...
@@ -193,7 +211,7 @@
"case …"
:
{
"prefix"
:
"case"
,
"body"
:
[
"case '${1:va
riabl
e}':"
,
"case '${1:va
lu
e}':"
,
"
\t
${0:# code...}"
,
"
\t
break;"
],
...
...
@@ -201,12 +219,12 @@
},
"$this->…"
:
{
"prefix"
:
"this"
,
"body"
:
"
$this->$0
"
,
"body"
:
"
\\
$this->$0;
"
,
"description"
:
"$this->..."
},
"echo $this->…"
:
{
"prefix"
:
"ethis"
,
"body"
:
"echo
$this->$0
"
,
"body"
:
"echo
\\
$this->$0;
"
,
"description"
:
"Echo this"
},
"Throw Exception"
:
{
...
...
@@ -216,14 +234,5 @@
"$0"
],
"description"
:
"Throw exception"
},
"while …"
:
{
"prefix"
:
"while"
,
"body"
:
[
"while (${1:$a <= 10}) {"
,
"
\t
${0:# code...}"
,
"}"
],
"description"
:
"While-loop"
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录