Skip to content

Universal stub generator for static code analysis.

License

Notifications You must be signed in to change notification settings

AdamMarton/Stub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stub

A stub generator written in PHP. Useful for creating stubs for static code analyzers when the actual code not available/cannot autoloaded, or just to speed up parsing.

The script is tested against these frameworks/libraries:

  • WordPress (~5secs)
  • Laravel (~2.5secs)

Features

  • PSR-2 compliant output

Usage

$ composer require adammarton/stub
<?php

require_once('vendor\autoload.php');

$stub = new Stub\Stub('<directory-to-parse>');
$stub->generate('<output-directory>');

Known Issues

  • Fix issue when output directory isn't created automatically
  • Fix namespace declaration issue: when more than one empty lines after namespace

Todos

  • Test with more frameworks
  • Restore logging feature
  • Implement CLI commands/options
  • Generate output in a single file optionally

About

Universal stub generator for static code analysis.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages