Skip to content

Commit

Permalink
feat: add support for Storage::drive besides Storage::disk (#1241)
Browse files Browse the repository at this point in the history
  • Loading branch information
PrinsFrank committed May 23, 2022
1 parent 99861c5 commit c1f8bc7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Improvements
* feat: Added conditional return types

### Improvements
* feat: add Storage::drive() support by @PrinsFrank in https://github.com/nunomaduro/larastan/pull/1241

### Fixes

* fix: Change QueryBuilder::newQuery() @return from `$this` to `static`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function getClass(): string

public function isStaticMethodSupported(MethodReflection $methodReflection): bool
{
return $methodReflection->getName() === 'disk';
return $methodReflection->getName() === 'disk' || $methodReflection->getName() === 'drive';
}

public function getTypeFromStaticMethodCall(
Expand Down
10 changes: 10 additions & 0 deletions tests/Features/Methods/StorageFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,21 @@ public function testDisk(): Filesystem
return Storage::disk();
}

public function testDrive(): Filesystem
{
return Storage::drive();
}

public function testDiskGetDriver(): bool
{
return Storage::disk()->deleteDirectory('foo');
}

public function testDriveGetDriver(): bool
{
return Storage::drive()->deleteDirectory('foo');
}

/** @return string|false */
public function testPutFile()
{
Expand Down

0 comments on commit c1f8bc7

Please sign in to comment.