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

        $engineFactory = new EngineFactory();

        foreach (array_keys($decodedFileContent) as $engineName) {
            $engineName = (string) $engineName;
            $engineData = $decodedFileContent[$engineName];

            $this->collection->addEngine($engineName, $engineFactory->build($engineData, $decodedFileContent, $engineName));
        }
    }
public function addEnginesFile(string $filename) : void
    {
        $decodedFileContent = $this->loadFile($filename);

        $engineFactory = new EngineFactory();

        foreach (array_keys($decodedFileContent) as $engineName) {
            $engineName = (string) $engineName;
            $engineData = $decodedFileContent[$engineName];

            $this->collection->addEngine($engineName, $engineFactory->build($engineData, $decodedFileContent, $engineName));
        }
    }
public function addEnginesFile ( string $ filename ) : void { $ decodedFileContent = $ this -> loadFile ( $ filename ) ; $ engineFactory = new EngineFactory ( ) ; foreach ( array_keys ( $ decodedFileContent ) as $ engineName ) { $ engineName = ( string ) $ engineName ; $ engineData = $ decodedFileContent [ $ engineName ] ; $ this -> collection -> addEngine ( $ engineName , $ engineFactory -> build ( $ engineData , $ decodedFileContent , $ engineName ) ) ; } }
Load a engines.json file and parse it into the platforms data array, validates these data and creates a
collection of Engine objects

@param string $filename Name of the file

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