GithubHelp home page GithubHelp logo

Comments (4)

PabloKowalczyk avatar PabloKowalczyk commented on July 17, 2024

Could you paste code to reproduce issue?

from crunz.

nhstephan avatar nhstephan commented on July 17, 2024

Apologies, the following should reproduce the issue.

$schedule = new Schedule();
$schedule->run(
    '/some/path/to/a/command',
    ['--someflag' => true]
)
...

The fatal error occurs when a boolean is passed instead of an expected string value. A solution would be to pass the boolean as a string (e.g. 'true') for the parameter, however this doesn't solve the problem of ambiguous typecasting in ProcessUtils if a non-string value is passed ... which now throws a fatal error in PHP 8.x. In ProcessUtils you may wish to add more type checking before passing parameters to native functions like str_replace.

from crunz.

PabloKowalczyk avatar PabloKowalczyk commented on July 17, 2024

Looks like Crunz tried to support ['--option' => 'value'], but it doesn't work like that in Process (https://symfony.com/doc/current/components/process.html) and this behavior (non-list array) should be deprecated, also \Crunz\Schedule::run method has docblock with @param string[] $parameters which clearly expects list of string values.

If you really want (do you?) I can convert boolean values to string 1 and 0 for now, but v3.3 will deprecate passing non-list arrays.

from crunz.

nhstephan avatar nhstephan commented on July 17, 2024

OK, thanks for the information. I will close the issue since the behavior is being deprecated.

from crunz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.