File tree Expand file tree Collapse file tree 3 files changed +52
-4
lines changed
Expand file tree Collapse file tree 3 files changed +52
-4
lines changed Original file line number Diff line number Diff line change 11# php-stub-generator
22A tool to generate stub-files for your php classes.
3+
4+ The main purpose for this tool is to generate stub-files from php classes to have code
5+ completion for your IDE when encrypting your library with e.g.
6+ [ the ioncube encoder] ( http://www.ioncube.com/php_encoder.php ) .
7+
8+ [ ![ Build Status] ( https://travis-ci.org/Setasign/php-stub-generator.svg?branch=master )] ( https://travis-ci.org/Setasign/php-stub-generator )
9+ [ ![ Total Downloads] ( https://poser.pugx.org/setasign/php-stub-generator/downloads.svg )] ( https://packagist.org/packages/setasign/php-stub-generator )
10+ [ ![ Minimum PHP Version] ( http://img.shields.io/badge/php-%3E%3D%207.1-8892BF.svg )] ( https://php.net/ )
11+ [ ![ License] ( https://img.shields.io/packagist/l/setasign/php-stub-generator.svg )] ( https://packagist.org/packages/setasign/php-stub-generator )
12+
13+ ## Installation
14+
15+ A basic installation via Composer could be done this way:
16+
17+ ``` bash
18+ $ composer require setasign/php-stub-generator
19+ ```
20+
21+ Composer will install the library to your project's ` vendor/setasign/php-stub-generator ` directory.
22+
23+
24+ ## Basic usage
25+
26+ ``` php
27+ <?php
28+
29+ use setasign\PhpStubGenerator\PhpStubGenerator;
30+ use setasign\PhpStubGenerator\Reader\AllFiles;
31+
32+ require_once __DIR__ . '/vendor/autoload.php';
33+
34+ $generator = new PhpStubGenerator();
35+ $generator->addSource(
36+ 'setapdf-core',
37+ new AllFiles(__DIR__ . '/vendor/setasign/setapdf-core/library')
38+ );
39+ $output = $generator->generate();
40+
41+ file_put_contents(__DIR__ . '/setapdf-core-stub.php', $output);
42+ ```
43+
44+ ## TODO
45+ - Traits are not supported yet
46+ - Command line tool: bin/generate-stub vendor/setasign/setapdf-core/library setapdf-core-stub.php
Original file line number Diff line number Diff line change 55 "license" : " MIT" ,
66 "authors" : [
77 {
8- "name" : " bob4ever"
8+ "name" : " Maximilian Kresse" ,
9+ "email" : " maximilian.kresse@setasign.com"
910 }
1011 ],
1112
Original file line number Diff line number Diff line change 22ini_set ('display_errors ' , 1 );
33
44if (defined ("AUTOLOAD_PATH " )) {
5- if (is_file (__DIR__ . '/../ ' .AUTOLOAD_PATH )) {
6- $ loader = include_once __DIR__ . '/../ ' . AUTOLOAD_PATH ;
5+ if (is_file (__DIR__ . '/../ ' . AUTOLOAD_PATH )) {
6+ include_once __DIR__ . '/../ ' . AUTOLOAD_PATH ;
77 } else {
8- throw new InvalidArgumentException ("Cannot load custom autoload file located at " .AUTOLOAD_PATH );
8+ throw new InvalidArgumentException (sprintf (
9+ 'Can \'t load custom autoload file located at %s ' ,
10+ AUTOLOAD_PATH
11+ ));
912 }
1013}
You can’t perform that action at this time.
0 commit comments