beyondcode / invoker-community

74 stars 2 forks source link

Open project error - Declaration of Doctrine #205

Closed spaceworkplatform closed 3 years ago

spaceworkplatform commented 3 years ago

OS: darwin Invoker Version: 2.5.0 Laravel Version: unknown Local project: true PHP Binary: /usr/local/bin/php Route: /home

Error:

Symfony\Component\ErrorHandler\Error\FatalError 

  Declaration of Doctrine\DBAL\Driver\PDOConnection::prepare($sql, $driverOptions = []) must be compatible with Doctrine\DBAL\Driver\Connection::prepare(string $sql): Doctrine\DBAL\Driver\Statement

  at phar:/Applications/Invoker.app/Contents/Resources/invoker.phar/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:41
     37▕     public function getServerVersion()
     38▕     {
     39▕         return \PDO::getAttribute(\PDO::ATTR_SERVER_VERSION);
     40▕     }
  ➜  41▕     public function prepare($sql, $driverOptions = [])
     42▕     {
     43▕         try {
     44▕             $statement = parent::prepare($sql, $driverOptions);
     45▕             \assert($statement instanceof \PDOStatement);

      +39 vendor frames 
  40  phar:/Applications/Invoker.app/Contents/Resources/invoker.phar/invoker.php:11
      App\Console\Kernel::bootstrap()

  41  /Applications/Invoker.app/Contents/Resources/invoker.phar:12
      ()

   Whoops\Exception\ErrorException 

  Declaration of Doctrine\DBAL\Driver\PDOConnection::prepare($sql, $driverOptions = []) must be compatible with Doctrine\DBAL\Driver\Connection::prepare(string $sql): Doctrine\DBAL\Driver\Statement

  at phar:/Applications/Invoker.app/Contents/Resources/invoker.phar/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:41
     37▕     public function getServerVersion()
     38▕     {
     39▕         return \PDO::getAttribute(\PDO::ATTR_SERVER_VERSION);
     40▕     }
  ➜  41▕     public function prepare($sql, $driverOptions = [])
     42▕     {
     43▕         try {
     44▕             $statement = parent::prepare($sql, $driverOptions);
     45▕             \assert($statement instanceof \PDOStatement);

      +1 vendor frames 
  2   [internal]:0
      Whoops\Run::handleShutdown()
mpociot commented 3 years ago

Can you tell me your local PHP version? I'm unable to reproduce this issue.

sbrow commented 3 years ago

I have the same issue with php 7.4 on darwin

hesje commented 3 years ago

Same issue with php 7.4 on darwin and laravel version 8.44.0

morganchorlton3 commented 3 years ago

Same issue here with php 8.0

mpociot commented 3 years ago

Can you reproduce this with a new Laravel app?

danutavadanei commented 3 years ago

Same issue here:

image


OS: darwin Invoker Version: 2.5.0 Laravel Version: 8.44.0 Local project: true PHP Binary: /usr/local/bin/php Route: /project/index?class=App%5CModels%5CEmployee&time=1622465538019&project=local-g6c69Nz45Gq3tiPtt8u2YU

Error:

Symfony\Component\ErrorHandler\Error\FatalError 

  Declaration of Doctrine\DBAL\Driver\PDOConnection::prepare($sql, $driverOptions = Array) must be compatible with Doctrine\DBAL\Driver\Connection::prepare(string $sql): Doctrine\DBAL\Driver\Statement

  at phar:/Applications/Invoker.app/Contents/Resources/invoker.phar/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:41
     37▕     public function getServerVersion()
     38▕     {
     39▕         return \PDO::getAttribute(\PDO::ATTR_SERVER_VERSION);
     40▕     }
  ➜  41▕     public function prepare($sql, $driverOptions = [])
     42▕     {
     43▕         try {
     44▕             $statement = parent::prepare($sql, $driverOptions);
     45▕             \assert($statement instanceof \PDOStatement);

      +26 vendor frames 
  27  phar:/Applications/Invoker.app/Contents/Resources/invoker.phar/src/Actions/IndexResourceAction.php:57
      Illuminate\Database\Eloquent\Builder::paginate()

  28  phar:/Applications/Invoker.app/Contents/Resources/invoker.phar/src/Actions/IndexResourceAction.php:36
      _HumbugBoxf6d381edc73c\Invoker\Actions\IndexResourceAction::getEntries()

   Whoops\Exception\ErrorException 

  Declaration of Doctrine\DBAL\Driver\PDOConnection::prepare($sql, $driverOptions = Array) must be compatible with Doctrine\DBAL\Driver\Connection::prepare(string $sql): Doctrine\DBAL\Driver\Statement

  at phar:/Applications/Invoker.app/Contents/Resources/invoker.phar/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:41
     37▕     public function getServerVersion()
     38▕     {
     39▕         return \PDO::getAttribute(\PDO::ATTR_SERVER_VERSION);
     40▕     }
  ➜  41▕     public function prepare($sql, $driverOptions = [])
     42▕     {
     43▕         try {
     44▕             $statement = parent::prepare($sql, $driverOptions);
     45▕             \assert($statement instanceof \PDOStatement);

      +23 vendor frames 
  24  phar:/Applications/Invoker.app/Contents/Resources/invoker.phar/src/Actions/IndexResourceAction.php:57
      Illuminate\Database\Eloquent\Builder::paginate()

  25  phar:/Applications/Invoker.app/Contents/Resources/invoker.phar/src/Actions/IndexResourceAction.php:36
      _HumbugBoxf6d381edc73c\Invoker\Actions\IndexResourceAction::getEntries()
strotgen commented 3 years ago

Hi! I am having the same issue. This started happening since the last update. Let me know if I can provide more information.


OS: linux Invoker Version: 2.5.0 Laravel Version: 8.37.0 Local project: unknown PHP Binary: /usr/local/bin/php PHP: 8.0.1 Route: /project/index?class=App%5CDomain%5CPayees%5CModels%5COffer&time=1622467816189&project=remote-vpiXJeyXPPUksKdSxbP8QN

Error:

PHP Fatal error:  Declaration of Doctrine\DBAL\Driver\PDOConnection::prepare($sql, $driverOptions = []) must be compatible with Doctrine\DBAL\Driver\Connection::prepare(string $sql): Doctrine\DBAL\Driver\Statement in phar:///tmp/forge_invoker.phar/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php on line 41
spaceworkplatform commented 3 years ago

Can you tell me your local PHP version? I'm unable to reproduce this issue.

PHP 8.0.6 (cli) (built: May 8 2021 02:01:02) ( NTS ) Copyright (c) The PHP Group Zend Engine v4.0.6, Copyright (c) Zend Technologies with Xdebug v3.0.4, Copyright (c) 2002-2021, by Derick Rethans with Zend OPcache v8.0.6, Copyright (c), by Zend Technologies

hansensalim commented 3 years ago

Can you reproduce this with a new Laravel app?

@mpociot Managed to reproduce this on new Laravel app by requiring v3^ doctrine/dbal dependency.

PHP: 8.0.3 Laravel: 8.28.1 doctrine/dbal: 3.1.0

I noticed that one of my project could be loaded just fine and it is using doctrine/dbal 2.13.0 I downgraded the doctrine/dbal on the test laravel app from v3.1 to v2.13 and it immediately works.

tfevens commented 3 years ago

Can replicate the findings of @hansensalim - I have apps locally that are using 3.1.0 and 2.13.1 of docrine/dbal. Only the 2.13.1 app is able to connect using Invoker.

ercsctt commented 3 years ago

Was also getting this problem, managed to fix it by downgrading doctrine/dbal to 2.13.1, it was previously 3.1.0.

morganchorlton3 commented 3 years ago

downgrading to 2.13.1 also worked for me, for both a current project and new laravel project

felixsc commented 3 years ago

Having the same issue after upgrading Invoker.

OS: linux (ubuntu) Invoker Version: 2.5.0 Laravel Version: 8.38 PHP: 8.0.1

domthomas-dev commented 3 years ago

Yes me too with the last version

OS: linux Invoker Version: 2.5.0 Laravel Version: 8.45.1 **PHP: 8.0.3

mpociot commented 3 years ago

Invoker 2.5.1 fixes this issue

domthomas-dev commented 3 years ago

Great. When can we update with this version ? At this moment, this version is no available. @mpociot

sschlein commented 3 years ago

It is?

CleanShot 2021-06-11 at 08 22 53@2x
domthomas-dev commented 3 years ago

Ok sorry. AutoUpdate not find it.