Fix/php81#44
Conversation
|
I did notice just now that some source code formatting changes crept in due to my IDE setup. If you are not happy with it I can change those back. |
|
Hello, |
Update psr/log to ^2.0
| @@ -11,7 +11,7 @@ | |||
| "require": { | |||
There was a problem hiding this comment.
I would suggest to use a require for "php 7.4" as the code is basically compatible with 7.4
There was a problem hiding this comment.
Hi @blacktek, unfortunately it is not backwards compatible with PHP 7.4 due to keywords such mixed being used as parameters or return types amongst other things.
There was a problem hiding this comment.
I'm currently using it on 7.4 too and is working. 7.4 doesn't support multiple union return types (e.g. string | bool), that I remember were not used. Are you sure that those are currently used?
There was a problem hiding this comment.
I assumed there would be problems since the psalm test fails but if these warnings/errors can be fixed quickly in order to return composer.json to 7.4 it may be worth it. I will look into it when I have some time.
There was a problem hiding this comment.
I had a quick look but I'm guessing you are not using my Fix/php81 fork in PHP 7.4. My fork uses things like the mixed keyword as function parameters and function return types. Many switch statements were replaced by match statements. Many methods returns the static keyword. The throw new statement is used. Union types are used as function arguments, and so on.
My fork is strictly for PHP 8.1 which is why I asked the repository owner whether two separate branches can be released, i.e. a new 4.x branch alongside the 3.x branch.
Alternatively they could just resurrect their repository but it seems the primary contributor is no longer available and active on Github and have not been for a year.
There was a problem hiding this comment.
it's possible that you're right. I'm struggling a bit using your Fix/php81 on php8.1 and probably you're right that I use the old dev-master on php7.4
tnx
There was a problem hiding this comment.
If you are struggling to set up my fork in composer.json here is an extract you can use:
{
"require": {
"php": "^8.1",
"vanilla/garden-cli": "dev-fix/php81"
},
"repositories": [
{ "type": "vcs", "url": "https://github.com/donatello-za/garden-cli" }
]
}There was a problem hiding this comment.
tnx a lot :) this is exactly what I was using.
The OptSchema::merge() function may create an array of strings if a "main"/"global" description is supplied as well as a description for individual commands. This fix will prevent errors in such a case and will simply show the correct description for the command.
Hi, I am concerned about the future of this repository and through this pull request I'm hoping to get the library up to PHP 8.1's standard and compatibility.
Some notes:
LogFormatterclass and unit tests have been removed.vanilla/garden-containerrepository causes deprecation warnings during unit testing. To solve this, that package will also need upgrading to PHP 8.1If you end up using this pull request your welcome to squash the commits, I can also do it from this side but I'm not sure if you'd like to see the progression of the commits.