HomeDevCentral

Avoid Phabricator URL in classes constructors

Description

Avoid Phabricator URL in classes constructors

Summary:
The notifications center works with gates (services)
and doors (services instances).

b42260e53626 introduced a notifications:payload command to
output a notification from a payload and those information.

To use this command with Phabricator too, we need to be able
to build the classes Phabricator want from only the instance
name, not from the full URL.

This refactoring allows to simplify constructors when handling
a Phabricator payload.

Test Plan:

$ php artisan config:show

+-------------+-----------+----------------------------------+--------------------------+
| Gate        | Door      | Instance                         | Status                   |
+-------------+-----------+----------------------------------+--------------------------+
| GitHub      | Nasqueron | ø                                | ✓                        |
| Phabricator | Nasqueron | https://devcentral.nasqueron.org | Projects map not cached. |
+-------------+-----------+----------------------------------+--------------------------+
$ php artisan phabricator:projectsmap
Querying projects map for https://devcentral.nasqueron.org
+--------------------------------+-------------------------------------+
| PHID                           | Project name                        |
+--------------------------------+-------------------------------------+
| PHID-PROJ-6dg6ogx5pjmk24ur4tp4 | Accounts                            |
| PHID-PROJ-cztcgpvqr6smnnekotq7 | Agora                               |
| PHID-PROJ-3iew3cqf3htpazfyzb5a | architecture                        |
| PHID-PROJ-ypzex6tkmmv7tt44nknw | assets.nasqueron.org                |
| PHID-PROJ-yxslhjbugwycl2ul4n6n | Auth Grove                          |

$ php artisan config:show

+-------------+-----------+----------------------------------+--------+
| Gate        | Door      | Instance                         | Status |
+-------------+-----------+----------------------------------+--------+
| GitHub      | Nasqueron | ø                                | ✓      |
| Phabricator | Nasqueron | https://devcentral.nasqueron.org | ✓      |
+-------------+-----------+----------------------------------+--------+

Reviewers: dereckson

Subscribers: alken-orin

Differential Revision: https://devcentral.nasqueron.org/D633

Details

Provenance
derecksonAuthored on Aug 23 2016, 22:30
Differential Revision
D633: Avoid Phabricator URL in classes constructors
Parents
rNOTIF015ca6e3b63a: Fix whitespace issue
Branches
Unknown
Tags
Unknown