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

@@ 1447-1453 (lines=7) @@
1444
            }
1445
1446
            foreach ($values as $value) {
1447
                if (is_string($value)) {
1448
                    $type = 'xs:string';
1449
                } elseif (is_int($value)) {
1450
                    $type = 'xs:integer';
1451
                } else {
1452
                    $type = null;
1453
                }
1454
1455
                $attributeValue = $document->createElementNS(Constants::NS_SAML, 'saml:AttributeValue');
1456
                $attribute->appendChild($attributeValue);
@@ 1504-1510 (lines=7) @@
1501
            }
1502
1503
            foreach ($values as $value) {
1504
                if (is_string($value)) {
1505
                    $type = 'xs:string';
1506
                } elseif (is_int($value)) {
1507
                    $type = 'xs:integer';
1508
                } else {
1509
                    $type = null;
1510
                }
1511
1512
                $attributeValue = $document2->createElementNS(Constants::NS_SAML, 'saml:AttributeValue');
1513
                $attribute->appendChild($attributeValue);