{"action":"created","issue":{"url":"https://api.github.com/repos/PHP-DI/PHP-DI/issues/383","repository_url":"https://api.github.com/repos/PHP-DI/PHP-DI","labels_url":"https://api.github.com/repos/PHP-DI/PHP-DI/issues/383/labels{/name}","comments_url":"https://api.github.com/repos/PHP-DI/PHP-DI/issues/383/comments","events_url":"https://api.github.com/repos/PHP-DI/PHP-DI/issues/383/events","html_url":"https://github.com/PHP-DI/PHP-DI/issues/383","id":134255120,"number":383,"title":"Enhance injecting configuration/scalar values","user":{"login":"mmizera","id":3079638,"avatar_url":"https://avatars.githubusercontent.com/u/3079638?v=3","gravatar_id":"","url":"https://api.github.com/users/mmizera","html_url":"https://github.com/mmizera","followers_url":"https://api.github.com/users/mmizera/followers","following_url":"https://api.github.com/users/mmizera/following{/other_user}","gists_url":"https://api.github.com/users/mmizera/gists{/gist_id}","starred_url":"https://api.github.com/users/mmizera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmizera/subscriptions","organizations_url":"https://api.github.com/users/mmizera/orgs","repos_url":"https://api.github.com/users/mmizera/repos","events_url":"https://api.github.com/users/mmizera/events{/privacy}","received_events_url":"https://api.github.com/users/mmizera/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/PHP-DI/PHP-DI/labels/enhancement","name":"enhancement","color":"009800"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-02-17T11:31:01Z","updated_at":"2016-05-14T16:51:19Z","closed_at":"2016-05-14T16:51:19Z","body":"@Resource('foo.bar.baz')\r\n\r\nas @Inject annotation injects service, @Resource could inject scalar values. Yes, I know you can @Inject('anything.under.this.key'),\r\n\r\nanyway ... @Resource should definitelly give you more possibilities, such as :\r\n\r\n-  ability to read multilevel arrays via dot notation, e.g. @Resource('foo.bar.baz') should look inside $config['foo']['bar']['baz']\r\n\t\t\tfor target value to inject\r\n\r\n-  ability to enforce scalar value type - via @var : exact (@var string), multiple @var string|array, or not, if @var mixed\r\n\r\n-  optional resources - @Resource(value=\"foo.bar.baz\", optional=true) // if not found, no error and field will hold it's default value\r\n"},"comment":{"url":"https://api.github.com/repos/PHP-DI/PHP-DI/issues/comments/219230731","html_url":"https://github.com/PHP-DI/PHP-DI/issues/383#issuecomment-219230731","issue_url":"https://api.github.com/repos/PHP-DI/PHP-DI/issues/383","id":219230731,"user":{"login":"mnapoli","id":720328,"avatar_url":"https://avatars.githubusercontent.com/u/720328?v=3","gravatar_id":"","url":"https://api.github.com/users/mnapoli","html_url":"https://github.com/mnapoli","followers_url":"https://api.github.com/users/mnapoli/followers","following_url":"https://api.github.com/users/mnapoli/following{/other_user}","gists_url":"https://api.github.com/users/mnapoli/gists{/gist_id}","starred_url":"https://api.github.com/users/mnapoli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mnapoli/subscriptions","organizations_url":"https://api.github.com/users/mnapoli/orgs","repos_url":"https://api.github.com/users/mnapoli/repos","events_url":"https://api.github.com/users/mnapoli/events{/privacy}","received_events_url":"https://api.github.com/users/mnapoli/received_events","type":"User","site_admin":false},"created_at":"2016-05-14T16:51:19Z","updated_at":"2016-05-14T16:51:19Z","body":"Same here I'll close because this issue boils down to:\r\n\r\n> `@Inject('db.host') @var string` I would expect Exception, if db.host is not string\r\n\r\nAnd that's not something I plan on adding in the near future."}}