private function generateStubs($primitive, $layer, $qcn): array
    {
        $generated_stubs = [];
        
        //
        // 1. SRC stubs
        //
        foreach ($primitive->getSrcStubs() as $filename => $stub) {
            
            $filename = $this->replacePlaceholdersInText($filename);
            if (!preg_match("#\\.php$#", $filename)) {
                $filename .= ".php";
            }
            
            $target_path = $layer->getSrcDir()
                           . DIRECTORY_SEPARATOR . $qcn->toPSR4Path()
                           . DIRECTORY_SEPARATOR . $filename;
            
            $generated_stubs[$target_path] = $stub;
            
        }
        
        
        //
        // 2. TEST stubs
        //
        foreach ($primitive->getTestStubs() as $filename => $stub) {
            
            $filename = $this->replacePlaceholdersInText($filename);
            if (!preg_match("#\\.php$#", $filename)) {
                $filename .= ".php";
            }
            
            $target_path = $layer->getTestsDir()
                           . DIRECTORY_SEPARATOR . $qcn->toPSR4Path()
                           . DIRECTORY_SEPARATOR . $filename;
            
            $generated_stubs[$target_path] = $stub;
        }
        
        return $generated_stubs;
    }