Browse Source

PHP 8 + Laravel 8 minimum

shalvah 2 years ago
parent
commit
b9f9fa328f

+ 3 - 4
.github/workflows/run-tests.yml

@@ -2,7 +2,7 @@ name: Tests
 
 on:
   push:
-    branches: [master]
+    branches: [master, v4]
   pull_request:
 
 jobs:
@@ -13,12 +13,11 @@ jobs:
         php:
         - '8.1'
         - '8.0'
-        - '7.4'
         deps:
         - highest
         include:
-          - {php: '7.4', deps: lowest}
-          - {php: '7.4', deps: dingo}
+          - {php: '8.0', deps: lowest}
+          - {php: '8.0', deps: dingo}
 
     name: Tests (PHP ${{ matrix.php }} - ${{ matrix.deps }})
 

+ 12 - 12
composer.json

@@ -16,39 +16,39 @@
     }
   ],
   "require": {
-    "php": ">=7.4",
+    "php": ">=8.0",
     "ext-fileinfo": "*",
     "ext-json": "*",
     "ext-pdo": "*",
     "erusev/parsedown": "1.7.4",
     "fakerphp/faker": "^1.9.1",
-    "illuminate/console": "^6.0|^7.0|^8.0|^9.0",
-    "illuminate/routing": "^6.0|^7.0|^8.0|^9.0",
-    "illuminate/support": "^6.0|^7.0|^8.0|^9.0",
+    "illuminate/console": "^8.0|^9.0",
+    "illuminate/routing": "^8.0|^9.0",
+    "illuminate/support": "^8.0|^9.0",
     "league/flysystem": "^1.1.4|^2.1.1|^3.0",
     "mpociot/reflection-docblock": "^1.0.1",
     "nikic/php-parser": "^4.10",
-    "nunomaduro/collision": "^3.0|^4.0|^5.0|^6.0",
-    "ramsey/uuid": "^3.8|^4.0",
+    "nunomaduro/collision": "^5.10|^6.0",
+    "ramsey/uuid": "^4.2.2",
     "shalvah/clara": "^3.1.0",
     "shalvah/upgrader": "0.*",
     "spatie/data-transfer-object": "^2.6|^3.0",
-    "symfony/var-exporter": "^4.0|^5.0|^6.0",
-    "symfony/yaml": "^4.0|^5.0|^6.0"
+    "symfony/var-exporter": "^5.4|^6.0",
+    "symfony/yaml": "^5.4|^6.0"
   },
   "require-dev": {
     "brianium/paratest": "^6.0",
     "dms/phpunit-arraysubset-asserts": "^0.2.0",
     "laravel/legacy-factories": "^1.3.0",
-    "laravel/lumen-framework": "^6.0|^7.0|^8.0|^9.0",
+    "laravel/lumen-framework": "^8.0|^9.0",
     "league/fractal": "^0.19.0",
     "nikic/fast-route": "^1.3",
-    "orchestra/testbench": "^4.0|^5.0|^6.0|^7.0",
+    "orchestra/testbench": "^6.0|^7.0",
     "pestphp/pest": "^1.21",
     "phpstan/phpstan": "^1.0",
     "phpunit/phpunit": "^9.0|^10.0",
-    "symfony/css-selector": "^5.3|^6.0",
-    "symfony/dom-crawler": "^5.3|^6.0"
+    "symfony/css-selector": "^5.4|^6.0",
+    "symfony/dom-crawler": "^5.4|^6.0"
   },
   "autoload": {
     "psr-4": {

+ 0 - 1
phpstan.neon

@@ -7,7 +7,6 @@ parameters:
         - '#Call to an undefined method Illuminate\\Routing\\Route::versions\(\).#'
         - '#Call to an undefined method Illuminate\\Contracts\\Validation\\Validator::getRules\(\).#'
         - '#Call to an undefined method ReflectionType::getName\(\).#'
-        - '#(.*)NunoMaduro\\Collision(.*)#'
         - '#.+Dingo.+#'
         - '#Call to an undefined method Illuminate\\Contracts\\Filesystem\\Filesystem::path\(\)#'
         - '#Access to an undefined property Illuminate\\Support\\HigherOrderCollectionProxy#'

+ 0 - 7
src/Commands/GenerateDocumentation.php

@@ -37,13 +37,6 @@ class GenerateDocumentation extends Command
 
     protected string $configName;
 
-    public function newLine($count = 1)
-    {
-        // TODO Remove when Laravel 6 is no longer supported
-        $this->getOutput()->write(str_repeat("\n", $count));
-        return $this;
-    }
-
     public function handle(RouteMatcherInterface $routeMatcher, GroupedEndpointsFactory $groupedEndpointsFactory): void
     {
         $this->bootstrap();

+ 0 - 7
src/Commands/Upgrade.php

@@ -11,13 +11,6 @@ class Upgrade extends Command
 
     protected $description = '';
 
-    public function newLine($count = 1)
-    {
-        // TODO Remove when Laravel 6 is no longer supported
-        $this->getOutput()->write(str_repeat("\n", $count));
-        return $this;
-    }
-
     public function handle(): void
     {
         $oldConfig = config('scribe');

+ 1 - 7
src/Tools/ErrorHandlingUtils.php

@@ -31,13 +31,7 @@ class ErrorHandlingUtils
     public static function dumpException(\Throwable $e): void
     {
         $output = new ConsoleOutput(OutputInterface::VERBOSITY_VERBOSE);
-        try {
-            $handler = new \NunoMaduro\Collision\Handler(new \NunoMaduro\Collision\Writer(null, $output));
-        } catch (\Throwable $error) {
-            // Version 3 used a different API
-            // todo remove when Laravel 7 is minimum supported
-            $handler = new \NunoMaduro\Collision\Handler(new \NunoMaduro\Collision\Writer($output));
-        }
+        $handler = new \NunoMaduro\Collision\Handler(new \NunoMaduro\Collision\Writer(null, $output));
         $handler->setInspector(new \Whoops\Exception\Inspector($e));
         $handler->setException($e);
         $handler->handle();

+ 1 - 1
src/Tools/Globals.php

@@ -4,7 +4,7 @@ namespace Knuckles\Scribe\Tools;
 
 class Globals
 {
-    public const SCRIBE_VERSION = '3.32.0';
+    public const SCRIBE_VERSION = '4.x-dev';
 
     public static bool $shouldBeVerbose = false;