public function addDevicesFile(string $filename) : void
    {
        $decodedFileContent = $this->loadFile($filename);

        foreach ($decodedFileContent as $deviceName => $deviceData) {
            $this->collection->addDevice($deviceName, $this->deviceFactory->build($deviceData, $deviceName));
        }
    }
public function addDevicesFile(string $filename) : void
    {
        $decodedFileContent = $this->loadFile($filename);

        foreach ($decodedFileContent as $deviceName => $deviceData) {
            $this->collection->addDevice($deviceName, $this->deviceFactory->build($deviceData, $deviceName));
        }
    }
public function addDevicesFile ( string $ filename ) : void { $ decodedFileContent = $ this -> loadFile ( $ filename ) ; foreach ( $ decodedFileContent as $ deviceName => $ deviceData ) { $ this -> collection -> addDevice ( $ deviceName , $ this -> deviceFactory -> build ( $ deviceData , $ deviceName ) ) ; } }
Load a devices.json file and parse it into the platforms data array, validates these data and creates a
collection of Device objects

@param string $filename Name of the file

@throws \Assert\AssertionFailedException
@throws \RuntimeException                if the file does not exist or has invalid JSON
Load a devices . json file and parse it into the platforms data array validates these data and creates a collection of Device objects