Code Duplication    Length = 3-4 lines in 2 locations

src/TagDependencyTrait.php 2 locations

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