From 7d30396d0cff7184b8e585a9d49893b41a6f5d8b Mon Sep 17 00:00:00 2001 From: benjamenhogben Date: Fri, 5 Oct 2018 09:48:33 +0100 Subject: [PATCH 1/3] Add throwable to try/catch block --- extensions/php/snippets/php.snippets.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extensions/php/snippets/php.snippets.json b/extensions/php/snippets/php.snippets.json index c8dc8405300..1010dad8993 100644 --- a/extensions/php/snippets/php.snippets.json +++ b/extensions/php/snippets/php.snippets.json @@ -254,6 +254,8 @@ "body": [ "try {", "\t${1://code...}", + "} catch (\\Throwable \\$$t) {", + "\t${2://throw $$t;}", "} catch (\\Exception \\$$e) {", "\t${2://throw $$e;}", "}" From f0b51ea9ad914cadd0879d9ca784a05df528a7e8 Mon Sep 17 00:00:00 2001 From: benjamenhogben Date: Fri, 5 Oct 2018 10:50:02 +0100 Subject: [PATCH 2/3] Catch Throwable user editable --- extensions/php/snippets/php.snippets.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/extensions/php/snippets/php.snippets.json b/extensions/php/snippets/php.snippets.json index 1010dad8993..f964dc42a01 100644 --- a/extensions/php/snippets/php.snippets.json +++ b/extensions/php/snippets/php.snippets.json @@ -254,10 +254,8 @@ "body": [ "try {", "\t${1://code...}", - "} catch (\\Throwable \\$$t) {", - "\t${2://throw $$t;}", - "} catch (\\Exception \\$$e) {", - "\t${2://throw $$e;}", + "} catch (${2:\\Throwable} ${3:$$t}) {", + "\t${4://throw $$th;}", "}" ], "description": "Try catch block" From 1de8905bf5c0e26170aff0d7b3332de9f9f5ffe3 Mon Sep 17 00:00:00 2001 From: benjamenhogben Date: Tue, 9 Oct 2018 14:07:13 +0100 Subject: [PATCH 3/3] Change throwable var name --- extensions/php/snippets/php.snippets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/php/snippets/php.snippets.json b/extensions/php/snippets/php.snippets.json index f964dc42a01..1f2a07bef20 100644 --- a/extensions/php/snippets/php.snippets.json +++ b/extensions/php/snippets/php.snippets.json @@ -254,7 +254,7 @@ "body": [ "try {", "\t${1://code...}", - "} catch (${2:\\Throwable} ${3:$$t}) {", + "} catch (${2:\\Throwable} ${3:$$th}) {", "\t${4://throw $$th;}", "}" ],