Code Duplication    Length = 15-15 lines in 3 locations

src/Entity/Capture.php 3 locations

@@ 27-41 (lines=15) @@
24
     *
25
     * @return \Acquia\LiftClient\Entity\Capture
26
     */
27
    public function setPersonUdf($num, $value)
28
    {
29
        if (!is_int($num)) {
30
            throw new LiftSdkException('Argument $num must be an instance of integer.');
31
        }
32
        if ($num < 1 || $num > self::PERSON_UDF_COUNT) {
33
            throw new LiftSdkException('Argument $num must be greater than 0 and smaller or equal to 50.');
34
        }
35
        if (!is_string($value)) {
36
            throw new LiftSdkException('Argument $value must be an instance of string.');
37
        }
38
        $this['person_udf'.$num] = $value;
39
40
        return $this;
41
    }
42
43
    /**
44
     * Set the 'event_udf#' field.
@@ 53-67 (lines=15) @@
50
     *
51
     * @return \Acquia\LiftClient\Entity\Capture
52
     */
53
    public function setEventUdf($num, $value)
54
    {
55
        if (!is_int($num)) {
56
            throw new LiftSdkException('Argument $num must be an instance of integer.');
57
        }
58
        if ($num < 1 || $num > self::EVENT_UDF_COUNT) {
59
            throw new LiftSdkException('Argument $num must be greater than 0 and smaller or equal to 50.');
60
        }
61
        if (!is_string($value)) {
62
            throw new LiftSdkException('Argument $value must be an instance of string.');
63
        }
64
        $this['event_udf'.$num] = $value;
65
66
        return $this;
67
    }
68
69
    /**
70
     * Set the 'touch_udf#' field.
@@ 79-93 (lines=15) @@
76
     *
77
     * @return \Acquia\LiftClient\Entity\Capture
78
     */
79
    public function setTouchUdf($num, $value)
80
    {
81
        if (!is_int($num)) {
82
            throw new LiftSdkException('Argument $num must be an instance of integer.');
83
        }
84
        if ($num < 1 || $num > self::TOUCH_UDF_COUNT) {
85
            throw new LiftSdkException('Argument $num must be greater than 0 and smaller or equal to 20.');
86
        }
87
        if (!is_string($value)) {
88
            throw new LiftSdkException('Argument $value must be an instance of string.');
89
        }
90
        $this['event_udf'.$num] = $value;
91
92
        return $this;
93
    }
94
95
    /**
96
     * Sets the 'event_name' parameter.