Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Catchable fatal error: Argument 1 passed to Box\Spout\Common\Helper\FileSystemHelper #825

Open
harjindermankoo opened this issue Jul 30, 2021 · 1 comment

Comments

@harjindermankoo
Copy link

Hi
I wonder if you can help. I have large excel files and am trying to combine them into one. I am getting the error
Catchable fatal error: Argument 1 passed to Box\Spout\Common\Helper\FileSystemHelper::__construct() must be an instance of Box\Spout\Common\Helper\string, string given, called in /xxx/xxx/xxx/xxxx/website.com/vendor/spoutsrc/Spout/Writer/XLSX/Helper/FileSystemHelper.php on line 63 and defined in /xxx/xxx/xxx/xxxx//vendor/spoutsrc/Spout/Common/Helper/FileSystemHelper.php on line 20

replaced actual location with x's

PHP ver 7.2.33
Spout 3.2.0 I think. If you tell me how I can actually check that would be helpful

Any help appreciated

@adrilo
Copy link
Collaborator

adrilo commented Aug 2, 2021

Hi !
For some reasons, the string typehint defined here:

public function __construct(string $baseFolderPath)
is interpreted as belonging to the class itself. This should not be the default behavior (as you can see here: https://3v4l.org/dUDYE).
One way you can work around the issue is to add a backslash before the string (=> \string). Otherwise, I'm not sure why you are experiencing this issue...

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

No branches or pull requests

2 participants