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

Added more logging and some code refactor #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jmartinmad
Copy link
Collaborator

No description provided.

*/
public function delete($path)
private function ensureWeCanWriteDestFile($newpath, $overwrite)

Choose a reason for hiding this comment

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

we have exactly the same check in src/Cmp/Storage/Adapter/FileSystemAdapter.php
maybe in future common checks between those two classes we can create a common class for check it, and avoid duplicate it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I had some doubts about this because it's only one function, but yes, may be is a good idea prepare a trait to afford this duplicate function and future duplicate checks if any.

Copy link

@hmoragregaCMP hmoragregaCMP left a comment

Choose a reason for hiding this comment

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

👍

* @param \Exception $e
*/
private function logAdapterException($adapter, $e)
private function logAdapterException(AdapterInterface $adapter, $e)

Choose a reason for hiding this comment

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

add \Exception

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed!

*
* @throws InvalidStorageAdapterException
*/
public function __construct(array $config = [], $bucket = '', $pathPrefix = '')
public function __construct(array $config = [], $bucket = '', $pathPrefix = '', $options = [])

Choose a reason for hiding this comment

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

Add array or [] to $option declaration.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed!

$e = new FileExistsException($newpath);
$this->logger->log(
LogLevel::ERROR,
'Adapter "'.$this->getName().'" fails. Des file {path} already exists.',

Choose a reason for hiding this comment

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

Des means destination?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Typo, fixed!

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.

4 participants