Problem/Motivation

When I try install this module in Drupal 8.9.16 version, I found the follow error:

ParseError: syntax error, unexpected 'EntityTypeManagerInterface' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in Symfony\Component\ClassLoader\ApcClassLoader->loadClass() (line 21 of modules/contrib/jsonapi_image_styles/src/Form/JsonApiImageStylesAdminForm.php).

Steps to reproduce

Install in Drupal 8.9.16 version

Comments

larisse created an issue. See original summary.

larisse’s picture

takuma shimabukuro’s picture

Assigned: Unassigned » takuma shimabukuro
takuma shimabukuro’s picture

Assigned: takuma shimabukuro » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new336.82 KB

I revewed the patch and after the apply this patch i could install correctly in my enviroment

I attached the image that it works

guypaddock’s picture

Technically, the previous syntax should be valid for PHP 7.4. @larisse and @Takuma Shimabukuro: What version of PHP are you using?

larisse’s picture

Hi @GuyPaddock! I'm using PHP 7.4.3 version.

guypaddock’s picture

The reason I ask is because I am running PHP 7.4 as well and did not need to apply the patch because the syntax was valid for 7.4 variable type declarations: https://stitcher.io/blog/typed-properties-in-php-74

hamrant’s picture

I have this issue on PHP 7.3.19. Security Support of the 7.3 version will be until 6 Dec 2021 - https://www.php.net/supported-versions.php, so, in my case will be simpler to use a patch for now and later update PHP. So maybe there is no point in committing this fix.

Anyway, @larisse, thanks for the fix!

wells’s picture

Status: Reviewed & tested by the community » Closed (won't fix)

Technically Drupal 9 still supports PHP 7.3 but given that security support for it ends in about two months I think we should continue to target 7.4 as a minimum version. As @hamrant notes folks who need PHP 7.3 support can use this patch.

lamp5’s picture

So please tell me why you didn't set min php version in composer file? https://git.drupalcode.org/project/jsonapi_image_styles/-/blob/2.0.x/com...
You know that we are using this module on production ? this is not a stable, it is dev.... without any standards of release process.

wells’s picture

Good point. Happy to take an MR for that change. I took this module over as abandoned only a few weeks ago I can’t say I’ll intimately familiar with it (:

wells’s picture

Status: Closed (won't fix) » Needs work

  • wells committed 2c708c8 on 2.0.x authored by larisse
    Issue #3229668 by larisse, Takuma Shimabukuro, GuyPaddock, hamrant,...
wells’s picture

Status: Needs work » Fixed

On second thought that seems unnecessary since we can't technically enforce PHP 7.4 on the new 3.0.x branch. I'll update the project description to clarify this stuff after I get a 3.x release out. Thanks, all!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.