Skip to content

Commit e639b38

Browse files
AdrienClairembaulttrasher
authored andcommitted
Switch to PSR12
1 parent f927d44 commit e639b38

2 files changed

Lines changed: 39 additions & 32 deletions

File tree

hook.php.tpl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* -------------------------------------------------------------------------
45
* {NAME} plugin for GLPI
@@ -33,15 +34,17 @@
3334
*
3435
* @return boolean
3536
*/
36-
function plugin_{LNAME}_install() {
37-
return true;
37+
function plugin_{LNAME}_install()
38+
{
39+
return true;
3840
}
3941

4042
/**
4143
* Plugin uninstall process
4244
*
4345
* @return boolean
4446
*/
45-
function plugin_{LNAME}_uninstall() {
46-
return true;
47+
function plugin_{LNAME}_uninstall()
48+
{
49+
return true;
4750
}

setup.php.tpl

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* -------------------------------------------------------------------------
45
* {NAME} plugin for GLPI
@@ -41,10 +42,11 @@ define("PLUGIN_{UNAME}_MAX_GLPI_VERSION", "10.0.99");
4142
*
4243
* @return void
4344
*/
44-
function plugin_init_{LNAME}() {
45-
global $PLUGIN_HOOKS;
45+
function plugin_init_{LNAME}()
46+
{
47+
global $PLUGIN_HOOKS;
4648
47-
$PLUGIN_HOOKS['csrf_compliant']['{LNAME}'] = true;
49+
$PLUGIN_HOOKS['csrf_compliant']['{LNAME}'] = true;
4850
}
4951

5052

@@ -54,20 +56,21 @@ function plugin_init_{LNAME}() {
5456
*
5557
* @return array
5658
*/
57-
function plugin_version_{LNAME}() {
58-
return [
59-
'name' => '{NAME}',
60-
'version' => PLUGIN_{UNAME}_VERSION,
61-
'author' => '<a href="http://www.teclib.com">Teclib\'</a>',
62-
'license' => '',
63-
'homepage' => '',
64-
'requirements' => [
65-
'glpi' => [
66-
'min' => PLUGIN_{UNAME}_MIN_GLPI_VERSION,
67-
'max' => PLUGIN_{UNAME}_MAX_GLPI_VERSION,
68-
]
69-
]
70-
];
59+
function plugin_version_{LNAME}()
60+
{
61+
return [
62+
'name' => '{NAME}',
63+
'version' => PLUGIN_{UNAME}_VERSION,
64+
'author' => '<a href="http://www.teclib.com">Teclib\'</a>',
65+
'license' => '',
66+
'homepage' => '',
67+
'requirements' => [
68+
'glpi' => [
69+
'min' => PLUGIN_{UNAME}_MIN_GLPI_VERSION,
70+
'max' => PLUGIN_{UNAME}_MAX_GLPI_VERSION,
71+
]
72+
]
73+
];
7174
}
7275

7376
/**
@@ -76,9 +79,9 @@ function plugin_version_{LNAME}() {
7679
*
7780
* @return boolean
7881
*/
79-
function plugin_{LNAME}_check_prerequisites() {
80-
81-
return true;
82+
function plugin_{LNAME}_check_prerequisites()
83+
{
84+
return true;
8285
}
8386

8487
/**
@@ -88,13 +91,14 @@ function plugin_{LNAME}_check_prerequisites() {
8891
*
8992
* @return boolean
9093
*/
91-
function plugin_{LNAME}_check_config($verbose = false) {
92-
if (true) { // Your configuration check
93-
return true;
94-
}
94+
function plugin_{LNAME}_check_config($verbose = false)
95+
{
96+
if (true) { // Your configuration check
97+
return true;
98+
}
9599

96-
if ($verbose) {
97-
echo __('Installed / not configured', '{LNAME}');
98-
}
99-
return false;
100+
if ($verbose) {
101+
echo __('Installed / not configured', '{LNAME}');
102+
}
103+
return false;
100104
}

0 commit comments

Comments
 (0)