mirror of
https://github.com/SociallyDev/Spaces-API.git
synced 2025-07-05 20:41:31 -07:00
Allowed passing validation flag to Space::file()
This commit is contained in:
parent
3a32727c28
commit
c52d22a70e
4 changed files with 194 additions and 235 deletions
|
@ -325,13 +325,14 @@ class Space
|
||||||
* Get an instance of \SpacesAPI\File for a given filename
|
* Get an instance of \SpacesAPI\File for a given filename
|
||||||
*
|
*
|
||||||
* @param string $filename
|
* @param string $filename
|
||||||
|
* @package bool $validate
|
||||||
*
|
*
|
||||||
* @return \SpacesAPI\File
|
* @return \SpacesAPI\File
|
||||||
* @throws \SpacesAPI\Exceptions\FileDoesntExistException Thrown if the file doesn't exist
|
* @throws \SpacesAPI\Exceptions\FileDoesntExistException Thrown if the file doesn't exist
|
||||||
*/
|
*/
|
||||||
public function file(string $filename): File
|
public function file(string $filename, bool $validate = true): File
|
||||||
{
|
{
|
||||||
return new File($this, $filename);
|
return new File($this, $filename, [], $validate);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "sociallydev/spaces-api",
|
"name": "sociallydev/spaces-api",
|
||||||
"description": "Library for accessing Digital Ocean spaces",
|
"description": "Library for accessing Digital Ocean spaces",
|
||||||
"version":"3.5.0",
|
"version":"3.6.0",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"authors": [
|
"authors": [
|
||||||
|
|
418
composer.lock
generated
418
composer.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -180,7 +180,7 @@ Recursively download an entire directory.
|
||||||
**Description**
|
**Description**
|
||||||
|
|
||||||
```php
|
```php
|
||||||
public file (string $filename)
|
public file (string $filename, bool $validate = true)
|
||||||
```
|
```
|
||||||
|
|
||||||
Get an instance of \SpacesAPI\File for a given filename
|
Get an instance of \SpacesAPI\File for a given filename
|
||||||
|
@ -190,6 +190,8 @@ Get an instance of \SpacesAPI\File for a given filename
|
||||||
**Parameters**
|
**Parameters**
|
||||||
|
|
||||||
* `(string) $filename`
|
* `(string) $filename`
|
||||||
|
* `(bool) $validate`
|
||||||
|
: Whether to validate the file exits. Defaults to `true`
|
||||||
|
|
||||||
**Return Values**
|
**Return Values**
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue