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

Deprecated: Return type of MyCLabs\Enum\Enum::jsonSerialize() should... #39

Open
kodie opened this issue Feb 20, 2022 · 4 comments
Open

Comments

@kodie
Copy link

kodie commented Feb 20, 2022

Running into these errors while running strauss:

PHP Deprecated:  Return type of MyCLabs\Enum\Enum::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/kodiegrantham/.composer/vendor/myclabs/php-enum/src/Enum.php on line 246

Deprecated: Return type of MyCLabs\Enum\Enum::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/kodiegrantham/.composer/vendor/myclabs/php-enum/src/Enum.php on line 246

I have it installed as a global package due to a conflict with the version of flysystem that strauss uses and the one my package uses.

It hangs there for a while and then ultimately fails with this error:

PHP Fatal error:  Uncaught TypeError: BrianHenryIE\Strauss\Licenser::addChangeDeclarationToPhpString(): Return value must be of type string, null returned in /Users/kodiegrantham/.composer/vendor/brianhenryie/strauss/src/Licenser.php:270
@BrianHenryIE
Copy link
Owner

I tried updating the flysystem version but the breaking changes need updates to Strauss's code.

I hesitate to do that because I want unit tests against the file system operations so I feel that should be done at the same time.

It wasn't me who chose flysystem, so I'm open to suggestions on what library is best for filesystem access.

@kodie
Copy link
Author

kodie commented Apr 24, 2023

@BrianHenryIE Flysystem is definitely the best package to use for accessing the file system which is why I'm using it for my package as well. I'm not really sure how to go about fixing the conflict which is ironic since Strauss is meant to solve that problem for other packages but can't for itself 😄

@kodie
Copy link
Author

kodie commented Apr 24, 2023

@BrianHenryIE I basically got around this by not installing the package as a global one but having a script that downloads the phar file and uses that instead which seems to be working fine for me:

  "scripts": {
    "strauss": [
      "test -e strauss.phar || curl -o strauss.phar -L -C - https://github.com/BrianHenryIE/strauss/releases/download/0.14.0/strauss.phar",
      "php strauss.phar"
    ],
    "post-install-cmd": [
      "@strauss"
    ],
    "post-update-cmd": [
      "@strauss"
    ]
  },

@BrianHenryIE
Copy link
Owner

I think that will be the recommended way to use Stauss in future. I plan to add CLI parameters so it can mostly be used without the Composer extra key.

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

2 participants