Universal stub generator for static code analysis.

Installs: 13

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 1

Forks: 0

Open Issues: 1

pkg:composer/adammarton/stub

dev-master 2019-02-20 10:47 UTC

This package is auto-updated.

Last update: 2025-10-21 01:37:52 UTC


README

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