From 0eebf93ccadfcb6c7727a1b10d5518f4e44ab9a9 Mon Sep 17 00:00:00 2001
From: Viktor Pedersen <viktor@dsv.su.se>
Date: Mon, 13 Sep 2021 11:14:46 +0200
Subject: [PATCH] cleaning up debug output

---
 include/Product.php    |  2 +-
 include/SearchPage.php | 15 +--------------
 2 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/include/Product.php b/include/Product.php
index d3dd24c..b09a121 100644
--- a/include/Product.php
+++ b/include/Product.php
@@ -111,7 +111,7 @@ class Product extends Entity {
     }
 
     public function matches($terms, $matchAll=false) {
-        print('DEBUG $terms: ');
+        print('DEBUG $terms in matches: ');
         var_dump($terms);
         print('<br><br>');
         $terms = $this->specify_search($terms, array('brand',
diff --git a/include/SearchPage.php b/include/SearchPage.php
index 0d5c4e3..859605f 100644
--- a/include/SearchPage.php
+++ b/include/SearchPage.php
@@ -64,29 +64,17 @@ class SearchPage extends Page {
         $mustMatchArray = array(); 
         $cannotMatchArray = array(); 
         $mayMatchArray = array();
-
-
-
         foreach($terms as $key => $value) {
-            var_dump("dump term: ", $value);
             if(!is_array($value)) {
                 $value = array($value);
             }
             foreach($value as $term) {
-                print('DEBUG $parsedTerm: ');
-                var_dump($term);
-                print('<br>DEBUG $parsedTerm[0]: ');
-                var_dump($term[0]);
-                print('<br>');
                 switch ($term[0]) {
                     case "+":
                         if (!array_key_exists($key, $mustMatchArray)) {
                             $mustMatchArray[$key] = array();
                         }
                         $mustMatchArray[$key][] = substr($term, 1);
-                        print('DEBUG $mustMatchArray: ');
-                        var_dump($mustMatchArray);
-                        print('<br>');
                         break;
                     case "!":
                     case "-":
@@ -113,7 +101,6 @@ class SearchPage extends Page {
 
         $items = get_items($type);
         $sanitizedItems = array();
-        $out = array();
         foreach($items as $item) {
             $result = $item->matches($mustMatchArray, True);
             if($result) {
@@ -160,7 +147,7 @@ class SearchPage extends Page {
             //     }
             // }
         }
-        print('DEBUG $out: ');
+        print('DEBUG $sanitizedItems: ');
         var_dump($sanitizedItems);
         print('<br><br>');
         // $out = array();