src/CodeGeneration/PostProcessor/FileOverrider.php
public function applyOverrides(): array
    {
        $filesUpdated = [];
        $filesSame    = [];
        $errors       = [];
        foreach ($this->getOverridesIterator() as $pathToFileInOverrides) {
            $relativePathToFileInProject = $this->getRelativePathInProjectFromOverridePath($pathToFileInOverrides);
            if ($this->overrideFileHashIsCorrect($pathToFileInOverrides)) {
                if (false === is_file($pathToFileInOverrides)) {
                    throw new \RuntimeException('path ' . $pathToFileInOverrides . ' is not a file');
                }
                copy($pathToFileInOverrides, $this->pathToProjectRoot . $relativePathToFileInProject);
                $filesUpdated[] = $relativePathToFileInProject;
                continue;
            }
            if ($this->projectFileIsSameAsOverride($pathToFileInOverrides)) {
                $filesSame[] = $relativePathToFileInProject;
                continue;
            }
            $errors[$pathToFileInOverrides] = $this->getProjectFileHash($relativePathToFileInProject);
        }
        if ([] !== $errors) {
            throw new \RuntimeException('These file hashes were not up to date:' . print_r($errors, true));
        }

        return [$this->sortFiles($filesUpdated), $this->sortFiles($filesSame)];
    }
public function applyOverrides(): array
    {
        $filesUpdated = [];
        $filesSame    = [];
        $errors       = [];
        foreach ($this->getOverridesIterator() as $pathToFileInOverrides) {
            $relativePathToFileInProject = $this->getRelativePathInProjectFromOverridePath($pathToFileInOverrides);
            if ($this->overrideFileHashIsCorrect($pathToFileInOverrides)) {
                if (false === is_file($pathToFileInOverrides)) {
                    throw new \RuntimeException('path ' . $pathToFileInOverrides . ' is not a file');
                }
                copy($pathToFileInOverrides, $this->pathToProjectRoot . $relativePathToFileInProject);
                $filesUpdated[] = $relativePathToFileInProject;
                continue;
            }
            if ($this->projectFileIsSameAsOverride($pathToFileInOverrides)) {
                $filesSame[] = $relativePathToFileInProject;
                continue;
            }
            $errors[$pathToFileInOverrides] = $this->getProjectFileHash($relativePathToFileInProject);
        }
        if ([] !== $errors) {
            throw new \RuntimeException('These file hashes were not up to date:' . print_r($errors, true));
        }

        return [$this->sortFiles($filesUpdated), $this->sortFiles($filesSame)];
    }
public function applyOverrides ( ) : array { $ filesUpdated = [ ] ; $ filesSame = [ ] ; $ errors = [ ] ; foreach ( $ this -> getOverridesIterator ( ) as $ pathToFileInOverrides ) { $ relativePathToFileInProject = $ this -> getRelativePathInProjectFromOverridePath ( $ pathToFileInOverrides ) ; if ( $ this -> overrideFileHashIsCorrect ( $ pathToFileInOverrides ) ) { if ( false === is_file ( $ pathToFileInOverrides ) ) { throw new \ RuntimeException ( 'path ' . $ pathToFileInOverrides . ' is not a file' ) ; } copy ( $ pathToFileInOverrides , $ this -> pathToProjectRoot . $ relativePathToFileInProject ) ; $ filesUpdated [ ] = $ relativePathToFileInProject ; continue ; } if ( $ this -> projectFileIsSameAsOverride ( $ pathToFileInOverrides ) ) { $ filesSame [ ] = $ relativePathToFileInProject ; continue ; } $ errors [ $ pathToFileInOverrides ] = $ this -> getProjectFileHash ( $ relativePathToFileInProject ) ; } if ( [ ] !== $ errors ) { throw new \ RuntimeException ( 'These file hashes were not up to date:' . print_r ( $ errors , true ) ) ; } return [ $ this -> sortFiles ( $ filesUpdated ) , $ this -> sortFiles ( $ filesSame ) ] ; }
Loop over all the override files and copy into the project

@return array[] the file paths that have been updated
Loop over all the override files and copy into the project