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

Instantiator not able to resolve __constructor with alone argument #63

Open
tonicospinelli opened this issue Jul 2, 2016 · 1 comment
Labels
Milestone

Comments

@tonicospinelli
Copy link
Member

An excpetion was throwed when try to construct an object with only one parameter at constructor and it being a reference to another object.

[productRepository \Develop\Business\Application\Product\Repositories\Product]
__construct = [[databaseConnection]]
PHP Catchable fatal error:  Object of class Respect\Config\Instantiator could not be converted to string in /Users/aspinelli/Projects/tonicospinelli/developing-for-business/vendor/respect/config/library/Respect/Config/Container.php on line 310

So, works when I use property name instead of constructor call!

@tonicospinelli tonicospinelli changed the title Instantiator not able to resolve __constructor with alone Instantiator not able to resolve __constructor with alone argument Jul 19, 2016
@augustohp augustohp added this to the 2.1 milestone Dec 3, 2017
@augustohp augustohp added the bug label Dec 3, 2017
@augustohp
Copy link
Member

augustohp commented Dec 5, 2017

Although there is a bug in the parser here, it will come to a point where we still need to solve an issue with the DSL we are using over INI files: [] is used to detect variables, but they also denote a sequence (e.g: [a] is variable a or a sequence containing element a?).

I was thinking on moving the variable expansion to @name:

[@db PDO]
dsn = "sqlite::memory:"

[@instanceName From\Class]
__construct[] = [@db]
appendSequence[] = [a]

I would prefer $, like in PHP, but I am not inclined to make people deal with variable expansion inside PHP scripts while dealing with Config.

Any thoughts against this @Respect/core ?

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

No branches or pull requests

2 participants