]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
lint: apply phpcbf to plugins/
authorVirtualTam <virtualtam@flibidi.net>
Fri, 12 Oct 2018 22:22:45 +0000 (00:22 +0200)
committerVirtualTam <virtualtam@flibidi.net>
Sun, 2 Dec 2018 21:39:16 +0000 (22:39 +0100)
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
plugins/archiveorg/archiveorg.php
plugins/demo_plugin/demo_plugin.php
plugins/markdown/markdown.php
plugins/pubsubhubbub/pubsubhubbub.php
plugins/qrcode/qrcode.php
plugins/wallabag/wallabag.php

index cda35751041933c6caffd061c59121da5833c24f..5dcea5a647930b43d6226fc8033f9e51408db67c 100644 (file)
@@ -17,7 +17,7 @@ function hook_archiveorg_render_linklist($data)
     $archive_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/archiveorg/archiveorg.html');
 
     foreach ($data['links'] as &$value) {
-        if($value['private'] && preg_match('/^\?[a-zA-Z0-9-_@]{6}($|&|#)/', $value['real_url'])) {
+        if ($value['private'] && preg_match('/^\?[a-zA-Z0-9-_@]{6}($|&|#)/', $value['real_url'])) {
             continue;
         }
         $archive = sprintf($archive_html, $value['url'], t('View on archive.org'));
index f3a63b6aeb26a9a003271f981e16ac32761623d6..bdbc719bc778c98c4a2396e8dc1049ecc20a26eb 100644 (file)
@@ -73,7 +73,6 @@ function hook_demo_plugin_render_header($data)
 {
     // Only execute when linklist is rendered.
     if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) {
-
         // If loggedin
         if ($data['_LOGGEDIN_'] === true) {
             /*
@@ -448,8 +447,7 @@ function hook_demo_plugin_render_feed($data)
     foreach ($data['links'] as &$link) {
         if ($data['_PAGE_'] == Router::$PAGE_FEED_ATOM) {
             $link['description'] .= ' - ATOM Feed' ;
-        }
-        elseif ($data['_PAGE_'] == Router::$PAGE_FEED_RSS) {
+        } elseif ($data['_PAGE_'] == Router::$PAGE_FEED_RSS) {
             $link['description'] .= ' - RSS Feed';
         }
     }
index 08e64dae087e1a9828bd23d8c0f54680c485e263..8823af91c77d816a015136227eb8859b4c0cef5b 100644 (file)
@@ -139,7 +139,6 @@ function hook_markdown_render_includes($data)
         || $data['_PAGE_'] == Router::$PAGE_DAILY
         || $data['_PAGE_'] == Router::$PAGE_EDITLINK
     ) {
-
         $data['css_files'][] = PluginManager::$PLUGINS_PATH . '/markdown/markdown.css';
     }
 
@@ -195,8 +194,7 @@ function reverse_text2clickable($description)
         // Detect and toggle block of code
         if (!$codeBlockOn) {
             $codeBlockOn = preg_match('/^```/', $descriptionLine) > 0;
-        }
-        elseif (preg_match('/^```/', $descriptionLine) > 0) {
+        } elseif (preg_match('/^```/', $descriptionLine) > 0) {
             $codeBlockOn = false;
         }
 
@@ -302,13 +300,17 @@ function sanitize_html($description)
     foreach ($escapeTags as $tag) {
         $description = preg_replace_callback(
             '#<\s*'. $tag .'[^>]*>(.*</\s*'. $tag .'[^>]*>)?#is',
-            function ($match) { return escape($match[0]); },
-            $description);
+            function ($match) {
+                return escape($match[0]);
+            },
+            $description
+        );
     }
     $description = preg_replace(
         '#(<[^>]+\s)on[a-z]*="?[^ "]*"?#is',
         '$1',
-        $description);
+        $description
+    );
     return $description;
 }
 
@@ -341,7 +343,7 @@ function process_markdown($description, $escape = true, $allowedProtocols = [])
         ->text($processedDescription);
     $processedDescription = sanitize_html($processedDescription);
 
-    if(!empty($processedDescription)){
+    if (!empty($processedDescription)) {
         $processedDescription = '<div class="markdown">'. $processedDescription . '</div>';
     }
 
index 184b588b7f44d62b89df0fc2f0e07094da0e8b41..9f0342a37fa376b20cdab8dac2a655c0c178ea5b 100644 (file)
@@ -6,7 +6,7 @@
  * PubSub is a protocol which fasten up RSS fetching:
  *   - Every time a new link is posted, Shaarli notify the hub.
  *   - The hub notify all feed subscribers that a new link has been posted.
- *   - Subscribers retrieve the new link. 
+ *   - Subscribers retrieve the new link.
  */
 
 use pubsubhubbub\publisher\Publisher;
@@ -82,7 +82,8 @@ function hook_pubsubhubbub_save_link($data, $conf)
  *
  * @throws Exception An error occurred.
  */
-function nocurl_http_post($url, $postString) {
+function nocurl_http_post($url, $postString)
+{
     $params = array('http' => array(
         'method' => 'POST',
         'content' => $postString,
index 0f96a106921e856eff1160cc0b881c1b68b2e75d..4b59caa03e61db70ebeef68a4626c751ae034bb8 100644 (file)
@@ -17,7 +17,8 @@ function hook_qrcode_render_linklist($data)
     $qrcode_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/qrcode/qrcode.html');
 
     foreach ($data['links'] as &$value) {
-        $qrcode = sprintf($qrcode_html,
+        $qrcode = sprintf(
+            $qrcode_html,
             urlencode($value['url']),
             $value['url'],
             PluginManager::$PLUGINS_PATH
index 9dfd079eb21da9d027dc71a3aacfb9fe5d0608a0..a6476c71c893b0b9f7b2fadef9e8610a86b807be 100644 (file)
@@ -69,4 +69,3 @@ function wallabag_dummy_translation()
     t('Wallabag API URL');
     t('Wallabag API version (1 or 2)');
 }
-