-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathBase.php
More file actions
64 lines (56 loc) · 1.65 KB
/
Base.php
File metadata and controls
64 lines (56 loc) · 1.65 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/**
* @file
* Contains DrupalCodeBuilder\Task.
*/
namespace DrupalCodeBuilder\Task;
use DrupalCodeBuilder\Environment\EnvironmentInterface;
/**
* Base class for Tasks.
*
* Task classes contain code to perform distinct operations. For example,
* getting hook data by finding and processing api.php files is the domain of
* the Collect task.
*
* Public methods on Task classes are part of Drupal Code Builder's public API,
* and may be considered stable.
*
* Each task may also define the sanity level it requires. This allows the
* Environment object to state whether the current environment is ready for the
* task. For example, generating a module requires hook data to be ready;
* whereas processing hook data does not.
*
* Task classes may be specialized for different major versions of Drupal, by
* appending the version number to the class name. The unversioned class should
* also exist as a parent class.
*
* Task objects should be instantiated by \DrupalCodeBuilder\Factory::getTask().
*/
class Base {
/**
* The environment.
*
* @var \DrupalCodeBuilder\Environment\EnvironmentInterface
*/
protected $environment;
/**
* Constructor.
*
* @param $environment
* The current environment handler.
*/
function __construct(EnvironmentInterface $environment) {
$this->environment = $environment;
}
/**
* Get the sanity level this task requires.
*
* @return
* A sanity level string to pass to the environment's verifyEnvironment().
*
* @see \DrupalCodeBuilder\Environment\EnvironmentInterface::verifyEnvironment()
*/
function getSanityLevel() {
return $this->sanity_level;
}
}