for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
class Shop_validation_customer extends Custom_validation
{
// バリデーションの設定
protected function set_validation_rules()
$this->set_error_delimiters('<div class="error">', '</div>');
$this->set_rules('name', '名前', 'trim|required|max_length[64]');
'trim|required|max_length[64]'
string
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);
$this->set_rules('zip', '郵便番号', 'trim|max_length[8]');
'trim|max_length[8]'
$this->set_rules('addr', '住所', 'trim|required|max_length[128]');
'trim|required|max_length[128]'
$this->set_rules('tel', '電話番号', 'trim|required|max_length[20]');
'trim|required|max_length[20]'
$this->set_rules(
'email', 'メールアドレス', 'trim|required|valid_email|max_length[64]'
'trim|required|valid_email|max_length[64]'
);
}
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: