Code Duplication    Length = 16-19 lines in 2 locations

Admin/Traits/CollectionsManager.php 1 location

@@ 117-132 (lines=16) @@
114
        return $this;
115
    }
116
117
    private function configureCollectionsManager()
118
    {
119
        $blast = $this->getConfigurationPool()->getContainer()->getParameter('blast');
120
        $key = 'collections'; // name of the key in the blast.yml
121
        // merge configuration/parameters
122
        foreach ($this->getCurrentComposition() as $class) {
123
            if (isset($blast[$class]) && isset($blast[$class]['manage']) && isset($blast[$class]['manage'][$key])) {
124
                if (!is_array($blast[$class]['manage'][$key])) {
125
                    $blast[$class]['manage'][$key] = [$blast[$class]['manage'][$key]];
126
                }
127
                $this->addManagedCollections($blast[$class]['manage'][$key]);
128
            }
129
        }
130
131
        return $this;
132
    }
133
}
134

Admin/Traits/ManyToManyManager.php 1 location

@@ 72-90 (lines=19) @@
69
        }
70
    }
71
72
    private function configureManyToManyManager()
73
    {
74
        $blast = $this->getConfigurationPool()->getContainer()->getParameter('blast');
75
        $key = 'manyToMany'; // name of the key in the blast.yml
76
77
        // merge configuration/parameters
78
        foreach ($this->getCurrentComposition() as $class) {
79
            if (isset($blast[$class])
80
          && isset($blast[$class]['manage'])
81
          && isset($blast[$class]['manage'][$key])) {
82
                if (!is_array($blast[$class]['manage'][$key])) {
83
                    $blast[$class]['manage'][$key] = [$blast[$class]['manage'][$key]];
84
                }
85
                $this->addManyToManyCollections($blast[$class]['manage'][$key]);
86
            }
87
        }
88
89
        return $this;
90
    }
91
}
92