Code Duplication    Length = 8-8 lines in 3 locations

src/SAML2/Assertion.php 2 locations

@@ 526-533 (lines=8) @@
523
                $nameFormat = Constants::NAMEFORMAT_UNSPECIFIED;
524
            }
525
526
            if ($firstAttribute) {
527
                $this->nameFormat = $nameFormat;
528
                $firstAttribute = false;
529
            } else {
530
                if ($this->nameFormat !== $nameFormat) {
531
                    $this->nameFormat = Constants::NAMEFORMAT_UNSPECIFIED;
532
                }
533
            }
534
535
            if (!array_key_exists($name, $this->attributes)) {
536
                $this->attributes[$name] = array();
@@ 859-866 (lines=8) @@
856
                $nameFormat = Constants::NAMEFORMAT_UNSPECIFIED;
857
            }
858
859
            if ($firstAttribute) {
860
                $this->nameFormat = $nameFormat;
861
                $firstAttribute = false;
862
            } else {
863
                if ($this->nameFormat !== $nameFormat) {
864
                    $this->nameFormat = Constants::NAMEFORMAT_UNSPECIFIED;
865
                }
866
            }
867
868
            if (!array_key_exists($name, $this->attributes)) {
869
                $this->attributes[$name] = array();

src/SAML2/AttributeQuery.php 1 location

@@ 70-77 (lines=8) @@
67
                $nameFormat = Constants::NAMEFORMAT_UNSPECIFIED;
68
            }
69
70
            if ($firstAttribute) {
71
                $this->nameFormat = $nameFormat;
72
                $firstAttribute = false;
73
            } else {
74
                if ($this->nameFormat !== $nameFormat) {
75
                    $this->nameFormat = Constants::NAMEFORMAT_UNSPECIFIED;
76
                }
77
            }
78
79
            if (!array_key_exists($name, $this->attributes)) {
80
                $this->attributes[$name] = array();