Code Duplication    Length = 7-11 lines in 2 locations

src/OroCRM/Bundle/DemoDataBundle/Migrations/Data/Demo/ORM/LoadEmailData.php 1 location

@@ 134-144 (lines=11) @@
131
    /**
132
     * @param User $user
133
     */
134
    protected function setSecurityContext($user)
135
    {
136
        $securityContext = $this->container->get('security.context');
137
        $token = new UsernamePasswordOrganizationToken(
138
            $user,
139
            $user->getUsername(),
140
            'main',
141
            $this->getReference('default_organization')
142
        );
143
        $securityContext->setToken($token);
144
    }
145
146
    /**
147
     * @param $randomTemplate

src/OroCRM/Bundle/ReportBundle/Tests/Functional/DataFixtures/LoadLeadsData.php 1 location

@@ 215-221 (lines=7) @@
212
    /**
213
     * @param User $user
214
     */
215
    protected function setSecurityContext($user)
216
    {
217
        $securityContext = $this->container->get('security.context');
218
        $token           = new UsernamePasswordOrganizationToken($user, $user->getUsername(
219
        ), 'main', $this->organization);
220
        $securityContext->setToken($token);
221
    }
222
223
    /**
224
     * @param ObjectManager $manager