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

        $this->divisionDataValidator->validate($divisionData, $filename, $this->allDivisions, false);

        $this->collection->addDivision(
            $this->divisionFactory->build(
                $divisionData,
                $filename,
                false
            )
        );
    }
public function addSourceFile(string $filename) : void
    {
        $divisionData = $this->loadFile($filename);

        $this->divisionDataValidator->validate($divisionData, $filename, $this->allDivisions, false);

        $this->collection->addDivision(
            $this->divisionFactory->build(
                $divisionData,
                $filename,
                false
            )
        );
    }
public function addSourceFile ( string $ filename ) : void { $ divisionData = $ this -> loadFile ( $ filename ) ; $ this -> divisionDataValidator -> validate ( $ divisionData , $ filename , $ this -> allDivisions , false ) ; $ this -> collection -> addDivision ( $ this -> divisionFactory -> build ( $ divisionData , $ filename , false ) ) ; }
Load a JSON file, parse it's JSON to arrays, validates these data and creates a
collection of Division 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 JSON file parse it s JSON to arrays validates these data and creates a collection of Division objects