-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow spatie/invade 2.x #9660
Allow spatie/invade 2.x #9660
Conversation
hamrak
commented
Nov 14, 2023
•
edited
edited
- Changes have been thoroughly tested to not break existing functionality.
- New functionality has been documented or existing documentation has been updated to reflect changes.
- Visual changes are explained in the PR description using a screenshot/recording of before and after.
@@ -43,21 +44,21 @@ protected function guessBelongsToRelationshipName(AbstractAsset $column, string | |||
{ | |||
/** @var Model $modelInstance */ | |||
$modelInstance = app($model); | |||
$modelInstanceReflection = invade($modelInstance); | |||
$modelInstanceReflection = new ReflectionClass(invade($modelInstance)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need invade here?
$modelInstanceReflection = new ReflectionClass(invade($modelInstance)); | |
$modelInstanceReflection = new ReflectionClass($modelInstance); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, you right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you test your previous code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class Invader
{
/** @var T */
public object $obj;
public ReflectionClass $reflected;
/**
* @param T $obj
*/
public function __construct(object $obj)
{
$this->obj = $obj;
$this->reflected = new ReflectionClass($obj);
}
...
This was in version 1.1.1.
In 2.0 is this
class Invader
{
/**
* @param T $obj
*/
public function __construct(
public object $obj
) {
}
...
Fix invade