Edgard 5 лет назад
Родитель
Сommit
4313990a69
7 измененных файлов с 16 добавлено и 6 удалено
  1. 11 1
      .phpcs.xml
  2. 2 0
      composer.json
  3. 1 1
      front/callback.php
  4. 0 1
      front/provider.form.php
  5. 0 1
      front/provider.php
  6. 1 1
      hook.php
  7. 1 1
      inc/provider.class.php

+ 11 - 1
.phpcs.xml

@@ -2,9 +2,19 @@
 <ruleset>
 
    <!-- rules -->
-   <rule ref="./vendor/glpi-project/coding-standard/GlpiStandard">
+   <rule ref="./vendor/glpi-project/coding-standard/GlpiStandard" />
+
+   <!-- Indent 3 -->
+   <rule ref="Generic.WhiteSpace.ScopeIndent">
+      <properties>
+         <property name="indent" value="3"/>
+         <property name="exact" value="true"/>
+      </properties>
    </rule>
 
+   <!-- file must end by a new line -->
+   <rule ref="PSR2.Files.EndFileNewline" />
+
    <!-- files -->
    <file>.</file>
    <exclude-pattern>vendor</exclude-pattern>

+ 2 - 0
composer.json

@@ -6,6 +6,8 @@
         "squizlabs/php_codesniffer": "^3.5"
     },
     "scripts": {
+        "lint": "phpcs",
+        "lint:fix": "phpcbf",
         "update-locales": "@php tools/update-locales.php"
     },
     "config": {

+ 1 - 1
front/callback.php

@@ -86,7 +86,7 @@ Html::nullHeader("Login", $CFG_GLPI["root_doc"] . '/index.php');
 echo '<div class="center b">' . __('User not authorized to connect in GLPI') . '<br><br>';
 // Logout whit noAUto to manage auto_login with errors
 echo '<a href="' . $CFG_GLPI["root_doc"] . '/front/logout.php?noAUTO=1' .
- str_replace("?", "&", $REDIRECT) . '" class="singlesignon">' . __('Log in again') . '</a></div>';
+str_replace("?", "&", $REDIRECT) . '" class="singlesignon">' . __('Log in again') . '</a></div>';
 echo '<script type="text/javascript">
    if (window.opener) {
       $(".singlesignon").on("click", function (e) {

+ 0 - 1
front/provider.form.php

@@ -66,4 +66,3 @@ if (isset($_POST["add"])) {
 
 
 Html::footer();
-

+ 0 - 1
front/provider.php

@@ -14,4 +14,3 @@ if ($_SESSION["glpiactiveprofile"]["interface"] == "central") {
 Search::show('PluginSinglesignonProvider');
 
 Html::footer();
-

+ 1 - 1
hook.php

@@ -19,7 +19,7 @@ function plugin_singlesignon_display_login() {
       $url = PluginSinglesignonProvider::getCallbackUrl($row['id'], $query);
 
       $html[] = '<a href="' . $url . '" class="singlesignon" style="color: #CFCFCF">' .
-            sprintf(__sso('[ Login with %s ]'), $row['name']) . '</a>';
+      sprintf(__sso('[ Login with %s ]'), $row['name']) . '</a>';
    }
 
    echo implode("<br />\n", $html);

+ 1 - 1
inc/provider.class.php

@@ -256,7 +256,7 @@ class PluginSinglesignonProvider extends CommonDBTM {
          unset($opt['id']);
          if (isset($options[$optid])) {
             $message = "Duplicate key $optid ({$options[$optid]['name']}/{$opt['name']}) in " .
-                  get_class($this) . " searchOptions!";
+            get_class($this) . " searchOptions!";
             Toolbox::logDebug($message);
          }
          foreach ($opt as $k => $v) {