lavary/crunz

some problems whith v2.3.0 but on v1.12.4 and php v5.6 everything is fine

ishicamiru opened this issue · 14 comments

Crunz version: 2.3.0

PHP version: 8.0.0 and 7.4.13

**Operating system type and versionubuntu v2004:

Description
devilbox@php-8.0.0 in /shared/httpd/new_sheduler $ vendor/bin/crunz schedule:run

Fatal error: Declaration of Symfony\Component\DependencyInjection\ServiceLocator::has(string $id) must be compatible with Psr\Container\ContainerInterface::has($id) in /shared/httpd/new_sheduler/vendor/symfony/dependency-injection/ServiceLocator.php on line 46

Call Stack:
0.0001 421984 1. {main}() /shared/httpd/new_sheduler/vendor/lavary/crunz/crunz:0
0.0037 995328 2. Crunz\Application->__construct($appName = 'Crunz Command Line Interface', $appVersion = 'v2.2.1') /shared/httpd/new_sheduler/vendor/lavary/crunz/crunz:70
0.0040 1030008 3. Crunz\Application->initializeContainer() /shared/httpd/new_sheduler/vendor/lavary/crunz/src/Application.php:67
0.0044 1063584 4. Crunz\Application->buildContainer() /shared/httpd/new_sheduler/vendor/lavary/crunz/src/Application.php:119
0.0044 1063584 5. Composer\Autoload\ClassLoader->loadClass($class = 'Symfony\Component\DependencyInjection\ContainerBuilder') /shared/httpd/new_sheduler/vendor/lavary/crunz/src/Application.php:150
0.0044 1063712 6. Composer\Autoload\includeFile($file = '/shared/httpd/new_sheduler/vendor/composer/../symfony/dependency-injection/ContainerBuilder.php') /shared/httpd/new_sheduler/vendor/composer/ClassLoader.php:322
0.0059 1277920 7. include('/shared/httpd/new_sheduler/vendor/symfony/dependency-injection/ContainerBuilder.php') /shared/httpd/new_sheduler/vendor/composer/ClassLoader.php:444
0.0059 1277920 8. Composer\Autoload\ClassLoader->loadClass($class = 'Symfony\Component\DependencyInjection\Container') /shared/httpd/new_sheduler/vendor/symfony/dependency-injection/ContainerBuilder.php:53
0.0059 1278048 9. Composer\Autoload\includeFile($file = '/shared/httpd/new_sheduler/vendor/composer/../symfony/dependency-injection/Container.php') /shared/httpd/new_sheduler/vendor/composer/ClassLoader.php:322
0.0062 1330576 10. include('/shared/httpd/new_sheduler/vendor/symfony/dependency-injection/Container.php') /shared/httpd/new_sheduler/vendor/composer/ClassLoader.php:444
0.0063 1333912 11. class_exists($class = 'Symfony\Component\DependencyInjection\Argument\ServiceLocator') /shared/httpd/new_sheduler/vendor/symfony/dependency-injection/Container.php:29
0.0063 1334040 12. Composer\Autoload\ClassLoader->loadClass($class = 'Symfony\Component\DependencyInjection\Argument\ServiceLocator') /shared/httpd/new_sheduler/vendor/symfony/dependency-injection/Container.php:29
0.0063 1334168 13. Composer\Autoload\includeFile($file = '/shared/httpd/new_sheduler/vendor/composer/../symfony/dependency-injection/Argument/ServiceLocator.php') /shared/httpd/new_sheduler/vendor/composer/ClassLoader.php:322
0.0063 1339944 14. include('/shared/httpd/new_sheduler/vendor/symfony/dependency-injection/Argument/ServiceLocator.php') /shared/httpd/new_sheduler/vendor/composer/ClassLoader.php:444
0.0063 1339944 15. Composer\Autoload\ClassLoader->loadClass($class = 'Symfony\Component\DependencyInjection\ServiceLocator') /shared/httpd/new_sheduler/vendor/symfony/dependency-injection/Argument/ServiceLocator.php:21
0.0064 1340072 16. Composer\Autoload\includeFile($file = '/shared/httpd/new_sheduler/vendor/composer/../symfony/dependency-injection/ServiceLocator.php') /shared/httpd/new_sheduler/vendor/composer/ClassLoader.php:322
0.0066 1362368 17. include('/shared/httpd/new_sheduler/vendor/symfony/dependency-injection/ServiceLocator.php') /shared/httpd/new_sheduler/vendor/composer/ClassLoader.php:444

image
image
image

Possible Workaround composer require symfony/service-contracts:2.2.0 =>
i can use vendor/bin/crunz schedule:run but task commands only fire once,

Interesting, please show output of composer info and your composer.json file.

Sorry, I mean composer info output without symfony/service-contracts dependency.

doctrine/lexer 1.2.1 PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.
dragonmantank/cron-expression v2.3.1 CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due
egulias/email-validator 3.1.1 A library for validating emails against several RFCs
lavary/crunz v2.3.0 Schedule your tasks right from the code.
opis/closure 3.6.2 A library that can be used to serialize closures (anonymous functions) and arbitrary objects.
psr/container 1.1.1 Common Container Interface (PHP FIG PSR-11)
psr/log 1.1.3 Common interface for logging libraries
swiftmailer/swiftmailer v6.2.7 Swiftmailer, free feature-rich PHP mailer
symfony/config v5.2.4 Helps you find, load, combine, autofill and validate configuration values of any kind
symfony/console v5.2.6 Eases the creation of beautiful and testable command line interfaces
symfony/dependency-injection v5.2.6 Allows you to standardize and centralize the way objects are constructed in your application
symfony/deprecation-contracts v2.4.0 A generic function and convention to trigger deprecation notices
symfony/filesystem v5.2.6 Provides basic utilities for the filesystem
symfony/lock v5.2.6 Creates and manages locks, a mechanism to provide exclusive access to a shared resource
symfony/polyfill-ctype v1.22.1 Symfony polyfill for ctype functions
symfony/polyfill-iconv v1.22.1 Symfony polyfill for the Iconv extension
symfony/polyfill-intl-grapheme v1.22.1 Symfony polyfill for intl's grapheme_* functions
symfony/polyfill-intl-idn v1.22.1 Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions
symfony/polyfill-intl-normalizer v1.22.1 Symfony polyfill for intl's Normalizer class and related functions
symfony/polyfill-mbstring v1.22.1 Symfony polyfill for the Mbstring extension
symfony/polyfill-php72 v1.22.1 Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions
symfony/polyfill-php73 v1.22.1 Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions
symfony/polyfill-php80 v1.22.1 Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
symfony/process v5.2.4 Executes commands in sub-processes
symfony/service-contracts v2.4.0 Generic abstractions related to writing services
symfony/string v5.2.6 Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way
symfony/yaml v5.2.5 Loads and dumps YAML files
image
image

I'm trying to reproduce it locally but without success. You could try to remove Crunz cache /tmp/.crunz (inside container/VM) and try again. Depedencies' versions seems ok.

performed the above action but was unsuccessful, thanks for your support)

Could you create repo with Docker (and composer.lock file) to reproduce the issue?

Tested your repo on Ubuntu with PHP 8.0.3 and Crunz works, so I'm unable to reproduce this issue.

https://github.com/ishicamiru/Schedule sorry, i update repo ,(symfony/service-contracs:2.4.0 as in the original lavary/crunz)

Tested code after update but still cannot reproduce issue.

for those who use devilbox in the .even file write psr,phalcon
and re-install lavary / crunz
image

Nice finding. This is why i can't reproduce it on my local machine. Thanks @ishicamiru.