franzliedke / studio

A workbench for developing Composer packages.
MIT License
1.14k stars 73 forks source link

drop support for php <8.1 #122

Open head1328 opened 1 year ago

head1328 commented 1 year ago

studio create throws an error using PHP 8.2

`Fatal error: Uncaught Error: Attempt to modify property "psr-4" on null in /Users/head/.composer/vendor/franzl/studio/src/Parts/PhpUnit/Part.php:19 Stack trace:

0 /Users/head/.composer/vendor/franzl/studio/src/Creator/SkeletonCreator.php(55): Studio\Parts\PhpUnit\Part->setupPackage(Object(stdClass), Object(Studio\Filesystem\Directory))

1 /Users/head/.composer/vendor/franzl/studio/src/Creator/SkeletonCreator.php(45): Studio\Creator\SkeletonCreator->installParts()

2 /Users/head/.composer/vendor/franzl/studio/src/Console/CreateCommand.php(68): Studio\Creator\SkeletonCreator->create()

3 /Users/head/.composer/vendor/franzl/studio/src/Console/BaseCommand.php(35): Studio\Console\CreateCommand->fire()

4 /Users/head/.composer/vendor/symfony/console/Command/Command.php(312): Studio\Console\BaseCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

5 /Users/head/.composer/vendor/symfony/console/Application.php(1022): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

6 /Users/head/.composer/vendor/symfony/console/Application.php(314): Symfony\Component\Console\Application->doRunCommand(Object(Studio\Console\CreateCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

7 /Users/head/.composer/vendor/symfony/console/Application.php(168): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

8 /Users/head/.composer/vendor/franzl/studio/bin/studio(30): Symfony\Component\Console\Application->run()

9 /Users/head/.composer/vendor/bin/studio(120): include('/Users/head/.co...')

10 {main}

thrown in /Users/head/.composer/vendor/franzl/studio/src/Parts/PhpUnit/Part.php on line 19`

maks-rafalko commented 6 months ago

I have the same issue Attempt to modify property "psr-4" on null

PHP 8.3.3 (cli) (built: Feb 16 2024 17:14:40) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.3, Copyright (c) Zend Technologies
    with Xdebug v3.3.1, Copyright (c) 2002-2023, by Derick Rethans

@apfelbox @franzliedke could you please look into this PR / issue?

meanwile, this is how I used this PR locally as a global installation:

nano ~/.composer/composer.json

and override content with

{
    "require": {
        "franzl/studio": "dev-php8support"
    },
    "config": {
        "allow-plugins": {
            "franzl/studio": true
        }
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/head1328/studio/"
        }
    ]
}

then

composer global update franzl/studio

I can confirm that studio works on PHP 8.3 with this PR

benr77 commented 6 months ago

Please can you also add Symfony 7.x support to this otherwise even if this is merged we are going to run into the next hurdle almost immediately. Thanks.