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

@@ 236-247 (lines=12) @@
233
     *
234
     * @return string
235
     */
236
    private function assureValidType($type)
237
    {
238
        foreach (self::getTypes() as $allowedType) {
239
            if ($type === $allowedType) {
240
                return $type;
241
            }
242
        }
243
244
        throw new InvalidType(
245
            sprintf('"%s" is not a valid type for %s', $type, TailoredAudience::class)
246
        );
247
    }
248
249
    /**
250
     * @return array