Bläddra i källkod

removed dollar from param name

tags/0.1.11
Robin Thoni 8 år sedan
förälder
incheckning
9a31bdaccf
2 ändrade filer med 8 tillägg och 8 borttagningar
  1. 2
    2
      src/Utils/Business/LuDocParser.php
  2. 6
    6
      tests/LuDocParserTest.php

+ 2
- 2
src/Utils/Business/LuDocParser.php Visa fil

@@ -101,11 +101,11 @@ class LuDocParser
101 101
                         $paramMatches = [];
102 102
                         if (preg_match("/([^ ]+) *([^ ]+) *(.*)/", $line, $paramMatches) === 1) {
103 103
                             if ($paramMatches[1][0] == "$") {
104
-                                $currentParam->setName($paramMatches[1]);
104
+                                $currentParam->setName(substr($paramMatches[1], 1, strlen($paramMatches[1]) - 1));
105 105
                                 $currentParam->setType($paramMatches[2]);
106 106
                             }
107 107
                             else {
108
-                                $currentParam->setName($paramMatches[2]);
108
+                                $currentParam->setName(substr($paramMatches[2], 1, strlen($paramMatches[2]) - 1));
109 109
                                 $currentParam->setType($paramMatches[1]);
110 110
                             }
111 111
                             $currentParam->setSummary($paramMatches[3] . "\n");

+ 6
- 6
tests/LuDocParserTest.php Visa fil

@@ -44,9 +44,9 @@ class LuDocParserTest extends \PHPUnit_Framework_TestCase
44 44
         }
45 45
         
46 46
         $expectedParams = [
47
-            ["Name" => '$myvar', "Type" => "MyType", "Summary" => "some doc\n",
47
+            ["Name" => 'myvar', "Type" => "MyType", "Summary" => "some doc\n",
48 48
                 "Constraints" => []],
49
-            ["Name" => '$myvar2', "Type" => "MyType", "Summary" => "some other doc\n",
49
+            ["Name" => 'myvar2', "Type" => "MyType", "Summary" => "some other doc\n",
50 50
                 "Constraints" => []]
51 51
         ];
52 52
         
@@ -70,9 +70,9 @@ class LuDocParserTest extends \PHPUnit_Framework_TestCase
70 70
         }
71 71
 
72 72
         $expectedParams = [
73
-            '$myvar' => ["Name" => '$myvar', "Type" => "MyType", "Summary" => "some doc\n",
73
+            'myvar' => ["Name" => 'myvar', "Type" => "MyType", "Summary" => "some doc\n",
74 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 76
                 "Constraints" => []]
77 77
         ];
78 78
 
@@ -105,9 +105,9 @@ class LuDocParserTest extends \PHPUnit_Framework_TestCase
105 105
         }
106 106
 
107 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 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 111
                 "Constraints" => [
112 112
                     ["Method" => "min", "Arguments" => ["42"]],
113 113
                     ["Method" => "max", "Arguments" => ["42"]],

Laddar…
Avbryt
Spara