Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/php-static-scanner-instrumentalization.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-12-21 22:50:10 +0300
committerLukas Reschke <lukas@statuscode.ch>2016-12-21 22:50:10 +0300
commitd86707ec5d56e704ed6d5a0c9f936218df85cc30 (patch)
tree36d4ea6ecd0c8ea8427e2bd9ae099ccb2037217a
parentb22864ae0f11d473ddf8e3c5263c355871a885e3 (diff)
Remove parameters completely and move into GET
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
-rw-r--r--README.md5
-rw-r--r--src/Visitor/PublicFunctionVisitor.php2
2 files changed, 5 insertions, 2 deletions
diff --git a/README.md b/README.md
index 2784d7e..7e001d0 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@ a `$_GET` on code related to the Nextcloud appframework. So the original code wo
use OCP\AppFramework\Controller;
class Foo extends Controller {
- public function list($index) {
+ public function list($index, $bar) {
// Logic of the code
}
}
@@ -24,8 +24,9 @@ the resulting code would look like:
use OCP\AppFramework\Controller;
class Foo extends Controller {
- public function list($index) {
+ public function list() {
$index = $_GET['index'];
+ $bar = $_GET['bar'];
// Logic of the code
}
}
diff --git a/src/Visitor/PublicFunctionVisitor.php b/src/Visitor/PublicFunctionVisitor.php
index 4ad3157..bdeb388 100644
--- a/src/Visitor/PublicFunctionVisitor.php
+++ b/src/Visitor/PublicFunctionVisitor.php
@@ -40,6 +40,8 @@ class PublicFunctionVisitor extends NodeVisitorAbstract {
array_unshift($node->stmts, new Node\Expr\Assign($var, $expr));
}
+ $node->params = [];
+
}
return $node;