forked from cebe/yii2-openapi
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from siggi-k/openapiSchema
DbModel with openapiSchema
- Loading branch information
Showing
79 changed files
with
564 additions
and
38 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
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,25 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (c) 2018 Carsten Brandt <[email protected]> and contributors | ||
* @license https://github.com/cebe/yii2-openapi/blob/master/LICENSE | ||
*/ | ||
|
||
namespace cebe\yii2openapi\lib\helpers; | ||
|
||
class FormatHelper | ||
{ | ||
/** | ||
* @param string $description | ||
* @param int $spacing | ||
* @return string | ||
*/ | ||
public static function getFormattedDescription(string $description, int $spacing = 1): string | ||
{ | ||
$descriptionArr = explode("\n", trim($description)); | ||
$descriptionArr = array_map(function ($item) { | ||
return $item === '' ? '' : ' ' . $item; | ||
}, $descriptionArr); | ||
return implode("\n".str_repeat(" ", $spacing)."*", $descriptionArr); | ||
} | ||
} |
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
Oops, something went wrong.