Add AllowDynamicProperties Attribute to cooperate with php8.2 deprecation (#1428)

* Add `AllowDynamicProperties` Attribute to cooperate with php8.2 deprecation

* lint snapshot
This commit is contained in:
GeoSot
2024-02-08 11:09:30 +01:00
committed by GitHub
parent 341c0ab89f
commit bc158a1b86
2 changed files with 5 additions and 2 deletions
+4 -2
View File
@@ -1081,9 +1081,11 @@ class ModelsCommand extends Command
}
$classname = $this->write_mixin ? $mixinClassName : $classname;
$output = "namespace {$namespace}{\n{$docComment}\n\t{$keyword}class {$classname} ";
if (!$this->write_mixin) {
$allowDynamicAttributes = $this->write_mixin ? "#[\AllowDynamicProperties]\n\t" : '';
$output = "namespace {$namespace}{\n{$docComment}\n\t{$keyword}{$allowDynamicAttributes}class {$classname} ";
if (! $this->write_mixin) {
$output .= "extends \Eloquent ";
if ($interfaceNames) {
@@ -184,6 +184,7 @@ namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWi
* @method static \Illuminate\Database\Eloquent\Builder|Post whereYearNullable($value)
* @mixin \Eloquent
*/
#[\AllowDynamicProperties]
class IdeHelperPost {}
}