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

@@ 1531-1537 (lines=7) @@
1528
            }
1529
1530
            foreach ($values as $value) {
1531
                if (is_string($value)) {
1532
                    $type = 'xs:string';
1533
                } elseif (is_int($value)) {
1534
                    $type = 'xs:integer';
1535
                } else {
1536
                    $type = null;
1537
                }
1538
1539
                $attributeValue = $document->createElementNS(Constants::NS_SAML, 'saml:AttributeValue');
1540
                $attribute->appendChild($attributeValue);
@@ 1588-1594 (lines=7) @@
1585
            }
1586
1587
            foreach ($values as $value) {
1588
                if (is_string($value)) {
1589
                    $type = 'xs:string';
1590
                } elseif (is_int($value)) {
1591
                    $type = 'xs:integer';
1592
                } else {
1593
                    $type = null;
1594
                }
1595
1596
                $attributeValue = $document2->createElementNS(Constants::NS_SAML, 'saml:AttributeValue');
1597
                $attribute->appendChild($attributeValue);