private function generateClassCode(\ReflectionClass $rc) : array
    {
        $mocked_class_name = self::generateMockClassName($rc);
        $namespace = $rc->getNamespaceName();
        $mock_target_class = $rc->getShortName();
        $methods = $rc->getMethods();
        
        $methods = array_filter($methods, function($item){
            /** @var \ReflectionMethod $item */
            return Util::isAllBitSet($item->getModifiers(), \ReflectionMethod::IS_ABSTRACT);
        });
        
        // first line
        $code[] = '<?php';
        
        // namespaces
        if (!empty($namespace)){
            $code[] = 'namespace ' . $namespace . ';';
        }
        
        // uses
        $code[] = '';
        foreach(self::getMethodRequiredClassesByClass($rc) as $rc_){
            $code[] = 'use ' . $rc_->getName() . ';';
        }
        
        // comment
        $code[] = '';
        $code[] = '/**';
        $code[] = ' * Mock class for: ' . $rc->getName();
        $code[] = ' * Generated by stk2k/Decoy';
        $code[] = ' */';
        
        // class definition
        if ($rc->isInterface()){
            $code[] = Code::PHP_CLASS . ' ' . $mocked_class_name .  ' ' . Code::PHP_IMPLEMENTS . ' ' . $mock_target_class;
        }
        else{
            $code[] = Code::PHP_CLASS . ' ' . $mocked_class_name .  ' ' . Code::PHP_EXTENDS . ' ' . $mock_target_class;
        }
        $code[] = '{';
        foreach($methods as $rm){
            $code = array_merge($code, $this->generateMethodCode($rm));
        }
        $code[] = '}';
        
        return array($code, $mocked_class_name, $namespace);
    }