Passed
Push — master ( 72aaf1...8a2b22 )
by Richard
01:25
created
Maphper/Relation/One.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 	private $siblings = [];
10 10
 
11 11
 	public function __construct(\Maphper\Maphper $mapper, $parentField, $localField, array $criteria = []) {
12
-        if ($criteria) $mapper = $mapper->filter($this->criteira);
12
+		if ($criteria) $mapper = $mapper->filter($this->criteira);
13 13
 		$this->mapper = $mapper;
14 14
 		$this->parentField = $parentField;
15 15
 		$this->localField = $localField;
@@ -49,18 +49,18 @@  discard block
 block discarded – undo
49 49
 		//Fetch the results so they're in the cache for the corresponding maphper object
50 50
 		$results = $this->mapper->filter([$this->localField => $recordsToLoad]);
51 51
 
52
-        $this->loadDataIntoSiblings($results);
52
+		$this->loadDataIntoSiblings($results);
53 53
 	}
54 54
 
55
-    private function loadDataIntoSiblings($results) {
56
-        $cache = [];
55
+	private function loadDataIntoSiblings($results) {
56
+		$cache = [];
57 57
 		foreach ($results as $result) {
58 58
 			$cache[$result->{$this->localField}] = $result;
59 59
 		}
60 60
 
61 61
 		foreach ($this->siblings as $sibling) {
62
-            if ($sibling->parentField === $this->parentField &&
63
-                isset($cache[$sibling->parentObject->{$this->parentField}]))$sibling->data = $cache[$sibling->parentObject->{$this->parentField}];
62
+			if ($sibling->parentField === $this->parentField &&
63
+				isset($cache[$sibling->parentObject->{$this->parentField}]))$sibling->data = $cache[$sibling->parentObject->{$this->parentField}];
64 64
 		}
65 65
 		/*
66 66
 		foreach ($this->siblings as $sibling) {
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 			else $sibling->data = $sibling->mapper->filter([$sibling->localField => $sibling->parentObject->{$this->parentField}])->item(0);
69 69
 		}
70 70
 		*/
71
-    }
71
+	}
72 72
 
73 73
 	public function __call($func, array $args = []) {
74 74
 		if ($this->lazyLoad() == null) return '';
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
 	public function __get($name) {
79 79
 		if ($this->lazyLoad()) return $this->lazyLoad()->$name;
80
-        else return null;
80
+		else return null;
81 81
 	}
82 82
 
83 83
 	public function __isset($name) {
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
 	}
86 86
 
87 87
 	public function overwrite($parentObject, &$data) {
88
-        $this->mapper[] = $data;
88
+		$this->mapper[] = $data;
89 89
 
90
-        if (!isset($parentObject->{$this->parentField}) || $parentObject->{$this->parentField} != $data->{$this->localField}) {
90
+		if (!isset($parentObject->{$this->parentField}) || $parentObject->{$this->parentField} != $data->{$this->localField}) {
91 91
 			$parentObject->{$this->parentField} = $data->{$this->localField};
92 92
 			//Trigger an update of the parent object
93 93
 			return true;
Please login to merge, or discard this patch.