diff --git a/php-templates/translations.php b/php-templates/translations.php index acfaf2bd0..656f39384 100644 --- a/php-templates/translations.php +++ b/php-templates/translations.php @@ -124,7 +124,6 @@ function vscodeCollectTranslations(string $path, ?string $namespace = null) $property = $reflection->hasProperty('paths') ? $reflection->getProperty('paths') : $reflection->getProperty('path'); -$property->setAccessible(true); $paths = Illuminate\Support\Arr::wrap($property->getValue($loader)); diff --git a/src/Console/ModelsCommand.php b/src/Console/ModelsCommand.php index 4f22206b3..b9cdfe047 100644 --- a/src/Console/ModelsCommand.php +++ b/src/Console/ModelsCommand.php @@ -887,7 +887,6 @@ protected function isRelationNullable(string $relation, Relation $relationObj): if (in_array($relation, ['hasOne', 'hasOneThrough', 'morphOne'], true)) { $defaultProp = $reflectionObj->getProperty('withDefault'); - $defaultProp->setAccessible(true); return !$defaultProp->getValue($relationObj); } @@ -897,7 +896,6 @@ protected function isRelationNullable(string $relation, Relation $relationObj): } $fkProp = $reflectionObj->getProperty('foreignKey'); - $fkProp->setAccessible(true); $enforceNullableRelation = $this->laravel['config']->get('ide-helper.enforce_nullable_relationships', true); @@ -930,7 +928,6 @@ protected function isMorphToRelationNullable(Relation $relationObj): bool } $fkProp = $reflectionObj->getProperty('foreignKey'); - $fkProp->setAccessible(true); foreach (Arr::wrap($fkProp->getValue($relationObj)) as $foreignKey) { if (isset($this->nullableColumns[$foreignKey])) { @@ -1283,9 +1280,6 @@ protected function hasCamelCaseModelProperties() */ protected function getAttributeTypes(Model $model, \ReflectionMethod $reflectionMethod): Collection { - // Private/protected ReflectionMethods require setAccessible prior to PHP 8.1 - $reflectionMethod->setAccessible(true); - /** @var Attribute $attribute */ $attribute = $reflectionMethod->invoke($model); diff --git a/src/Factories.php b/src/Factories.php index 97d91ef0b..d156c0197 100644 --- a/src/Factories.php +++ b/src/Factories.php @@ -16,7 +16,6 @@ public static function all() $factory = app(Factory::class); $definitions = (new ReflectionClass(Factory::class))->getProperty('definitions'); - $definitions->setAccessible(true); foreach ($definitions->getValue($factory) as $factory_target => $config) { try {