src/Handlers/OkFileHandler.php
/**
     * Create's the .OK files for all .CSV files that matches the passed pattern.
     *
     * @param string $pattern The pattern that matches the .CSV files we want to create the .OK files for
     *
     * @return int Return's the number of created .OK files
     * @throws \Exception Is thrown, one of the proposed .OK files can not be created
     */
Create's the .OK files for all .CSV files that matches the passed pattern.
@param string $pattern The pattern that matches the .CSV files we want to create the .OK files for

@return int Return's the number of created .OK files
@throws \Exception Is thrown, one of the proposed .OK files can not be created
Create ' s the . OK files for all . CSV files that matches the passed pattern . @param string $pattern The pattern that matches the . CSV files we want to create the . OK files for @return int Return ' s the number of created . OK files @throws \ Exception Is thrown one of the proposed . OK files can not be created
public function createOkFiles(string $pattern) : int
    {
        $counter = 0;
        $proposedOkFilenames = $this->getLoader()->load($pattern);
        foreach ($proposedOkFilenames as $okFilename => $csvFilenames) {
            if ($this->getFilesystemAdapter()->write($okFilename, implode(PHP_EOL, $csvFilenames)) === false) {
                throw new \Exception(sprintf('Can\' create .OK file "%s"', $okFilename));
            }
            $counter++;
        }
        return $counter;
    }
public function createOkFiles ( string $ pattern ) : int { $ counter = 0 ; $ proposedOkFilenames = $ this -> getLoader ( ) -> load ( $ pattern ) ; foreach ( $ proposedOkFilenames as $ okFilename => $ csvFilenames ) { if ( $ this -> getFilesystemAdapter ( ) -> write ( $ okFilename , implode ( PHP_EOL , $ csvFilenames ) ) === false ) { throw new \ Exception ( sprintf ( 'Can\' create .OK file "%s"' , $ okFilename ) ) ; } $ counter ++ ; } return $ counter ; }
Create's the .OK files for all .CSV files that matches the passed pattern.
Create ' s the . OK files for all . CSV files that matches the passed pattern .
// initialize the counter for the processed .OK files // load the array with the proposed .OK filenames // create the proposed .OK files // write the proposed .OK file // raise the counter // return the number of created .OK files