Code Duplication    Length = 9-12 lines in 3 locations

src/Intraface/modules/accounting/VoucherFile.php 1 location

@@ 30-40 (lines=11) @@
27
        $this->error   = new Intraface_Error;
28
    }
29
30
    function validate($var)
31
    {
32
        $validator = new Intraface_Validator($this->error);
33
        if (!empty($var['description'])) {
34
            $validator->isString($var['description'], 'Beskrivelsen ulovlig', '', 'allow_empty');
35
        }
36
        if ($this->error->isError()) {
37
            return false;
38
        }
39
        return true;
40
    }
41
42
    function save($var)
43
    {

src/Intraface/modules/cms/section/Picture.php 1 location

@@ 44-52 (lines=9) @@
41
        }
42
    }
43
44
    function validate_section(& $var)
45
    {
46
        $validator = new Intraface_Validator($this->error);
47
        if (!empty($var['pic_id'])) {
48
            $validator->isNumeric($var['pic_id'], 'error in pic_id', 'allow_empty');
49
        }
50
51
        if ($this->error->isError()) {
52
            return 0;
53
        }
54
        return 1;
55
    }

src/Intraface/modules/cms/templatesection/Longtext.php 1 location

@@ 35-46 (lines=12) @@
32
        }
33
    }
34
35
    function validate_section($var)
36
    {
37
        $validator = new Intraface_Validator($this->error);
38
        if (!empty($var['size'])) {
39
            $validator->isNumeric($var['size'], 'error in size', 'allow_empty');
40
        }
41
42
        if ($this->error->isError()) {
43
            return false;
44
        }
45
        return true;
46
    }
47
48
    function save_section($var)
49
    {