Skip to content

Commit 9b9e9f4

Browse files
committed
formatting updates
1 parent a2eb345 commit 9b9e9f4

2 files changed

Lines changed: 20 additions & 12 deletions

File tree

src/Plugin.php

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
*
1010
* @package Detain\MyAdminVpsDirectadmin
1111
*/
12-
class Plugin {
13-
12+
class Plugin
13+
{
1414
public static $name = 'DirectAdmin VPS Addon';
1515
public static $description = 'Allows selling of DirectAdmin Licenses as a VPS Addon. DirectAdmin is a graphical web-based web hosting control panel designed to make administration of websites easier. DirectAdmin is often called DA for short. More info at https://www.directadmin.com/';
1616
public static $help = '';
@@ -20,13 +20,15 @@ class Plugin {
2020
/**
2121
* Plugin constructor.
2222
*/
23-
public function __construct() {
23+
public function __construct()
24+
{
2425
}
2526

2627
/**
2728
* @return array
2829
*/
29-
public static function getHooks() {
30+
public static function getHooks()
31+
{
3032
return [
3133
'function.requirements' => [__CLASS__, 'getRequirements'],
3234
self::$module.'.load_addons' => [__CLASS__, 'getAddon'],
@@ -37,15 +39,17 @@ public static function getHooks() {
3739
/**
3840
* @param \Symfony\Component\EventDispatcher\GenericEvent $event
3941
*/
40-
public static function getRequirements(GenericEvent $event) {
42+
public static function getRequirements(GenericEvent $event)
43+
{
4144
$loader = $event->getSubject();
4245
$loader->add_page_requirement('vps_add_directadmin', '/../vendor/detain/myadmin-directadmin-vps-addon/src/vps_add_directadmin.php');
4346
}
4447

4548
/**
4649
* @param \Symfony\Component\EventDispatcher\GenericEvent $event
4750
*/
48-
public static function getAddon(GenericEvent $event) {
51+
public static function getAddon(GenericEvent $event)
52+
{
4953
/**
5054
* @var \ServiceHandler $service
5155
*/
@@ -55,7 +59,7 @@ function_requirements('class.AddonHandler');
5559
$addon->setModule(self::$module)
5660
->set_text('DirectAdmin')
5761
->set_cost(VPS_DA_COST)
58-
->set_require_ip(TRUE)
62+
->set_require_ip(true)
5963
->setEnable([__CLASS__, 'doEnable'])
6064
->setDisable([__CLASS__, 'doDisable'])
6165
->register();
@@ -67,7 +71,8 @@ function_requirements('class.AddonHandler');
6771
* @param $repeatInvoiceId
6872
* @param bool $regexMatch
6973
*/
70-
public static function doEnable(\ServiceHandler $serviceOrder, $repeatInvoiceId, $regexMatch = FALSE) {
74+
public static function doEnable(\ServiceHandler $serviceOrder, $repeatInvoiceId, $regexMatch = false)
75+
{
7176
$serviceInfo = $serviceOrder->getServiceInfo();
7277
$settings = get_module_settings(self::$module);
7378
require_once __DIR__.'/../../../../include/licenses/license.functions.inc.php';
@@ -85,7 +90,8 @@ function_requirements('activate_directadmin');
8590
* @param $repeatInvoiceId
8691
* @param bool $regexMatch
8792
*/
88-
public static function doDisable(\ServiceHandler $serviceOrder, $repeatInvoiceId, $regexMatch = FALSE) {
93+
public static function doDisable(\ServiceHandler $serviceOrder, $repeatInvoiceId, $regexMatch = false)
94+
{
8995
$serviceInfo = $serviceOrder->getServiceInfo();
9096
$settings = get_module_settings(self::$module);
9197
require_once __DIR__.'/../../../../include/licenses/license.functions.inc.php';
@@ -98,13 +104,14 @@ function_requirements('deactivate_directadmin');
98104
$headers .= 'MIME-Version: 1.0'.PHP_EOL;
99105
$headers .= 'Content-type: text/html; charset=UTF-8'.PHP_EOL;
100106
$headers .= 'From: '.$settings['TITLE'].' <'.$settings['EMAIL_FROM'].'>'.PHP_EOL;
101-
admin_mail($subject, $email, $headers, FALSE, 'admin/vps_da_canceled.tpl');
107+
admin_mail($subject, $email, $headers, false, 'admin/vps_da_canceled.tpl');
102108
}
103109

104110
/**
105111
* @param \Symfony\Component\EventDispatcher\GenericEvent $event
106112
*/
107-
public static function getSettings(GenericEvent $event) {
113+
public static function getSettings(GenericEvent $event)
114+
{
108115
$settings = $event->getSubject();
109116
$settings->add_text_setting(self::$module, 'Addon Costs', 'vps_da_cost', 'VPS DirectAdmin License:', 'This is the cost for purchasing a direct admin license on top of a VPS.', $settings->get_setting('VPS_DA_COST'));
110117
}

src/vps_add_directadmin.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
* Adds DirectAdmin to a VPS
1212
* @return void
1313
*/
14-
function vps_add_directadmin() {
14+
function vps_add_directadmin()
15+
{
1516
function_requirements('class.AddServiceAddon');
1617
$addon = new AddServiceAddon();
1718
$addon->load(__FUNCTION__, 'DirectAdmin', 'vps', VPS_DA_COST, 'da');

0 commit comments

Comments
 (0)