Completed
Pull Request — master (#313)
by Thomas
18:19 queued 08:41
created
htdocs/src/Oc/SmartyPlugins/prefilter.t.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@
 block discarded – undo
112 112
 
113 113
                 // rebuild block with replaced plural
114 114
                 $block = '';
115
-                foreach ($attrs AS $k => $v) {
115
+                foreach ($attrs as $k => $v) {
116 116
                     if ($block != '') {
117 117
                         $block .= ' ';
118 118
                     }
Please login to merge, or discard this patch.
htdocs/lang/de/ocstyle/main.tpl.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@
 block discarded – undo
145 145
                         <td><strong>{t}Language:{/t}&nbsp;</strong></td>
146 146
                         <td>
147 147
 <?php
148
-                            foreach ($opt['template']['locales'] AS $k => $lang)
148
+                            foreach ($opt['template']['locales'] as $k => $lang)
149 149
                                 if ($lang['show'] == true)
150 150
                                     echo '<a style="text-decoration: none;" href="index.php?locale=' . $k . '"><img src="' . $lang['flag'] . '" alt="' . $lang['name'] . '" title="' . $lang['name'] . '" width="24px" height="18px" /></a> ';
151 151
 ?>
Please login to merge, or discard this patch.
htdocs/okapi/oauth.php 1 patch
Upper-Lower-Casing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
   public $key;
173 173
   public $secret;
174 174
 
175
-  function __construct($key, $secret, $callback_url=NULL) {
175
+  function __construct($key, $secret, $callback_url=null) {
176 176
     $this->key = $key;
177 177
     $this->secret = $secret;
178 178
     $this->callback_url = $callback_url;
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
   public static $version = '1.0';
404 404
   public static $POST_INPUT = 'php://input';
405 405
 
406
-  function __construct($http_method, $http_url, $parameters=NULL) {
406
+  function __construct($http_method, $http_url, $parameters=null) {
407 407
     $parameters = ($parameters) ? $parameters : array();
408 408
     $parameters = array_merge( OAuthUtil::parse_parameters(parse_url($http_url, PHP_URL_QUERY)), $parameters);
409 409
     $this->parameters = $parameters;
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
   /**
416 416
    * attempt to build up a request from what was passed to the server
417 417
    */
418
-  public static function from_request($http_method=NULL, $http_url=NULL, $parameters=NULL) {
418
+  public static function from_request($http_method=null, $http_url=null, $parameters=null) {
419 419
     $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on")
420 420
               ? 'http'
421 421
               : 'https';
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
   /**
468 468
    * pretty much a helper function to set up the request
469 469
    */
470
-  public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters=NULL) {
470
+  public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters=null) {
471 471
     $parameters = ($parameters) ?  $parameters : array();
472 472
     $defaults = array("oauth_version" => OAuthRequest::$version,
473 473
                       "oauth_nonce" => OAuthRequest::generate_nonce(),
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
     $consumer = $this->get_consumer($request);
683 683
 
684 684
     // no token required for the initial token request
685
-    $token = NULL;
685
+    $token = null;
686 686
 
687 687
     $this->check_signature($request, $consumer, $token);
688 688
 
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
   private function get_signature_method($request) {
749 749
     $signature_method = $request instanceof OAuthRequest
750 750
         ? $request->get_parameter("oauth_signature_method")
751
-        : NULL;
751
+        : null;
752 752
 
753 753
     if (!$signature_method) {
754 754
       // According to chapter 7 ("Accessing Protected Ressources") the signature-method
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
   protected function get_consumer($request) {
774 774
     $consumer_key = $request instanceof OAuthRequest
775 775
         ? $request->get_parameter("oauth_consumer_key")
776
-        : NULL;
776
+        : null;
777 777
 
778 778
     if (!$consumer_key) {
779 779
       throw new OAuthMissingParameterException('oauth_consumer_key');
@@ -793,7 +793,7 @@  discard block
 block discarded – undo
793 793
   protected function get_token($request, $consumer, $token_type="access") {
794 794
     $token_field = $request instanceof OAuthRequest
795 795
          ? $request->get_parameter('oauth_token')
796
-         : NULL;
796
+         : null;
797 797
     if (!$token_field) {
798 798
       throw new OAuthMissingParameterException('oauth_token');
799 799
     }
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
       $consumer, $token_type, $token_field
802 802
     );
803 803
     if (!$token) {
804
-      throw new OAuthInvalidTokenException("Invalid $token_type token: $token_field.");
804
+      throw new OAuthInvalidTokenException("invalid $token_type token: $token_field.");
805 805
     }
806 806
     return $token;
807 807
   }
@@ -814,10 +814,10 @@  discard block
 block discarded – undo
814 814
     // this should probably be in a different method
815 815
     $timestamp = $request instanceof OAuthRequest
816 816
         ? $request->get_parameter('oauth_timestamp')
817
-        : NULL;
817
+        : null;
818 818
     $nonce = $request instanceof OAuthRequest
819 819
         ? $request->get_parameter('oauth_nonce')
820
-        : NULL;
820
+        : null;
821 821
 
822 822
     $this->check_timestamp($timestamp);
823 823
     $this->check_nonce($consumer, $token, $nonce, $timestamp);
@@ -955,7 +955,7 @@  discard block
 block discarded – undo
955 955
       // returns the headers in the same case as they are in the
956 956
       // request
957 957
       $out = array();
958
-      foreach ($headers AS $key => $value) {
958
+      foreach ($headers as $key => $value) {
959 959
         $key = str_replace(
960 960
             " ",
961 961
             "-",
Please login to merge, or discard this patch.
htdocs/okapi/services/caches/search/searching.inc.php 1 patch
Upper-Lower-Casing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
     public  function __construct(OkapiRequest $request)
27 27
     {
28 28
         $this->request = $request;
29
-        $this->longitude_expr = NULL;
30
-        $this->latitude_expr = NULL;
31
-        $this->location_extra_sql = NULL;
32
-        $this->search_params = NULL;
29
+        $this->longitude_expr = null;
30
+        $this->latitude_expr = null;
31
+        $this->location_extra_sql = null;
32
+        $this->search_params = null;
33 33
     }
34 34
 
35 35
     /**
@@ -697,7 +697,7 @@  discard block
 block discarded – undo
697 697
             'extra_joins' => $extra_joins,
698 698
         );
699 699
 
700
-        if ($this->search_params === NULL)
700
+        if ($this->search_params === null)
701 701
         {
702 702
             $this->search_params = $ret_array;
703 703
         } else {
@@ -818,7 +818,7 @@  discard block
 block discarded – undo
818 818
             $location_extra_sql = array(
819 819
                 'extra_joins' => $extra_joins
820 820
             );
821
-            if ($this->search_params === NULL)
821
+            if ($this->search_params === null)
822 822
             {
823 823
                 $this->search_params = $location_extra_sql;
824 824
             } else {
Please login to merge, or discard this patch.
htdocs/okapi/services/apiref/method.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@
 block discarded – undo
136 136
             throw new InvalidParam('name', "Method does not exist: '$methodname'.");
137 137
         $options = OkapiServiceRunner::options($methodname);
138 138
         if (!isset($options['min_auth_level']))
139
-            throw new Exception("Method $methodname is missing a required 'min_auth_level' option!");
139
+            throw new Exception("method $methodname is missing a required 'min_auth_level' option!");
140 140
         $docs = simplexml_load_string(OkapiServiceRunner::docs($methodname));
141 141
         $exploded = explode("/", $methodname);
142 142
         $result = array(
Please login to merge, or discard this patch.
htdocs/okapi/views/devel/dbstruct.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
         $struct = shell_exec($shell_arguments);
45 45
         if (strlen($struct) > 1000000)
46 46
             throw new Exception("something went terribly wrong while dumping table structures");
47
-        if (stripos($struct,"dumping data") !== FALSE)
47
+        if (stripos($struct,"dumping data") !== false)
48 48
             throw new Exception("something went terribly wrong while dumping table structures");
49 49
 
50 50
         # Remove the "AUTO_INCREMENT=..." values. They break the diffs.
Please login to merge, or discard this patch.
htdocs/okapi/cronjobs.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@
 block discarded – undo
140 140
                 return;
141 141
             }
142 142
         }
143
-        throw new Exception("CronJob $job_name not found.");
143
+        throw new Exception("cronjob $job_name not found.");
144 144
     }
145 145
 
146 146
     /**
Please login to merge, or discard this patch.
htdocs/editcache.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -844,7 +844,7 @@
 block discarded – undo
844 844
                 $desclangs = mb_split(',', $cache_record['desc_languages']);
845 845
                 $cache_descs = '';
846 846
                 $gc_com_refs = false;
847
-                foreach ($desclangs AS $desclang) {
847
+                foreach ($desclangs as $desclang) {
848 848
                     if (count($desclangs) > 1) {
849 849
                         $remove_url = 'removedesc.php?cacheid=' . urlencode($cache_id) . '&desclang=' . urlencode(
850 850
                                 $desclang
Please login to merge, or discard this patch.
htdocs/translate.php 1 patch
Upper-Lower-Casing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 }
232 232
 
233 233
 $languages = [];
234
-foreach ($opt['locale'] AS $k => $v) {
234
+foreach ($opt['locale'] as $k => $v) {
235 235
     if ($access->mayTranslate($k)) {
236 236
         $languages[] = $k;
237 237
     }
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
     global $opt, $tpl, $translang;
515 515
 
516 516
     $structure = enumSqlFiles($opt['rootpath'] . '../sql/tables');
517
-    foreach ($structure AS $sTable) {
517
+    foreach ($structure as $sTable) {
518 518
         sql_export_structure_to_file($opt['rootpath'] . '../sql/tables/' . $sTable . '.sql', $sTable);
519 519
     }
520 520
 
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
     global $tpl, $msDirlist;
591 591
 
592 592
     $files = [];
593
-    foreach ($msDirlist AS $dir) {
593
+    foreach ($msDirlist as $dir) {
594 594
         $hDir = opendir($dir);
595 595
         if ($hDir !== false) {
596 596
             while (($file = readdir($hDir)) !== false) {
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
     /* check if supplied filename is within allowed path!
626 626
      */
627 627
     $bFound = false;
628
-    foreach ($msDirlist AS $dir) {
628
+    foreach ($msDirlist as $dir) {
629 629
         if (substr($dir, - 1) != '/') {
630 630
             $dir .= '/';
631 631
         }
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
     $transFileScan = new translate_filescan($filename);
652 652
     $transFileScan->parse();
653 653
 
654
-    foreach ($transFileScan->textlist AS $item) {
654
+    foreach ($transFileScan->textlist as $item) {
655 655
         $translationHandler->addText($item['text'], $filename, $item['line']);
656 656
     }
657 657
 
@@ -666,7 +666,7 @@  discard block
 block discarded – undo
666 666
     header('Content-Disposition:attachment;filename="translation.xml"');
667 667
 
668 668
     $lang = [];
669
-    foreach ($opt['template']['locales'] AS $k => $v) {
669
+    foreach ($opt['template']['locales'] as $k => $v) {
670 670
         $lang[] = $k;
671 671
     }
672 672
 
@@ -737,7 +737,7 @@  discard block
 block discarded – undo
737 737
     }
738 738
 
739 739
     $scanlang = [];
740
-    foreach ($opt['locale'] AS $k => $v) {
740
+    foreach ($opt['locale'] as $k => $v) {
741 741
         if (isset($_REQUEST['lang' . $k]) && ($_REQUEST['lang' . $k] == '1')) {
742 742
             $scanlang[] = $k;
743 743
         }
@@ -758,10 +758,10 @@  discard block
 block discarded – undo
758 758
      */
759 759
     $saTexts = [];
760 760
 
761
-    foreach ($doc->documentElement->childNodes AS $textnode) {
761
+    foreach ($doc->documentElement->childNodes as $textnode) {
762 762
         if ($textnode->nodeType == XML_ELEMENT_NODE) {
763 763
             $codeElements = $textnode->getElementsByTagName('code');
764
-            foreach ($scanlang AS $lang) {
764
+            foreach ($scanlang as $lang) {
765 765
                 $langElements = $textnode->getElementsByTagName($lang);
766 766
 
767 767
                 $sCodeText = $codeElements->item(0)->nodeValue;
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
             $transId = sql_value("SELECT `id` FROM `sys_trans` WHERE `text`='&1'", 0, $sCode);
825 825
 
826 826
             if ($transId != 0) {
827
-                foreach ($opt['locale'] AS $k => $v) {
827
+                foreach ($opt['locale'] as $k => $v) {
828 828
                     if (isset($_REQUEST[$k . $nIndex . 'new'])) {
829 829
                         $sText = base64_decode($_REQUEST[$k . $nIndex . 'new']);
830 830
 
Please login to merge, or discard this patch.