padawan-php / padawan.php

php intelligent code completion http server
http://mkusher.name/padawan/
MIT License
253 stars 30 forks source link

Cannot execute the command padawan in terminal #112

Closed miguelcjalmeida closed 6 years ago

miguelcjalmeida commented 6 years ago

Hello,

I am trying to execute the command: padawan, but I get the following exception:

Fatal error: Cannot use lexical variable $parameters as a parameter name in /home/scotilen/.config/composer/vendor/mnapoli/php-di/src/DI/Definition/Resolver/ClassDefinitionResolver.php on line 146

Call Stack:
    0.0001     393976   1. {main}() /home/scotilen/.config/composer/vendor/mkusher/padawan/bin/padawan:0
    0.0025     879576   2. Application\CLI\App->__construct() /home/scotilen/.config/composer/vendor/mkusher/padawan/bin/padawan:26
    0.0025     879576   3. Application\CLI\App->__construct() /home/scotilen/.config/composer/vendor/mkusher/padawan/src/Application/CLI/App.php:11
    0.0025     879576   4. Application\CLI\App->createContainer() /home/scotilen/.config/composer/vendor/mkusher/padawan/src/Application/BaseApplication.php:17
    0.0035    1090472   5. DI\ContainerBuilder->build() /home/scotilen/.config/composer/vendor/mkusher/padawan/src/Application/BaseApplication.php:70
    0.0050    1244696   6. DI\Container->__construct() /home/scotilen/.config/composer/vendor/mnapoli/php-di/src/DI/ContainerBuilder.php:152
    0.0052    1266768   7. spl_autoload_call() /home/scotilen/.config/composer/vendor/mnapoli/php-di/src/DI/Container.php:82
    0.0052    1266848   8. Composer\Autoload\ClassLoader->loadClass() /home/scotilen/.config/composer/vendor/mnapoli/php-di/src/DI/Container.php:82
    0.0052    1267008   9. Composer\Autoload\includeFile() /home/scotilen/.config/composer/vendor/composer/ClassLoader.php:322

My environment is configured with php 7.2.0 and composer 1.5.6 on a Manjaro linux.

I have installed padawan with the following command: composer global require mkusher/padawan

Does anybody knows what I am doing wrong?

Thanks for any help!

pbogut commented 6 years ago

You have installed v0.2.1 version, its the latest stable one but its pretty old and may not work with php 7. Try to install dev-master version via composer global require mkusher/padawan:dev-master.

miguelcjalmeida commented 6 years ago

Hi! thank you for your quick reply. I tried running the command you recommended, but it did not work. I got the following messages:

$ composer global require mkusher/padawan:dev-master
Changed current directory to /home/scotilen/.config/composer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for mkusher/padawan dev-master -> satisfiable by mkusher/padawan[dev-master].
    - mkusher/padawan dev-master requires react/filesystem dev-master -> satisfiable by react/filesystem[dev-master] but these conflict with your requirements or minimum-stability.

Installation failed, reverting ./composer.json to its original content.
miguelcjalmeida commented 6 years ago

I am sorry It seems composer has a setup to allow you to require @dev dependencies. So all I had to do is run the following command which added a minimum-stability flag in my composer.json:

composer global config minimum-stability dev # Sets minimum-stability to "dev"

So my global composer.json looks like this now:


{
   "require": { "mkusher/padawan": "dev-master"
    "minimum-stability": "dev"
}

Thank you! padawan is working great now <3