Giter Club home page Giter Club logo

Comments (5)

Seldaek avatar Seldaek commented on June 3, 2024 2

@dugwood Your issue is fixed in c2fd4d3 and now released as 2.7.6. The original issue here is unrelated though I believe as your problem was purely a composer runtime thing, and the OP seems to be having problem in their application autoloading, not while composer runs.

from composer.

Seldaek avatar Seldaek commented on June 3, 2024 1

You need to provide some information like at least your composer.json's autoload config..

from composer.

Seldaek avatar Seldaek commented on June 3, 2024 1

Right I'll fix that ASAP, thanks for figuring it out.

from composer.

dugwood avatar dugwood commented on June 3, 2024

Having an issue with 2.7.5 too, 2.7.4 (and previous) were working fine. Seems to be the same issue, here's my error:

Fatal error: Uncaught TypeError: Composer\EventDispatcher\EventDispatcher::getCallbackIdentifier(): Argument #1 ($cb) must be of type callable, array given, called in phar:///home/test/composer/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php on line 419 and defined in phar:///home/test/composer/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:664
Stack trace:
#0 phar:///home/test/composer/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php(419): Composer\EventDispatcher\EventDispatcher->getCallbackIdentifier()
#1 phar:///home/test/composer/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php(115): Composer\EventDispatcher\EventDispatcher->doDispatch()
#2 phar:///home/test/composer/composer.phar/src/Composer/Factory.php(448): Composer\EventDispatcher\EventDispatcher->dispatch()
#3 phar:///home/test/composer/composer.phar/src/Composer/Factory.php(629): Composer\Factory->createComposer()
#4 phar:///home/test/composer/composer.phar/src/Composer/Console/Application.php(549): Composer\Factory::create()
#5 phar:///home/test/composer/composer.phar/src/Composer/Console/Application.php(483): Composer\Console\Application->getComposer()
#6 phar:///home/test/composer/composer.phar/src/Composer/Console/Application.php(430): Composer\Console\Application->hintCommonErrors()
#7 phar:///home/test/composer/composer.phar/vendor/symfony/console/Application.php(171): Composer\Console\Application->doRun()
#8 phar:///home/test/composer/composer.phar/src/Composer/Console/Application.php(148): Symfony\Component\Console\Application->run()
#9 phar:///home/test/composer/composer.phar/bin/composer(93): Composer\Console\Application->run()
#10 /home/test/composer/composer.phar(29): require('...')
#11 {main}
  thrown in phar:///home/test/composer/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php on line 664

It happens for every call of composer.phar, whatever the arguments. And only with an autoprepend file with homemade autoloader. Disabling my autoloader solves the issue.

So clearly an issue in autoloading.

from composer.

dugwood avatar dugwood commented on June 3, 2024

To build upon previous notes:

  • @piercesteven12 issue must come from the reordering of autoloaders (which breaks the order his code expect the autoloaders)
    • for example, say there's a list of autoloaders: AL1, AL2, composer, AL3, AL4
    • the way composer rewrites the list is: composer, AL3, AL4, AL1, AL2
  • my issue is that my Autoloader isn't callable, but it works as expected... so maybe I'm missing a PHP declaration or something like that.
    • [EDIT] I was passing a private method to spl_autoload_register(), which works but is_callable() returns false (as it's not directly callable by an external code)
    • I think other people may face the same issue, perhaps removing the callable could be an option. Or add a warning that it's bad practice to have a private register function (which works)

from composer.

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.