Code Duplication    Length = 7-7 lines in 3 locations

src/SAML2/AttributeQuery.php 1 location

@@ 154-160 (lines=7) @@
151
            }
152
153
            foreach ($values as $value) {
154
                if (is_string($value)) {
155
                    $type = 'xs:string';
156
                } elseif (is_int($value)) {
157
                    $type = 'xs:integer';
158
                } else {
159
                    $type = null;
160
                }
161
162
                $attributeValue = Utils::addString($attribute, Constants::NS_SAML, 'saml:AttributeValue', $value);
163
                if ($type !== null) {

src/SAML2/Assertion.php 2 locations

@@ 1472-1478 (lines=7) @@
1469
            }
1470
1471
            foreach ($values as $value) {
1472
                if (is_string($value)) {
1473
                    $type = 'xs:string';
1474
                } elseif (is_int($value)) {
1475
                    $type = 'xs:integer';
1476
                } else {
1477
                    $type = null;
1478
                }
1479
1480
                $attributeValue = $document->createElementNS(Constants::NS_SAML, 'saml:AttributeValue');
1481
                $attribute->appendChild($attributeValue);
@@ 1529-1535 (lines=7) @@
1526
            }
1527
1528
            foreach ($values as $value) {
1529
                if (is_string($value)) {
1530
                    $type = 'xs:string';
1531
                } elseif (is_int($value)) {
1532
                    $type = 'xs:integer';
1533
                } else {
1534
                    $type = null;
1535
                }
1536
1537
                $attributeValue = $document2->createElementNS(Constants::NS_SAML, 'saml:AttributeValue');
1538
                $attribute->appendChild($attributeValue);