-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#171. Add Documentation abstract class + interface + refactoring
- Loading branch information
1 parent
ef6ea7b
commit 323b625
Showing
5 changed files
with
114 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
namespace SoliDry\Blocks; | ||
|
||
use SoliDry\ApiGenerator; | ||
use SoliDry\Controllers\BaseCommand; | ||
use SoliDry\Helpers\Classes; | ||
use SoliDry\Types\DefaultInterface; | ||
|
||
/** | ||
* Class Documentation | ||
* | ||
* @package SoliDry\Blocks | ||
* | ||
* @property BaseCommand generator | ||
*/ | ||
abstract class Documentation | ||
{ | ||
use ContentManager; | ||
|
||
protected $generator; | ||
protected $sourceCode = ''; | ||
protected $className; | ||
|
||
/** | ||
* Controllers constructor. | ||
* | ||
* @param ApiGenerator $generator | ||
*/ | ||
public function __construct($generator) | ||
{ | ||
$this->generator = $generator; | ||
$this->className = Classes::getClassName($this->generator->objectName); | ||
} | ||
|
||
protected function setDefaultDocs() | ||
{ | ||
$this->setComment(DefaultInterface::METHOD_START); | ||
|
||
|
||
|
||
$this->setComment(DefaultInterface::METHOD_END); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace SoliDry\Types; | ||
|
||
|
||
interface DocumentationInterface | ||
{ | ||
|
||
public const OA_INFO = '@OA\Info'; | ||
public const OA_GET = '@OA\Get'; | ||
public const OA_POST = '@OA\Post'; | ||
public const OA_PATCH = '@OA\Patch'; | ||
public const OA_DELETE = '@OA\Delete'; | ||
|
||
|
||
public const OA_PARAMETER = '@OA\Parameter'; | ||
public const OA_SCHEMA = '@OA\Schema'; | ||
public const OA_REQUEST_BODY = '@OA\RequestBody'; | ||
public const OA_RESPONSE = '@OA\Response'; | ||
|
||
public const PATH = 'path'; | ||
public const SUMMARY = 'summary'; | ||
public const TAGS = 'tags'; | ||
public const DESCRIPTION = 'description'; | ||
public const RESPONSE = 'response'; | ||
public const IN = 'in'; | ||
public const NAME = 'name'; | ||
public const REQUIRED = 'required'; | ||
} |