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

PreviewFactory#createPreviewFigureBuilder produces a warning for non-existing paths #7053

Open
m-vo opened this issue Mar 24, 2024 · 0 comments

Comments

@m-vo
Copy link
Member

m-vo commented Mar 24, 2024

Affected version(s)

4.13, 5.3

Description

Consider the following code:

$figure = $this->previewFactory
    ->createPreviewFigureBuilder($path, '_preview')
    ->buildIfResourceExists()
;

If path does not point to a valid resource (anymore), the call to createPreviewFigureBuilder will produce a warning:

Warning: filemtime(): stat failed for […]

This makes the API a bit cumbersome to use, because now you'll first need to check if a file exists before you can make calls to the factory. Can we improve this? In the above example, it would be nice, if the result would just be null like when using the FigureBuilder directly.

/cc @ausi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant