Skip to content

Commit cadbf1b

Browse files
committed
skip property promotion when property is different
1 parent de6fed3 commit cadbf1b

File tree

5 files changed

+54
-12
lines changed

5 files changed

+54
-12
lines changed

src/fields/data/ColorData.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828
*/
2929
class ColorData extends BaseObject implements Serializable, \Stringable
3030
{
31+
/**
32+
* @var string The color’s hex value
33+
*/
34+
private string $_hex;
35+
3136
/**
3237
* @var array
3338
* @see _hsl()
@@ -37,11 +42,12 @@ class ColorData extends BaseObject implements Serializable, \Stringable
3742
/**
3843
* Constructor.
3944
*
40-
* @param string $_hex hex color value, beginning with `#`. (Shorthand is not supported, e.g. `#f00`.)
45+
* @param string $hex hex color value, beginning with `#`. (Shorthand is not supported, e.g. `#f00`.)
4146
* @param array $config name-value pairs that will be used to initialize the object properties
4247
*/
43-
public function __construct(private string $_hex, array $config = [])
48+
public function __construct(string $hex, array $config = [])
4449
{
50+
$this->_hex = $hex;
4551
parent::__construct($config);
4652
}
4753

src/gql/base/MutationResolver.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,27 @@
2020
*/
2121
abstract class MutationResolver extends Component
2222
{
23+
/**
24+
* @var array Data that might be useful during mutation resolution.
25+
*/
26+
private array $_resolutionData;
27+
28+
/**
29+
* @var callable[] Value normalizers stored by argument name
30+
*/
31+
private array $_valueNormalizers = [];
32+
2333
/**
2434
* Construct a mutation resolver and store the resolution data as well as normalizers, if any provided.
2535
*
26-
* @param array $_resolutionData Resolver data
27-
* @param array $_valueNormalizers Data normalizers
36+
* @param array $data Resolver data
37+
* @param array $valueNormalizers Data normalizers
2838
* @param array $config
2939
*/
30-
public function __construct(private array $_resolutionData = [], private array $_valueNormalizers = [], array $config = [])
40+
public function __construct(array $data = [], array $valueNormalizers = [], array $config = [])
3141
{
42+
$this->_resolutionData = $data;
43+
$this->_valueNormalizers = $valueNormalizers;
3244
parent::__construct($config);
3345
}
3446

src/search/SearchQuery.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
*/
1818
class SearchQuery
1919
{
20+
/**
21+
* @var string
22+
*/
23+
private string $_query;
24+
2025
/**
2126
* @var array
2227
* @phpstan-var array{subLeft:bool,subRight:bool,exclude:bool,exact:bool}
@@ -31,12 +36,13 @@ class SearchQuery
3136
/**
3237
* Constructor
3338
*
34-
* @param string $_query
39+
* @param string $query
3540
* @param array $defaultTermOptions
3641
* @phpstan-param array{subLeft?:bool,subRight?:bool,exclude?:bool,exact?:bool} $defaultTermOptions
3742
*/
38-
public function __construct(private string $_query, array $defaultTermOptions = [])
43+
public function __construct(string $query, array $defaultTermOptions = [])
3944
{
45+
$this->_query = $query;
4046
$this->_defaultTermOptions = $defaultTermOptions + [
4147
'subLeft' => false,
4248
'subRight' => true,

src/test/console/CommandTest.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ class CommandTest
2929
public const SELECT = 'select';
3030
public const OUTPUT_COMMAND = 'outputCommand';
3131

32+
/**
33+
* @var ConsoleTest
34+
*/
35+
protected ConsoleTest $test;
36+
37+
/**
38+
* @var bool
39+
*/
40+
protected bool $ignoreStdout = false;
41+
3242
/**
3343
* @var int
3444
*/
@@ -72,14 +82,16 @@ class CommandTest
7282
/**
7383
* CommandTest constructor.
7484
*
75-
* @param ConsoleTest $test
85+
* @param ConsoleTest $consoleTest
7686
* @param string $command
7787
* @param array $parameters
78-
* @param bool $ignoreStdout
88+
* @param bool $ignoreStdOut
7989
* @throws InvalidConfigException
8090
*/
81-
public function __construct(protected ConsoleTest $test, protected string $command, protected array $parameters = [], protected bool $ignoreStdout = false)
91+
public function __construct(ConsoleTest $consoleTest, protected string $command, protected array $parameters = [], bool $ignoreStdOut = false)
8292
{
93+
$this->ignoreStdout = $ignoreStdOut;
94+
$this->test = $consoleTest;
8395
$this->setupController();
8496
}
8597

src/test/mockclasses/ToString.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,19 @@
1616
*/
1717
class ToString implements \Stringable
1818
{
19+
/**
20+
* @var string
21+
*/
22+
private string $_string;
23+
1924
/**
2025
* ToString constructor.
2126
*
22-
* @param string $_string
27+
* @param string $string
2328
*/
24-
public function __construct(private string $_string)
29+
public function __construct(string $string)
2530
{
31+
$this->_string = $string;
2632
}
2733

2834
/**

0 commit comments

Comments
 (0)