Skip to content

Commit

Permalink
Merge 61471c1 into 0b1c3f5
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkaOnLine committed Feb 15, 2023
2 parents 0b1c3f5 + 61471c1 commit 5e20cdd
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
@@ -1,7 +1,7 @@
#
# Base install
#
FROM amd64/php:8.0-apache as base
FROM amd64/php:8.1-apache as base

LABEL vendor="L5 Swagger"

Expand Down
8 changes: 4 additions & 4 deletions composer.json
Expand Up @@ -20,16 +20,16 @@
],
"require": {
"php": "^7.2 || ^8.0",
"laravel/framework": "^9.0 || >=8.40.0 || ^7.0",
"zircote/swagger-php": "^3.2 || ^4.0",
"laravel/framework": "^10.0 || ^9.0 || >=8.40.0 || ^7.0",
"zircote/swagger-php": "^3.2.0 || ^4.0.0",
"swagger-api/swagger-ui": "^3.0 || ^4.0",
"symfony/yaml": "^5.0 || ^6.0",
"ext-json": "*"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"phpunit/phpunit": "^10.0 || ^9.5",
"mockery/mockery": "1.*",
"orchestra/testbench": "7.* || ^6.15 || 5.*",
"orchestra/testbench": "^8.0 || 7.* || ^6.15 || 5.*",
"php-coveralls/php-coveralls": "^2.0"
},
"autoload": {
Expand Down
15 changes: 7 additions & 8 deletions phpunit.xml
@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnFailure="false"
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
stopOnFailure="false"
cacheDirectory=".phpunit.cache"
>
<coverage>
<include>
Expand Down
10 changes: 6 additions & 4 deletions src/Generator.php
Expand Up @@ -202,10 +202,12 @@ protected function createOpenApiGenerator(): OpenApiGenerator
{
$generator = new OpenApiGenerator();

// OpenApi spec version.
$generator->setVersion(
$this->scanOptions['open_api_spec_version'] ?? self::OPEN_API_DEFAULT_SPEC_VERSION
);
// OpenApi spec version - only from zircote/swagger-php 4
if (method_exists($generator, 'setVersion')) {
$generator->setVersion(
$this->scanOptions['open_api_spec_version'] ?? self::OPEN_API_DEFAULT_SPEC_VERSION
);
}

// Processors.
$this->setProcessors($generator);
Expand Down
2 changes: 1 addition & 1 deletion tests/ConfigFactoryTest.php
Expand Up @@ -57,7 +57,7 @@ public function canMergeConfigurationDeep(array $data, array $assert): void
$this->assertArraySimilar($config, $assert);
}

public function configDataProvider(): array
public static function configDataProvider(): array
{
return [
[
Expand Down
4 changes: 3 additions & 1 deletion tests/ConsoleTest.php
Expand Up @@ -2,6 +2,7 @@

namespace Tests;

use Illuminate\Contracts\Filesystem\FileNotFoundException;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Facades\Artisan;
use L5Swagger\Exceptions\L5SwaggerException;
Expand All @@ -18,6 +19,7 @@ class ConsoleTest extends TestCase
* @param string $artisanCommand
*
* @throws L5SwaggerException
* @throws FileNotFoundException
*/
public function canGenerate(string $artisanCommand): void
{
Expand All @@ -38,7 +40,7 @@ public function canGenerate(string $artisanCommand): void
/**
* @return iterable
*/
public function provideGenerateCommands(): iterable
public static function provideGenerateCommands(): iterable
{
yield 'default' => [
'artisanCommand' => 'l5-swagger:generate',
Expand Down
2 changes: 1 addition & 1 deletion tests/SecurityDefinitionsTest.php
Expand Up @@ -97,7 +97,7 @@ public function canGenerateApiJsonFileWithSecurityDefinition(
/**
* @return iterable
*/
public function provideConfigAndSchemes(): iterable
public static function provideConfigAndSchemes(): iterable
{
$securitySchemes = [
'new_api_key_securitye' => [
Expand Down

0 comments on commit 5e20cdd

Please sign in to comment.