芝麻web文件管理V1.00
编辑当前文件:/home/sditechnicalteam/www/vendor/nunomaduro/larastan/src/Properties/ModelAccessorExtension.php
isSubclassOf(Model::class)) { return false; } $camelCase = Str::camel($propertyName); if ($classReflection->hasNativeMethod($camelCase)) { $methodReflection = $classReflection->getNativeMethod($camelCase); if ($methodReflection->isPublic() || $methodReflection->isPrivate()) { return false; } $returnType = ParametersAcceptorSelector::selectSingle($methodReflection->getVariants())->getReturnType(); if (! $returnType instanceof GenericObjectType) { return false; } if (! (new ObjectType(Attribute::class))->isSuperTypeOf($returnType)->yes()) { return false; } return true; } return $classReflection->hasNativeMethod('get'.Str::studly($propertyName).'Attribute'); } public function getProperty( ClassReflection $classReflection, string $propertyName ): PropertyReflection { $studlyName = Str::studly($propertyName); if ($classReflection->hasNativeMethod($studlyName)) { $methodReflection = $classReflection->getNativeMethod($studlyName); /** @var GenericObjectType $returnType */ $returnType = ParametersAcceptorSelector::selectSingle($methodReflection->getVariants())->getReturnType(); return new ModelProperty( $classReflection, $returnType->getTypes()[0], $returnType->getTypes()[1] ); } $method = $classReflection->getNativeMethod('get'.Str::studly($propertyName).'Attribute'); return new ModelProperty( $classReflection, $method->getVariants()[0]->getReturnType(), $method->getVariants()[0]->getReturnType() ); } }