Code Duplication    Length = 3-4 lines in 2 locations

src/TagDependencyTrait.php 2 locations

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