-
Notifications
You must be signed in to change notification settings - Fork 75
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
php 8.2 support #91
php 8.2 support #91
Conversation
@@ -36,6 +36,7 @@ | |||
* @author Nicolas Bérard-Nault <nicobn@php.net> | |||
* @author Jonathan H. Wage <jwage@mac.com> | |||
*/ | |||
#[\AllowDynamicProperties] |
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.
Method setOption($key, $value) is using dynamic properties:
/**
* setOption
*
* @param string $key
* @param string $value
* @return void
*/
public function setOption($key, $value)
{
$name = 'set' . Doctrine_Inflector::classify($key);
if (method_exists($this, $name)) {
$this->$name($value);
} else {
$key = '_' . $key;
$this->$key = $value;
}
}
@@ -153,9 +153,9 @@ public function testGetData() | |||
|
|||
public function testSetSequenceName() | |||
{ | |||
$this->objTable->sequenceName = 'test-seq'; | |||
$this->objTable->setOption('sequenceName', 'test-seq'); |
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.
This test might have been wrong for a long time. I created the following example to demonstrate, that without using setOption, this test accidentally created a new public property instead of setting the value in the options array:
<?php
class X {
private $storage = [];
public function __construct() {
$this->storage['foo'] = 'bar';
}
public function __get($name) {
var_dump('#### magic getter!');
return $this->storage[$name];
}
public function getStorage($name) {
return $this->storage[$name];
}
}
$x = new X();
var_dump($x->foo); // Returns the value of X::$storage['foo']
var_dump($x->getStorage('foo')); // Returns the value of X::$storage['foo']
$x->foo = "baz"; // Creates a new dynamic property $foo
var_dump($x->foo); // Returns the value of the dynamic property $foo
var_dump($x->getStorage('foo')); // Returns the value of X::$storage['foo']
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.
LGTM, not sure why the CI did not run 🤔
Can you rebase this PR @thirsch ?
8b455cd
to
4e3c6c0
Compare
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.
Thanks!
- would it be possible to keep the git commit messages consistent? (
php 8.2 >
) - Could you please rebase (merged another PR) again?
4e3c6c0
to
f338825
Compare
…d in case of clear() and moved the property _pendingJoinConditions fom Doctrine_Query up to Doctrine_Query_Abstract in the hierarchy.
f338825
to
0241c0b
Compare
Sure, commit messages are fixed and branch is rebased. |
And here is the doctrine1 part of the 8.2 support.
For every missing property, I've tried to keep the style used in the surrounding classes. Some are written "each prop per line", others are separated by comma, as in sf1. My primary goal was to not change too much of existing things but make it compatible to 8.2.
Here is the 8.2 support branch for sf1: FriendsOfSymfony1/symfony1#274