Completed
Pull Request — develop (#7)
by Kenji
01:27
created
application/controllers/Form.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -122,8 +122,7 @@
 block discarded – undo
122 122
 		if ($this->email->send())
123 123
 		{
124 124
 			return TRUE;
125
-		}
126
-		else
125
+		} else
127 126
 		{
128 127
 //			echo $this->email->print_debugger();
129 128
 			return FALSE;
Please login to merge, or discard this patch.
application/controllers/Shop.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
12 12
  */
13 13
 class Shop extends MY_Controller {
14 14
 
15
-	public $limit;	// 1ページに表示する商品の数
16
-	public $admin;	// 管理者のメールアドレス
15
+	public $limit; // 1ページに表示する商品の数
16
+	public $admin; // 管理者のメールアドレス
17 17
 
18 18
 	public function __construct()
19 19
 	{
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 
68 68
 # モデルよりそのカテゴリの商品数を取得し、ページネーションを生成します。
69 69
 		$this->load->library('generate_pagination');
70
-		$path  = '/shop/index/' . $cat_id;
70
+		$path  = '/shop/index/'.$cat_id;
71 71
 		$total = $this->inventory_model->get_product_count($cat_id);
72 72
 		$data['pagination'] = $this->generate_pagination->get_links($path, $total, 4);
73 73
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 		);
150 150
 
151 151
 # 検索キーワードをクエリ文字列から取得します。
152
-		$q = (string) $this->input->get('q');
152
+		$q = (string)$this->input->get('q');
153 153
 # 全角スペースを半角スペースに変換します。
154 154
 		$q = trim(mb_convert_kana($q, 's'));
155 155
 # 検索キーワードを検証します。
@@ -168,13 +168,13 @@  discard block
 block discarded – undo
168 168
 
169 169
 # ページネーションを生成します。
170 170
 		$this->load->library('generate_pagination');
171
-		$path  = '/shop/search';
171
+		$path = '/shop/search';
172 172
 		$data['pagination'] = $this->generate_pagination->get_links($path, $total, 3);
173 173
 
174 174
 		$data['q'] = $q;
175 175
 		$data['total'] = $total;
176 176
 
177
-		$data['main']   = 'shop_search';
177
+		$data['main'] = 'shop_search';
178 178
 		$data['item_count'] = $this->cart_model->count();
179 179
 		$this->twig->display('shop_tmpl_shop', $data);
180 180
 	}
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -216,8 +216,7 @@  discard block
 block discarded – undo
216 216
 
217 217
 			$data['action'] = '注文内容の確認';
218 218
 			$data['main']   = 'shop_confirm';
219
-		}
220
-		else
219
+		} else
221 220
 		{
222 221
 			$data = [
223 222
 				'action' => 'お客様情報の入力',
@@ -245,8 +244,7 @@  discard block
 block discarded – undo
245 244
 			$this->twig->display('shop_tmpl_checkout', $data);
246 245
 # 注文が完了したので、セッションを破棄します。
247 246
 			$this->session->sess_destroy();
248
-		}
249
-		else
247
+		} else
250 248
 		{
251 249
 			echo 'システムエラー';
252 250
 		}
Please login to merge, or discard this patch.
application/hooks/Convert_encoding.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 		}
26 26
 
27 27
 # 携帯端末からのアクセスを判定するためユーザエージェントクラスをロードします。
28
-		$agent =& load_class('User_agent');
28
+		$agent = & load_class('User_agent');
29 29
 
30 30
 # 携帯端末からの入力文字エンコードを変換します。
31 31
 		if (count($_POST) > 1 && $agent->is_mobile())
@@ -41,13 +41,13 @@  discard block
 block discarded – undo
41 41
 			return;
42 42
 		}
43 43
 
44
-		if (! $this->check_route()) {
44
+		if ( ! $this->check_route()) {
45 45
 			return;
46 46
 		}
47 47
 
48 48
 		// load_class()でuser_agentをロードしたため、$this->user_agentとして
49 49
 		// して代入されているので、それを$this->agentに変更する
50
-		$CI =& get_instance();
50
+		$CI = & get_instance();
51 51
 		$CI->agent = $CI->user_agent;
52 52
 		unset($CI->user_agent);
53 53
 	}
Please login to merge, or discard this patch.
application/libraries/Generate_pagination.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 	public function get_links($path, $total, $uri_segment)
9 9
 	{
10 10
 # ページネーションクラスをロードします。
11
-		$this->CI =& get_instance();
11
+		$this->CI = & get_instance();
12 12
 		$this->CI->load->library('pagination');
13 13
 
14 14
 		$config = [];
Please login to merge, or discard this patch.
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -5,6 +5,12 @@
 block discarded – undo
5 5
 	private $CI;
6 6
 
7 7
 	// ページネーションの生成
8
+
9
+	/**
10
+	 * @param string $path
11
+	 * @param integer $total
12
+	 * @param integer $uri_segment
13
+	 */
8 14
 	public function get_links($path, $total, $uri_segment)
9 15
 	{
10 16
 # ページネーションクラスをロードします。
Please login to merge, or discard this patch.
application/libraries/Seeder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 
17 17
 	public function __construct()
18 18
 	{
19
-		$this->CI =& get_instance();
19
+		$this->CI = & get_instance();
20 20
 		$this->CI->load->database();
21 21
 		$this->CI->load->dbforge();
22 22
 		$this->db = $this->CI->db;
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 */
31 31
 	public function call($seeder)
32 32
 	{
33
-		$file = APPPATH . 'database/seeds/' . $seeder . '.php';
33
+		$file = APPPATH.'database/seeds/'.$seeder.'.php';
34 34
 		require_once $file;
35 35
 		$obj = new $seeder;
36 36
 		$obj->run();
Please login to merge, or discard this patch.
application/libraries/validation/Custom_validation.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 
7 7
 	public function __construct()
8 8
 	{
9
-		$this->CI =& get_instance();
9
+		$this->CI = & get_instance();
10 10
 		$this->CI->load->library('form_validation');
11 11
 
12 12
 		$this->set_validation_rules();
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -20,6 +20,9 @@
 block discarded – undo
20 20
 		$this->CI->form_validation->set_error_delimiters($prefix, $suffix);
21 21
 	}
22 22
 
23
+	/**
24
+	 * @param string $field
25
+	 */
23 26
 	protected function set_rules(
24 27
 		$field, $label = '', $rules = array(), $errors = array()
25 28
 	)
Please login to merge, or discard this patch.
application/libraries/validation/Field_validation.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 
7 7
 	public function __construct()
8 8
 	{
9
-		$this->CI =& get_instance();
9
+		$this->CI = & get_instance();
10 10
 		$this->CI->load->library('form_validation');
11 11
 	}
12 12
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,7 @@
 block discarded – undo
24 24
 		if ($this->CI->form_validation->run() === FALSE)
25 25
 		{
26 26
 			show_error('不正な入力です。');
27
-		}
28
-		else
27
+		} else
29 28
 		{
30 29
 			return TRUE;
31 30
 		}
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -10,6 +10,9 @@
 block discarded – undo
10 10
 		$this->CI->load->library('form_validation');
11 11
 	}
12 12
 
13
+	/**
14
+	 * @param string $rules
15
+	 */
13 16
 	public function validate($value, $rules, $errors = [])
14 17
 	{
15 18
 		$this->CI->form_validation->reset_validation();
Please login to merge, or discard this patch.
application/models/shop/Cart_model.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -25,13 +25,13 @@  discard block
 block discarded – undo
25 25
 # unset_userdata()メソッドで、セッションデータからその商品を削除します。
26 26
 		if ($qty <= 0)
27 27
 		{
28
-			$this->session->unset_userdata('item' . $id);
28
+			$this->session->unset_userdata('item'.$id);
29 29
 		}
30 30
 # 指定の数量が1以上の場合は、その商品が存在するかチェックした後に、商品と数量を
31 31
 # セッションデータに追加します。セッションの項目名は「item+商品ID」とします。
32 32
 		elseif ($this->inventory_model->is_available_product_item($id))
33 33
 		{
34
-			$this->session->set_userdata('item' . $id, $qty);
34
+			$this->session->set_userdata('item'.$id, $qty);
35 35
 		}
36 36
 	}
37 37
 
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 	 */
43 43
 	public function get_all()
44 44
 	{
45
-		$items = [];	// 商品情報の配列
46
-		$total = 0;		// 合計金額
47
-		$line  = 0;		// 行数
45
+		$items = []; // 商品情報の配列
46
+		$total = 0; // 合計金額
47
+		$line  = 0; // 行数
48 48
 
49 49
 # セッションクラスのuserdata()メソッドですべてのセッションデータを取得し、
50 50
 # ループで回して必要な情報を取り出します。
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 			{
56 56
 				$line++;
57 57
 # 配列のキーから商品IDを取り出します。
58
-				$id     = (int) substr($key, 4);
58
+				$id     = (int)substr($key, 4);
59 59
 # get_product_item()メソッドを使い、商品データを取得します。
60 60
 				$item   = $this->inventory_model->get_product_item($id);
61 61
 # 単価に数量を掛けて金額を計算します。
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
 		}
75 75
 
76 76
 		$cart = [];
77
-		$cart['items'] = $items;	// 商品情報の配列
78
-		$cart['line']  = $line;		// 商品アイテム数
79
-		$cart['total'] = $total;	// 合計金額
77
+		$cart['items'] = $items; // 商品情報の配列
78
+		$cart['line']  = $line; // 商品アイテム数
79
+		$cart['total'] = $total; // 合計金額
80 80
 
81 81
 		return $cart;
82 82
 	}
Please login to merge, or discard this patch.
application/models/shop/Inventory_model.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,8 +56,7 @@
 block discarded – undo
56 56
 		if ($query->num_rows() == 1)
57 57
 		{
58 58
 			return TRUE;
59
-		}
60
-		else
59
+		} else
61 60
 		{
62 61
 			return FALSE;
63 62
 		}
Please login to merge, or discard this patch.
Doc Comments   +22 added lines patch added patch discarded remove patch
@@ -18,6 +18,9 @@  discard block
 block discarded – undo
18 18
 		return $query->result();
19 19
 	}
20 20
 
21
+	/**
22
+	 * @param string $id
23
+	 */
21 24
 	public function get_category_name($id)
22 25
 	{
23 26
 		$this->db->select('name');
@@ -27,6 +30,11 @@  discard block
 block discarded – undo
27 30
 		return $row->name;
28 31
 	}
29 32
 
33
+	/**
34
+	 * @param string $cat_id
35
+	 * @param string|null $limit
36
+	 * @param string $offset
37
+	 */
30 38
 	public function get_product_list($cat_id, $limit, $offset)
31 39
 	{
32 40
 		$this->db->where('category_id', $cat_id);
@@ -35,6 +43,9 @@  discard block
 block discarded – undo
35 43
 		return $query->result();
36 44
 	}
37 45
 
46
+	/**
47
+	 * @param string $cat_id
48
+	 */
38 49
 	public function get_product_count($cat_id)
39 50
 	{
40 51
 		$this->db->where('category_id', $cat_id);
@@ -49,6 +60,9 @@  discard block
 block discarded – undo
49 60
 		return $query->row();
50 61
 	}
51 62
 
63
+	/**
64
+	 * @param integer $id
65
+	 */
52 66
 	public function is_available_product_item($id)
53 67
 	{
54 68
 		$this->db->where('id', $id);
@@ -63,6 +77,11 @@  discard block
 block discarded – undo
63 77
 		}
64 78
 	}
65 79
 
80
+	/**
81
+	 * @param string $q
82
+	 * @param string|null $limit
83
+	 * @param string $offset
84
+	 */
66 85
 	public function get_product_by_search($q, $limit, $offset)
67 86
 	{
68 87
 # 検索キーワードをスペースで分割し、like()メソッドでLIKE句を指定します。
@@ -78,6 +97,9 @@  discard block
 block discarded – undo
78 97
 		return $query->result();
79 98
 	}
80 99
 
100
+	/**
101
+	 * @param string $q
102
+	 */
81 103
 	public function get_count_by_search($q)
82 104
 	{
83 105
 		$this->db->select('name');
Please login to merge, or discard this patch.