Removed support for Laravel 8 and therefore for PHP < 8.0 (#1504)

* Removed support for Laravel 8 and therefore for PHP < 8.0

* Update php-cs-fixer to v3

* composer fix-style
This commit is contained in:
Markus Podar
2024-02-05 13:25:08 +01:00
committed by GitHub
parent 485c756f6c
commit a8b34ad228
27 changed files with 63 additions and 242 deletions
+2 -2
View File
@@ -329,7 +329,7 @@ class Alias
continue;
}
$method = new \ReflectionMethod($className, $name);
$class = new \ReflectionClass($className);
$class = new ReflectionClass($className);
if (!in_array($magic, $this->usedMethods)) {
if ($class !== $this->root) {
@@ -348,7 +348,7 @@ class Alias
protected function detectMethods()
{
foreach ($this->classes as $class) {
$reflection = new \ReflectionClass($class);
$reflection = new ReflectionClass($class);
$methods = $reflection->getMethods(\ReflectionMethod::IS_PUBLIC);
if ($methods) {
+2 -2
View File
@@ -42,7 +42,7 @@ class GeneratorCommand extends Command
/** @var \Illuminate\Config\Repository */
protected $config;
/** @var \Illuminate\Filesystem\Filesystem */
/** @var Filesystem */
protected $files;
/** @var \Illuminate\View\Factory */
@@ -54,7 +54,7 @@ class GeneratorCommand extends Command
/**
*
* @param \Illuminate\Config\Repository $config
* @param \Illuminate\Filesystem\Filesystem $files
* @param Filesystem $files
* @param \Illuminate\View\Factory $view
*/
public function __construct(
+12 -16
View File
@@ -354,7 +354,7 @@ class ModelsCommand extends Command
/**
* cast the properties's type from $casts.
*
* @param \Illuminate\Database\Eloquent\Model $model
* @param Model $model
*/
public function castPropertiesType($model)
{
@@ -498,7 +498,7 @@ class ModelsCommand extends Command
/**
* Load the properties from the database table.
*
* @param \Illuminate\Database\Eloquent\Model $model
* @param Model $model
*
* @throws DBALException If custom field failed to register
*/
@@ -602,7 +602,7 @@ class ModelsCommand extends Command
}
/**
* @param \Illuminate\Database\Eloquent\Model $model
* @param Model $model
*/
public function getPropertiesFromMethods($model)
{
@@ -777,7 +777,7 @@ class ModelsCommand extends Command
'int|null',
true,
false
// What kind of comments should be added to the relation count here?
// What kind of comments should be added to the relation count here?
);
}
} elseif (
@@ -1126,7 +1126,7 @@ class ModelsCommand extends Command
return '\Illuminate\Database\Eloquent\Collection';
}
/** @var \Illuminate\Database\Eloquent\Model $model */
/** @var Model $model */
$model = new $className();
return '\\' . get_class($model->newCollection());
}
@@ -1285,7 +1285,7 @@ class ModelsCommand extends Command
/**
* Generates methods provided by the SoftDeletes trait
* @param \Illuminate\Database\Eloquent\Model $model
* @param Model $model
*/
protected function getSoftDeleteMethods($model)
{
@@ -1302,7 +1302,7 @@ class ModelsCommand extends Command
/**
* Generate factory method from "HasFactory" trait.
*
* @param \Illuminate\Database\Eloquent\Model $model
* @param Model $model
*/
protected function getFactoryMethods($model)
{
@@ -1330,16 +1330,12 @@ class ModelsCommand extends Command
return;
}
if (version_compare($this->laravel->version(), '9', '>=')) {
$this->setMethod('factory', $factory, ['$count = null, $state = []']);
} else {
$this->setMethod('factory', $factory, ['...$parameters']);
}
$this->setMethod('factory', $factory, ['$count = null, $state = []']);
}
/**
* Generates methods that return collections
* @param \Illuminate\Database\Eloquent\Model $model
* @param Model $model
*/
protected function getCollectionMethods($model)
{
@@ -1382,7 +1378,7 @@ class ModelsCommand extends Command
return $type;
}
$reflection = new \ReflectionClass($type);
$reflection = new ReflectionClass($type);
if (!$reflection->implementsInterface(Castable::class)) {
return $type;
@@ -1414,7 +1410,7 @@ class ModelsCommand extends Command
return $type;
}
$reflection = new \ReflectionClass($type);
$reflection = new ReflectionClass($type);
if (!$reflection->implementsInterface(CastsAttributes::class)) {
return $type;
@@ -1620,7 +1616,7 @@ class ModelsCommand extends Command
}
/**
* @param \Illuminate\Database\Eloquent\Model $model
* @param Model $model
* @throws \Illuminate\Contracts\Container\BindingResolutionException
* @throws \RuntimeException
*/
+2 -2
View File
@@ -26,7 +26,7 @@ class Generator
/** @var \Illuminate\View\Factory */
protected $view;
/** @var \Symfony\Component\Console\Output\OutputInterface */
/** @var OutputInterface */
protected $output;
protected $extra = [];
@@ -37,7 +37,7 @@ class Generator
/**
* @param \Illuminate\Config\Repository $config
* @param \Illuminate\View\Factory $view
* @param \Symfony\Component\Console\Output\OutputInterface $output
* @param OutputInterface $output
* @param string $helpers
*/
public function __construct(
+4 -4
View File
@@ -16,15 +16,15 @@ class GenerateModelHelper
*/
public static $shouldRun = false;
/** @var \Illuminate\Contracts\Console\Kernel */
/** @var Artisan */
protected $artisan;
/** @var \Illuminate\Contracts\Config\Repository */
/** @var Config */
protected $config;
/**
* @param \Illuminate\Contracts\Console\Kernel $artisan
* @param \Illuminate\Contracts\Config\Repository $config
* @param Artisan $artisan
* @param Config $config
*/
public function __construct(Artisan $artisan, Config $config)
{
+1 -1
View File
@@ -22,7 +22,7 @@ use Illuminate\Support\Str;
class Method
{
/** @var \Barryvdh\Reflection\DocBlock */
/** @var DocBlock */
protected $phpdoc;
/** @var \ReflectionMethod */