Passed
Pull Request — master (#208)
by Matthew
05:58
created
src/form/LocatorForm.php 1 patch
Indentation   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -19,88 +19,88 @@
 block discarded – undo
19 19
 class LocatorForm extends Form
20 20
 {
21 21
 
22
-    /**
23
-     * LocatorForm constructor.
24
-     * @param Controller $controller
25
-     * @param string $name
26
-     */
27
-    public function __construct(Controller $controller, $name)
28
-    {
22
+	/**
23
+	 * LocatorForm constructor.
24
+	 * @param Controller $controller
25
+	 * @param string $name
26
+	 */
27
+	public function __construct(Controller $controller, $name)
28
+	{
29 29
 
30
-        $fields = FieldList::create(
31
-            TextField::create('Address')
32
-                ->setTitle('')
33
-                ->setAttribute('placeholder', 'address or zip code')
34
-        );
30
+		$fields = FieldList::create(
31
+			TextField::create('Address')
32
+				->setTitle('')
33
+				->setAttribute('placeholder', 'address or zip code')
34
+		);
35 35
 
36
-        $pageCategories = Locator::locator_categories_by_locator($controller->data()->ID);
37
-        if ($pageCategories && $pageCategories->count() > 0) {
38
-            $categories = false;
39
-        } else {
40
-            $categories = Locator::get_all_categories();
41
-            if ($categories->count() < 1) {
42
-                $categories = false;
43
-            }
44
-        }
36
+		$pageCategories = Locator::locator_categories_by_locator($controller->data()->ID);
37
+		if ($pageCategories && $pageCategories->count() > 0) {
38
+			$categories = false;
39
+		} else {
40
+			$categories = Locator::get_all_categories();
41
+			if ($categories->count() < 1) {
42
+				$categories = false;
43
+			}
44
+		}
45 45
 
46
-        if ($categories) {
47
-            $categoriesField = DropdownField::create('CategoryID')
48
-                ->setTitle('')
49
-                ->setEmptyString('all categories')
50
-                ->setSource($categories->map());
51
-            $fields->push($categoriesField);
52
-        }
46
+		if ($categories) {
47
+			$categoriesField = DropdownField::create('CategoryID')
48
+				->setTitle('')
49
+				->setEmptyString('all categories')
50
+				->setSource($categories->map());
51
+			$fields->push($categoriesField);
52
+		}
53 53
 
54
-        if ($controller->getShowRadius()) {
55
-            $radiusArray = array_values($controller->getRadii());
56
-            $this->extend('overrideRadiusArray', $radiusArray);
57
-            $fields->push(DropdownField::create('Radius', '', ArrayLib::valuekey($radiusArray))
58
-                ->setEmptyString('radius'));
59
-        }
54
+		if ($controller->getShowRadius()) {
55
+			$radiusArray = array_values($controller->getRadii());
56
+			$this->extend('overrideRadiusArray', $radiusArray);
57
+			$fields->push(DropdownField::create('Radius', '', ArrayLib::valuekey($radiusArray))
58
+				->setEmptyString('radius'));
59
+		}
60 60
 
61
-        $actions = FieldList::create(
62
-            FormAction::create('doFilterLocations')
63
-                ->setTitle('Search')
64
-        );
61
+		$actions = FieldList::create(
62
+			FormAction::create('doFilterLocations')
63
+				->setTitle('Search')
64
+		);
65 65
 
66
-        $validator = $this->getValidator();
66
+		$validator = $this->getValidator();
67 67
 
68
-        parent::__construct($controller, $name, $fields, $actions, $validator);
69
-    }
68
+		parent::__construct($controller, $name, $fields, $actions, $validator);
69
+	}
70 70
 
71
-    /**
72
-     * @return null|RequiredFields|\SilverStripe\Forms\Validator
73
-     */
74
-    public function getValidator()
75
-    {
76
-        $validator = parent::getValidator();
77
-        if (empty($validator)) {
78
-            if (!$this->validator instanceof RequiredFields) {
79
-                $this->setValidator(RequiredFields::create('Address'));
80
-            }
81
-            $validator = $this->validator;
82
-        }
83
-        $this->extend('updateRequiredFields', $validator);
84
-        return $validator;
85
-    }
71
+	/**
72
+	 * @return null|RequiredFields|\SilverStripe\Forms\Validator
73
+	 */
74
+	public function getValidator()
75
+	{
76
+		$validator = parent::getValidator();
77
+		if (empty($validator)) {
78
+			if (!$this->validator instanceof RequiredFields) {
79
+				$this->setValidator(RequiredFields::create('Address'));
80
+			}
81
+			$validator = $this->validator;
82
+		}
83
+		$this->extend('updateRequiredFields', $validator);
84
+		return $validator;
85
+	}
86 86
 
87
-    /**
88
-     * @return FieldList
89
-     */
90
-    public function Fields()
91
-    {
92
-        $fields = parent::Fields();
93
-        $this->extend('updateLocatorFormFields', $fields);
94
-        return $fields;
95
-    }
87
+	/**
88
+	 * @return FieldList
89
+	 */
90
+	public function Fields()
91
+	{
92
+		$fields = parent::Fields();
93
+		$this->extend('updateLocatorFormFields', $fields);
94
+		return $fields;
95
+	}
96 96
 
97
-    /**
98
-     * @return \SilverStripe\Forms\FieldList
99
-     */
100
-    public function Actions()
101
-    {
102
-        $actions = parent::Actions();
103
-        $this->extend('updateLocatorActions', $actions);
104
-        return $actions;
105
-    }
97
+	/**
98
+	 * @return \SilverStripe\Forms\FieldList
99
+	 */
100
+	public function Actions()
101
+	{
102
+		$actions = parent::Actions();
103
+		$this->extend('updateLocatorActions', $actions);
104
+		return $actions;
105
+	}
106 106
 }
Please login to merge, or discard this patch.