diff --git a/.github/ISSUE_TEMPLATE/BUG.yml b/.github/ISSUE_TEMPLATE/BUG.yml index f0870fc..dbad7f3 100644 --- a/.github/ISSUE_TEMPLATE/BUG.yml +++ b/.github/ISSUE_TEMPLATE/BUG.yml @@ -16,14 +16,10 @@ body: id: version attributes: label: Version - description: What version of Spaces-API is this occuring on? Versions below 3 will not be fixed. Please upgrade. + description: What version of Spaces-API is this occuring on? options: - - 3.5.0 - - 3.4.0 - - 3.3.0 - - 3.2.0 - - 3.1.0 - - 3.0.0 + - 2.0.1 + - 2.0.0 validations: required: true - type: input diff --git a/README.md b/README.md index b9137c1..588a067 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ -# This library is deprecated -We recommend using the [official SDK](https://github.com/DigitalOceanPHP/Client) or the [Laravel package](https://github.com/GrahamCampbell/Laravel-DigitalOcean) +![Spaces-API](https://imgur.com/NYNsQyl.png "Devang Srivastava's Spaces-API") -All issues will be closed and new PRs will not be accepted +PHP library for accessing Digital Ocean spaces ## Installation Install via composer @@ -33,9 +32,6 @@ $file2url = $file2->getSignedURL("2 hours"); // Make a copy $file3 = $file2->copy('remote-file-3.txt'); -// Move or rename a file -$file2->move('new-filename.txt') - // Make a file public and get the URL $file3->makePublic(); $file3url = $file3->getURL(); diff --git a/SpacesAPI/File.php b/SpacesAPI/File.php index 964a571..f824b8a 100644 --- a/SpacesAPI/File.php +++ b/SpacesAPI/File.php @@ -4,8 +4,6 @@ namespace SpacesAPI; use SpacesAPI\Exceptions\FileDoesntExistException; -use function PHPUnit\Framework\isNull; - /** * Represents a single file * @@ -48,21 +46,20 @@ class File private $_content_length; /** - * @param \SpacesAPI\Space $space An instance of `\SpacesAPI\Space` - * @param string $filename The filename of a file - * @param array $info Any information already known about the file (eg content_length, content_type, etc). Default `[]` - * @param bool $validate Check that the file exists + * @param \SpacesAPI\Space $space + * @param string $filename + * @param array $info * - * @throws \SpacesAPI\Exceptions\FileDoesntExistException If validation is `true` and the file doesn't exist + * @throws \SpacesAPI\Exceptions\FileDoesntExistException */ - public function __construct(Space $space, string $filename, array $info = [], bool $validate = true) + public function __construct(Space $space, string $filename, array $info = []) { $this->space = $space; $this->space_name = $space->getName(); $this->s3 = $space->getS3Client(); $this->_filename = $filename; - if ($validate && !$this->s3->doesObjectExist($this->space_name, $filename)) { + if (!$this->s3->doesObjectExist($this->space_name, $filename)) { throw new FileDoesntExistException("File $filename doesn't exist"); } @@ -213,34 +210,19 @@ class File * * @return \SpacesAPI\File */ - public function copy(string $newFilename): File + public function copy(string $newFilename, bool $public = false): File { $this->s3->copy( $this->space_name, $this->_filename, $this->space_name, $newFilename, - ($this->isPublic()) ? 'public-read' : 'private' + ($public) ? 'public-read' : 'private' ); return new self($this->space, $newFilename); } - /** - * @param string $newFilename - * - * @return \SpacesAPI\File - */ - public function move(string $newFilename): File - { - $this->copy($newFilename); - $this->delete(); - $this->_filename = $newFilename; - $this->fetchFileInfo(); - - return $this; - } - /** * Get the public URL * This URL will not work if the file is private diff --git a/SpacesAPI/Space.php b/SpacesAPI/Space.php index 8ef5ced..0b55f8a 100644 --- a/SpacesAPI/Space.php +++ b/SpacesAPI/Space.php @@ -36,16 +36,15 @@ class Space * * @param \Aws\S3\S3Client $s3 An authenticated S3Client instance * @param string $name Space name - * @param bool $validate Check that the space exists * - * @throws \SpacesAPI\Exceptions\SpaceDoesntExistException If validation is `true` and the space doesn't exist + * @throws \SpacesAPI\Exceptions\SpaceDoesntExistException */ - public function __construct(S3Client $s3, string $name, bool $validate = true) + public function __construct(S3Client $s3, string $name) { $this->s3 = $s3; $this->name = $name; - if ($validate && !$this->s3->doesBucketExist($name)) { + if (!$this->s3->doesBucketExist($name)) { throw new SpaceDoesntExistException("Space '$this->name' does not exist"); } } @@ -234,29 +233,13 @@ class Space /** * List all files in the space (recursively) * - * @param string $directory The directory to list files in. Empty string for root directory - * - * @return array - */ - public function listFiles(string $directory = ""): array - { - $rawFiles = $this->rawListFiles($directory); - $files = []; - - foreach ($rawFiles as $fileInfo) { - $files[$fileInfo['Key']] = new File($this, $fileInfo['Key'], $fileInfo, false); - } - - return ['files' => $files]; - } - - /** * @param string $directory The directory to list files in. Empty string for root directory * @param string|null $continuationToken Used internally to work around request limits (1000 files per request) * * @return array + * @throws \SpacesAPI\Exceptions\FileDoesntExistException */ - private function rawListFiles(string $directory = "", ?string $continuationToken = null): array + public function listFiles(string $directory = "", ?string $continuationToken = null): array { $data = Result::parse( $this->s3->listObjectsV2([ @@ -269,14 +252,20 @@ class Space ]) ); + $files = [ + 'files' => [], + ]; + if (!isset($data['Contents'])) { - return []; + return $files; } - $files = $data['Contents']; + foreach ($data['Contents'] as $fileInfo) { + $files['files'][$fileInfo['Key']] = new File($this, $fileInfo['Key'], $fileInfo); + } if (isset($data["NextContinuationToken"]) && $data["NextContinuationToken"] != "") { - $files = array_merge($files, $this->rawListFiles($directory, $data["NextContinuationToken"])); + $files = array_merge($files['files'], $this->listFiles($directory, $data["NextContinuationToken"])['files']); } return $files; @@ -288,14 +277,13 @@ class Space * @param string $text The text to upload * @param string $filename The filepath/name to save to * @param array $params Any extra parameters. [See here](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property) - * @param bool $private True for the file to be private, false to allow public access * * @return \SpacesAPI\File */ - public function uploadText(string $text, string $filename, array $params = [], bool $private = true): File + public function uploadText(string $text, string $filename, array $params = []): File { - $this->s3->upload($this->name, $filename, $text, ($private) ? 'private' : 'public-read', $params); - return new File($this, $filename, [], false); + $this->s3->upload($this->name, $filename, $text, 'private', $params); + return new File($this, $filename); } /** @@ -303,36 +291,31 @@ class Space * * @param string $filepath The path to the file, including the filename. Relative and absolute paths are accepted. * @param string|null $filename The remote filename. If `null`, the local filename will be used. - * @param string|null $mimeType The file mime type to pass as ContentType for the file (e.g. 'image/jpeg'). - * @param bool $private True for the file to be private, false to allow public access. * * @return \SpacesAPI\File */ - public function uploadFile(string $filepath, ?string $filename = null, ?string $mimeType = null, bool $private = true): File + public function uploadFile(string $filepath, ?string $filename = null): File { $this->s3->putObject([ 'Bucket' => $this->name, 'Key' => ($filename) ?: basename($filepath), 'SourceFile' => $filepath, - 'ContentType' => $mimeType, - 'ACL' => ($private) ? 'private' : 'public-read' ]); - return new File($this, ($filename) ?: basename($filepath), [], false); + return new File($this, ($filename) ?: basename($filepath)); } /** * Get an instance of \SpacesAPI\File for a given filename * * @param string $filename - * @package bool $validate * * @return \SpacesAPI\File * @throws \SpacesAPI\Exceptions\FileDoesntExistException Thrown if the file doesn't exist */ - public function file(string $filename, bool $validate = true): File + public function file(string $filename): File { - return new File($this, $filename, [], $validate); + return new File($this, $filename); } /** diff --git a/SpacesAPI/Spaces.php b/SpacesAPI/Spaces.php index c248664..3f90470 100644 --- a/SpacesAPI/Spaces.php +++ b/SpacesAPI/Spaces.php @@ -36,7 +36,7 @@ class Spaces { $this->s3 = new S3Client([ "version" => "latest", - "region" => $region, + "region" => "us-east-1", "endpoint" => "https://$region.$host", "credentials" => ["key" => $accessKey, "secret" => $secretKey], "ua_append" => "SociallyDev-Spaces-API/2", @@ -61,7 +61,7 @@ class Spaces $spaces = []; foreach (Result::parse($this->s3->listBuckets()['Buckets']) as $bucket) { - $spaces[$bucket['Name']] = new Space($this->s3, $bucket['Name'], false); + $spaces[$bucket['Name']] = new Space($this->s3, $bucket['Name']); } return $spaces; @@ -87,7 +87,7 @@ class Spaces throw new SpaceExistsException($e->getAwsErrorMessage()); } - return new Space($this->s3, $name, false); + return new Space($this->s3, $name); } /** diff --git a/composer.json b/composer.json index 8eec5d8..715d5ff 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "sociallydev/spaces-api", "description": "Library for accessing Digital Ocean spaces", - "version":"3.6.1", + "version":"3.1.0", "type": "library", "license": "MIT", "authors": [ @@ -27,7 +27,7 @@ }, "require-dev": { "clean/phpdoc-md": "^0.19.1", - "phpunit/phpunit": "^9.5.13", - "vlucas/phpdotenv": "^v5.4.1" + "phpunit/phpunit": "^9.5", + "vlucas/phpdotenv": "^5.3" } } diff --git a/composer.lock b/composer.lock index c3a48a5..f42afa8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,80 +4,29 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7d7e52ae944bdcc52309b9908e6db236", + "content-hash": "77328f11e2ce84c590e531213fe931c6", "packages": [ - { - "name": "aws/aws-crt-php", - "version": "v1.0.2", - "source": { - "type": "git", - "url": "https://github.com/awslabs/aws-crt-php.git", - "reference": "3942776a8c99209908ee0b287746263725685732" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/awslabs/aws-crt-php/zipball/3942776a8c99209908ee0b287746263725685732", - "reference": "3942776a8c99209908ee0b287746263725685732", - "shasum": "" - }, - "require": { - "php": ">=5.5" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35|^5.4.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "AWS SDK Common Runtime Team", - "email": "aws-sdk-common-runtime@amazon.com" - } - ], - "description": "AWS Common Runtime for PHP", - "homepage": "http://aws.amazon.com/sdkforphp", - "keywords": [ - "amazon", - "aws", - "crt", - "sdk" - ], - "support": { - "issues": "https://github.com/awslabs/aws-crt-php/issues", - "source": "https://github.com/awslabs/aws-crt-php/tree/v1.0.2" - }, - "time": "2021-09-03T22:57:30+00:00" - }, { "name": "aws/aws-sdk-php", - "version": "3.242.0", + "version": "3.190.2", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "cab6d4f830ce275a1742a3e35e2625917b006dd2" + "reference": "8ca6a5f9834de3eb3fb84b28fc12c9088bc01293" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/cab6d4f830ce275a1742a3e35e2625917b006dd2", - "reference": "cab6d4f830ce275a1742a3e35e2625917b006dd2", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/8ca6a5f9834de3eb3fb84b28fc12c9088bc01293", + "reference": "8ca6a5f9834de3eb3fb84b28fc12c9088bc01293", "shasum": "" }, "require": { - "aws/aws-crt-php": "^1.0.2", "ext-json": "*", "ext-pcre": "*", "ext-simplexml": "*", - "guzzlehttp/guzzle": "^6.5.8 || ^7.4.5", + "guzzlehttp/guzzle": "^5.3.3|^6.2.1|^7.0", "guzzlehttp/promises": "^1.4.0", - "guzzlehttp/psr7": "^1.8.5 || ^2.3", + "guzzlehttp/psr7": "^1.7.0", "mtdowling/jmespath.php": "^2.6", "php": ">=5.5" }, @@ -85,8 +34,6 @@ "andrewsville/php-token-reflection": "^1.4", "aws/aws-php-sns-message-validator": "~1.0", "behat/behat": "~3.0", - "composer/composer": "^1.10.22", - "dms/phpunit-arraysubset-asserts": "^0.4.0", "doctrine/cache": "~1.4", "ext-dom": "*", "ext-openssl": "*", @@ -94,11 +41,10 @@ "ext-sockets": "*", "nette/neon": "^2.3", "paragonie/random_compat": ">= 2", - "phpunit/phpunit": "^4.8.35 || ^5.6.3 || ^9.5", + "phpunit/phpunit": "^4.8.35|^5.4.3", "psr/cache": "^1.0", "psr/simple-cache": "^1.0", - "sebastian/comparator": "^1.2.3 || ^4.0", - "yoast/phpunit-polyfills": "^1.0" + "sebastian/comparator": "^1.2.3" }, "suggest": { "aws/aws-php-sns-message-validator": "To validate incoming SNS notifications", @@ -114,12 +60,12 @@ } }, "autoload": { - "files": [ - "src/functions.php" - ], "psr-4": { "Aws\\": "src/" - } + }, + "files": [ + "src/functions.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -146,41 +92,40 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.242.0" + "source": "https://github.com/aws/aws-sdk-php/tree/3.190.2" }, - "time": "2022-11-10T19:15:37+00:00" + "time": "2021-08-13T18:12:28+00:00" }, { "name": "guzzlehttp/guzzle", - "version": "7.5.0", + "version": "7.3.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba" + "reference": "7008573787b430c1c1f650e3722d9bba59967628" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b50a2a1251152e43f6a37f0fa053e730a67d25ba", - "reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7008573787b430c1c1f650e3722d9bba59967628", + "reference": "7008573787b430c1c1f650e3722d9bba59967628", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.5", - "guzzlehttp/psr7": "^1.9 || ^2.4", + "guzzlehttp/promises": "^1.4", + "guzzlehttp/psr7": "^1.7 || ^2.0", "php": "^7.2.5 || ^8.0", - "psr/http-client": "^1.0", - "symfony/deprecation-contracts": "^2.2 || ^3.0" + "psr/http-client": "^1.0" }, "provide": { "psr/http-client-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.1", + "bamarni/composer-bin-plugin": "^1.4.1", "ext-curl": "*", "php-http/client-integration-tests": "^3.0", - "phpunit/phpunit": "^8.5.29 || ^9.5.23", - "psr/log": "^1.1 || ^2.0 || ^3.0" + "phpunit/phpunit": "^8.5.5 || ^9.3.5", + "psr/log": "^1.1" }, "suggest": { "ext-curl": "Required for CURL handler support", @@ -189,64 +134,36 @@ }, "type": "library", "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": false - }, "branch-alias": { - "dev-master": "7.5-dev" + "dev-master": "7.3-dev" } }, "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { "GuzzleHttp\\": "src/" - } + }, + "files": [ + "src/functions_include.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" }, - { - "name": "Jeremy Lindblom", - "email": "jeremeamia@gmail.com", - "homepage": "https://github.com/jeremeamia" - }, - { - "name": "George Mponos", - "email": "gmponos@gmail.com", - "homepage": "https://github.com/gmponos" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, { "name": "Márk Sági-Kazár", "email": "mark.sagikazar@gmail.com", - "homepage": "https://github.com/sagikazarmark" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" + "homepage": "https://sagikazarmark.hu" } ], "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", "keywords": [ "client", "curl", @@ -260,7 +177,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.5.0" + "source": "https://github.com/guzzle/guzzle/tree/7.3.0" }, "funding": [ { @@ -272,24 +189,28 @@ "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", - "type": "tidelift" + "url": "https://github.com/alexeyshockov", + "type": "github" + }, + { + "url": "https://github.com/gmponos", + "type": "github" } ], - "time": "2022-08-28T15:39:27+00:00" + "time": "2021-03-23T11:33:13+00:00" }, { "name": "guzzlehttp/promises", - "version": "1.5.2", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "b94b2807d85443f9719887892882d0329d1e2598" + "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/b94b2807d85443f9719887892882d0329d1e2598", - "reference": "b94b2807d85443f9719887892882d0329d1e2598", + "url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d", + "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d", "shasum": "" }, "require": { @@ -301,41 +222,26 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5-dev" + "dev-master": "1.4-dev" } }, "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { "GuzzleHttp\\Promise\\": "src/" - } + }, + "files": [ + "src/functions_include.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" } ], "description": "Guzzle promises library", @@ -344,110 +250,66 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.5.2" + "source": "https://github.com/guzzle/promises/tree/1.4.1" }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", - "type": "tidelift" - } - ], - "time": "2022-08-28T14:55:35+00:00" + "time": "2021-03-07T09:25:29+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.4.3", + "version": "1.8.2", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "67c26b443f348a51926030c83481b85718457d3d" + "reference": "dc960a912984efb74d0a90222870c72c87f10c91" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/67c26b443f348a51926030c83481b85718457d3d", - "reference": "67c26b443f348a51926030c83481b85718457d3d", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91", + "reference": "dc960a912984efb74d0a90222870c72c87f10c91", "shasum": "" }, "require": { - "php": "^7.2.5 || ^8.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", - "ralouphie/getallheaders": "^3.0" + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" }, "provide": { - "psr/http-factory-implementation": "1.0", "psr/http-message-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.1", - "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.29 || ^9.5.23" + "ext-zlib": "*", + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": false - }, "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "1.7-dev" } }, "autoload": { "psr-4": { "GuzzleHttp\\Psr7\\": "src/" - } + }, + "files": [ + "src/functions_include.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" }, - { - "name": "George Mponos", - "email": "gmponos@gmail.com", - "homepage": "https://github.com/gmponos" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://github.com/sagikazarmark" - }, { "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", "homepage": "https://github.com/Tobion" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://sagikazarmark.hu" } ], "description": "PSR-7 message implementation that also provides common utility methods", @@ -463,23 +325,9 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.4.3" + "source": "https://github.com/guzzle/psr7/tree/1.8.2" }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", - "type": "tidelift" - } - ], - "time": "2022-10-26T14:07:24+00:00" + "time": "2021-04-26T09:17:50+00:00" }, { "name": "mtdowling/jmespath.php", @@ -513,12 +361,12 @@ } }, "autoload": { - "files": [ - "src/JmesPath.php" - ], "psr-4": { "JmesPath\\": "src/" - } + }, + "files": [ + "src/JmesPath.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -594,61 +442,6 @@ }, "time": "2020-06-29T06:28:15+00:00" }, - { - "name": "psr/http-factory", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-factory.git", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "shasum": "" - }, - "require": { - "php": ">=7.0.0", - "psr/http-message": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interfaces for PSR-7 HTTP message factories", - "keywords": [ - "factory", - "http", - "message", - "psr", - "psr-17", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-factory/tree/master" - }, - "time": "2019-04-30T12:38:16+00:00" - }, { "name": "psr/http-message", "version": "1.0.1", @@ -746,100 +539,30 @@ }, "time": "2019-03-08T08:55:37+00:00" }, - { - "name": "symfony/deprecation-contracts", - "version": "v2.5.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-01-02T09:53:40+00:00" - }, { "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", "shasum": "" }, "require": { "php": ">=7.1" }, - "provide": { - "ext-mbstring": "*" - }, "suggest": { "ext-mbstring": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -847,12 +570,12 @@ } }, "autoload": { - "files": [ - "bootstrap.php" - ], "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" - } + }, + "files": [ + "bootstrap.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -878,7 +601,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" }, "funding": [ { @@ -894,7 +617,7 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2021-05-27T12:26:48+00:00" } ], "packages-dev": [ @@ -933,39 +656,39 @@ }, { "name": "clean/phpdoc-md", - "version": "0.19.2", + "version": "0.19.1", "source": { "type": "git", "url": "https://github.com/clean/phpdoc-md.git", - "reference": "fd18c3eb7359431406b65da6c508bb6126588792" + "reference": "3a15f1bda437b76c6658ce34f5b52e8c5a10ada3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/clean/phpdoc-md/zipball/fd18c3eb7359431406b65da6c508bb6126588792", - "reference": "fd18c3eb7359431406b65da6c508bb6126588792", + "url": "https://api.github.com/repos/clean/phpdoc-md/zipball/3a15f1bda437b76c6658ce34f5b52e8c5a10ada3", + "reference": "3a15f1bda437b76c6658ce34f5b52e8c5a10ada3", "shasum": "" }, "require": { - "clean/phpatlas": "^0.2", - "clean/view": "^0.1", - "php": "^5.6|^7|^8", + "clean/phpatlas": "0.2.0", + "clean/view": "0.1.0", "phpdocumentor/reflection-docblock": "^3|^4|^5" }, "require-dev": { - "clean/mpr": "^1", - "phpunit/phpunit": ">5" + "clean/mpr": "dev-master", + "codeclimate/php-test-reporter": "dev-master", + "phpunit/phpunit": "<6" }, "bin": [ "bin/phpdoc-md" ], "type": "library", "autoload": { - "files": [ - "src/snippets.php" - ], "psr-4": { "Clean\\PhpDocMd\\": "src/" - } + }, + "files": [ + "src/snippets.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -978,9 +701,9 @@ ], "support": { "issues": "https://github.com/clean/phpdoc-md/issues", - "source": "https://github.com/clean/phpdoc-md/tree/0.19.2" + "source": "https://github.com/clean/phpdoc-md/tree/0.19.1" }, - "time": "2022-08-25T15:00:20+00:00" + "time": "2020-02-25T12:57:26+00:00" }, { "name": "clean/view", @@ -1018,30 +741,29 @@ }, { "name": "doctrine/instantiator", - "version": "1.4.1", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", + "doctrine/coding-standard": "^8.0", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.16 || ^1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.22" + "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "type": "library", "autoload": { @@ -1068,7 +790,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.1" + "source": "https://github.com/doctrine/instantiator/tree/1.4.0" }, "funding": [ { @@ -1084,30 +806,35 @@ "type": "tidelift" } ], - "time": "2022-03-03T08:28:38+00:00" + "time": "2020-11-10T18:47:58+00:00" }, { "name": "graham-campbell/result-type", - "version": "v1.1.0", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/GrahamCampbell/Result-Type.git", - "reference": "a878d45c1914464426dc94da61c9e1d36ae262a8" + "reference": "7e279d2cd5d7fbb156ce46daada972355cea27bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/a878d45c1914464426dc94da61c9e1d36ae262a8", - "reference": "a878d45c1914464426dc94da61c9e1d36ae262a8", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/7e279d2cd5d7fbb156ce46daada972355cea27bb", + "reference": "7e279d2cd5d7fbb156ce46daada972355cea27bb", "shasum": "" }, "require": { - "php": "^7.2.5 || ^8.0", - "phpoption/phpoption": "^1.9" + "php": "^7.0|^8.0", + "phpoption/phpoption": "^1.7.3" }, "require-dev": { - "phpunit/phpunit": "^8.5.28 || ^9.5.21" + "phpunit/phpunit": "^6.5|^7.5|^8.5|^9.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, "autoload": { "psr-4": { "GrahamCampbell\\ResultType\\": "src/" @@ -1120,8 +847,7 @@ "authors": [ { "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" + "email": "graham@alt-three.com" } ], "description": "An Implementation Of The Result Type", @@ -1134,7 +860,7 @@ ], "support": { "issues": "https://github.com/GrahamCampbell/Result-Type/issues", - "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.0" + "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.0.1" }, "funding": [ { @@ -1146,42 +872,41 @@ "type": "tidelift" } ], - "time": "2022-07-30T15:56:11+00:00" + "time": "2020-04-13T13:17:36+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.11.0", + "version": "1.10.2", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, - "conflict": { - "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" + "replace": { + "myclabs/deep-copy": "self.version" }, "require-dev": { - "doctrine/collections": "^1.6.8", - "doctrine/common": "^2.13.3 || ^3.2.2", - "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" }, "type": "library", "autoload": { - "files": [ - "src/DeepCopy/deep_copy.php" - ], "psr-4": { "DeepCopy\\": "src/DeepCopy/" - } + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1197,7 +922,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" }, "funding": [ { @@ -1205,20 +930,20 @@ "type": "tidelift" } ], - "time": "2022-03-03T13:19:32+00:00" + "time": "2020-11-13T09:40:50+00:00" }, { "name": "nikic/php-parser", - "version": "v4.15.1", + "version": "v4.12.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900" + "reference": "6608f01670c3cc5079e18c1dab1104e002579143" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", - "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6608f01670c3cc5079e18c1dab1104e002579143", + "reference": "6608f01670c3cc5079e18c1dab1104e002579143", "shasum": "" }, "require": { @@ -1259,9 +984,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.12.0" }, - "time": "2022-09-04T07:30:47+00:00" + "time": "2021-07-21T10:44:31+00:00" }, { "name": "phar-io/manifest", @@ -1325,16 +1050,16 @@ }, { "name": "phar-io/version", - "version": "3.2.1", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + "reference": "bae7c545bef187884426f042434e561ab1ddb182" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", + "reference": "bae7c545bef187884426f042434e561ab1ddb182", "shasum": "" }, "require": { @@ -1370,9 +1095,9 @@ "description": "Library for handling version information and constraints", "support": { "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.2.1" + "source": "https://github.com/phar-io/version/tree/3.1.0" }, - "time": "2022-02-21T01:04:05+00:00" + "time": "2021-02-23T14:00:09+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -1429,16 +1154,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", + "version": "5.2.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556", + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556", "shasum": "" }, "require": { @@ -1449,8 +1174,7 @@ "webmozart/assert": "^1.9.1" }, "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" + "mockery/mockery": "~1.3.2" }, "type": "library", "extra": { @@ -1480,36 +1204,30 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master" }, - "time": "2021-10-19T17:43:47+00:00" + "time": "2020-09-03T19:13:55+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.6.2", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d" + "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/48f445a408c131e38cab1c235aa6d2bb7a0bb20d", - "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", "shasum": "" }, "require": { - "php": "^7.4 || ^8.0", + "php": "^7.2 || ^8.0", "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "ext-tokenizer": "*", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-phpunit": "^1.1", - "phpunit/phpunit": "^9.5", - "rector/rector": "^0.13.9", - "vimeo/psalm": "^4.25" + "ext-tokenizer": "*" }, "type": "library", "extra": { @@ -1535,39 +1253,35 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.2" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0" }, - "time": "2022-10-14T12:47:21+00:00" + "time": "2020-09-17T18:55:26+00:00" }, { "name": "phpoption/phpoption", - "version": "1.9.0", + "version": "1.7.5", "source": { "type": "git", "url": "https://github.com/schmittjoh/php-option.git", - "reference": "dc5ff11e274a90cc1c743f66c9ad700ce50db9ab" + "reference": "994ecccd8f3283ecf5ac33254543eb0ac946d525" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/dc5ff11e274a90cc1c743f66c9ad700ce50db9ab", - "reference": "dc5ff11e274a90cc1c743f66c9ad700ce50db9ab", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/994ecccd8f3283ecf5ac33254543eb0ac946d525", + "reference": "994ecccd8f3283ecf5ac33254543eb0ac946d525", "shasum": "" }, "require": { - "php": "^7.2.5 || ^8.0" + "php": "^5.5.9 || ^7.0 || ^8.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8", - "phpunit/phpunit": "^8.5.28 || ^9.5.21" + "bamarni/composer-bin-plugin": "^1.4.1", + "phpunit/phpunit": "^4.8.35 || ^5.7.27 || ^6.5.6 || ^7.0 || ^8.0 || ^9.0" }, "type": "library", "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": true - }, "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.7-dev" } }, "autoload": { @@ -1582,13 +1296,11 @@ "authors": [ { "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh" + "email": "schmittjoh@gmail.com" }, { "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" + "email": "graham@alt-three.com" } ], "description": "Option Type for PHP", @@ -1600,7 +1312,7 @@ ], "support": { "issues": "https://github.com/schmittjoh/php-option/issues", - "source": "https://github.com/schmittjoh/php-option/tree/1.9.0" + "source": "https://github.com/schmittjoh/php-option/tree/1.7.5" }, "funding": [ { @@ -1612,27 +1324,94 @@ "type": "tidelift" } ], - "time": "2022-07-30T15:51:26+00:00" + "time": "2020-07-20T17:29:33+00:00" }, { - "name": "phpunit/php-code-coverage", - "version": "9.2.18", + "name": "phpspec/prophecy", + "version": "1.13.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "12fddc491826940cf9b7e88ad9664cf51f0f6d0a" + "url": "https://github.com/phpspec/prophecy.git", + "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/12fddc491826940cf9b7e88ad9664cf51f0f6d0a", - "reference": "12fddc491826940cf9b7e88ad9664cf51f0f6d0a", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/be1996ed8adc35c3fd795488a653f4b518be70ea", + "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.2", + "php": "^7.2 || ~8.0, <8.1", + "phpdocumentor/reflection-docblock": "^5.2", + "sebastian/comparator": "^3.0 || ^4.0", + "sebastian/recursion-context": "^3.0 || ^4.0" + }, + "require-dev": { + "phpspec/phpspec": "^6.0", + "phpunit/phpunit": "^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.11.x-dev" + } + }, + "autoload": { + "psr-4": { + "Prophecy\\": "src/Prophecy" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/1.13.0" + }, + "time": "2021-03-17T13:42:18+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "f6293e1b30a2354e8428e004689671b83871edde" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f6293e1b30a2354e8428e004689671b83871edde", + "reference": "f6293e1b30a2354e8428e004689671b83871edde", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.14", + "nikic/php-parser": "^4.10.2", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -1681,7 +1460,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.18" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.6" }, "funding": [ { @@ -1689,20 +1468,20 @@ "type": "github" } ], - "time": "2022-10-27T13:35:33+00:00" + "time": "2021-03-28T07:26:59+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "3.0.6", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8", + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8", "shasum": "" }, "require": { @@ -1741,7 +1520,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.5" }, "funding": [ { @@ -1749,7 +1528,7 @@ "type": "github" } ], - "time": "2021-12-02T12:48:52+00:00" + "time": "2020-09-28T05:57:25+00:00" }, { "name": "phpunit/php-invoker", @@ -1934,16 +1713,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.26", + "version": "9.5.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "851867efcbb6a1b992ec515c71cdcf20d895e9d2" + "reference": "191768ccd5c85513b4068bdbe99bb6390c7d54fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/851867efcbb6a1b992ec515c71cdcf20d895e9d2", - "reference": "851867efcbb6a1b992ec515c71cdcf20d895e9d2", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/191768ccd5c85513b4068bdbe99bb6390c7d54fb", + "reference": "191768ccd5c85513b4068bdbe99bb6390c7d54fb", "shasum": "" }, "require": { @@ -1958,23 +1737,28 @@ "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.13", + "phpspec/prophecy": "^1.12.1", + "phpunit/php-code-coverage": "^9.2.3", "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-invoker": "^3.1.1", "phpunit/php-text-template": "^2.0.3", "phpunit/php-timer": "^5.0.2", "sebastian/cli-parser": "^1.0.1", "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.8", + "sebastian/comparator": "^4.0.5", "sebastian/diff": "^4.0.3", "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.5", + "sebastian/exporter": "^4.0.3", "sebastian/global-state": "^5.0.1", "sebastian/object-enumerator": "^4.0.3", "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.2", + "sebastian/type": "^2.3.4", "sebastian/version": "^3.0.2" }, + "require-dev": { + "ext-pdo": "*", + "phpspec/prophecy-phpunit": "^2.0.1" + }, "suggest": { "ext-soap": "*", "ext-xdebug": "*" @@ -1989,11 +1773,11 @@ } }, "autoload": { - "files": [ - "src/Framework/Assert/Functions.php" - ], "classmap": [ "src/" + ], + "files": [ + "src/Framework/Assert/Functions.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2016,23 +1800,19 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.26" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.8" }, "funding": [ { - "url": "https://phpunit.de/sponsors.html", + "url": "https://phpunit.de/donate.html", "type": "custom" }, { "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", - "type": "tidelift" } ], - "time": "2022-10-28T06:00:21+00:00" + "time": "2021-07-31T15:17:34+00:00" }, { "name": "sebastian/cli-parser", @@ -2203,16 +1983,16 @@ }, { "name": "sebastian/comparator", - "version": "4.0.8", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + "reference": "55f4261989e546dc112258c7a75935a81a7ce382" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382", "shasum": "" }, "require": { @@ -2265,7 +2045,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" }, "funding": [ { @@ -2273,7 +2053,7 @@ "type": "github" } ], - "time": "2022-09-14T12:41:17+00:00" + "time": "2020-10-26T15:49:45+00:00" }, { "name": "sebastian/complexity", @@ -2400,16 +2180,16 @@ }, { "name": "sebastian/environment", - "version": "5.1.4", + "version": "5.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7" + "reference": "388b6ced16caa751030f6a69e588299fa09200ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/1b5dff7bb151a4db11d49d90e5408e4e938270f7", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac", "shasum": "" }, "require": { @@ -2451,7 +2231,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.4" + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3" }, "funding": [ { @@ -2459,20 +2239,20 @@ "type": "github" } ], - "time": "2022-04-03T09:37:03+00:00" + "time": "2020-09-28T05:52:38+00:00" }, { "name": "sebastian/exporter", - "version": "4.0.5", + "version": "4.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" + "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/d89cc98761b8cb5a1a235a6b703ae50d34080e65", + "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65", "shasum": "" }, "require": { @@ -2521,14 +2301,14 @@ } ], "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "https://www.github.com/sebastianbergmann/exporter", + "homepage": "http://www.github.com/sebastianbergmann/exporter", "keywords": [ "export", "exporter" ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.3" }, "funding": [ { @@ -2536,20 +2316,20 @@ "type": "github" } ], - "time": "2022-09-14T06:03:37+00:00" + "time": "2020-09-28T05:24:23+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.5", + "version": "5.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49", "shasum": "" }, "require": { @@ -2592,7 +2372,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3" }, "funding": [ { @@ -2600,7 +2380,7 @@ "type": "github" } ], - "time": "2022-02-14T08:28:10+00:00" + "time": "2021-06-11T13:31:12+00:00" }, { "name": "sebastian/lines-of-code", @@ -2891,28 +2671,28 @@ }, { "name": "sebastian/type", - "version": "3.2.0", + "version": "2.3.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e" + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", - "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", "shasum": "" }, "require": { "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "2.3-dev" } }, "autoload": { @@ -2935,7 +2715,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.0" + "source": "https://github.com/sebastianbergmann/type/tree/2.3.4" }, "funding": [ { @@ -2943,7 +2723,7 @@ "type": "github" } ], - "time": "2022-09-12T14:47:03+00:00" + "time": "2021-06-15T12:49:02+00:00" }, { "name": "sebastian/version", @@ -3000,31 +2780,28 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.27.0", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", "shasum": "" }, "require": { "php": ">=7.1" }, - "provide": { - "ext-ctype": "*" - }, "suggest": { "ext-ctype": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3032,12 +2809,12 @@ } }, "autoload": { - "files": [ - "bootstrap.php" - ], "psr-4": { "Symfony\\Polyfill\\Ctype\\": "" - } + }, + "files": [ + "bootstrap.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3062,7 +2839,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" }, "funding": [ { @@ -3078,20 +2855,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.27.0", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", "shasum": "" }, "require": { @@ -3100,7 +2877,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3108,12 +2885,12 @@ } }, "autoload": { - "files": [ - "bootstrap.php" - ], "psr-4": { "Symfony\\Polyfill\\Php80\\": "" }, + "files": [ + "bootstrap.php" + ], "classmap": [ "Resources/stubs" ] @@ -3145,7 +2922,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" }, "funding": [ { @@ -3161,7 +2938,7 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2021-07-28T13:41:28+00:00" }, { "name": "theseer/tokenizer", @@ -3215,43 +2992,39 @@ }, { "name": "vlucas/phpdotenv", - "version": "v5.5.0", + "version": "v5.3.0", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7" + "reference": "b3eac5c7ac896e52deab4a99068e3f4ab12d9e56" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7", - "reference": "1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/b3eac5c7ac896e52deab4a99068e3f4ab12d9e56", + "reference": "b3eac5c7ac896e52deab4a99068e3f4ab12d9e56", "shasum": "" }, "require": { "ext-pcre": "*", - "graham-campbell/result-type": "^1.0.2", + "graham-campbell/result-type": "^1.0.1", "php": "^7.1.3 || ^8.0", - "phpoption/phpoption": "^1.8", - "symfony/polyfill-ctype": "^1.23", - "symfony/polyfill-mbstring": "^1.23.1", - "symfony/polyfill-php80": "^1.23.1" + "phpoption/phpoption": "^1.7.4", + "symfony/polyfill-ctype": "^1.17", + "symfony/polyfill-mbstring": "^1.17", + "symfony/polyfill-php80": "^1.17" }, "require-dev": { "bamarni/composer-bin-plugin": "^1.4.1", "ext-filter": "*", - "phpunit/phpunit": "^7.5.20 || ^8.5.30 || ^9.5.25" + "phpunit/phpunit": "^7.5.20 || ^8.5.14 || ^9.5.1" }, "suggest": { "ext-filter": "Required to use the boolean validator." }, "type": "library", "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": true - }, "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.3-dev" } }, "autoload": { @@ -3266,13 +3039,13 @@ "authors": [ { "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" + "email": "graham@alt-three.com", + "homepage": "https://gjcampbell.co.uk/" }, { "name": "Vance Lucas", "email": "vance@vancelucas.com", - "homepage": "https://github.com/vlucas" + "homepage": "https://vancelucas.com/" } ], "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", @@ -3283,7 +3056,7 @@ ], "support": { "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v5.5.0" + "source": "https://github.com/vlucas/phpdotenv/tree/v5.3.0" }, "funding": [ { @@ -3295,25 +3068,25 @@ "type": "tidelift" } ], - "time": "2022-10-16T01:01:54+00:00" + "time": "2021-01-20T15:23:13+00:00" }, { "name": "webmozart/assert", - "version": "1.11.0", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", "shasum": "" }, "require": { - "ext-ctype": "*", - "php": "^7.2 || ^8.0" + "php": "^7.2 || ^8.0", + "symfony/polyfill-ctype": "^1.8" }, "conflict": { "phpstan/phpstan": "<0.12.20", @@ -3351,9 +3124,9 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.11.0" + "source": "https://github.com/webmozarts/assert/tree/1.10.0" }, - "time": "2022-06-03T18:03:27+00:00" + "time": "2021-03-09T10:59:23+00:00" } ], "aliases": [], @@ -3365,5 +3138,5 @@ "php": ">=7.3" }, "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.1.0" } diff --git a/docs/Examples.md b/docs/Examples.md index 0ca16bf..77c246b 100644 --- a/docs/Examples.md +++ b/docs/Examples.md @@ -33,7 +33,7 @@ foreach ($files['files'] as $file) { ```php $space = new Spaces('api-key', 'api-secret')->space('my-space-name'); -$file = $space->uploadFile('./localfile.txt', 'remote-filename.txt'); +$file = $space->uploadFile('./localfile.txt'); ``` [API docs for uploading files](Space.md#spaceuploadfile) diff --git a/docs/File.md b/docs/File.md index 3e50692..dc17ff3 100644 --- a/docs/File.md +++ b/docs/File.md @@ -21,16 +21,18 @@ Rather obtain an instance from `\SpacesAPI\Space::list()`, `\SpacesAPI\Spaces::f | Name | Description | |------|-------------| |[__construct](#file__construct)|| +|[__get](#file__get)|Magic getter to make the properties read-only| |[copy](#filecopy)|Copy the file on the space| |[delete](#filedelete)|Permanently delete this file| |[download](#filedownload)|Download the file to a local location| |[getContents](#filegetcontents)|Get the file contents as a string| |[getSignedURL](#filegetsignedurl)|Get a signed URL, which will work for private files| -|[getURL](#filegeturl)|Get the public URL. This URL will not work if the file is private| +|[getURL](#filegeturl)|Get the public URL +This URL will not work if the file is private| |[isPublic](#fileispublic)|Is this file publicly accessible| |[makePrivate](#filemakeprivate)|Make file non-publicly accessible| |[makePublic](#filemakepublic)|Make file publicly accessible| -|[move](#filemove)|Move and/or rename file| +|[pascalCaseToCamelCase](#filepascalcasetocamelcase)|| @@ -40,15 +42,18 @@ Rather obtain an instance from `\SpacesAPI\Space::list()`, `\SpacesAPI\Spaces::f **Description** ```php - __construct (\SpacesAPI\Space $space, string $filename, array $info = [], bool $validate = true) + __construct (\SpacesAPI\Space $space, string $filename, array $info = []) ``` + + + + **Parameters** * `(\SpacesAPI\Space) $space` : An instance of `\SpacesAPI\Space` * `(string) $filename` : The filename of a file * `(array) $info` : Any information already known about the file (eg content_length, content_type, etc). Default `[]` -* `(bool) $validate` : Check that the file exists. Default `true` **Return Values** @@ -56,7 +61,7 @@ Rather obtain an instance from `\SpacesAPI\Space::list()`, `\SpacesAPI\Spaces::f **Throws Exceptions** -`\SpacesAPI\Exceptions\FileDoesntExistException` : If validation is `true` and the file doesn't exist +`\SpacesAPI\Exceptions\FileDoesntExistException` : If the file doesn't exist
@@ -289,27 +294,4 @@ Make file publicly accessible `void` -
- - -### File::move - -**Description** - -```php -public move (string $newFilename) -``` - -Move or rename a file -The instance of `File` is now the moved object - -**Parameters** - -* `(string) $newFilename` - -**Return Values** - -`\SpacesAPI\File` : An instance for the new file - -
diff --git a/docs/Space.md b/docs/Space.md index 69d114b..ef23140 100644 --- a/docs/Space.md +++ b/docs/Space.md @@ -37,7 +37,7 @@ Rather obtain an instance from `\SpacesAPI\Spaces::space()` or `\SpacesAPI\Space **Description** ```php -public __construct (\Aws\S3\S3Client $s3, string $name, bool $validate = true) +public __construct (\Aws\S3\S3Client $s3, string $name) ``` Load a space @@ -51,8 +51,6 @@ rather obtain an instance from `\SpacesAPI\Spaces::space()` or `\SpacesAPI\Space : An authenticated S3Client instance * `(string) $name` : Space name -* `(bool) $validate` -: Check that the space exists. Default `true` **Return Values** @@ -62,7 +60,7 @@ rather obtain an instance from `\SpacesAPI\Spaces::space()` or `\SpacesAPI\Space **Throws Exceptions** -`\SpacesAPI\Exceptions\SpaceDoesntExistException` : If validation is `true` and the space doesn't exist +`\SpacesAPI\Exceptions\SpaceDoesntExistException` : If the space doesn't exist
@@ -180,7 +178,7 @@ Recursively download an entire directory. **Description** ```php -public file (string $filename, bool $validate = true) +public file (string $filename) ``` Get an instance of \SpacesAPI\File for a given filename @@ -190,8 +188,6 @@ Get an instance of \SpacesAPI\File for a given filename **Parameters** * `(string) $filename` -* `(bool) $validate` -: Whether to validate the file exits. Defaults to `true` **Return Values** @@ -318,7 +314,7 @@ Is file listing enabled? **Description** ```php -public listFiles (string $directory = "") +public listFiles (string $directory, string|null $continuationToken = null) ``` List all files in the space (recursively) @@ -329,6 +325,8 @@ List all files in the space (recursively) * `(string) $directory` : The directory to list files in. Empty string for root directory +* `(string|null) $continuationToken` +: Used internally to work around request limits (1000 files per request). Leave this value `null` **Return Values** @@ -465,7 +463,7 @@ Recursively upload an entire directory **Description** ```php -public uploadFile (string $filepath, string|null $filename = null, string|null $mimeType = null, bool $private = true) +public uploadFile (string $filepath, string|null $filename = null) ``` Upload a file @@ -478,10 +476,6 @@ Upload a file : The path to the file, including the filename. Relative and absolute paths are accepted. * `(string|null) $filename` : The remote filename. If `null`, the local filename will be used. Default `null` -* `(string|null) $mimeType` -: The files mimeType. If `null` the mimeType is inferred from the file by DigitalOcean Spaces. Default `null` -* `(bool)` $private -: If `true` then the file is private, if `false` the file is publicly available. Default `true` **Return Values** @@ -498,7 +492,7 @@ Upload a file **Description** ```php -public uploadText (string $text, string $filename, array $params = [], bool $private = true) +public uploadText (string $text, string $filename, array $params => []) ``` Upload a string of text to file @@ -513,8 +507,6 @@ Upload a string of text to file : The filepath/name to save to * `(array) $params` : Any extra parameters. [See here](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property) -* `(bool) $private` -: True for the file to be private, false to allow public access **Return Values** diff --git a/tests/FileTest.php b/tests/FileTest.php index d43bce3..bf7516f 100644 --- a/tests/FileTest.php +++ b/tests/FileTest.php @@ -8,7 +8,6 @@ use SpacesAPI\Spaces; class FileTest extends TestCase { - private static $tempSpaceName; private static $space; private static $file; @@ -20,15 +19,18 @@ class FileTest extends TestCase $spaces = new Spaces($_ENV['SPACES_KEY'], $_ENV['SPACES_SECRET']); - self::$tempSpaceName = md5(time()); + try { + $spaces->space('spaces-api-test')->destroy(); + } catch (SpaceDoesntExistException $e) { + } - self::$space = $spaces->create(self::$tempSpaceName); + self::$space = $spaces->create('spaces-api-test'); self::$file = self::$space->uploadText('Lorem ipsum', 'lorem-ipsum.txt'); } public static function tearDownAfterClass(): void { - self::$space->destroy(); + (new Spaces($_ENV['SPACES_KEY'], $_ENV['SPACES_SECRET']))->space('spaces-api-test')->destroy(); } public function testCanUpdatePrivacy() @@ -62,17 +64,6 @@ class FileTest extends TestCase self::$space->file('lorem-ipsum-2.txt'); } - public function testCanMoveRenameFile() - { - $file = self::$file->copy('test.txt'); - $file->move('renamed-file.txt'); - - $this->assertEquals("renamed-file.txt", $file->filename); - - $this->expectException(FileDoesntExistException::class); - self::$space->file('test.txt'); - } - public function testCanGetURL() { $this->assertStringContainsString('lorem-ipsum.txt', self::$file->getURL()); diff --git a/tests/SpaceTest.php b/tests/SpaceTest.php index a16f70d..6c1177f 100644 --- a/tests/SpaceTest.php +++ b/tests/SpaceTest.php @@ -9,7 +9,6 @@ use SpacesAPI\Spaces; class SpaceTest extends TestCase { - private static $tempSpaceName; private static $space; public static function setUpBeforeClass(): void @@ -20,14 +19,17 @@ class SpaceTest extends TestCase $spaces = new Spaces($_ENV['SPACES_KEY'], $_ENV['SPACES_SECRET']); - self::$tempSpaceName = md5(time()); + try { + $spaces->space('spaces-api-test')->destroy(); + } catch (SpaceDoesntExistException $e) { + } - self::$space = $spaces->create(self::$tempSpaceName); + self::$space = $spaces->create('spaces-api-test'); } public static function tearDownAfterClass(): void { - self::$space->destroy(); +// (new Spaces($_ENV['SPACES_KEY'], $_ENV['SPACES_SECRET']))->space('spaces-api-test')->destroy(); } public function testCanUpdateSpacePrivacy() @@ -69,14 +71,6 @@ class SpaceTest extends TestCase { $file = self::$space->uploadText("Lorem ipsum", "lorem-ipsum.txt"); $this->assertInstanceOf(File::class, $file); - $this->assertFalse($file->isPublic()); - } - - public function testCanPublicUploadText() - { - $file = self::$space->uploadText("Lorem ipsum", "lorem-ipsum.txt", [], false); - $this->assertInstanceOf(File::class, $file); - $this->assertTrue($file->isPublic()); } public function testCanUploadFile() @@ -86,14 +80,6 @@ class SpaceTest extends TestCase $this->assertInstanceOf(File::class, $file); } - public function testCanUploadFileWithMimeType() - { - $tmpFile = tempnam(sys_get_temp_dir(), 'spaces-test'); - $file = self::$space->uploadFile($tmpFile, 'upload-test.txt', 'text/plain'); - $this->assertInstanceOf(File::class, $file); - $this->assertEquals('text/plain', $file->content_type); - } - /** * @depends testCanUploadText * @depends testCanUploadFile diff --git a/tests/SpacesTest.php b/tests/SpacesTest.php index 9b9a00a..765d85f 100644 --- a/tests/SpacesTest.php +++ b/tests/SpacesTest.php @@ -10,21 +10,21 @@ use SpacesAPI\Spaces; class SpacesTest extends TestCase { - private static $tempSpaceName; - public static function setUpBeforeClass(): void { $dotenv = Dotenv::createImmutable(__DIR__ . "/.."); $dotenv->load(); $dotenv->required(['SPACES_KEY', 'SPACES_SECRET']); - // This should hopefully always be unique amongst all DO spaces - self::$tempSpaceName = md5(time()); + try { + (new Spaces($_ENV['SPACES_KEY'], $_ENV['SPACES_SECRET']))->space('spaces-api-test')->destroy(); + } catch (SpaceDoesntExistException $e) { + } } public static function tearDownAfterClass(): void { - (new Spaces($_ENV['SPACES_KEY'], $_ENV['SPACES_SECRET']))->space(self::$tempSpaceName)->destroy(); + (new Spaces($_ENV['SPACES_KEY'], $_ENV['SPACES_SECRET']))->space('spaces-api-test')->destroy(); } public function testAuthenticationCanFail() @@ -53,7 +53,7 @@ class SpacesTest extends TestCase */ public function testCanCreateSpace(Spaces $spaces) { - $space = $spaces->create(self::$tempSpaceName); + $space = $spaces->create('spaces-api-test'); $this->assertInstanceOf(Space::class, $space); return $space; @@ -69,7 +69,7 @@ class SpacesTest extends TestCase $spaceFound = false; foreach ($list as $name => $space) { - if ($name == self::$tempSpaceName && $space->getName() == self::$tempSpaceName) { + if ($name == 'spaces-api-test' && $space->getName() == 'spaces-api-test') { $spaceFound = true; } }