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

Exception interface should extend Throwable on PHP 7+

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.6.0, 1.6.0alpha2
    • Labels:
      None

      Description

      In mongodb/mongo-php-driver#940, Andreas Braun proposed having the driver's Exception interface extend Throwable on PHP 7+ to assist with static analysis warnings on @throws annotations using the interface. While classes cannot implement Throwable directly, interfaces can extend it in both internals and userland (much like Traversable) so we should consider doing this.

      It would have the added benefit of ensuring that no userland class implements this interface without also extending PHP's Exception or Error base classes.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: