Documentation / Data
Reader for PHP data input.
The DataReader
$reader = new DataReader();
// Associative array as source
$configuration = $reader->createConfiguration(['a' => 1]);
// Object as source
$configuration = $reader->createConfiguration((object)['a' => 1]);
// Null as source
$configuration = $reader->createConfiguration(null);
Constructor options
public function __construct(
string $class = Configuration::class,
);
class
- An instance of any class implementingConfigurationInterface
to be returned (defaultConfiguration
).
createConfiguration options
public function createConfiguration(
object|array|null $data = null,
): ConfigurationInterface;
data
- Input to be read as object, associative array or null.