Skip to content

Commit

Permalink
Stable release
Browse files Browse the repository at this point in the history
Fixed a glitch generating swagger documentation
  • Loading branch information
andrevanzuydam committed Mar 24, 2019
1 parent 77f5a8f commit 0d5c77e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Tina4/Routing.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php
/**
* Created by PhpStorm.
* User: Andre van Zuydam
* Date: 2016/02/09
* Time: 02:02 PM
* Purpose: Determine routing responses and data outputs based on the URL sent from the system
* You are welcome to read and modify this code but it should not be broken, if you find something to improve it, send me an email with the patch
* [email protected]
*/
* Created by PhpStorm.
* User: Andre van Zuydam
* Date: 2016/02/09
* Time: 02:02 PM
* Purpose: Determine routing responses and data outputs based on the URL sent from the system
* You are welcome to read and modify this code but it should not be broken, if you find something to improve it, send me an email with the patch
* [email protected]
*/
namespace Tina4;

class Routing
Expand Down Expand Up @@ -273,7 +273,7 @@ function getSwagger($title = "Tina4", $description = "Swagger Documentation", $v
$method = strtolower($route["method"]);
//echo $method;

$reflection = new ReflectionFunction($route["function"]);
$reflection = new \ReflectionFunction($route["function"]);
$doc = $reflection->getDocComment();
preg_match_all('#@(.*?)\n#s', $doc, $annotations);

Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ The following steps will establish the automated Swagger annotation
```php
<?php
use Tina4\Get;
use Tina4\Routing;
//A swagger endpoint for annotating your API end points
Get::add('/swagger/json.json', function($response) {
return $response ( (new Routing())->getSwagger("Some Name for the Swagger","Some other description","1.0.0"));
Expand Down

0 comments on commit 0d5c77e

Please sign in to comment.