Returns the diff of a file

@param   array  $files       The path to the file
@return  string[]
504109
public function getDiff(array $files = null)
    {
        $diffs  = array();

        if (is_null($files)) {
            $status = $this->getStatus();

            foreach ($status as $entry) {
                if ($entry['status'] !== 'modified') {
			continue;
		}

                $files[] = $entry['file'];
            }

            asort($files);
        }

        $files = array_map(array($this, 'resolveLocalPath'), $files);

        foreach ($files as $file) {
            $result = $this->getSvn()->{'diff'}($this->getRepositoryPath(), $file);
            $result->assertSuccess(sprintf('Cannot show diff for "%s" from "%s"',
                $file, $this->getRepositoryPath()
            ));

            $diffs[$file] = $result->getStdOut();
        }

        return $diffs;
    }
426180
protected function copy( $files ) {
		$failures = [];

		foreach ( $files as $source => $destination ) {
			if ( file_exists( $destination ) ) {
				$failures[ $source ] = $destination;
				continue;
			}

			$directory = dirname( $destination );
			if ( ! file_exists( $directory ) ) {
				mkdir( $directory );
			}

			copy( $source, $destination );
		}

		return $failures;
	}
75152
private static function getIgnoredFiles($file) {
    if (file_exists($file) === FALSE) {
      return array();
    }

    $contents = file_get_contents($file);
    if ($contents === FALSE) {
      return array();
    }

    return preg_split('/\s+/', $contents);
  }
614607
public function write(array $files)
    {
        $filesystem = $this->getFilesystem($this->field, $this->settings);
        $results = [];
        foreach ($files as $file => $path) {
            $results[] = $this->writeFile($filesystem, $file, $path);
        }

        return $results;
    }
151296
protected function resolveLocalGlobPath(array $files)
    {
        $absoluteFiles  = $this->resolveFullPath($files);
        $expandedFiles  = array();
        foreach ($absoluteFiles as $absoluteFile) {
            $globResult     = glob($absoluteFile);
            if (   empty($globResult)
                && stripos($absoluteFile, '*') === false
                && !file_exists($absoluteFile)
            ) {
                $expandedFiles[]    = $absoluteFile;
            } else {
                $expandedFiles  = array_merge($expandedFiles, $globResult);
            }
        }
        return $this->resolveLocalPath($expandedFiles);
    }
286717
protected static function findFile($file, array $paths)
    {
        if ($file === null) {
            return null;
        }
        foreach ($paths as $path) {
            $files = glob("$path/$file");
            if (!empty($files)) {
                return $files[0];
            }
        }
    }
514221
private static function normaliseUplaod(array $files)
    {
        $output = [];
        foreach ($files as $key => $value) {
            if ($value instanceof UploadedFileInterface) {
                $output[ $key ] = $value;
            } elseif (is_array($value) && isset($value[ 'tmp_name' ])) {
                $output[ $key ] = UploadedFile::create($value);
            } elseif (is_array($value)) {
                $output[ $key ] = self::normaliseUplaod($value);
            } else {
                throw new \InvalidArgumentException('The input parameter is not in the correct format.');
            }
        }

        return $output;
    }
984218
protected function normalizeMultiUpload(array $files): array
	{
		$normalized = [];

		$keys = array_keys($files);

		$count = count($files['name']);

		for($i = 0; $i < $count; $i++)
		{
			foreach($keys as $key)
			{
				$normalized[$i][$key] = $files[$key][$i];
			}
		}

		return $normalized;
	}
801282
protected function translations(array $files = array())
    {
        $return = [];
        foreach ($files as $file) {
            $translation = $this->getStringsBetween($file->getContents(), 'trans(\'', "')");
            $translation = array_filter($translation, function($element) {
                if (str_contains($element, ', {')) {
                    return false;
                }
                return $element;
            });
            $translationWithParams = $this->getStringsBetween($file->getContents(), 'trans(\'', "', {");
            $translation           = array_merge($translation, $translationWithParams);
            $return                = array_merge($return, $translation);
        }
        return $return;
    }
941490
private function findDiff($new)
    {
        $old = $this->oldValues;
        $diff = [];

        foreach ($new as $key => $value) {
            if (!isset($old[$key]) || $old[$key] !== $new[$key]) {
                $diff[$key] = $value;
            }
        }

        return $diff;
    }
404214
protected function _getFileData($_files) {
		$return_files = [];
		if (is_array($_files)) {
			foreach ($_files as $fkey => $fvalue) {
				if (is_array($fvalue)) {
					foreach ($fvalue as $varname => $varpair) {
						if (is_array($varpair)) {
							foreach ($varpair as $fieldname => $varvalue) {
								$return_files[$fkey][$fieldname][$varname]=$varvalue;
							}
						} else {
							$return_files[$fkey] = $fvalue;
						}
					}
				}
			}
		}
		return $return_files;
	}
402486
public static function parseFiles($paths, $file) {
		if ($paths === null) {
			$paths = ROOT . DS . 'config' . DS;
		}

		$list = [];
		foreach ((array)$paths as $path) {
			$list += static::parseFile($path . $file);
		}

		return $list;
	}
347348
protected function getFiles(array $files)
    {
        $filesEntity = [];

        foreach ($files as $file) {
            $filesEntity[] = new File($file);
        }

        return $filesEntity;
    }
1179335
protected function prepareFiles($files) {
    $values = [];

    foreach ($files as $file_uuid) {
      $file = $this->fileStorage->loadByProperties([
        'uuid' => $file_uuid,
      ]);

      if ($file) {
        $values[] = [
          'target_id' => current($file)->id(),
        ];
      }
    }

    return $values;
  }
1111721
private function wrapUploads($files): array
    {
        if (empty($files)) {
            return [];
        }

        $result = [];
        foreach ($files as $index => $f) {
            if (!isset($f['name'])) {
                $result[$index] = $this->wrapUploads($f);
                continue;
            }

            if (UPLOAD_ERR_OK === $f['error']) {
                $stream = $this->streamFactory->createStreamFromFile($f['tmpName']);
            } else {
                $stream = $this->streamFactory->createStream();
            }

            $result[$index] = $this->uploadsFactory->createUploadedFile(
                $stream,
                $f['size'],
                $f['error'],
                $f['name'],
                $f['mime']
            );
        }

        return $result;
    }
1730
public static function createFromFilesGlobal(array $files) : array
    {
        $items = [];
        $files = self::normalizeSuperglobal($files);
        self::buildMap($files, $items);

        return $items;
    }
1359408
private function merge(array $files)
    {
        $content = '';

        foreach ($files as $file) {
            $content .= file_get_contents($this->basePath . $file);
        }

        return $content;
    }