Browse Source

fixed spaces in doc parsers; changed default sql to php type to mixed

develop
Robin Thoni 8 years ago
parent
commit
0cf082bfcc

+ 2
- 2
src/Utils/Business/LuMethodDocParser.php View File

93
             if (preg_match("/ *\\** *(.*) */", $line, $lineMatches) === 1) {
93
             if (preg_match("/ *\\** *(.*) */", $line, $lineMatches) === 1) {
94
                 $line = $lineMatches[1];
94
                 $line = $lineMatches[1];
95
                 $commandMatches = [];
95
                 $commandMatches = [];
96
-                if (preg_match("/@([^ ]+) *(.*)/", $line, $commandMatches)) {
96
+                if (preg_match("/@([^ ]+) +(.*)/", $line, $commandMatches)) {
97
                     $command = strtolower($commandMatches[1]);
97
                     $command = strtolower($commandMatches[1]);
98
                     $line = $commandMatches[2];
98
                     $line = $commandMatches[2];
99
                     if ($command == "param") {
99
                     if ($command == "param") {
100
                         $currentParam = new LuParameterDbo();
100
                         $currentParam = new LuParameterDbo();
101
                         $paramMatches = [];
101
                         $paramMatches = [];
102
-                        if (preg_match("/([^ ]+) *([^ ]+) *(.*)/", $line, $paramMatches) === 1) {
102
+                        if (preg_match("/([^ ]+) +([^ ]+) +(.*)/", $line, $paramMatches) === 1) {
103
                             if ($paramMatches[1][0] == "$") {
103
                             if ($paramMatches[1][0] == "$") {
104
                                 $currentParam->setName(substr($paramMatches[1], 1, strlen($paramMatches[1]) - 1));
104
                                 $currentParam->setName(substr($paramMatches[1], 1, strlen($paramMatches[1]) - 1));
105
                                 $currentParam->setType($paramMatches[2]);
105
                                 $currentParam->setType($paramMatches[2]);

+ 2
- 2
src/Utils/Business/LuPropertyDocParser.php View File

44
             if (preg_match("/ *\\** *(.*) */", $line, $lineMatches) === 1) {
44
             if (preg_match("/ *\\** *(.*) */", $line, $lineMatches) === 1) {
45
                 $line = $lineMatches[1];
45
                 $line = $lineMatches[1];
46
                 $commandMatches = [];
46
                 $commandMatches = [];
47
-                if (preg_match("/@([^ ]+) *(.*)/", $line, $commandMatches)) {
47
+                if (preg_match("/@([^ ]+) +(.*)/", $line, $commandMatches)) {
48
                     $command = strtolower($commandMatches[1]);
48
                     $command = strtolower($commandMatches[1]);
49
                     $line = $commandMatches[2];
49
                     $line = $commandMatches[2];
50
                     if ($command == "var") {
50
                     if ($command == "var") {
51
                         $paramMatches = [];
51
                         $paramMatches = [];
52
-                        if (preg_match("/([^ ]+) *([^ ]+) *(.*)/", $line, $paramMatches) === 1) {
52
+                        if (preg_match("/([^ ]+) +([^ ]+) +(.*)/", $line, $paramMatches) === 1) {
53
                             if ($paramMatches[1][0] == "$") {
53
                             if ($paramMatches[1][0] == "$") {
54
                                 $currentParam->setName(substr($paramMatches[1], 1, strlen($paramMatches[1]) - 1));
54
                                 $currentParam->setName(substr($paramMatches[1], 1, strlen($paramMatches[1]) - 1));
55
                                 $currentParam->setType($paramMatches[2]);
55
                                 $currentParam->setType($paramMatches[2]);

+ 1
- 1
src/Utils/DataAccess/PgSqlDataAccess.php View File

117
             $sqlType = substr($sqlType, 0, strlen($sqlType) - 2);
117
             $sqlType = substr($sqlType, 0, strlen($sqlType) - 2);
118
         }
118
         }
119
         if (!isset(static::$types) || static::$types[$sqlType] == "") {
119
         if (!isset(static::$types) || static::$types[$sqlType] == "") {
120
-            return "string";
120
+            return "mixed";
121
         }
121
         }
122
         return static::$types[$sqlType] . ($isArray ? "[]" : "");
122
         return static::$types[$sqlType] . ($isArray ? "[]" : "");
123
     }
123
     }

+ 15
- 15
tests/DatabaseTest.php View File

135
 {
135
 {
136
     public function testSetup()
136
     public function testSetup()
137
     {
137
     {
138
-        $config = ['databases' => [
139
-            [
140
-                'name'      => 'mydb',
141
-                'driver'    => 'pgsql',
142
-                'host'      => '172.17.0.1',
143
-                'database'  => 'intra_betaclean',
144
-                'username'  => 'dev',
145
-                'password'  => 'dev'
146
-            ]
147
-        ]];
148
-        $app = new LuticateApplication($config);
149
-        $app->setupDatabases();
138
+//        $config = ['databases' => [
139
+//            [
140
+//                'name'      => 'mydb',
141
+//                'driver'    => 'pgsql',
142
+//                'host'      => '172.17.0.1',
143
+//                'database'  => 'intra_betaclean',
144
+//                'username'  => 'dev',
145
+//                'password'  => 'dev'
146
+//            ]
147
+//        ]];
148
+//        $app = new LuticateApplication($config);
149
+//        $app->setupDatabases();
150
         
150
         
151
 //        $dbo = new TestTableDbo();
151
 //        $dbo = new TestTableDbo();
152
 //        $dbo->setId(11);
152
 //        $dbo->setId(11);
167
 //        }, ['Id']));
167
 //        }, ['Id']));
168
 
168
 
169
 
169
 
170
-        $pdo = TestTableDataAccess::getPdo();
171
-        $pgsql = new PgSqlDataAccess();
170
+//        $pdo = TestTableDataAccess::getPdo();
171
+//        $pgsql = new PgSqlDataAccess();
172
 //        $pgsql->getStoredProceduresFull($pdo);
172
 //        $pgsql->getStoredProceduresFull($pdo);
173
-        var_dump($pgsql->getStoredProceduresFull($pdo));
173
+//        var_dump($pgsql->getStoredProceduresFull($pdo));
174
     }
174
     }
175
 }
175
 }

Loading…
Cancel
Save