-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e2cd55b
commit 785723a
Showing
4 changed files
with
17 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Strictly speaking these types of named constructors should be non-fallible because they construct whitelisted cases. Though I can see a type checker would think they could throw since they contain calls to
__construct
, which of course may throw (I'm not sure if any editors proactively check this and complain?). This is a bit of an unfortunate side effect of PHP only permitting one "real" constructor; ideally these could be separate constructors in their own right and could thus construct a valid instance directly.I'm not sure if it is worth removing the
@throws
to communicate to a user that this method is guaranteed to succeed? (i.e. the user shouldn't be having to think about putting try-catch blocks around these).(also see:
Purpose::local()
,ProtocolCollection::default()
,ProtocolCollection::v1()
, andProtocolCollection::v2()
)