Code Duplication    Length = 11-13 lines in 2 locations

src/Codeception/Module/Phalcon.php 1 location

@@ 538-550 (lines=13) @@
535
     * @return \Phalcon\Mvc\Model
536
     * @throws ModuleException
537
     */
538
    protected function getModelRecord($model)
539
    {
540
        if (!class_exists($model)) {
541
            throw new ModuleException(__CLASS__, "Model $model does not exist");
542
        }
543
544
        $record = new $model;
545
        if (!$record instanceof PhalconModel) {
546
            throw new ModuleException(__CLASS__, "Model $model is not instance of \\Phalcon\\Mvc\\Model");
547
        }
548
549
        return $record;
550
    }
551
552
    /**
553
     * Get identity.

src/Codeception/Module/Yii2.php 1 location

@@ 379-389 (lines=11) @@
376
            ->one();
377
    }
378
379
    protected function getModelRecord($model)
380
    {
381
        if (!class_exists($model)) {
382
            throw new \RuntimeException("Model $model does not exist");
383
        }
384
        $record = new $model;
385
        if (!$record instanceof ActiveRecordInterface) {
386
            throw new \RuntimeException("Model $model is not implement interface \\yii\\db\\ActiveRecordInterface");
387
        }
388
        return $record;
389
    }
390
391
    /**
392
     * Converting $page to valid Yii 2 URL