{"id":18765312,"url":"https://github.com/setasign/php-stub-generator","last_synced_at":"2025-04-09T16:17:06.957Z","repository":{"id":55960323,"uuid":"100685583","full_name":"Setasign/php-stub-generator","owner":"Setasign","description":"A tool to generate stub-files for your php classes.","archived":false,"fork":false,"pushed_at":"2025-03-11T11:45:27.000Z","size":192,"stargazers_count":28,"open_issues_count":0,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-09T16:16:56.308Z","etag":null,"topics":["ioncube","php","reflection","stubs"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Setasign.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-18T07:28:30.000Z","updated_at":"2025-03-11T11:44:24.000Z","dependencies_parsed_at":"2025-01-15T14:19:51.706Z","dependency_job_id":"846333eb-ec54-471d-91a3-d0cd031f5ce2","html_url":"https://github.com/Setasign/php-stub-generator","commit_stats":{"total_commits":47,"total_committers":5,"mean_commits":9.4,"dds":0.3829787234042553,"last_synced_commit":"2a83abfb026e8c7337663ed413e99230fa2d86ef"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Setasign%2Fphp-stub-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Setasign%2Fphp-stub-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Setasign%2Fphp-stub-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Setasign%2Fphp-stub-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Setasign","download_url":"https://codeload.github.com/Setasign/php-stub-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065285,"owners_count":21041872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ioncube","php","reflection","stubs"],"created_at":"2024-11-07T18:33:32.772Z","updated_at":"2025-04-09T16:17:06.927Z","avatar_url":"https://github.com/Setasign.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-stub-generator\nA tool to generate stub-files for your php classes.\n\nThe main purpose for this tool is to generate stub-files from php classes to have code \ncompletion for your IDE when encrypting your library with e.g. \n[the ioncube encoder](http://www.ioncube.com/php_encoder.php).\n\n[![Minimum PHP Version](http://img.shields.io/badge/php-%3E%3D%208.2-8892BF.svg)](https://php.net/)\n[![License](https://img.shields.io/packagist/l/setasign/php-stub-generator.svg)](https://packagist.org/packages/setasign/php-stub-generator)\n\n## Installation\n\nA basic installation via Composer could be done this way:\n\n```bash\ncomposer require setasign/php-stub-generator\n```\n\nComposer will install the tool to your project's `vendor/setasign/php-stub-generator` directory.\n\n\n## Basic usage\n\n```php\n\u003c?php\ndeclare(strict_types=1);\n\nuse setasign\\PhpStubGenerator\\PhpStubGenerator;\nuse setasign\\PhpStubGenerator\\Reader\\AllFiles;\n\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$generator = new PhpStubGenerator();\n$generator-\u003eaddSource(\n    'setapdf-core',\n    new AllFiles(__DIR__ . '/vendor/setasign/setapdf-core/library')\n);\n$output = $generator-\u003egenerate();\n\nfile_put_contents(__DIR__ . '/setapdf-core-stub.php', $output);\n```\n\nAlternatively you could just call the cli helper.\n\n```bash\nvendor/bin/php-stub-generator generate setapdf-core/library setapdf-core-stub.php\n```\n\n## Settings\nThe PhpStubGenerator class has following settings:\n```php\nclass PhpStubGenerator\n{\n    /**\n     * End of line character(s).\n     *\n     * Doesn't change the used EOL character(s) of doc blocks.\n     *\n     * @var string\n     */\n    public static $eol = \"\\n\";\n\n    /**\n     * Tab character(s)\n     *\n     * @var string\n     */\n    public static $tab = '    ';\n\n    /**\n     * If enabled all generated class constants get a visibility (the generated stubs require PHP \u003e= 7.1)\n     * \n     * Within the cli tool can be set with the option \"--addClassConstantsVisibility\"\n     * \n     * @var bool\n     */\n    public static $addClassConstantsVisibility = false;\n    \n    /**\n     * If false the interface \\Stringable won't be filtered out (the generated stubs require PHP \u003e= 8.0).\n     *\n     * Within the cli tool can be set with the option \"--includeStringable\"\n     *\n     * @var bool\n     */\n    public static bool $includeStringable = false;\n}\n```\n\n## Drawbacks\n- Calculated constants or constants that use other constants like \\_\\_DIR\\_\\_ will be filled with the values of the \n  runtime environment.\n- Global Functions and Constants are currently ignored","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsetasign%2Fphp-stub-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsetasign%2Fphp-stub-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsetasign%2Fphp-stub-generator/lists"}