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:
-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;