From 6ade12ac150ac41d9d955488e712d456d7d14a38 Mon Sep 17 00:00:00 2001 From: Michael Thessel Date: Fri, 12 Apr 2013 01:16:52 +0000 Subject: [PATCH 1/6] Changed method snippet --- snippets/php.snippets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/php.snippets b/snippets/php.snippets index 31ebdfa..614bbbc 100644 --- a/snippets/php.snippets +++ b/snippets/php.snippets @@ -46,9 +46,9 @@ snippet f } # method snippet m - ${1:abstract }${2:protected}${3: static} function ${4:foo}(${5:array }${6:$bar}) + ${1:protected} function ${2:foo}() { - ${7} + ${3} } # setter method snippet sm From 41644d72e5cc29845acf34ec5bc98b72db1adedf Mon Sep 17 00:00:00 2001 From: Michael Thessel Date: Fri, 12 Apr 2013 01:18:57 +0000 Subject: [PATCH 2/6] Whitespace cleanup --- snippets/php.snippets | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/snippets/php.snippets b/snippets/php.snippets index 614bbbc..6be1495 100644 --- a/snippets/php.snippets +++ b/snippets/php.snippets @@ -51,7 +51,7 @@ snippet m ${3} } # setter method -snippet sm +snippet sm /** * Sets the value of ${1:foo} * @@ -104,7 +104,7 @@ snippet S $_SERVER['${1:variable}']${2} snippet SS $_SESSION['${1:variable}']${2} - + # the following are old ones snippet inc include '${1:file}';${2} @@ -205,7 +205,7 @@ snippet doc_h * @copyright ${4:$2}, `strftime('%d %B, %Y')` * @package ${5:default} */ - + # Interface snippet interface /** @@ -344,8 +344,8 @@ snippet vd snippet vdd var_dump(${1}); die(${2:}); snippet http_redirect - header ("HTTP/1.1 301 Moved Permanently"); - header ("Location: ".URL); + header ("HTTP/1.1 301 Moved Permanently"); + header ("Location: ".URL); exit(); # Getters & Setters snippet gs @@ -375,7 +375,7 @@ snippet gs snippet ags /** * ${1:description} - * + * * @${7} */ ${2:protected} $${3:foo}; From 95b1a81d6ea334002b3af263acf616feac6ef598 Mon Sep 17 00:00:00 2001 From: Michael Thessel Date: Fri, 12 Apr 2013 01:20:42 +0000 Subject: [PATCH 3/6] Changed class snippet --- snippets/php.snippets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/php.snippets b/snippets/php.snippets index 6be1495..6ca1f58 100644 --- a/snippets/php.snippets +++ b/snippets/php.snippets @@ -28,9 +28,9 @@ snippet use use ${1:Foo\Bar\Baz}; ${2} snippet c - ${1:abstract }class ${2:`Filename()`} + class ${1:`Filename()`} { - ${3} + ${2} } snippet i interface ${1:`Filename()`} From 613f3c1b258907c713d6c6baa7b4aef197825e13 Mon Sep 17 00:00:00 2001 From: Michael Thessel Date: Fri, 12 Apr 2013 02:46:37 +0000 Subject: [PATCH 4/6] Added array_map() snippet --- snippets/php.snippets | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/snippets/php.snippets b/snippets/php.snippets index 6ca1f58..3e5a9be 100644 --- a/snippets/php.snippets +++ b/snippets/php.snippets @@ -394,3 +394,8 @@ snippet rett return true; snippet retf return false; +snippet am + array_map(function($${1:v}) { + ${3} + return $$1; + }, $${2:foo}); From 2c858bb724c3cec61094f26f3ccf5bf28a8da8bb Mon Sep 17 00:00:00 2001 From: Michael Thessel Date: Fri, 12 Apr 2013 02:50:15 +0000 Subject: [PATCH 5/6] Added return array placeholder --- snippets/php.snippets | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/snippets/php.snippets b/snippets/php.snippets index 3e5a9be..f8a406f 100644 --- a/snippets/php.snippets +++ b/snippets/php.snippets @@ -395,7 +395,7 @@ snippet rett snippet retf return false; snippet am - array_map(function($${1:v}) { + $${1:foo} = array_map(function($${2:v}) { ${3} - return $$1; - }, $${2:foo}); + return $$2; + }, $$1); From 8ec2e4ce7aab2fd84826d13dd6af9e4dc5453e46 Mon Sep 17 00:00:00 2001 From: Michael Thessel Date: Fri, 12 Apr 2013 02:57:14 +0000 Subject: [PATCH 6/6] Added array_walk snippet --- snippets/php.snippets | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/snippets/php.snippets b/snippets/php.snippets index f8a406f..793c2a5 100644 --- a/snippets/php.snippets +++ b/snippets/php.snippets @@ -399,3 +399,7 @@ snippet am ${3} return $$2; }, $$1); +snippet aw + array_walk($${1:foo}, function(&$${2:v}, $${3:k}) { + $$2 = ${4}; + });