TomasVotruba / lines

CLI tool for quick size measure of PHP project, runs anywhere
https://tomasvotruba.com/blog/easy-and-quick-way-to-measure-lines-of-code-in-php
MIT License
161 stars 4 forks source link

installing "lines" in a symfony project results in 'Attempted to load class "UnicodeString" from namespace' error #34

Open c33s opened 1 year ago

c33s commented 1 year ago

as "lines" replaces symfony/string

....
    "replace": {
        "symfony/string": "*",
        "symfony/polyfill-ctype": "*",
        "symfony/polyfill-intl-grapheme": "*",
        "symfony/polyfill-mbstring": "*"
    },
...

but does not provide a real replacement, it results in an error if installed in a symfony project

Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 255
!!
!!
!!  Symfony\Component\ErrorHandler\Error\ClassNotFoundError^ {#4401
!!    #message: """
!!      Attempted to load class "UnicodeString" from namespace "Symfony\Component\String".\n
!!      Did you forget a "use" statement for another namespace?
!!      """
!!    #code: 0
!!    #file: "vendor\symfony\console\Helper\Helper.php"
!!    #line: 51
!!    trace: {
!!      vendor\symfony\console\Helper\Helper.php:51 { …}
!!      vendor\symfony\console\Application.php:874 { …}
!!      vendor\symfony\console\Application.php:845 { …}
!!      vendor\symfony\http-kernel\EventListener\DebugHandlersListener.php:83 { …}
!!      vendor\symfony\error-handler\ErrorHandler.php:537 { …}
!!      Symfony\Component\ErrorHandler\ErrorHandler->handleException() {}
!!    }
!!  }
!!
Script @auto-scripts was called via post-update-cmd
TomasVotruba commented 1 year ago

Thanks for reporting :+1:

Could you try the 0.4.1.72 version? If that helps, I'll keep only the downgraded tagging

c33s commented 1 year ago

i can confirm version 0.4.1.72 works with symfony/skeleton

composer create-project symfony/skeleton:"6.3.*" my_project_directory

because if forgot to mention before: replacing polyfill-ctype also was a problem on dev-main.

  Problem 1
    - __root__ is present at version 1.0.0+no-version-set and cannot be modified by Composer
    - tomasvotruba/lines[dev-main] cannot be installed as that would require removing __root__[1.0.0+no-version-set]. They both replace symfony/polyfill-ctype and thus cannot coexist.
    - Root composer.json requires tomasvotruba/lines dev-main -> satisfiable by tomasvotruba/lines[dev-main].
TomasVotruba commented 1 year ago

I've just released 0.5 version that is downgraded without any weird suffix. Could you try it?