Uploaded image for project: 'Couchbase PHP client library'
  1. Couchbase PHP client library
  2. PCBC-513

Consider removing final from PHP classes

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 2.4.2
    • 2.4.1
    • None
    • None

    Description

      A lot of classes, including Cluster, Bucket and BucketManager, are marked as final. Since this disables user from extending the classes, it also disables testing frameworks like PHPUnit and Mockery from mocking them.

      This makes it really hard to unit test classes which use any of these final classes. (I can of course work around this by using proxy classes, but it adds a lot of ugly stuff to my codebase.)

      Why were these classes marked as final in the first place? And could it be reverted for the purpose of unit testing/mocking?

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            avsej Sergey Avseyev
            demontpx Bert Hekman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty