-
Notifications
You must be signed in to change notification settings - Fork 16
[TASK] Disable E_NOTICE in error_reporting #1099
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
base: main
Are you sure you want to change the base?
Conversation
When using the PlantUML-Renderer a notice is triggered by tempnam(). This is displayed within the rendered documentation.
|
I think we should address the notice and not suppress it generally. Can you mention the notice here so that we can try how to prevent a notice somehow? |
|
with following guides.xml config: <extension
class="\phpDocumentor\Guides\Graphs\DependencyInjection\GraphsExtension"
renderer="plantuml"
plantuml-binary="/usr/bin/plantuml"
/>
Above the plantuml then this is rendered: Notice: tempnam(): file created in the system's temporary directory in /opt/guides/vendor/phpdocumentor/guides-graphs/src/Graphs/Renderer/PlantumlRenderer.php on line 48 |
|
So I actually think we should suppress that notice in the graphRenderer.php of phpdocumentor, wdyt? I think generally we do want to see PHP notices to spot errors...?! Maybe also we're missing a php.ini setting for |
|
Would you like to try to adapt your patch and actually set this |
|
Unfortunately same notice with that added to php.ini:
|
When using the local PlantUML binary renderer (renderer="plantuml"), the upstream PlantumlRenderer calls tempnam() with a subdirectory that may not exist, triggering a PHP E_NOTICE that appears in the rendered documentation output. This adds a DecoratingPlantumlBinaryRenderer that ensures the temp directory exists before delegating to the inner renderer, fixing the issue without requiring upstream changes or global E_NOTICE suppression. Resolves: TYPO3-Documentation#1099
Add unit tests to verify the decorator: - Creates temp directory when missing before rendering - Properly delegates to the inner renderer Also changes constructor to accept DiagramRenderer interface instead of concrete PlantumlRenderer to enable mocking in tests. Relates: TYPO3-Documentation#1099
Change DecoratingPlantumlBinaryRenderer constructor to accept DiagramRenderer interface instead of concrete PlantumlRenderer. This improves testability and follows dependency inversion principle. The decorator only needs the interface contract, not the concrete implementation. Relates: TYPO3-Documentation#1099
Add a test that expects tempnam() to trigger E_NOTICE when the directory doesn't exist. When this test FAILS, it indicates that PHP's behavior has changed or upstream has fixed the issue, and the DecoratingPlantumlBinaryRenderer workaround may no longer be needed. This helps track when we can safely remove this workaround. Relates: TYPO3-Documentation#1099
|
problem is the missing |
When using the local PlantUML binary renderer (renderer="plantuml"), the upstream PlantumlRenderer calls tempnam() with a subdirectory that may not exist, triggering a PHP E_NOTICE that appears in the rendered documentation output. This adds a DecoratingPlantumlBinaryRenderer that ensures the temp directory exists before delegating to the inner renderer, fixing the issue without requiring upstream changes or global E_NOTICE suppression. Resolves: TYPO3-Documentation#1099
Add unit tests to verify the decorator: - Creates temp directory when missing before rendering - Properly delegates to the inner renderer Also changes constructor to accept DiagramRenderer interface instead of concrete PlantumlRenderer to enable mocking in tests. Relates: TYPO3-Documentation#1099
Change DecoratingPlantumlBinaryRenderer constructor to accept DiagramRenderer interface instead of concrete PlantumlRenderer. This improves testability and follows dependency inversion principle. The decorator only needs the interface contract, not the concrete implementation. Relates: TYPO3-Documentation#1099
Add a test that expects tempnam() to trigger E_NOTICE when the directory doesn't exist. When this test FAILS, it indicates that PHP's behavior has changed or upstream has fixed the issue, and the DecoratingPlantumlBinaryRenderer workaround may no longer be needed. This helps track when we can safely remove this workaround. Relates: TYPO3-Documentation#1099
When using the PlantUML-Renderer a notice is triggered by tempnam(). This is displayed within the rendered documentation.