-
When an array is passed to my Processor, it returns a stdClass. Any idea how to keep this an array? I can manually convert it back, but it feels weird. // This is an array
$configuration = Neon::decodeFile($this->configurationFile);
$schema = Expect::structure([
'parameters' => Expect::structure([
'directories' => Expect::listOf('string')->transform(fn(array $directories) => array_map($this->makeAbsolute(...), $directories)),
'excludes' => Expect::listOf('string'),
'environmentLoader' => Expect::string()->transform($this->makeAbsolute(...)),
]),
]);
$processor = new Processor();
$configuration = $processor->process($schema, $configuration);
// $configuration is a stdClass now |
Beta Was this translation helpful? Give feedback.
Answered by
dg
Oct 4, 2024
Replies: 1 comment 1 reply
-
The easiest is to use |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
ruudk
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The easiest is to use
Expect::structure([...])->castTo('array')