Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-530

Document MongoDB\Driver\Server type constants

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.2.0-alpha1, 1.2.0
    • Affects Version/s: 1.1.1
    • Component/s: Docs
    • None

      The PHP documentation for MongoDB\Driver\Server shows five TYPE_* constants being defined by the class: https://secure.php.net/manual/en/class.mongodb-driver-server.php

      The documentation is incorrect as using reflection one can see the following constants:

      php > var_dump((new ReflectionClass('MongoDB\Driver\Server'))->getConstants());
      array(9) {
        'TYPE_UNKNOWN' =>
        int(0)
        'TYPE_STANDALONE' =>
        int(1)
        'TYPE_MONGOS' =>
        int(2)
        'TYPE_POSSIBLE_PRIMARY' =>
        int(3)
        'TYPE_RS_PRIMARY' =>
        int(4)
        'TYPE_RS_SECONDARY' =>
        int(5)
        'TYPE_RS_ARBITER' =>
        int(6)
        'TYPE_RS_OTHER' =>
        int(7)
        'TYPE_RS_GHOST' =>
        int(8)
      }
      

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            a.braun Andreas B.
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: