Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config - incompatible function signatures #1102

Open
Sweetchuck opened this issue Feb 14, 2022 · 6 comments
Open

Config - incompatible function signatures #1102

Sweetchuck opened this issue Feb 14, 2022 · 6 comments

Comments

@Sweetchuck
Copy link
Contributor

Sweetchuck commented Feb 14, 2022

Steps to reproduce

package version commit
consolidation/robo 3.x-dev 5d0c995
consolidation/config 2.x-dev fde7dfee1885ecca9afa3adb8442711d92a5c8ce
dflydev/dot-access-data v3.0.1
grasmash/expander dev-master 84c256112763e00d09b437d269897339ca1ceaf4

\Robo\Robo::createConfiguration()
calls the new \Robo\Config\Config(); constructor without argument.
$data = null
But the \Dflydev\DotAccessData\Data::__construct does not accepet NULL.

Expected behavior

No fatal error

Actual behavior

PHP Fatal error: Uncaught TypeError: Argument 1 passed to Dflydev\DotAccessData\Data::__construct() must be of the type array, null given, called in /project/vendor/consolidation/config/src/Config.php on line 80 and defined in /project/vendor/dflydev/dot-access-data/src/Data.php:40
Stack trace:
0 /project/vendor/consolidation/config/src/Config.php(80): Dflydev\DotAccessData\Data->__construct()
1 /project/vendor/consolidation/robo/src/Config/Config.php(43): Consolidation\Config\Config->replace()
2 /project/vendor/consolidation/robo/src/Config/Config.php(35): Robo\Config\Config->replace()
3 /project/vendor/consolidation/robo/src/Config/Config.php(26): Robo\Config\Config->import()
4 /project/vendor/consolidation/robo/src/Robo.ph in /project/vendor/dflydev/dot-access-data/src/Data.php on line 40

Sweetchuck added a commit to Sweetchuck/consolidation-robo that referenced this issue Feb 14, 2022
@greg-1-anderson
Copy link
Member

This is fixed in dev-main of consolidation/config. I think you need to be using a non-stable version of grasmash/expander to be affected.

@Sweetchuck
Copy link
Contributor Author

I am using the latest commit from the consolidation/config. Which is the fde7dfe

2.x-dev is a branch alias in the composer.json
https://github.com/consolidation/config/blob/fde7dfee1885ecca9afa3adb8442711d92a5c8ce/composer.json#L63

@Sweetchuck
Copy link
Contributor Author

Before the upgrade everything worked fine.

consolidation/config

  • before a4cf7769d6aacfb337c2008cadcb2bc9de3b95e2
  • after fde7dfee1885ecca9afa3adb8442711d92a5c8ce

consolidation/robo

grasmash/expander

  • before 95d6037344a4be1dd5f8e0b0b2571a28c397578f
  • after 84c256112763e00d09b437d269897339ca1ceaf4

I am not referencing directly the grasmash/expander in my composer.json.

{
    "require": {
        "consolidation/config": "2.x-dev",
        "consolidation/robo": "3.x-dev"
    }
}

composer why grasmash/expander

consolidation/config 2.x-dev requires grasmash/expander (^1)

@greg-1-anderson
Copy link
Member

greg-1-anderson commented Feb 14, 2022

Yeah, my understanding is that grasmash/expander ^1 holds you back to dflydev/dot-access-data ^1. If you're experiencing something else, I'm not sure what the issue is. The easiest solution, though, is a new release of consolidation/config, which I will do shortly.

@greg-1-anderson
Copy link
Member

I thought fde7dfe fixed this. Will need to investigate.

@greg-1-anderson
Copy link
Member

Oh I see the same bug exists in Robo's override of the config class.

greg-1-anderson added a commit that referenced this issue Sep 20, 2022
…dev\DotAccessData\Data (#1103)"

This reverts commit c281785.

This change was only intended for the 4.x branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants