setasign/php-stub-generator

A tool to generate stub-files for your php classes.

v0.3.0-alpha 2017-08-28 06:40 UTC

README

A tool to generate stub-files for your php classes.

The main purpose for this tool is to generate stub-files from php classes to have code completion for your IDE when encrypting your library with e.g. the ioncube encoder.

Build Status Minimum PHP Version License

Installation

A basic installation via Composer could be done this way:

$ composer require setasign/php-stub-generator ^0.3.0-alpha

Composer will install the library to your project's vendor/setasign/php-stub-generator directory.

Basic usage

<?php

use setasign\PhpStubGenerator\PhpStubGenerator;
use setasign\PhpStubGenerator\Reader\AllFiles;

require_once __DIR__ . '/vendor/autoload.php';

$generator = new PhpStubGenerator();
$generator->addSource(
    'setapdf-core',
    new AllFiles(__DIR__ . '/vendor/setasign/setapdf-core/library')
);
$output = $generator->generate();

file_put_contents(__DIR__ . '/setapdf-core-stub.php', $output);

Alternatively you could just call the cli helper.

vendor/bin/php-stub-generator generate vendor/setasign/setapdf-core/library setapdf-core-stub.php

TODO

  • Traits are not supported yet