Skip to content

Commit

Permalink
Upgrade to support Laravel 10
Browse files Browse the repository at this point in the history
* L10 Upgrade
* Add return types and hinting.
* Modernize php language norms.
* No change to output / functionality.
  • Loading branch information
robertmarney authored Feb 18, 2023
1 parent 76ad48a commit b19da2b
Show file tree
Hide file tree
Showing 14 changed files with 255 additions and 266 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [8.2, 8.1, 8.0]
php: [8.2, 8.1]
laravel: [10.*, 9.*]
dependency-version: [prefer-lowest, prefer-stable]
include:
Expand All @@ -19,7 +19,8 @@ jobs:
testbench: 7.*
exclude:
- laravel: 10.*
php: 8.0
php: 8.0.2


name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ composer.lock
.DS_Store
.idea
.phpunit.*
/build
1 change: 1 addition & 0 deletions build/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
19 changes: 13 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,22 @@
}
],
"require": {
"php": "^7.2|^8.0.2|^8.1",
"illuminate/support": "~5.5.0|~5.6.0|~5.7.0|~5.8.0|^6.0|^7.0|^8.0|^9.0|^10.0"
"php": "^8.0.2|^8.1|^8.2",
"illuminate/support": "^8.0|^9.0|^10.0"
},
"require-dev": {
"mockery/mockery": "^1.0.0",
"illuminate/filesystem": "~5.5.0|~5.6.0|~5.7.0|~5.8.0|^6.0|^7.0|^8.0|^9.0|^10.0",
"laravel/framework": "~5.5.0|~5.6.0|~5.7.0|~5.8.0|^6.0|^7.0|^8.0|^9.0|^10.0",
"illuminate/filesystem": "^8.0|^9.0|^10.0",
"laravel/framework": "^8.0|^9.0|^10.0",
"laravel/pint": "^1.0",
"mockery/mockery": "^1.0.0",
"nunomaduro/collision": "^6.0",
"nunomaduro/larastan": "^2.0.1",
"orchestra/testbench": "^7.0|^8.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^9.5"
"phpunit/phpunit": "^9.5",
"rector/rector": "^0.15.17"
},
"autoload": {
"psr-0": {
Expand All @@ -39,6 +40,12 @@
"Orangehill\\Iseed\\Tests\\": "tests"
}
},
"scripts": {
"analyse": "vendor/bin/phpstan analyse",
"test": "vendor/bin/phpunit",
"test-coverage": "vendor/bin/phpunit --coverage",
"format": "vendor/bin/pint"
},
"extra": {
"laravel": {
"providers": [
Expand Down
Empty file added phpstan-baseline.neon
Empty file.
12 changes: 12 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
includes:
- phpstan-baseline.neon

parameters:
level: 4
paths:
- src
tmpDir: build/phpstan
checkOctaneCompatibility: true
checkModelProperties: true
checkMissingIterableValueType: false

31 changes: 31 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);

use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\CodeQuality\Rector\ClassMethod\ReturnTypeFromStrictScalarReturnExprRector;
use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictNativeCallRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
__DIR__.'/src',
__DIR__.'/tests',
]);

// register a single rule
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);

$rectorConfig->rules([
ReturnTypeFromStrictNativeCallRector::class,
ReturnTypeFromStrictScalarReturnExprRector::class,
Rector\DeadCode\Rector\Cast\RecastingRemovalRector::class,
Rector\DeadCode\Rector\If_\RemoveAlwaysTrueIfConditionRector::class,
]);

// define sets of rules
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_81,
]);
};
3 changes: 1 addition & 2 deletions src/Orangehill/Iseed/Exceptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

class TableNotFoundException extends \RuntimeException
{

}
}
3 changes: 1 addition & 2 deletions src/Orangehill/Iseed/Facades/Iseed.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class Iseed extends Facade
{

/**
* Get the registered name of the component.
*
Expand All @@ -16,4 +15,4 @@ protected static function getFacadeAccessor()
{
return 'iseed';
}
}
}
Loading

0 comments on commit b19da2b

Please sign in to comment.