Browse Source

removed dollar from param name

tags/0.1.11
Robin Thoni 8 years ago
parent
commit
9a31bdaccf
2 changed files with 8 additions and 8 deletions
  1. 2
    2
      src/Utils/Business/LuDocParser.php
  2. 6
    6
      tests/LuDocParserTest.php

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

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($paramMatches[1]);
104
+                                $currentParam->setName(substr($paramMatches[1], 1, strlen($paramMatches[1]) - 1));
105
                                 $currentParam->setType($paramMatches[2]);
105
                                 $currentParam->setType($paramMatches[2]);
106
                             }
106
                             }
107
                             else {
107
                             else {
108
-                                $currentParam->setName($paramMatches[2]);
108
+                                $currentParam->setName(substr($paramMatches[2], 1, strlen($paramMatches[2]) - 1));
109
                                 $currentParam->setType($paramMatches[1]);
109
                                 $currentParam->setType($paramMatches[1]);
110
                             }
110
                             }
111
                             $currentParam->setSummary($paramMatches[3] . "\n");
111
                             $currentParam->setSummary($paramMatches[3] . "\n");

+ 6
- 6
tests/LuDocParserTest.php View File

44
         }
44
         }
45
         
45
         
46
         $expectedParams = [
46
         $expectedParams = [
47
-            ["Name" => '$myvar', "Type" => "MyType", "Summary" => "some doc\n",
47
+            ["Name" => 'myvar', "Type" => "MyType", "Summary" => "some doc\n",
48
                 "Constraints" => []],
48
                 "Constraints" => []],
49
-            ["Name" => '$myvar2', "Type" => "MyType", "Summary" => "some other doc\n",
49
+            ["Name" => 'myvar2', "Type" => "MyType", "Summary" => "some other doc\n",
50
                 "Constraints" => []]
50
                 "Constraints" => []]
51
         ];
51
         ];
52
         
52
         
70
         }
70
         }
71
 
71
 
72
         $expectedParams = [
72
         $expectedParams = [
73
-            '$myvar' => ["Name" => '$myvar', "Type" => "MyType", "Summary" => "some doc\n",
73
+            'myvar' => ["Name" => 'myvar', "Type" => "MyType", "Summary" => "some doc\n",
74
                 "Constraints" => []],
74
                 "Constraints" => []],
75
-            '$myvar2' => ["Name" => '$myvar2', "Type" => "MyType", "Summary" => "some other doc\non another line\n",
75
+            'myvar2' => ["Name" => 'myvar2', "Type" => "MyType", "Summary" => "some other doc\non another line\n",
76
                 "Constraints" => []]
76
                 "Constraints" => []]
77
         ];
77
         ];
78
 
78
 
105
         }
105
         }
106
 
106
 
107
         $expectedParams = [
107
         $expectedParams = [
108
-            '$myvar' => ["Name" => '$myvar', "Type" => "MyType", "Summary" => "some doc\nToo much doc\n",
108
+            'myvar' => ["Name" => 'myvar', "Type" => "MyType", "Summary" => "some doc\nToo much doc\n",
109
                 "Constraints" => []],
109
                 "Constraints" => []],
110
-            '$myvar2' => ["Name" => '$myvar2', "Type" => "MyType", "Summary" => "some other doc\non another line\nand another\n",
110
+            'myvar2' => ["Name" => 'myvar2', "Type" => "MyType", "Summary" => "some other doc\non another line\nand another\n",
111
                 "Constraints" => [
111
                 "Constraints" => [
112
                     ["Method" => "min", "Arguments" => ["42"]],
112
                     ["Method" => "min", "Arguments" => ["42"]],
113
                     ["Method" => "max", "Arguments" => ["42"]],
113
                     ["Method" => "max", "Arguments" => ["42"]],

Loading…
Cancel
Save