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 #13 remote-tracking branch 'php-openapi/144-methods-naming-for-…
…non-crud-actions' * php-openapi/144-methods-naming-for-non-crud-actions: Refactor Remove TODO Refactor and add docs Add more concrete tests Complete the test Fix failing tests Add fix & test for cebe#84 Add docs about URL rules config Add docs Add more tests Fix bug Fix style Fix failing test Fix bug - WIP Fix this issue Fix issue in generated url rule config Fix issue: `actionCreateinvoicePayment` instead of `actionCreateInvoicePayment` Initial commit to create this PR
- Loading branch information
Showing
35 changed files
with
921 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
<?php | ||
|
||
use yii\helpers\VarDumper; | ||
|
||
?> | ||
<?= '<?php' ?> | ||
|
||
/** | ||
* OpenAPI UrlRules | ||
* | ||
* This file is auto generated. | ||
*/ | ||
<?php $rules = \yii\helpers\VarDumper::export($urls);?> | ||
<?php /** @var array $urls */ | ||
$rules = VarDumper::export($urls); ?> | ||
return <?= str_replace('\\\\', '\\', $rules); ?>; |
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
25 changes: 25 additions & 0 deletions
25
tests/specs/issue_fix/144_methods_naming_for_non_crud_actions/app/config/urls.rest.php
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 | ||
/** | ||
* OpenAPI UrlRules | ||
* | ||
* This file is auto generated. | ||
*/ | ||
return [ | ||
'GET fruit/mango' => 'fruits/mango', | ||
'GET fruits/mango' => 'fruit/mango', | ||
'POST fruits/mango' => 'fruit/create-mango', | ||
'GET animal/goat' => 'animal/goat', | ||
'POST animal/goat' => 'animal/create-goat', | ||
'POST payments/invoice/<invoice:\d+>' => 'payments/invoice', | ||
'GET payments/invoice-payment' => 'payment/invoice-payment', | ||
'GET a1/b1' => 'abc/xyz', | ||
'POST a1/b1' => 'abc/xyz', | ||
'GET aa2/bb2' => 'payments/xyz2', | ||
'fruit/mango' => 'fruits/options', | ||
'fruits/mango' => 'fruit/options', | ||
'animal/goat' => 'animal/options', | ||
'payments/invoice/<invoice:\d+>' => 'payments/options', | ||
'payments/invoice-payment' => 'payment/options', | ||
'a1/b1' => 'abc/options', | ||
'aa2/bb2' => 'payments/options', | ||
]; |
20 changes: 20 additions & 0 deletions
20
...specs/issue_fix/144_methods_naming_for_non_crud_actions/app/controllers/AbcController.php
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,20 @@ | ||
<?php | ||
|
||
namespace app\controllers; | ||
|
||
class AbcController extends \app\controllers\base\AbcController | ||
{ | ||
|
||
public function checkAccess($action, $model = null, $params = []) | ||
{ | ||
//TODO implement checkAccess | ||
} | ||
|
||
public function actionXyz() | ||
{ | ||
//TODO implement actionXyz | ||
} | ||
|
||
|
||
} | ||
|
25 changes: 25 additions & 0 deletions
25
...cs/issue_fix/144_methods_naming_for_non_crud_actions/app/controllers/AnimalController.php
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 | ||
|
||
namespace app\controllers; | ||
|
||
class AnimalController extends \app\controllers\base\AnimalController | ||
{ | ||
|
||
public function checkAccess($action, $model = null, $params = []) | ||
{ | ||
//TODO implement checkAccess | ||
} | ||
|
||
public function actionGoat() | ||
{ | ||
//TODO implement actionGoat | ||
} | ||
|
||
public function actionCreateGoat() | ||
{ | ||
//TODO implement actionCreateGoat | ||
} | ||
|
||
|
||
} | ||
|
Oops, something went wrong.