mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-17 17:47:13 +00:00
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:
@@ -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 {}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user