You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I faced an issue when I need to use the FQCN of my classes as a key for argumentsSet. When it is defined with FQCN in the way \Worker\Fixtures\UserFixture::class it does not work as expected, as in this case it takes all possible arguments, regardless of the key. Once it's set up as a string '\Worker\Fixtures\UserFixture' it works ex expected. It would be great if it's possible to use class constant instead fo the string. Here are examples of the source code
<?phpnamespaceWorker\Fixtures {
classUserFixture {
// accept some data
}
classDeviceFixture {
// accept some data
}
}
namespaceWorker {
classProvider
{
publicfunctionadd(array$data) {
return$this;
}
}
}
namespace {
useWorker\Fixtures;
$provider = new \Worker\Provider();
$provider
->add([
Fixtures\UserFixture::class => [
'attributes' => [
'', // get 4 unexpected fields (`firstName`, `lastName`, `deviceStatusId`, `externalId`)
]
]
])
;
}
In my example, if you try to add a new attribute, you will get the list of all 4 available attributes in the suggestion list (firstName, lastName, deviceStatusId, externalId) and it's not expected, as I need to see only 2 (firstName, lastName) by the key, which is Worker\Fixtures\UserFixture::class. If I change it to be simple string, it works as expected and I get the list of 2 expected elements (firstName, lastName). See the shortened samples of code with the string keys below:
<?phpnamespacePHPSTORM_META {
// same as abovefunctionfixture_set() {
return [
'Fixtures\UserFixture' => \PHPSTORM_META\fixture_data_set([
'firstName' => '',
'lastName' => '',
]),
'Fixtures\DeviceFixture' => \PHPSTORM_META\fixture_data_set([
'deviceStatusId' => '',
'externalId' => '',
]),
];
}
// same as above
}
worker.php
// same as abovenamespace {
$provider = new \Worker\Provider();
$provider
->add([
'Fixtures\UserFixture'' => [
'attributes' => [
'', // get 2 expected fields (`firstName`, `lastName`)
]
]
])
;
}
The text was updated successfully, but these errors were encountered:
Hi.
I faced an issue when I need to use the FQCN of my classes as a key for
argumentsSet
. When it is defined with FQCN in the way\Worker\Fixtures\UserFixture::class
it does not work as expected, as in this case it takes all possible arguments, regardless of the key. Once it's set up as a string'\Worker\Fixtures\UserFixture'
it works ex expected. It would be great if it's possible to use class constant instead fo the string. Here are examples of the source code.phpstorm.meta.php
worker.php
In my example, if you try to add a new attribute, you will get the list of all 4 available attributes in the suggestion list (
firstName
,lastName
,deviceStatusId
,externalId
) and it's not expected, as I need to see only 2 (firstName
,lastName
) by the key, which isWorker\Fixtures\UserFixture::class
. If I change it to be simple string, it works as expected and I get the list of 2 expected elements (firstName
,lastName
). See the shortened samples of code with thestring
keys below:worker.php
The text was updated successfully, but these errors were encountered: