protected function buildFileData(array $files)
	{
		$data = array();

		foreach ($files as $key => $file)
		{
			if (!is_numeric($key))
			{
				// If the key isn't numeric, then we are dealing with a file whose content has been supplied

				$data[$key] = array('content' => $file);
			}
			elseif (!file_exists($file))
			{
				// Otherwise, we have been given a path and we have to load the content
				// Verify that the each file exists.

				throw new \InvalidArgumentException('The file ' . $file . ' does not exist.');
			}
			else
			{
				$data[basename($file)] = array('content' => file_get_contents($file));
			}
		}

		return $data;
	}
protected function buildFileData(array $files)
	{
		$data = array();

		foreach ($files as $key => $file)
		{
			if (!is_numeric($key))
			{
				// If the key isn't numeric, then we are dealing with a file whose content has been supplied

				$data[$key] = array('content' => $file);
			}
			elseif (!file_exists($file))
			{
				// Otherwise, we have been given a path and we have to load the content
				// Verify that the each file exists.

				throw new \InvalidArgumentException('The file ' . $file . ' does not exist.');
			}
			else
			{
				$data[basename($file)] = array('content' => file_get_contents($file));
			}
		}

		return $data;
	}
protected function buildFileData ( array $ files ) { $ data = array ( ) ; foreach ( $ files as $ key => $ file ) { if ( ! is_numeric ( $ key ) ) { // If the key isn't numeric, then we are dealing with a file whose content has been supplied $ data [ $ key ] = array ( 'content' => $ file ) ; } elseif ( ! file_exists ( $ file ) ) { // Otherwise, we have been given a path and we have to load the content // Verify that the each file exists. throw new \ InvalidArgumentException ( 'The file ' . $ file . ' does not exist.' ) ; } else { $ data [ basename ( $ file ) ] = array ( 'content' => file_get_contents ( $ file ) ) ; } } return $ data ; }
Method to fetch a data array for transmitting to the GitHub API for a list of files based on
an input array of file paths or filename and content pairs.

@param   array  $files  The list of file paths or filenames and content.

@return  array

@since   1.0
@throws  \InvalidArgumentException
Method to fetch a data array for transmitting to the GitHub API for a list of files based on an input array of file paths or filename and content pairs .