Skip to content

Commit

Permalink
Raise minimum PHP requirements to ^8.0 and yiisoft/aliasess to ^2.0 +…
Browse files Browse the repository at this point in the history
… Fix psalm errors (#172)
  • Loading branch information
vjik authored Jul 1, 2021
1 parent 431e3d4 commit 1cd77e2
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 54 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2
10 changes: 3 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
- windows-latest

php:
- "7.4"
- "8.0"

steps:
Expand Down Expand Up @@ -51,15 +50,12 @@ jobs:
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-composer-
- name: Update composer
run: composer self-update

- name: Install dependencies with composer php 7.4
if: matrix.php == '7.4'
- name: Install dependencies with composer
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Install dependencies with composer php 8.0
if: matrix.php == '8.0'
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ignore-platform-reqs --ansi

- name: Run tests with codeception
run: |
php -S 127.0.0.1:8080 -t public > ./runtime/yii.log 2>&1 &
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
- ubuntu-latest

php:
- "7.4"
- "8.0"

steps:
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
Expand Down
72 changes: 36 additions & 36 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
checks:
php: true
php: true

filter:
paths:
- "src/*"
excluded_paths:
- "src/ApplicationRunner.php"
- "src/Installer.php"
paths:
- "src/*"
excluded_paths:
- "src/ApplicationRunner.php"
- "src/Installer.php"

build:
nodes:
analysis:
environment:
php: 7.4.12

tests:
override:
- php-scrutinizer-run

tests-and-coverage:
environment:
php: 7.4.12

dependencies:
override:
- composer self-update
- composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

tests:
override:
-
command: |
php -S 127.0.0.1:8080 -t public public/index-test.php > ./runtime/yii.log 2>&1 &
vendor/bin/codecept run --coverage-xml
on_node: 1
coverage:
file: runtime/tests/_output/coverage.xml
format: php-clover


nodes:
analysis:
environment:
php: 8.0.6

tests:
override:
- php-scrutinizer-run

tests-and-coverage:
environment:
php:
version: 8.0.6
ini:
xdebug.mode: coverage

dependencies:
override:
- composer self-update
- composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

tests:
override:
- command: |
php -S 127.0.0.1:8080 -t public public/index-test.php > ./runtime/yii.log 2>&1 &
vendor/bin/codecept run --coverage-xml
on_node: 1
coverage:
file: runtime/tests/_output/coverage.xml
format: php-clover
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ Yii application template for Yii 3 is best for rapidly creating projects.

## Requirements

The minimum requirement by this project template that your Web server supports PHP 7.4.0.
The minimum requirement by this project template that your Web server supports PHP 8.0.

## Installation

You'll need at least PHP 7.4.
You'll need at least PHP 8.0.

If you do not have [Composer](http://getcomposer.org/), you may install it by following the instructions
at [getcomposer.org](http://getcomposer.org/doc/00-intro.md).
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
]
},
"require": {
"php": "^7.4|^8.0",
"php": "^8.0",
"httpsoft/http-message": "^1.0.5",
"psr/container": "^1.0",
"psr/http-message": "^1.0",
"psr/http-server-handler": "^1.0",
"symfony/console": "^5.3",
"yiisoft/aliases": "^1.1|^2.0",
"yiisoft/aliases": "^2.0",
"yiisoft/assets": "^1.0",
"yiisoft/cache": "^1.0",
"yiisoft/cache-file": "^1.0",
Expand Down
3 changes: 0 additions & 3 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
>
<projectFiles>
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
</psalm>

1 change: 1 addition & 0 deletions src/ApplicationRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public function run(): void
// Register error handler with real container-configured dependencies.
$this->registerErrorHandler($container->get(ErrorHandler::class), $errorHandler);

/** @var Container */
$container = $container->get(ContainerInterface::class);

if ($this->debug) {
Expand Down
4 changes: 2 additions & 2 deletions src/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace App;

use Composer\Script\Event;
use FilesystemIterator as FSIterator;
use RecursiveDirectoryIterator as DirIterator;
use RecursiveIteratorIterator as RIterator;
Expand All @@ -14,7 +13,7 @@ final class Installer
/**
* @psalm-suppress UndefinedClass
*/
public static function postUpdate(Event $event = null): void
public static function postUpdate(): void
{
self::chmodRecursive('runtime', 0777);
self::chmodRecursive('public/assets', 0777);
Expand All @@ -24,6 +23,7 @@ private static function chmodRecursive(string $path, int $mode): void
{
chmod($path, $mode);

/** @psalm-var iterable<array-key, string> $iterator */
$iterator = new RIterator(
new DirIterator($path, FSIterator::SKIP_DOTS | FSIterator::CURRENT_AS_PATHNAME),
RIterator::SELF_FIRST
Expand Down

0 comments on commit 1cd77e2

Please sign in to comment.