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

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

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

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

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

+ 15
- 15
tests/DatabaseTest.php View File

@@ -135,18 +135,18 @@ class DatabaseTest extends \PHPUnit_Framework_TestCase
135 135
 {
136 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 151
 //        $dbo = new TestTableDbo();
152 152
 //        $dbo->setId(11);
@@ -167,9 +167,9 @@ class DatabaseTest extends \PHPUnit_Framework_TestCase
167 167
 //        }, ['Id']));
168 168
 
169 169
 
170
-        $pdo = TestTableDataAccess::getPdo();
171
-        $pgsql = new PgSqlDataAccess();
170
+//        $pdo = TestTableDataAccess::getPdo();
171
+//        $pgsql = new PgSqlDataAccess();
172 172
 //        $pgsql->getStoredProceduresFull($pdo);
173
-        var_dump($pgsql->getStoredProceduresFull($pdo));
173
+//        var_dump($pgsql->getStoredProceduresFull($pdo));
174 174
     }
175 175
 }

Loading…
Cancel
Save