Code Duplication    Length = 15-15 lines in 3 locations

src/Entity/Capture.php 3 locations

@@ 21-35 (lines=15) @@
18
     *
19
     * @return \Acquia\LiftClient\Entity\Capture
20
     */
21
    public function setPersonUdf($num, $value)
22
    {
23
        if (!is_int($num)) {
24
            throw new LiftSdkException('Argument must be an instance of integer.');
25
        }
26
        if ($num < 1 || $num > 50) {
27
            throw new LiftSdkException('Argument must be greater than 0 and smaller or equal to 50.');
28
        }
29
        if (!is_string($value)) {
30
            throw new LiftSdkException('Argument must be an instance of string.');
31
        }
32
        $this['person_udf'.$num] = $value;
33
34
        return $this;
35
    }
36
37
    /**
38
     * Set the 'event_udf$' field.
@@ 47-61 (lines=15) @@
44
     *
45
     * @return \Acquia\LiftClient\Entity\Capture
46
     */
47
    public function setEventUdf($num, $value)
48
    {
49
        if (!is_int($num)) {
50
            throw new LiftSdkException('Argument must be an instance of integer.');
51
        }
52
        if ($num < 1 || $num > 50) {
53
            throw new LiftSdkException('Argument must be greater than 0 and smaller or equal to 50.');
54
        }
55
        if (!is_string($value)) {
56
            throw new LiftSdkException('Argument must be an instance of string.');
57
        }
58
        $this['event_udf'.$num] = $value;
59
60
        return $this;
61
    }
62
63
    /**
64
     * Set the 'touch_udf$' field.
@@ 73-87 (lines=15) @@
70
     *
71
     * @return \Acquia\LiftClient\Entity\Capture
72
     */
73
    public function setTouchUdf($num, $value)
74
    {
75
        if (!is_int($num)) {
76
            throw new LiftSdkException('Argument must be an instance of integer.');
77
        }
78
        if ($num < 1 || $num > 20) {
79
            throw new LiftSdkException('Argument must be greater than 0 and smaller or equal to 50.');
80
        }
81
        if (!is_string($value)) {
82
            throw new LiftSdkException('Argument must be an instance of string.');
83
        }
84
        $this['event_udf'.$num] = $value;
85
86
        return $this;
87
    }
88
89
    /**
90
     * Sets the 'event_name' parameter.