php 8.2 support#91
Merged
thePanz merged 5 commits intoFriendsOfSymfony1:masterfrom Jan 10, 2023
Merged
Conversation
thirsch
commented
Dec 15, 2022
| * @author Nicolas Bérard-Nault <nicobn@php.net> | ||
| * @author Jonathan H. Wage <jwage@mac.com> | ||
| */ | ||
| #[\AllowDynamicProperties] |
Collaborator
Author
There was a problem hiding this comment.
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;
}
}| public function testSetSequenceName() | ||
| { | ||
| $this->objTable->sequenceName = 'test-seq'; | ||
| $this->objTable->setOption('sequenceName', 'test-seq'); |
Collaborator
Author
There was a problem hiding this comment.
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']
thePanz
reviewed
Jan 9, 2023
8b455cd to
4e3c6c0
Compare
thePanz
approved these changes
Jan 10, 2023
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
Collaborator
Author
Sure, commit messages are fixed and branch is rebased. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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