Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support yiisoft/assets version of ^5.0 #109

Merged
merged 5 commits into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 2.1.2 under development

- Enh #109: Add support `yiisoft/assets` version of `^5.0` (@vjik)
- Enh #110: Raise the minimum PHP version to 8.1 and minor refactoring (@vjik)

## 2.1.1 September 04, 2024
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"swagger-api/swagger-ui": "^4.1|^5.0",
"yiisoft/aliases": "^1.1|^2.0|^3.0",
"yiisoft/arrays": "^3.0",
"yiisoft/assets": "^2.0|^3.0|^4.0",
"yiisoft/assets": "^2.0|^3.0|^4.0|^5.0",
"yiisoft/cache": "^1.0|^2.0|^3.0",
"yiisoft/data-response": "^1.0|^2.0",
"yiisoft/html": "^3.0",
Expand Down
12 changes: 12 additions & 0 deletions src/Asset/SwaggerUiAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,28 @@
namespace Yiisoft\Swagger\Asset;

use Yiisoft\Assets\AssetBundle;
use Yiisoft\Assets\AssetManager;

/**
* @psalm-import-type CssFile from AssetManager
* @psalm-import-type JsFile from AssetManager
*/
final class SwaggerUiAsset extends AssetBundle
{
public ?string $basePath = '@assets';

public ?string $baseUrl = '@assetsUrl';

/**
* @psalm-var array<string|CssFile>
*/
public array $css = [
'swagger-ui.css',
];

/**
* @psalm-var array<string|JsFile>
*/
public array $js = [
'swagger-ui-bundle.js',
'swagger-ui-standalone-preset.js',
Expand Down
Loading