Shop_validation_customer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A set_validation_rules() 0 12 1
1
<?php
2
3
class Shop_validation_customer extends Custom_validation
4
{
5
	// バリデーションの設定
6
	protected function set_validation_rules()
7
	{
8
		$this->set_error_delimiters('<div class="error">', '</div>');
9
10
		$this->set_rules('name', '名前', 'trim|required|max_length[64]');
0 ignored issues
show
Documentation introduced by
'trim|required|max_length[64]' is of type string, but the function expects a array.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
11
		$this->set_rules('zip', '郵便番号', 'trim|max_length[8]');
0 ignored issues
show
Documentation introduced by
'trim|max_length[8]' is of type string, but the function expects a array.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
12
		$this->set_rules('addr', '住所', 'trim|required|max_length[128]');
0 ignored issues
show
Documentation introduced by
'trim|required|max_length[128]' is of type string, but the function expects a array.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
13
		$this->set_rules('tel', '電話番号', 'trim|required|max_length[20]');
0 ignored issues
show
Documentation introduced by
'trim|required|max_length[20]' is of type string, but the function expects a array.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
14
		$this->set_rules(
15
			'email', 'メールアドレス', 'trim|required|valid_email|max_length[64]'
0 ignored issues
show
Documentation introduced by
'trim|required|valid_email|max_length[64]' is of type string, but the function expects a array.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
16
		);
17
	}
18
}
19