Laravel version update
Laravel version update
This commit is contained in:
53
vendor/chumper/zipper/tests/ArrayArchive.php
vendored
53
vendor/chumper/zipper/tests/ArrayArchive.php
vendored
@@ -1,10 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Chumper\Zipper;
|
||||
|
||||
use Chumper\Zipper\Repositories\RepositoryInterface;
|
||||
|
||||
class ArrayArchive implements RepositoryInterface
|
||||
{
|
||||
private $entries = array();
|
||||
private $entries = [];
|
||||
|
||||
/**
|
||||
* Construct with a given path
|
||||
@@ -13,7 +15,7 @@ class ArrayArchive implements RepositoryInterface
|
||||
* @param bool $new
|
||||
* @param $archiveImplementation
|
||||
*/
|
||||
function __construct($filePath, $new = false, $archiveImplementation = null)
|
||||
public function __construct($filePath, $new = false, $archiveImplementation = null)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -22,18 +24,27 @@ class ArrayArchive implements RepositoryInterface
|
||||
*
|
||||
* @param $pathToFile
|
||||
* @param $pathInArchive
|
||||
* @return void
|
||||
*/
|
||||
public function addFile($pathToFile, $pathInArchive)
|
||||
{
|
||||
$this->entries[$pathInArchive] = $pathInArchive;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a file to the opened Archive using its contents
|
||||
*
|
||||
* @param $name
|
||||
* @param $content
|
||||
*/
|
||||
public function addFromString($name, $content)
|
||||
{
|
||||
$this->entries[$name] = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a file permanently from the Archive
|
||||
*
|
||||
* @param $pathInArchive
|
||||
* @return void
|
||||
*/
|
||||
public function removeFile($pathInArchive)
|
||||
{
|
||||
@@ -44,6 +55,7 @@ class ArrayArchive implements RepositoryInterface
|
||||
* Get the content of a file
|
||||
*
|
||||
* @param $pathInArchive
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFileContent($pathInArchive)
|
||||
@@ -55,6 +67,7 @@ class ArrayArchive implements RepositoryInterface
|
||||
* Get the stream of a file
|
||||
*
|
||||
* @param $pathInArchive
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getFileStream($pathInArchive)
|
||||
@@ -67,23 +80,22 @@ class ArrayArchive implements RepositoryInterface
|
||||
* Will provide the filename for every item
|
||||
*
|
||||
* @param $callback
|
||||
* @return void
|
||||
*/
|
||||
public function each($callback)
|
||||
{
|
||||
foreach ($this->entries as $entry) {
|
||||
call_user_func_array($callback, array(
|
||||
call_user_func_array($callback, [
|
||||
'file' => $entry,
|
||||
));
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the file is in the archive
|
||||
*
|
||||
* @param $fileInArchive
|
||||
* @return boolean
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function fileExists($fileInArchive)
|
||||
{
|
||||
@@ -97,14 +109,33 @@ class ArrayArchive implements RepositoryInterface
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
return "OK";
|
||||
return 'OK';
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes the archive and saves it
|
||||
* @return void
|
||||
*/
|
||||
public function close()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an empty directory
|
||||
*
|
||||
* @param $dirName
|
||||
*/
|
||||
public function addEmptyDir($dirName)
|
||||
{
|
||||
// CODE...
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the password to be used for decompressing
|
||||
*
|
||||
* @param $password
|
||||
*/
|
||||
public function usePassword($password)
|
||||
{
|
||||
// CODE...
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user