From e16f7b4d17bc2c65a1bacef8442db7ec7fe50479 Mon Sep 17 00:00:00 2001
From: "florian.azizian" <florian.azizian@maarch.org>
Date: Wed, 17 Jan 2018 17:43:41 +0100
Subject: [PATCH] FIX undo php7.0 syntaxe

---
 core/Controllers/UserController.php           | 20 ++++++++--------
 package-lock.json                             |  2 +-
 .../basket/controllers/BasketController.php   | 24 +++++++++----------
 .../contact/controllers/ContactController.php | 10 ++++----
 4 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/core/Controllers/UserController.php b/core/Controllers/UserController.php
index e4146dd1cd9..ab68ed0c2d4 100755
--- a/core/Controllers/UserController.php
+++ b/core/Controllers/UserController.php
@@ -42,9 +42,9 @@ class UserController
 
         $data = $request->getParams();
 
-        $check = Validator::stringType()::notEmpty()->validate($data['userId']) && preg_match("/^[\w.@-]*$/", $data['userId']);
-        $check = $check && Validator::stringType()::notEmpty()->validate($data['firstname']);
-        $check = $check && Validator::stringType()::notEmpty()->validate($data['lastname']);
+        $check = Validator::stringType()->notEmpty()->validate($data['userId']) && preg_match("/^[\w.@-]*$/", $data['userId']);
+        $check = $check && Validator::stringType()->notEmpty()->validate($data['firstname']);
+        $check = $check && Validator::stringType()->notEmpty()->validate($data['lastname']);
         $check = $check && (empty($data['mail']) || filter_var($data['mail'], FILTER_VALIDATE_EMAIL));
         $check = $check && (empty($data['phone']) || preg_match("/^(?:0|\+\d\d\s?)[1-9]([\.\-\s]?\d\d){4}$/", $data['phone']));
         if (!$check) {
@@ -59,7 +59,7 @@ class UserController
         UserModel::create(['user' => $data]);
 
         $newUser = UserModel::getByUserId(['userId' => $data['userId']]);
-        if (!Validator::intType()::notEmpty()->validate($newUser['id'])) {
+        if (!Validator::intType()->notEmpty()->validate($newUser['id'])) {
             return $response->withStatus(500)->withJson(['errors' => 'User Creation Error']);
         }
 
@@ -78,9 +78,9 @@ class UserController
 
         $data = $request->getParams();
 
-        $check = Validator::stringType()::notEmpty()->validate($data['user_id']);
-        $check = $check && Validator::stringType()::notEmpty()->validate($data['firstname']);
-        $check = $check && Validator::stringType()::notEmpty()->validate($data['lastname']);
+        $check = Validator::stringType()->notEmpty()->validate($data['user_id']);
+        $check = $check && Validator::stringType()->notEmpty()->validate($data['firstname']);
+        $check = $check && Validator::stringType()->notEmpty()->validate($data['lastname']);
         $check = $check && (empty($data['mail']) || filter_var($data['mail'], FILTER_VALIDATE_EMAIL));
         $check = $check && (empty($data['phone']) || preg_match("/^(?:0|\+\d\d\s?)[1-9]([\.\-\s]?\d\d){4}$/", $data['phone']));
         if (!$check) {
@@ -180,8 +180,8 @@ class UserController
 
         $data = $request->getParams();
 
-        $check = Validator::stringType()::notEmpty()->validate($data['firstname']);
-        $check = $check && Validator::stringType()::notEmpty()->validate($data['lastname']);
+        $check = Validator::stringType()->notEmpty()->validate($data['firstname']);
+        $check = $check && Validator::stringType()->notEmpty()->validate($data['lastname']);
         $check = $check && (empty($data['mail']) || filter_var($data['mail'], FILTER_VALIDATE_EMAIL));
         $check = $check && (empty($data['phone']) || preg_match("/^(?:0|\+\d\d\s?)[1-9]([\.\-\s]?\d\d){4}$/", $data['phone']));
         if (!$check) {
@@ -296,7 +296,7 @@ class UserController
 
         $data = $request->getParams();
 
-        $check = Validator::stringType()::notEmpty()->validate($data['status']);
+        $check = Validator::stringType()->notEmpty()->validate($data['status']);
         $check = $check && ($data['status'] == 'OK' || $data['status'] == 'ABS');
         if (!$check) {
             return $response->withStatus(400)->withJson(['errors' => 'Bad Request']);
diff --git a/package-lock.json b/package-lock.json
index 289363d59cb..e3f1da41c5a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -168,7 +168,7 @@
     "@types/jquery": {
       "version": "2.0.48",
       "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-2.0.48.tgz",
-      "integrity": "sha1-PpDYzeLSkBXlWDAX94MMs5dbLu8=",
+      "integrity": "sha512-nNLzUrVjaRV/Ds1eHZLYTd7IZxs38cwwLSaqMJj8OTXY8xNUbxSK69bi9cMLvQ7dm/IBeQ1wHwQ0S1uYa0rd2w==",
       "dev": true
     },
     "@types/node": {
diff --git a/src/app/basket/controllers/BasketController.php b/src/app/basket/controllers/BasketController.php
index baa597ccac6..e431b2a4686 100644
--- a/src/app/basket/controllers/BasketController.php
+++ b/src/app/basket/controllers/BasketController.php
@@ -56,10 +56,10 @@ class BasketController
 
         $data = $request->getParams();
 
-        $check = Validator::stringType()::notEmpty()->validate($data['id']);
-        $check = $check && Validator::stringType()::notEmpty()->validate($data['name']);
-        $check = $check && Validator::stringType()::notEmpty()->validate($data['description']);
-        $check = $check && Validator::stringType()::notEmpty()->validate($data['clause']);
+        $check = Validator::stringType()->notEmpty()->validate($data['id']);
+        $check = $check && Validator::stringType()->notEmpty()->validate($data['name']);
+        $check = $check && Validator::stringType()->notEmpty()->validate($data['description']);
+        $check = $check && Validator::stringType()->notEmpty()->validate($data['clause']);
         if (!$check) {
             return $response->withStatus(400)->withJson(['errors' => 'Bad Request']);
         }
@@ -91,9 +91,9 @@ class BasketController
 
         $data = $request->getParams();
 
-        $check = Validator::stringType()::notEmpty()->validate($data['name']);
-        $check = $check && Validator::stringType()::notEmpty()->validate($data['description']);
-        $check = $check && Validator::stringType()::notEmpty()->validate($data['clause']);
+        $check = Validator::stringType()->notEmpty()->validate($data['name']);
+        $check = $check && Validator::stringType()->notEmpty()->validate($data['description']);
+        $check = $check && Validator::stringType()->notEmpty()->validate($data['clause']);
         if (!$check) {
             return $response->withStatus(400)->withJson(['errors' => 'Bad Request']);
         }
@@ -196,9 +196,9 @@ class BasketController
 
         $data = $request->getParams();
 
-        $check = Validator::stringType()::notEmpty()->validate($data['group_id']);
-        $check = $check && Validator::stringType()::notEmpty()->validate($data['result_page']);
-        $check = $check && Validator::arrayType()::notEmpty()->validate($data['groupActions']);
+        $check = Validator::stringType()->notEmpty()->validate($data['group_id']);
+        $check = $check && Validator::stringType()->notEmpty()->validate($data['result_page']);
+        $check = $check && Validator::arrayType()->notEmpty()->validate($data['groupActions']);
         if (!$check) {
             return $response->withStatus(400)->withJson(['errors' => 'Bad Request']);
         }
@@ -263,8 +263,8 @@ class BasketController
 
         $data = $request->getParams();
 
-        $check = Validator::stringType()::notEmpty()->validate($data['result_page']);
-        $check = $check && Validator::arrayType()::notEmpty()->validate($data['groupActions']);
+        $check = Validator::stringType()->notEmpty()->validate($data['result_page']);
+        $check = $check && Validator::arrayType()->notEmpty()->validate($data['groupActions']);
         if (!$check) {
             return $response->withStatus(400)->withJson(['errors' => 'Bad Request']);
         }
diff --git a/src/app/contact/controllers/ContactController.php b/src/app/contact/controllers/ContactController.php
index 04875335c8a..4f044ab68d4 100644
--- a/src/app/contact/controllers/ContactController.php
+++ b/src/app/contact/controllers/ContactController.php
@@ -27,11 +27,11 @@ class ContactController
         $data = $request->getParams();
 
         $check = Validator::notEmpty()->validate($data['firstname']);
-        $check = $check && Validator::stringType()::notEmpty()->validate($data['lastname']);
-        $check = $check && Validator::intVal()::notEmpty()->validate($data['contactType']);
-        $check = $check && Validator::intVal()::notEmpty()->validate($data['contactPurposeId']);
-        $check = $check && Validator::stringType()::notEmpty()->validate($data['isCorporatePerson']);
-        $check = $check && Validator::stringType()::notEmpty()->validate($data['email']);
+        $check = $check && Validator::stringType()->notEmpty()->validate($data['lastname']);
+        $check = $check && Validator::intVal()->notEmpty()->validate($data['contactType']);
+        $check = $check && Validator::intVal()->notEmpty()->validate($data['contactPurposeId']);
+        $check = $check && Validator::stringType()->notEmpty()->validate($data['isCorporatePerson']);
+        $check = $check && Validator::stringType()->notEmpty()->validate($data['email']);
         if (!$check) {
             return $response->withStatus(400)->withJson(['errors' => 'Bad Request']);
         }
-- 
GitLab