{"action":"created","issue":{"url":"https://api.github.com/repos/Level-2/Dice/issues/73","labels_url":"https://api.github.com/repos/Level-2/Dice/issues/73/labels{/name}","comments_url":"https://api.github.com/repos/Level-2/Dice/issues/73/comments","events_url":"https://api.github.com/repos/Level-2/Dice/issues/73/events","html_url":"https://github.com/Level-2/Dice/issues/73","id":102897672,"number":73,"title":"Fatal Error: Uncaught exception 'ReflectionException'","user":{"login":"starf","id":1461847,"avatar_url":"https://avatars.githubusercontent.com/u/1461847?v=3","gravatar_id":"","url":"https://api.github.com/users/starf","html_url":"https://github.com/starf","followers_url":"https://api.github.com/users/starf/followers","following_url":"https://api.github.com/users/starf/following{/other_user}","gists_url":"https://api.github.com/users/starf/gists{/gist_id}","starred_url":"https://api.github.com/users/starf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/starf/subscriptions","organizations_url":"https://api.github.com/users/starf/orgs","repos_url":"https://api.github.com/users/starf/repos","events_url":"https://api.github.com/users/starf/events{/privacy}","received_events_url":"https://api.github.com/users/starf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-24T21:42:47Z","updated_at":"2015-10-15T22:58:17Z","closed_at":null,"body":"To start off, thanks for your excellent library, maybe this is more of a user-error, would be kind of you to help me out.\r\n\r\nFatal error: Uncaught exception 'ReflectionException' with message 'Class Db is an internal class that cannot be instantiated without invoking its constructor'\r\n\r\nUsing PHP Version 5.5.9\r\n\r\nUsing Dice 1.3.2 this works:\r\n```\r\n$rule = new \\Dice\\Rule;\r\n$rule->shared = true;\r\n$dice->addRule('Db', $rule);\r\n$db = $dice->create('Db', [$dbHost, $dbUser, $dbPass, $dbName]);\r\n```\r\nUsing Dice 2.0-legacy this doesn't work: (producing forementioned error)\r\n```\r\n$rule1 = ['shared' => true];\r\n$rule2 = ['constructParams' => [$dbHost, $dbUser, $dbPass, $dbName]];\r\n$dice->addRule('Db', $rule1);\r\n$dice->addRule('Db', $rule2);\r\n$db = $dice->create('Db');\r\n```\r\nWhat am i missing here?\r\nImportant to notice on 5.6.4 everything works without a hickup, leading to believe i'm simply using the wrong library but i've double checked that twice.\r\nOn that note it may be usefull to include the \"legacy\" version information in the code comment on top"},"comment":{"url":"https://api.github.com/repos/Level-2/Dice/issues/comments/148546504","html_url":"https://github.com/Level-2/Dice/issues/73#issuecomment-148546504","issue_url":"https://api.github.com/repos/Level-2/Dice/issues/73","id":148546504,"user":{"login":"niclaslindberg","id":4067396,"avatar_url":"https://avatars.githubusercontent.com/u/4067396?v=3","gravatar_id":"","url":"https://api.github.com/users/niclaslindberg","html_url":"https://github.com/niclaslindberg","followers_url":"https://api.github.com/users/niclaslindberg/followers","following_url":"https://api.github.com/users/niclaslindberg/following{/other_user}","gists_url":"https://api.github.com/users/niclaslindberg/gists{/gist_id}","starred_url":"https://api.github.com/users/niclaslindberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niclaslindberg/subscriptions","organizations_url":"https://api.github.com/users/niclaslindberg/orgs","repos_url":"https://api.github.com/users/niclaslindberg/repos","events_url":"https://api.github.com/users/niclaslindberg/events{/privacy}","received_events_url":"https://api.github.com/users/niclaslindberg/received_events","type":"User","site_admin":false},"created_at":"2015-10-15T22:58:17Z","updated_at":"2015-10-15T22:58:17Z","body":"Hi.\r\n\r\nDouble checked the examples (for subsitution) with the code. \r\n\r\nAccording to the code the right way of declaring substitutions for interfaces (in 3.5 Default rules) should be:\r\n\r\n    $dice->addRule(Interface::class, ['instanceOf' => YourClass::class]);\r\n"}}