Code Duplication    Length = 12-12 lines in 2 locations

src/TwitterAds/TailoredAudience/GlobalOptOut.php 1 location

@@ 73-84 (lines=12) @@
70
     *
71
     * @return string
72
     */
73
    private function assureValidType($type)
74
    {
75
        foreach (TailoredAudience::getTypes() as $allowedType) {
76
            if ($type === $allowedType) {
77
                return $type;
78
            }
79
        }
80
81
        throw new InvalidType(
82
            sprintf('"%s" is not a valid type for %s', $type, TailoredAudience::class)
83
        );
84
    }
85
86
    /**
87
     * @return array

src/TwitterAds/TailoredAudience/TailoredAudience.php 1 location

@@ 224-235 (lines=12) @@
221
     *
222
     * @return string
223
     */
224
    private function assureValidType($type)
225
    {
226
        foreach (self::getTypes() as $allowedType) {
227
            if ($type === $allowedType) {
228
                return $type;
229
            }
230
        }
231
232
        throw new InvalidType(
233
            sprintf('"%s" is not a valid type for %s', $type, TailoredAudience::class)
234
        );
235
    }
236
237
    /**
238
     * @return array