Skip to content

Commit 31afd83

Browse files
committed
refactor: rename Interfaces syntax to Contracts
1 parent 546d88d commit 31afd83

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

MIGRATION-GUIDES.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ The base namespace of the package had also been changed, so you need to use new
1010
- `tests/TestCase.php`, change namespace of `\RonasIT\Support\AutoDoc\Tests\AutoDocTestCaseTrait` to
1111
`\RonasIT\AutoDoc\Traits\AutoDocTestCaseTrait`;
1212
- `phpunit.xml`, change namespace of extension from `RonasIT\Support\AutoDoc\Tests\PhpUnitExtensions\SwaggerExtension` to
13-
`RonasIT\AutoDoc\Support\PHPUnit\Extensions\SwaggerExtension`
13+
`RonasIT\AutoDoc\Support\PHPUnit\Extensions\SwaggerExtension`;
14+
- your custom documentation drivers, change interface from `RonasIT\AutoDoc\Interfaces\SwaggerDriverInterface` to
15+
`RonasIT\AutoDoc\Contracts\SwaggerDriverContract`.

config/auto-doc.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
|
111111
| The name of driver, which will collect and save documentation
112112
| Feel free to use your own driver class which should be inherited from
113-
| `RonasIT\AutoDoc\Interfaces\SwaggerDriverInterface` interface,
113+
| `RonasIT\AutoDoc\Contracts\SwaggerDriverContract` interface,
114114
| or one of our drivers from the `drivers` config:
115115
*/
116116
'driver' => env('SWAGGER_DRIVER', 'local'),

src/Interfaces/SwaggerDriverInterface.php renamed to src/Contracts/SwaggerDriverContract.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
namespace RonasIT\AutoDoc\Interfaces;
3+
namespace RonasIT\AutoDoc\Contracts;
44

5-
interface SwaggerDriverInterface
5+
interface SwaggerDriverContract
66
{
77
/**
88
* Save temporary data

src/Drivers/BaseDriver.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace RonasIT\AutoDoc\Drivers;
44

5-
use RonasIT\AutoDoc\Interfaces\SwaggerDriverInterface;
5+
use RonasIT\AutoDoc\Contracts\SwaggerDriverContract;
66

7-
abstract class BaseDriver implements SwaggerDriverInterface
7+
abstract class BaseDriver implements SwaggerDriverContract
88
{
99
protected string $tempFilePath;
1010

src/Services/SwaggerService.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
use RonasIT\AutoDoc\Exceptions\SwaggerDriverClassNotFoundException;
1818
use RonasIT\AutoDoc\Exceptions\UnsupportedDocumentationViewerException;
1919
use RonasIT\AutoDoc\Exceptions\WrongSecurityConfigException;
20-
use RonasIT\AutoDoc\Interfaces\SwaggerDriverInterface;
20+
use RonasIT\AutoDoc\Contracts\SwaggerDriverContract;
2121
use RonasIT\AutoDoc\Traits\GetDependenciesTrait;
2222
use RonasIT\AutoDoc\Validators\SwaggerSpecValidator;
2323
use Symfony\Component\HttpFoundation\Response;
2424

2525
/**
26-
* @property SwaggerDriverInterface $driver
26+
* @property SwaggerDriverContract $driver
2727
*/
2828
class SwaggerService
2929
{
@@ -124,7 +124,7 @@ protected function setDriver()
124124
$this->driver = app($className);
125125
}
126126

127-
if (!$this->driver instanceof SwaggerDriverInterface) {
127+
if (!$this->driver instanceof SwaggerDriverContract) {
128128
throw new InvalidDriverClassException($driver);
129129
}
130130
}

0 commit comments

Comments
 (0)