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

        $platformFactory = new PlatformFactory();

        foreach (array_keys($decodedFileContent) as $platformName) {
            $platformName = (string) $platformName;
            $platformData = $decodedFileContent[$platformName];

            $this->collection->addPlatform($platformName, $platformFactory->build($platformData, $decodedFileContent, $platformName));
        }
    }
public function addPlatformsFile(string $filename) : void
    {
        $decodedFileContent = $this->loadFile($filename);

        $platformFactory = new PlatformFactory();

        foreach (array_keys($decodedFileContent) as $platformName) {
            $platformName = (string) $platformName;
            $platformData = $decodedFileContent[$platformName];

            $this->collection->addPlatform($platformName, $platformFactory->build($platformData, $decodedFileContent, $platformName));
        }
    }
public function addPlatformsFile ( string $ filename ) : void { $ decodedFileContent = $ this -> loadFile ( $ filename ) ; $ platformFactory = new PlatformFactory ( ) ; foreach ( array_keys ( $ decodedFileContent ) as $ platformName ) { $ platformName = ( string ) $ platformName ; $ platformData = $ decodedFileContent [ $ platformName ] ; $ this -> collection -> addPlatform ( $ platformName , $ platformFactory -> build ( $ platformData , $ decodedFileContent , $ platformName ) ) ; } }
Load a platforms.json file and parse it into the platforms data array, validates these data and creates a
collection of Platform objects

@param string $filename Name of the file

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