Skip to content
This repository has been archived by the owner on Sep 24, 2020. It is now read-only.

Fatal error: Uncaught TypeError #353

Closed
EvgenyOrekhov opened this issue Feb 9, 2018 · 6 comments
Closed

Fatal error: Uncaught TypeError #353

EvgenyOrekhov opened this issue Feb 9, 2018 · 6 comments
Labels

Comments

@EvgenyOrekhov
Copy link
Contributor

When I run vendor/bin/phpsa check I get the following error:

Fatal error: Uncaught TypeError: Argument 1 passed to PHPSA\Configuration::__construct() must be of the type array, null given, called in /app/vendor/ovr/phpsa/src/Command/AbstractCommand.php on line 48 and defined in /app/vendor/ovr/phpsa/src/Configuration.php:34
Stack trace:
#0 /app/vendor/ovr/phpsa/src/Command/AbstractCommand.php(48): PHPSA\Configuration->__construct(NULL, Array, NULL)
#1 /app/vendor/ovr/phpsa/src/Command/CheckCommand.php(75): PHPSA\Command\AbstractCommand->loadConfiguration('.phpsa.yml', '/app')
#2 /app/vendor/symfony/console/Command/Command.php(252): PHPSA\Command\CheckCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /app/vendor/symfony/console/Application.php(865): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /app/vendor/symfony/console/Application.php(241): Symfony\Component\Console\Application->doRunCommand(Obj in /app/vendor/ovr/phpsa/src/Configuration.php on line 34

I don't have a .phpsa.yml in my project. Do I need one? Should PHPSA work without a .phpsa.yml?

@EvgenyOrekhov
Copy link
Contributor Author

PHPSA version: e2d3e11
PHP version: 7.2.2
symfony/* packages version: 4.0.4

@ddmler
Copy link
Collaborator

ddmler commented Feb 10, 2018

You do need a .phpsa.yml file. If you don't have one yourself it should use the one in the root project directory. Did you delete that one or is it broken?

@EvgenyOrekhov
Copy link
Contributor Author

@ddmler This is how I got fatal error:

  1. composer require --dev ovr/phpsa:dev-master
  2. vendor/bin/phpsa check

What did I do wrong?

@ddmler
Copy link
Collaborator

ddmler commented Feb 11, 2018

I tried your steps, it's a bug in finding the location of the config file here:
https://github.com/ovr/phpsa/blob/master/src/Command/AbstractCommand.php#L38
both supplied file locations here are your project root directory, we need one that looks inside our vendor/ovr/phpsa folder.

@ddmler ddmler added the bug label Feb 11, 2018
@armoour
Copy link

armoour commented Jul 10, 2018

i met this issue too.

@EvgenyOrekhov
Copy link
Contributor Author

I am no longer interested in this. Feel free to reopen if needed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants