Code Duplication    Length = 3-4 lines in 2 locations

src/TagDependencyTrait.php 2 locations

@@ 82-85 (lines=4) @@
79
            $tag = [];
80
            $changed = false;
81
82
            foreach ($tagFields as $tagField) {
83
                $tag[$tagField] = $this->$tagField;
84
                $changed |= isset($oldfields[$tagField]);
85
            }
86
87
            $tags[] = NamingHelper::getCompositeTag($this->className(), $tag);
88
@@ 91-93 (lines=3) @@
88
89
            if ($changed) {
90
                $tag = [];
91
                foreach ($tagFields as $tagField) {
92
                    $tag[$tagField] = isset($oldfields[$tagField]) ? $oldfields[$tagField] : $this->$tagField;
93
                }
94
                $tags[] = NamingHelper::getCompositeTag($this->className(), $tag);
95
            }
96
        }