CRM_Core_Resources - Use splats, CollectionAdderTrait, CollectionAdderInterface
authorTim Otten <totten@civicrm.org>
Mon, 24 Aug 2020 10:10:33 +0000 (03:10 -0700)
committerSeamus Lee <seamuslee001@gmail.com>
Thu, 3 Sep 2020 22:02:17 +0000 (08:02 +1000)
commite9d08c6b837dbe648af2402e63565606420e951f
tree4fd21226716017d373cb9e6a2e74b6ad5ea92511
parent8b7abdb6cf4e15bc0b20c61435dc04f9db5d45b6
CRM_Core_Resources - Use splats, CollectionAdderTrait, CollectionAdderInterface

Before
------

`CRM_Core_Resources` directly implements a number of functions (`addFoo()`)

After
-----

`CRM_Core_Resources` re-uses the implementations from `CollectionAdderTrait`

Comment
-------

The method signatures in `CollectionAdderTrait` look different, but they are
compatible.  In particular, the use of splat (`...$options`) means that they
can accept either key-value options or positional options. The existing
test-cases in `CollectionTestTrait` assert as much.
CRM/Core/Resources.php
CRM/Core/Resources/CollectionAdderTrait.php
CRM/Core/Resources/CollectionTrait.php