Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[9.x] Flysystem v3 support #40411

Merged
merged 2 commits into from
Jan 14, 2022
Merged

[9.x] Flysystem v3 support #40411

merged 2 commits into from
Jan 14, 2022

Conversation

driesvints
Copy link
Member

@driesvints driesvints commented Jan 14, 2022

This PR introduces Flysystem v3 support for Laravel 9. I've implemented the new has method that checks for both a file and directory. I've updated the subsequent methods docblock descriptions and assertion messages to make that more clear. It's how the behaviour is now in Laravel 8.

I've also added complementary fileExists, directoryExists and their missing equivalents. I didn't add assertExists equivalents because that felt a little overkill.

*
* @param string $path
* @return bool
*/
public function exists($path)
{
return $this->driver->fileExists($path);
return $this->driver->has($path);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -378,7 +422,7 @@ public function setVisibility($path, $visibility)
*/
public function prepend($path, $data, $separator = PHP_EOL)
{
if ($this->exists($path)) {
if ($this->fileExists($path)) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I adjusted these because these methods are specifically for files.

@driesvints driesvints marked this pull request as ready for review January 14, 2022 12:59
@taylorotwell taylorotwell merged commit 89e0e56 into 9.x Jan 14, 2022
@taylorotwell taylorotwell deleted the flysystem-v3 branch January 14, 2022 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants