Test Failed
Push — master ( b7a47e...ab2bba )
by
unknown
05:06
created
lib/ObjectsUtils.php 1 patch
Indentation   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -7,69 +7,69 @@
 block discarded – undo
7 7
  */
8 8
 class ObjectsUtils
9 9
 {
10
-    /**
11
-     * @param $objects \stdClass[]
12
-     * @param $key
13
-     * @return array
14
-     *
15
-     * Objects 에서 특정 key를 가진 값들을 모두 얻기
16
-     *
17
-     * $dicts = $db->sqlObjects('select * from tb_book');
18
-     * $b_ids = ObjectsUtils::extractValuesByKey($objects, 'id');
19
-     */
20
-    public static function extractValuesByKey($objects, $key)
21
-    {
10
+	/**
11
+	 * @param $objects \stdClass[]
12
+	 * @param $key
13
+	 * @return array
14
+	 *
15
+	 * Objects 에서 특정 key를 가진 값들을 모두 얻기
16
+	 *
17
+	 * $dicts = $db->sqlObjects('select * from tb_book');
18
+	 * $b_ids = ObjectsUtils::extractValuesByKey($objects, 'id');
19
+	 */
20
+	public static function extractValuesByKey($objects, $key)
21
+	{
22 22
 		$return = [];
23
-        foreach ($objects as $object) {
24
-            $return[] = $object->$key;
25
-        }
26
-        return $return;
27
-    }
23
+		foreach ($objects as $object) {
24
+			$return[] = $object->$key;
25
+		}
26
+		return $return;
27
+	}
28 28
 
29
-    /**
30
-     * @param $objects
31
-     * @param $key
32
-     * @return array
33
-     *
34
-     * Objects 에서 특정 key 를 기준으로 재배치(key 기준으로 하나밖에 없을떄)
35
-     *
36
-     * $objects = $db->sqlObjects('select * from cpdp_books');
37
-     * $cpdp_books_by_bid = ObjectsUtils::alignByKey($objects, 'b_id');
38
-     * $cpdp_books_111011110 = $tb_book_property_by_bid['111011110'];
39
-     *
40
-     * $cpdp_books_111011110 => ['id' => '123123', 'b_id'=>'111011110', 'title' => '바람과 함께 사라지다']
41
-     */
42
-    public static function alignByKey($objects, $key)
43
-    {
44
-        $return = [];
45
-        foreach ($objects as $object) {
46
-            $return[$object->$key] = $object;
47
-        }
48
-        return $return;
49
-    }
29
+	/**
30
+	 * @param $objects
31
+	 * @param $key
32
+	 * @return array
33
+	 *
34
+	 * Objects 에서 특정 key 를 기준으로 재배치(key 기준으로 하나밖에 없을떄)
35
+	 *
36
+	 * $objects = $db->sqlObjects('select * from cpdp_books');
37
+	 * $cpdp_books_by_bid = ObjectsUtils::alignByKey($objects, 'b_id');
38
+	 * $cpdp_books_111011110 = $tb_book_property_by_bid['111011110'];
39
+	 *
40
+	 * $cpdp_books_111011110 => ['id' => '123123', 'b_id'=>'111011110', 'title' => '바람과 함께 사라지다']
41
+	 */
42
+	public static function alignByKey($objects, $key)
43
+	{
44
+		$return = [];
45
+		foreach ($objects as $object) {
46
+			$return[$object->$key] = $object;
47
+		}
48
+		return $return;
49
+	}
50 50
 
51
-    /**
52
-     * @param $objects
53
-     * @param $key
54
-     * @return array
55
-     *
56
-     * Objects 에서 특정 key 를 기준으로 재배치(key 기준으로 여러개 있을떄)
57
-     *
58
-     * $dicts = $db->sqlObjects('select * from tb_book_property');
59
-     * $tb_book_propertys_by_bid = ObjectsUtils::alignListByKey($dicts, 'b_id');
60
-     * $tb_book_propertys_111011110 = $tb_book_propertys_by_bid['111011110'];
61
-     *
62
-     * $tb_book_propertys_111011110 => [
63
-     *      ['b_id'=>'111011110', 'key' => 'num_pages', 'vaule' => 123123],
64
-     *      ['b_id'=>'111011110', 'key' => 'type', 'vaule' => 'pdf'],
65
-     * ]
66
-     */
67
-    public static function alignListByKey($objects, $key)
68
-    {
69
-        $return = [];
70
-        foreach ($objects as $object) {
71
-            $return[$object->$key][] = $object;
72
-        }
73
-        return $return;
74
-    }
51
+	/**
52
+	 * @param $objects
53
+	 * @param $key
54
+	 * @return array
55
+	 *
56
+	 * Objects 에서 특정 key 를 기준으로 재배치(key 기준으로 여러개 있을떄)
57
+	 *
58
+	 * $dicts = $db->sqlObjects('select * from tb_book_property');
59
+	 * $tb_book_propertys_by_bid = ObjectsUtils::alignListByKey($dicts, 'b_id');
60
+	 * $tb_book_propertys_111011110 = $tb_book_propertys_by_bid['111011110'];
61
+	 *
62
+	 * $tb_book_propertys_111011110 => [
63
+	 *      ['b_id'=>'111011110', 'key' => 'num_pages', 'vaule' => 123123],
64
+	 *      ['b_id'=>'111011110', 'key' => 'type', 'vaule' => 'pdf'],
65
+	 * ]
66
+	 */
67
+	public static function alignListByKey($objects, $key)
68
+	{
69
+		$return = [];
70
+		foreach ($objects as $object) {
71
+			$return[$object->$key][] = $object;
72
+		}
73
+		return $return;
74
+	}
75 75
 }
Please login to merge, or discard this patch.