Code Duplication    Length = 15-16 lines in 2 locations

src/Intraface/XMLRPC/Shop/Server0004.php 1 location

@@ 1079-1094 (lines=16) @@
1076
     *
1077
     * @return void
1078
     */
1079
    private function _factoryWebshop($shop_id)
1080
    {
1081
        if (!$this->kernel->intranet->hasModuleAccess('shop')) {
1082
            require_once 'XML/RPC2/Exception.php';
1083
            throw new XML_RPC2_FaultException('The intranet does not have access to the module webshop', -2);
1084
        }
1085
        $this->kernel->module('shop');
1086
1087
        $doctrine = $this->bucket->get('Doctrine_Connection_Common');
1088
        $gateway = new Intraface_modules_shop_ShopGateway($doctrine);
1089
        $shop = $gateway->findById($shop_id);
1090
        if ($shop === false) {
1091
            throw new XML_RPC2_FaultException('Could not find shop', 1);
1092
        }
1093
        $this->webshop = new Intraface_modules_shop_Coordinator($this->kernel, $shop, $this->credentials['session_id']);
1094
    }
1095
}
1096

src/Intraface/XMLRPC/Shop/Server0100.php 1 location

@@ 1241-1255 (lines=15) @@
1238
     *
1239
     * @return void
1240
     */
1241
    private function _factoryWebshop($shop_id)
1242
    {
1243
        if (!$this->kernel->intranet->hasModuleAccess('shop')) {
1244
            require_once 'XML/RPC2/Exception.php';
1245
            throw new XML_RPC2_FaultException('The intranet does not have access to the module webshop', -2);
1246
        }
1247
        $this->kernel->module('shop');
1248
1249
        $gateway = new Intraface_modules_shop_ShopGateway($this->doctrine);
1250
        $shop = $gateway->findById($shop_id);
1251
        if ($shop === false) {
1252
            throw new XML_RPC2_FaultException('Could not find shop', 1);
1253
        }
1254
        $this->webshop = new Intraface_modules_shop_Coordinator($this->kernel, $shop, $this->credentials['session_id']);
1255
    }
1256
1257
    private function getDoctrine()
1258
    {