[TASK] Ensure type safety in YamlFileLoader
The method getFileContents has return type string. However it contains a call to file_get_contents, that can return a boolean in case of failure. Added a check for if the file is readable and a cast to string when returning the value of the call to file_get_contents. In case of failure it will return the empty string, which will be caught properly in the method loadAndParse. Afterwards the error handling could be improved in loadAndParse to be more specific. Resolves: #100048 Releases: main, 11.5 Change-Id: Icf72332cdc2429318692682bf23e6d230109bdb6 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/77984 Tested-by:Simon Schaufelberger <simonschaufi+typo3@gmail.com> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by:
Oliver Klee <typo3-coding@oliverklee.de> Tested-by:
core-ci <typo3@b13.com> Reviewed-by:
Simon Schaufelberger <simonschaufi+typo3@gmail.com> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch>
Please register or sign in to comment