src/Decoy.php
public function mock(string $class) : MockedCode
    {
        $generator = new MockCodeGenerator($this->vfsRoot);
    
        try{
            $rc = new \ReflectionClass($class);
            return $generator->generate($rc);
        }
        catch(\ReflectionException $e){
            throw new DecoyException('Class not found: ' . $class, $e);
        }
        catch(MockCodeGeneratorException $e){
            throw new DecoyException('Failed to generate mock code for class: ' . $class, $e);
        }
    }
public function mock(string $class) : MockedCode
    {
        $generator = new MockCodeGenerator($this->vfsRoot);
    
        try{
            $rc = new \ReflectionClass($class);
            return $generator->generate($rc);
        }
        catch(\ReflectionException $e){
            throw new DecoyException('Class not found: ' . $class, $e);
        }
        catch(MockCodeGeneratorException $e){
            throw new DecoyException('Failed to generate mock code for class: ' . $class, $e);
        }
    }
public function mock ( string $ class ) : MockedCode { $ generator = new MockCodeGenerator ( $ this -> vfsRoot ) ; try { $ rc = new \ ReflectionClass ( $ class ) ; return $ generator -> generate ( $ rc ) ; } catch ( \ ReflectionException $ e ) { throw new DecoyException ( 'Class not found: ' . $ class , $ e ) ; } catch ( MockCodeGeneratorException $ e ) { throw new DecoyException ( 'Failed to generate mock code for class: ' . $ class , $ e ) ; } }
Generate mock class

@param string $class

@return MockedCode

@throws DecoyException
Generate mock class