Skip to content
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

Get rid of reflection in ObjectSnapshot #37

Merged
merged 4 commits into from
Dec 29, 2015

Conversation

Taluu
Copy link
Contributor

@Taluu Taluu commented Dec 27, 2015

Re-targeting of #34

$reflProperty->setAccessible(true);
$value = $reflProperty->getValue($object);
foreach ($export as $property => $value) {
$property = str_replace(["\x00*\x00", "\x00{$class}\x00"], '', $property); // not accessible properties
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be always true ? Can this change in php 7 for example ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup. Afterall, the tests are passing with php7 and even hhvm, so... And this should not change IMo, it's been there as long as object support was there so...

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok so let's go we will see in few year if it's still the case.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird. @Taluu where are you find this hack ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

during a simple (array) $object export :}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and some other things can't remember which too (I think it was in the var_dumper component of symfony)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I should check up with https://github.com/symfony/var-dumper/blob/master/Caster/Caster.php though, but then I would reintroduce some reflection...

@lunika
Copy link

lunika commented Dec 29, 2015

Looks good

Taluu added a commit that referenced this pull request Dec 29, 2015
Get rid of reflection in ObjectSnapshot
@Taluu Taluu merged commit 148d759 into Wisembly:1.x Dec 29, 2015
@Taluu Taluu deleted the no-reflection-snapshot branch December 29, 2015 14:18
@Taluu
Copy link
Contributor Author

Taluu commented Dec 29, 2015

I'll merge that on master when I'll have some time

@krichprollsch
Copy link

It's also work with inherited attributes?

Taluu added a commit that referenced this pull request Jan 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants