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

get_class() expects parameter 1 to be object, null given #132

Open
iredmedia opened this issue Jan 10, 2018 · 2 comments
Open

get_class() expects parameter 1 to be object, null given #132

iredmedia opened this issue Jan 10, 2018 · 2 comments

Comments

@iredmedia
Copy link

iredmedia commented Jan 10, 2018

I'm getting this error in one of my environments but I can't figure out why. It doesn't fail on home/login, but my internal pages it does.

get_class() expects parameter 1 to be object, null given

Here is more of the stack!

in Attachment.php (line 388)
--
at HandleExceptions->handleError(2, 'get_class() expects parameter 1 to be object, null given', '/app/vendor/codesleeve/stapler/src/Attachment.php', 388, array())
at get_class(null)in Attachment.php (line 388)
at Attachment->getInstanceClass()in Stapler.php (line 177)
at Stapler::getS3ClientInstance(object(Attachment))in Storage.php (line 27)

Edit: If i change the env FILESYSTEM_DRIVER to filesystem from S3 it works fine.

@lostincode
Copy link

Most likely because one of your environments is PHP 7.2 and the other is not.

Note: Explicitly passing NULL as the object is no longer allowed as of PHP 7.2.0. The parameter is still optional and calling get_class() without a parameter from inside a class will work, but passing NULL now emits an E_WARNING notice.

http://php.net/manual/en/function.get-class.php

Looks like this package will need an update to support PHP 7.2 and up.

@Alex-query
Copy link

i found a bad decidion use @ before $this->hasAttachedFile in __construct
// @$this->hasAttachedFile

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

No branches or pull requests

3 participants