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

Allow any version yii2 #14

Merged
merged 3 commits into from
Jan 20, 2024
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
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:

strategy:
matrix:
branch: ['2.0.49', '^2.2.x-dev']
os: [ubuntu-latest]
php: ['8.1', '8.2', '8.3']

Expand All @@ -54,7 +55,7 @@ jobs:
ini-values: date.timezone='UTC', session.save_path="${{ runner.temp }}"

- name: Install dependencies with composer.
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
run: composer require yiisoft/yii2:${{ matrix.branch }} --prefer-dist --no-progress --no-interaction --no-scripts --ansi

- name: Load database data.
env:
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,12 @@
<a href="https://github.com/yii2-extensions/gii/actions/workflows/build.yml" target="_blank">
<img src="https://github.com/yii2-extensions/gii/actions/workflows/build.yml/badge.svg" alt="PHPUnit">
</a>
<a href="https://github.com/yii2-extensions/gii/actions/workflows/compatibility.yml" target="_blank">
<img src="https://github.com/yii2-extensions/gii/actions/workflows/compatibility.yml/badge.svg" alt="Compatibility">
</a>
<a href="https://codecov.io/gh/yii2-extensions/gii" target="_blank">
<img src="https://codecov.io/gh/yii2-extensions/gii/branch/main/graph/badge.svg?token=MF0XUGVLYC" alt="Codecov">
</a>
<a href="https://github.com/yii2-extensions/gii/actions/workflows/static.yml" target="_blank">
<img src="https://github.com/yii2-extensions/gii/actions/workflows/static.yml/badge.svg" alt="PHPStan">
</a>
<a href="https://github.com/yii2-extensions/gii/actions/workflows/static.yml" target="_blank">
<img src="https://img.shields.io/badge/PHPStan%20level-2-blue" alt="PHPStan level">
</a>
<a href="https://github.styleci.io/repos/698630757?branch=main" target="_blank">
<img src="https://github.styleci.io/repos/698630757/shield?branch=main" alt="Code style">
</a>
</a>
</p>

## Installation
Expand Down Expand Up @@ -138,6 +132,12 @@ return [

[Check the documentation testing](/docs/testing.md) to learn about testing.

## Quality code

[![static-analysis](https://github.com/yii2-extensions/gii/actions/workflows/static.yml/badge.svg)](https://github.com/yii2-extensions/gii/actions/workflows/static.yml)
[![phpstan-level](https://img.shields.io/badge/PHPStan%20level-2-blue)](https://github.com/yii2-extensions/gii/actions/workflows/static.yml)
[![StyleCI](https://github.styleci.io/repos/698630757/shield?branch=main)](https://github.styleci.io/repos/698630757?branch=main)

## Our social networks

[![Twitter](https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter&logoColor=1DA1F2&labelColor=555555?style=flat)](https://twitter.com/Terabytesoftw)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"php": ">=8.1",
"ext-ctype": "*",
"phpspec/php-diff": "^1.1",
"yiisoft/yii2": "^2.2"
"yiisoft/yii2": "*"
},
"require-dev": {
"maglnet/composer-require-checker": "^4.6",
Expand Down
2 changes: 1 addition & 1 deletion src/generators/controller/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,6 @@ public function getViewFile($action)
public function getControllerNamespace()
{
$name = StringHelper::basename($this->controllerClass);
return ltrim(substr($this->controllerClass, 0, - (strlen($name) + 1)), '\\');
return ltrim(substr($this->controllerClass, 0, -(strlen($name) + 1)), '\\');
}
}
2 changes: 1 addition & 1 deletion src/generators/extension/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
*/
public function successMessage()
{
$outputPath = realpath(\Yii::getAlias($this->outputPath));
$outputPath = realpath(Yii::getAlias($this->outputPath));

Check warning on line 140 in src/generators/extension/Generator.php

View check run for this annotation

Codecov / codecov/patch

src/generators/extension/Generator.php#L140

Added line #L140 was not covered by tests
$output1 = <<<EOD
<p><em>The extension has been generated successfully.</em></p>
<p>To enable it in your application, you need to create a git repository
Expand Down