Respect / Respect/Config

Instantiator not able to resolve __constructor with alone argument

Open
#63 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
99
Forks
7
PR merge metrics
No merged PRs in 30d

Description

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!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at library/Respect/Config/Container.php around line 310 and reproduce the configuration shown for a constructor with one object reference, such as [[databaseConnection]]. Compare it with the working property-name form and determine the expected resolution behavior. Done means the constructor form no longer raises the object-to-string fatal error, with a regression test if the repository has an applicable test location.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.