| Total Complexity | 2 | 
| Total Lines | 82 | 
| Duplicated Lines | 0 % | 
| Coverage | 100% | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php | ||
| 5 | abstract class PackageResource | ||
| 6 | { | ||
| 7 | /** | ||
| 8 | * The package resource description. A litle summary of what this | ||
| 9 | * resource contains. | ||
| 10 | * | ||
| 11 | * @var string | ||
| 12 | */ | ||
| 13 | public $description; | ||
| 14 | |||
| 15 | /** | ||
| 16 | * The resource source. Usually the source will be a set of paths to files | ||
| 17 | * and/or folders. | ||
| 18 | * | ||
| 19 | * @var mixed | ||
| 20 | */ | ||
| 21 | protected $source; | ||
| 22 | |||
| 23 | /** | ||
| 24 | * The resource target. The destination of the resource, usually a root | ||
| 25 | * folder or file. | ||
| 26 | * | ||
| 27 | * @var mixed | ||
| 28 | */ | ||
| 29 | public $target; | ||
| 30 | |||
| 31 | /** | ||
| 32 | * Whether this resource is required for the package in order to work fine. | ||
| 33 | * | ||
| 34 | * @var bool | ||
| 35 | */ | ||
| 36 | public $required; | ||
| 37 | |||
| 38 | /** | ||
| 39 | * The set of installation messages for this resource. Usually, the array | ||
| 40 | * should contains keys for 'install', 'overwrite' and 'success' messages. | ||
| 41 | * | ||
| 42 | * @var array | ||
| 43 | */ | ||
| 44 | protected $messages; | ||
| 45 | |||
| 46 | /** | ||
| 47 | * Install or export the resource. | ||
| 48 | * | ||
| 49 | * @return void | ||
| 50 | */ | ||
| 51 | abstract public function install(); | ||
| 52 | |||
| 53 | /** | ||
| 54 | * Uninstall or remove the resource. | ||
| 55 | * | ||
| 56 | * @return void | ||
| 57 | */ | ||
| 58 | abstract public function uninstall(); | ||
| 59 | |||
| 60 | /** | ||
| 61 | * Check if the resource already exists on the target destination. | ||
| 62 | * | ||
| 63 | * @return bool | ||
| 64 | */ | ||
| 65 | abstract public function exists(); | ||
| 66 | |||
| 67 | /** | ||
| 68 | * Check if the resource is correctly installed. | ||
| 69 | * | ||
| 70 | * @return bool | ||
| 71 | */ | ||
| 72 | abstract public function installed(); | ||
| 73 | |||
| 74 | /** | ||
| 75 | * Get an installation message. | ||
| 76 | * | ||
| 77 | * @param string $key The message keyword | ||
| 78 | * @return string | ||
| 79 | */ | ||
| 80 | 11 | public function getInstallMessage($key) | |
| 89 |