{"action":"created","issue":{"url":"https://api.github.com/repos/mongodb/mongo-php-driver/issues/282","repository_url":"https://api.github.com/repos/mongodb/mongo-php-driver","labels_url":"https://api.github.com/repos/mongodb/mongo-php-driver/issues/282/labels{/name}","comments_url":"https://api.github.com/repos/mongodb/mongo-php-driver/issues/282/comments","events_url":"https://api.github.com/repos/mongodb/mongo-php-driver/issues/282/events","html_url":"https://github.com/mongodb/mongo-php-driver/issues/282","id":145943328,"number":282,"title":"\\MongoDB\\BSON\\ObjectID::_construct() $id parameter optional","user":{"login":"csizmazia","id":2581924,"avatar_url":"https://avatars.githubusercontent.com/u/2581924?v=3","gravatar_id":"","url":"https://api.github.com/users/csizmazia","html_url":"https://github.com/csizmazia","followers_url":"https://api.github.com/users/csizmazia/followers","following_url":"https://api.github.com/users/csizmazia/following{/other_user}","gists_url":"https://api.github.com/users/csizmazia/gists{/gist_id}","starred_url":"https://api.github.com/users/csizmazia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csizmazia/subscriptions","organizations_url":"https://api.github.com/users/csizmazia/orgs","repos_url":"https://api.github.com/users/csizmazia/repos","events_url":"https://api.github.com/users/csizmazia/events{/privacy}","received_events_url":"https://api.github.com/users/csizmazia/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-05T10:07:49Z","updated_at":"2016-04-05T17:43:51Z","closed_at":null,"body":"This is a minor issue, as it only affects syntax highlighting in IDEs, functionality works as expected.\r\n\r\nWhen creating a new `ObjectID`, the `$id` parameter is optional. However, this is not reflected in the PHP interface, which compiles to\r\n\r\n```\r\n/**\r\n         * Class ObjectID\r\n         * @link http://php.net/manual/en/class.mongodb-bson-objectid.php\r\n         */\r\n        class ObjectID implements Type\r\n        {\r\n            /**\r\n             * ObjectID constructor.\r\n             * @link http://php.net/manual/en/mongodb-bson-objectid.construct.php\r\n             * @param string $id\r\n             */\r\n            public function __construct($id)\r\n            {\r\n            }\r\n\r\n            /**\r\n             * @link http://php.net/manual/en/mongodb-bson-objectid.tostring.php\r\n             * @return string\r\n             */\r\n            public function __toString()\r\n            {\r\n            }\r\n        }\r\n```\r\n\r\nPHPStorm (and i guess other IDEs as well) report a problem on lines like this:\r\n`$id = new ObjectID();`\r\n\"Required parameter $id missing\"\r\n\r\nThis happens with the latest version 1.1.5 from PECL."},"comment":{"url":"https://api.github.com/repos/mongodb/mongo-php-driver/issues/comments/205915366","html_url":"https://github.com/mongodb/mongo-php-driver/issues/282#issuecomment-205915366","issue_url":"https://api.github.com/repos/mongodb/mongo-php-driver/issues/282","id":205915366,"user":{"login":"jmikola","id":244663,"avatar_url":"https://avatars.githubusercontent.com/u/244663?v=3","gravatar_id":"","url":"https://api.github.com/users/jmikola","html_url":"https://github.com/jmikola","followers_url":"https://api.github.com/users/jmikola/followers","following_url":"https://api.github.com/users/jmikola/following{/other_user}","gists_url":"https://api.github.com/users/jmikola/gists{/gist_id}","starred_url":"https://api.github.com/users/jmikola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmikola/subscriptions","organizations_url":"https://api.github.com/users/jmikola/orgs","repos_url":"https://api.github.com/users/jmikola/repos","events_url":"https://api.github.com/users/jmikola/events{/privacy}","received_events_url":"https://api.github.com/users/jmikola/received_events","type":"User","site_admin":false},"created_at":"2016-04-05T17:43:51Z","updated_at":"2016-04-05T17:43:51Z","body":"This may be a problem with PHPStorm's interface file, which we do not maintain.\r\n\r\nUsing reflection, the constructor does report having a single, optional argument:\r\n\r\n```\r\n$ php -r 'echo (new ReflectionClass(\"MongoDB\\BSON\\ObjectID\"))->getMethod(\"__construct\");'\r\nMethod [ <internal:mongodb, ctor> final public method __construct ] {\r\n\r\n  - Parameters [1] {\r\n    Parameter #0 [ <optional> $id ]\r\n  }\r\n}\r\n```\r\n"}}