Completed
Push — master ( 608d08...06a343 )
by Simon
02:05
created
code/controllers/ShortListController.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
         if ($item && $item->exists()) {
196 196
             $item->delete();
197 197
         } else {
198
-	        return false;
198
+            return false;
199 199
         }
200 200
 
201 201
         return true;
@@ -223,11 +223,11 @@  discard block
 block discarded – undo
223 223
     }
224 224
 
225 225
 
226
-	/**
227
-	 * Get a paginated list of the shortlist items.
228
-	 *
229
-	 * @return mixed the paginated list of items, or false if the list cannot be found.
230
-	 * */
226
+    /**
227
+     * Get a paginated list of the shortlist items.
228
+     *
229
+     * @return mixed the paginated list of items, or false if the list cannot be found.
230
+     * */
231 231
     public function paginatedItems()
232 232
     {
233 233
         if (!$this->getRequest()->param('URL') || !ShortList::isBrowser()) {
Please login to merge, or discard this patch.
code/models/ShortList.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -97,6 +97,6 @@
 block discarded – undo
97 97
 
98 98
         $validBrowser = preg_match($browserlist, $_SERVER['HTTP_USER_AGENT']) === 1;
99 99
 
100
-        return $validBrowser;// && !empty($_SERVER['HTTP_REFERER']);
100
+        return $validBrowser; // && !empty($_SERVER['HTTP_REFERER']);
101 101
     }
102 102
 }
Please login to merge, or discard this patch.
code/extensions/ShortListExtension.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -12,15 +12,15 @@  discard block
 block discarded – undo
12 12
      * */
13 13
     public function getShortlistURL($full = false)
14 14
     {
15
-	    if ($full) {
16
-		    $shortlist = $this->getShortList();
15
+        if ($full) {
16
+            $shortlist = $this->getShortList();
17 17
 
18
-	        if ($shortlist && $shortlist->exists()) {
19
-	            return $shortlist->Link();
20
-	        }
21
-	    } else {
22
-		    return Config::inst()->get('ShortList', 'URLSegment');
23
-	    }
18
+            if ($shortlist && $shortlist->exists()) {
19
+                return $shortlist->Link();
20
+            }
21
+        } else {
22
+            return Config::inst()->get('ShortList', 'URLSegment');
23
+        }
24 24
 
25 25
 
26 26
         return false;
@@ -31,39 +31,39 @@  discard block
 block discarded – undo
31 31
      * */
32 32
     public function getSessionID()
33 33
     {
34
-		Session::start();
35
-		return session_id();
36
-	}
34
+        Session::start();
35
+        return session_id();
36
+    }
37 37
 
38
-	public function getShortList()
39
-	{
40
-		return DataObject::get_one('ShortList', $filter = array('SessionID' => session_id()));
41
-	}
38
+    public function getShortList()
39
+    {
40
+        return DataObject::get_one('ShortList', $filter = array('SessionID' => session_id()));
41
+    }
42 42
 
43
-	public function getShortListCount()
44
-	{
45
-		$shortlist = $this->getShortList();
43
+    public function getShortListCount()
44
+    {
45
+        $shortlist = $this->getShortList();
46 46
 
47
-		if ($shortlist && $shortlist->exists()) {
48
-			return $shortlist->ShortListItems()->Count();
49
-		}
47
+        if ($shortlist && $shortlist->exists()) {
48
+            return $shortlist->ShortListItems()->Count();
49
+        }
50 50
 
51
-		return 0;
52
-	}
51
+        return 0;
52
+    }
53 53
 
54
-	public function AddedToShortList($ID = null, $type = null) {
55
-		if (is_null($ID) || is_null($type)) {
56
-			return false;
57
-		}
54
+    public function AddedToShortList($ID = null, $type = null) {
55
+        if (is_null($ID) || is_null($type)) {
56
+            return false;
57
+        }
58 58
 
59
-		$shortlist = $this->getShortList();
59
+        $shortlist = $this->getShortList();
60 60
 
61
-		if ($shortlist) {
62
-			$items = $shortlist->ShortListItems()->filter(array('ItemID' => $ID, 'ItemType' => $type));
61
+        if ($shortlist) {
62
+            $items = $shortlist->ShortListItems()->filter(array('ItemID' => $ID, 'ItemType' => $type));
63 63
 
64
-			return $items->Count() > 0;
65
-		}
64
+            return $items->Count() > 0;
65
+        }
66 66
 
67
-		return 0;
68
-	}
67
+        return 0;
68
+    }
69 69
 }
Please login to merge, or discard this patch.
tests/ShortlistTest.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 {
5 5
     protected static $fixture_file = 'fixtures.yml';
6 6
 
7
-	public function testShortlistCreation()
8
-	{
7
+    public function testShortlistCreation()
8
+    {
9 9
         $shortlists = ShortList::get();
10 10
 
11 11
         $this->get('shortlist');
Please login to merge, or discard this patch.