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

[10.x] Enhancement of Interface Cloud: Addition of fileExists method #47723

Closed
wants to merge 1 commit into from
Closed

[10.x] Enhancement of Interface Cloud: Addition of fileExists method #47723

wants to merge 1 commit into from

Conversation

BadJacky
Copy link

Description:
This pull request addresses a recurring PHPStan error that point out an undefined method, fileExists(), being called on the Illuminate\Contracts\Filesystem\Cloud interface.

This has been corrected by introducing a fileExists() method in the Cloud interface, which clarifies the contract for all classes that implement this interface. Consequently, it serves two essential tasks:

Fixes PHPStan error: Call to an undefined method Illuminate\Contracts\Filesystem\Cloud::fileExists(). when I using the Storage::cloud()->fileExists($s3_relative_path) to ensure the determine if a file exists.
Makes the interface's responsibilities more explicit and precise.
Modified Files:
Illuminate\Contracts\Filesystem\Cloud
Tasks:
Add fileExists() method to the Cloud interface
Update all the classes that implement Cloud interface and provide an implementation for fileExists()
Testing:
After the correction:

All existing tests should pass without any error
No PHPStan errors should be thrown for Call to an undefined method Illuminate\Contracts\Filesystem\Cloud::fileExists(). ✏️ app/Console/Commands/File/Retrieve.php
Note: This PR doesn't include implementations for fileExists(). The classes that implement Cloud should provide their own.

Copy link
Member

@GrahamCampbell GrahamCampbell left a comment

Choose a reason for hiding this comment

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

This is a breaking change, and cannot be made on the 10.x series.

@BadJacky
Copy link
Author

BadJacky commented Jul 12, 2023

@GrahamCampbell
Is not this a BC ?
#47664

@GrahamCampbell
Copy link
Member

No, that is a bug fix. All bug fixes could be argued to be BC breaks... but the difference is that a bug fix is changing to something to what it was always meant to be. This PR does not do that.

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.

3 participants