-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathRequestCommands.php
47 lines (40 loc) · 1.13 KB
/
RequestCommands.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
namespace Drupal\va_gov_content_release\Commands;
use Drupal\va_gov_content_release\Request\RequestInterface;
use Drush\Commands\DrushCommands;
/**
* A Drush interface to the Request service.
*/
class RequestCommands extends DrushCommands {
/**
* The Request service.
*
* @var \Drupal\va_gov_content_release\Request\RequestInterface
*/
protected $requestService;
/**
* Constructor.
*
* @param \Drupal\va_gov_content_release\Request\RequestInterface $requestService
* The request service.
*/
public function __construct(
RequestInterface $requestService
) {
$this->requestService = $requestService;
}
/**
* Submit a content release request.
*
* @param string $reason
* The reason for the request.
*
* @command va-gov-content-release:request:submit
* @aliases va-gov-content-release-request-submit
* va-gov-content-release-request-submit
*/
public function submitRequest(string $reason = 'Build requested via Drush.') {
$this->requestService->submitRequest($reason);
$this->io()->success('Content Release requested; check the queue for status.');
}
}