Read contents from file and put every line as an entry in the result array

@param string $codaFile Filepath
@return string[]
174539
private function fileToCodaLines(string $codaFile): array
	{
		return array_map(
			function($line) {
				return mb_convert_encoding($line, "UTF-8", "ISO-8859-1");
			},
			file($codaFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES));
	}
173888
public function getLastLines(int $numberOfLines = self::DEFAULT_NUMBER_OF_LINES): array
    {
        $lines = [];
        if (null === $this->file) {
            return $lines;
        }

        $this->file->seek($this->lineCount);
        $currentKey = $this->file->key();
        while ($currentKey >= 0) {
            $line = $this->getDefaultParser()->parse($this->file->current());
            if ($line) {
                $lines[] = $line;
            }

            if (--$currentKey >= 0) {
                $this->file->seek($currentKey);
            }

            if (\count($lines) >= $numberOfLines) {
                break;
            }
        }

        return $lines;
    }
679744
protected function readLinesFromFile($filePath)
    {
        // Read file into an array of lines with auto-detected line endings
        $autodetect = ini_get('auto_detect_line_endings');
        ini_set('auto_detect_line_endings', '1');
        $lines = file($filePath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
        ini_set('auto_detect_line_endings', $autodetect);
        return $lines;
    }
1101433
public function readLines()
    {
        if ($this->getFileObject()->isFile()) {
            if ($this->skipEmptyLines) {
                // skip empty lines
                $lines = file($this->getFileObject()->getPathname(), FILE_SKIP_EMPTY_LINES | FILE_IGNORE_NEW_LINES);
            } else {
                $lines = file($this->getFileObject()->getPathname(), FILE_IGNORE_NEW_LINES);
            }

            if (is_array($lines)) {
                return $lines;
            }
        }
        return array();
    }
585955
protected function readLine(string $cacheFile): string
    {
        $fp = fopen($cacheFile, 'r');
        $line = fgets($fp);
        fclose($fp);

        return $line;
    }
1138562
protected function _parseFiles($data) {
		$result = [];

		$normalize = function($key, $value) use ($result, &$normalize){
			foreach ($value as $param => $content) {
				foreach ($content as $num => $val) {
					if (is_numeric($num)) {
						$result[$key][$num][$param] = $val;
						continue;
					}
					if (is_array($val)) {
						foreach ($val as $next => $one) {
							$result[$key][$num][$next][$param] = $one;
						}
						continue;
					}
					$result[$key][$num][$param] = $val;
				}
			}
			return $result;
		};
		foreach ($data as $key => $value) {
			if (isset($value['name'])) {
				if (is_string($value['name'])) {
					$result[$key] = $value;
					continue;
				}
				if (is_array($value['name'])) {
					$result += $normalize($key, $value);
				}
			}
		}
		return $result;
	}
40217
public function getData(string $filePath): array
    {
        if (!is_readable($filePath) || is_dir($filePath)) {
            throw new \InvalidArgumentException('File ' . $filePath . ' is not a readable or not even a file');
        }
        $this->filePath = $filePath;
        $normalizedMetaData = $this->getNormalizedMetaDataFileContent();
        $normalizedMetaData = $this->addPathToData($normalizedMetaData);
        $normalizedMetaData = $this->addFilePathToData($normalizedMetaData);
        $normalizedMetaData = $this->addCheckSumToData($normalizedMetaData);

        return $normalizedMetaData;
    }
500819
protected function getTlsStreamContextDefaults($cafile)
    {
        $ciphers = implode(':', array(
            'ECDHE-RSA-AES128-GCM-SHA256',
            'ECDHE-ECDSA-AES128-GCM-SHA256',
            'ECDHE-RSA-AES256-GCM-SHA384',
            'ECDHE-ECDSA-AES256-GCM-SHA384',
            'DHE-RSA-AES128-GCM-SHA256',
            'DHE-DSS-AES128-GCM-SHA256',
            'kEDH+AESGCM',
            'ECDHE-RSA-AES128-SHA256',
            'ECDHE-ECDSA-AES128-SHA256',
            'ECDHE-RSA-AES128-SHA',
            'ECDHE-ECDSA-AES128-SHA',
            'ECDHE-RSA-AES256-SHA384',
            'ECDHE-ECDSA-AES256-SHA384',
            'ECDHE-RSA-AES256-SHA',
            'ECDHE-ECDSA-AES256-SHA',
            'DHE-RSA-AES128-SHA256',
            'DHE-RSA-AES128-SHA',
            'DHE-DSS-AES128-SHA256',
            'DHE-RSA-AES256-SHA256',
            'DHE-DSS-AES256-SHA',
            'DHE-RSA-AES256-SHA',
            'AES128-GCM-SHA256',
            'AES256-GCM-SHA384',
            'AES128-SHA256',
            'AES256-SHA256',
            'AES128-SHA',
            'AES256-SHA',
            'AES',
            'CAMELLIA',
            'DES-CBC3-SHA',
            '!aNULL',
            '!eNULL',
            '!EXPORT',
            '!DES',
            '!RC4',
            '!MD5',
            '!PSK',
            '!aECDH',
            '!EDH-DSS-DES-CBC3-SHA',
            '!EDH-RSA-DES-CBC3-SHA',
            '!KRB5-DES-CBC3-SHA',
            '!ADH'
        ));

        $options = array(
            'ssl' => array(
                'ciphers' => $ciphers,
                'verify_peer' => true,
                'verify_depth' => 7,
                'SNI_enabled' => true,
            )
        );

        if (!$cafile) {
            $cafile = CaBundle::getSystemCaRootBundlePath();
        }
        if (is_dir($cafile)) {
            $options['ssl']['capath'] = $cafile;
        } elseif ($cafile) {
            $options['ssl']['cafile'] = $cafile;
        } else {
            throw new RuntimeException('A valid cafile could not be located locally.');
        }

        if (version_compare(PHP_VERSION, '5.4.13') >= 0) {
            $options['ssl']['disable_compression'] = true;
        }

        return $options;
    }
823934
protected function readBlocks()
	{
		$open	= false;
		$file	= new FS_File_Reader( $this->fileName );
		$lines	= $file->readArray();
		foreach( $lines as $line )
		{
			$line	= trim( $line );
			if( $line )
			{
				if( preg_match( $this->patternSection, $line ) )
				{
					$section 	= preg_replace( $this->patternSection, "\\1", $line );
					if( !isset( $this->blocks[$section] ) )
						$this->blocks[$section]	= array();
					$open = true;
				}
				else if( $open )
				{
					$this->blocks[$section][]	= $line;
				}
			}
		}
		foreach( $this->blocks as $section => $block )
			$this->blocks[$section]	= implode( "\n", $block );
	}
779571
public function scanNextFile() {
		$_file = each($this->files);
		if ($_file === false) {
			return false;
		}
		$file = $_file['value'];

		$lines = file($file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
		if ($lines === false) {
			$lines = [];
		}
		return $lines;
	}
648065
private function parseFile($uploadedFile)
    {
        $item = [];

        if (is_array($uploadedFile)) {
            if (!is_array($uploadedFile['error'])) {
                $item[] = new UploadedFile(
                    $uploadedFile['tmp_name'],
                    isset($uploadedFile['name']) ? $uploadedFile['name'] : null,
                    isset($uploadedFile['type']) ? $uploadedFile['type'] : null,
                    isset($uploadedFile['size']) ? $uploadedFile['size'] : null,
                    $uploadedFile['error']
                );
            } else {
                foreach ($uploadedFile['error'] as $fieldIndex => $void) {
                    $item[] = new UploadedFile(
                        $uploadedFile['tmp_name'][$fieldIndex],
                        isset($uploadedFile['name']) ? $uploadedFile['name'][$fieldIndex] : null,
                        isset($uploadedFile['type']) ? $uploadedFile['type'][$fieldIndex] : null,
                        isset($uploadedFile['size']) ? $uploadedFile['size'][$fieldIndex] : null,
                        $uploadedFile['error'][$fieldIndex]
                    );
                }
            }
        }

        return $item;
    }
831558
protected function process(SplFileInfo $file): array
    {
        /** @var FileLoaderAdapterInterface $adapter */
        foreach ($this->adapters as $adapter) {
            if ($adapter->doesHandle($file)) return $adapter->process($file->getRealPath());
        }

        return [];

    }
969423
public function parse()
    {
        try {
            $this->ensureFileIsReadable();
        } catch (InvalidPathException $e) {
            return [];
        }

        $filePath = $this->filePath;
        $lines = $this->readLinesFromFile($filePath);

        $data = [];
        foreach ($lines as $line) {
            if (!$this->isComment($line) && $this->looksLikeSetter($line)) {
                list($name, $value) = $this->processFilters($line, null);
                $data[$name] = $value;
            }
        }

        return $data;
    }
1026679
public function getFileContents()
    {
        $result = null;
        $fsl = $this->getFile()->getFileStorageLocationObject();
        if ($fsl !== null) {
            $app = Application::getFacadeApplication();
            $cf = $app->make('helper/concrete/file');
            try {
                $result = $fsl->getFileSystemObject()->read($cf->prefix($this->fvPrefix, $this->fvFilename));
                if ($result === false) {
                    $result = null;
                }
            } catch (FileNotFoundException $x) {
            }
        }

        return $result;
    }
164824
public function getFileContent($filePath, $createIfNotExists = false)
    {
        if ($createIfNotExists && ! $this->disk->exists($filePath)) {
            if (! $this->disk->exists($directory = dirname($filePath))) {
                mkdir($directory, 0777, true);
            }

            file_put_contents($filePath, "<?php\n\nreturn [];");

            return [];
        }

        try {
            return (array) include $filePath;
        } catch (\ErrorException $e) {
            throw new FileNotFoundException('File not found: '.$filePath);
        }
    }
512042
public static function read($sConfigFile)
    {
        $sConfigFile = realpath($sConfigFile);
        if(!is_readable($sConfigFile))
        {
            throw new \Jaxon\Config\Exception\File(jaxon_trans('config.errors.file.access', array('path' => $sConfigFile)));
        }
        $sFileContent = file_get_contents($sConfigFile);
        $aConfigOptions = json_decode($sFileContent, true);
        if(!is_array($aConfigOptions))
        {
            throw new \Jaxon\Config\Exception\File(jaxon_trans('config.errors.file.content', array('path' => $sConfigFile)));
        }

        return $aConfigOptions;
    }
1161199
public static function readFile($strFilePath)
    {
        $result = "";
        $handle = fopen($strFilePath, "r");
        while (!feof($handle)) {
            $result .= fread($handle, 8000);
        }
        fclose($handle);

        return $result;
    }