{"id":16676992,"url":"https://github.com/abcaeffchen/doxygen-php-filters","last_synced_at":"2025-09-13T15:02:33.006Z","repository":{"id":28199172,"uuid":"31701463","full_name":"AbcAeffchen/doxygen-php-filters","owner":"AbcAeffchen","description":"Filters to get Doxygen work better with PHP code","archived":false,"fork":false,"pushed_at":"2020-02-06T07:03:41.000Z","size":22,"stargazers_count":18,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T23:16:22.138Z","etag":null,"topics":["doxygen","filter","php"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AbcAeffchen.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}},"created_at":"2015-03-05T07:32:10.000Z","updated_at":"2022-04-27T08:43:20.000Z","dependencies_parsed_at":"2022-09-13T05:51:16.139Z","dependency_job_id":null,"html_url":"https://github.com/AbcAeffchen/doxygen-php-filters","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbcAeffchen%2Fdoxygen-php-filters","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbcAeffchen%2Fdoxygen-php-filters/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbcAeffchen%2Fdoxygen-php-filters/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbcAeffchen%2Fdoxygen-php-filters/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AbcAeffchen","download_url":"https://codeload.github.com/AbcAeffchen/doxygen-php-filters/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248113160,"owners_count":21049795,"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":["doxygen","filter","php"],"created_at":"2024-10-12T13:24:49.547Z","updated_at":"2025-04-09T21:23:41.786Z","avatar_url":"https://github.com/AbcAeffchen.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# doxygen-php-filters\n[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/AbcAeffchen/doxygen-php-filters?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n\nFilters to get [Doxygen](http://doxygen.nl/) ([Doxygen on GitHub](https://github.com/doxygen/doxygen)) work better with PHP code.\n\n## How to use\n1. Choose your filter and download the `.php` file. If you want to use more than one filter, \nyou can combine them to one file or if you want to use all filters, you can use `all_filters.php`.\n2. Set the [`INPUT_FILTER`](http://doxygen.nl/manual/config.html#cfg_input_filter) to `php filter_file_name.php`.  \nIf PHP is not included in your PATH variable, you have to use `/path/to/php filter_file_name.php`\ninstead.\n\n## The Filters\n### Short array syntax (`attribute_short_array_syntax.php`)\nThis filter adds support for the short array syntax introduced with \n[PHP 5.4](https://www.php.net/manual/en/migration54.new-features.php).\nIf you have a multiline default value for a class member like this\n\n    private $arr = [ 0 =\u003e [ ... ],\n                     2 =\u003e [ ... ] ];\n\ndoxygen only adds the first line to the documentation.\nThe filter converts this code to \n\n    private $arr = array( 0 =\u003e [ ... ],\n                          2 =\u003e [ ... ] );\n\nso doxygen can understand the array syntax right.\n\n### Class member type hints (`attribute_type_hints.php`)\nThere seems to be a [bug](https://bugzilla.gnome.org/show_bug.cgi?id=626105) that prevents\ndoxygen from documenting class members with `@var`. The filter is a slight improvement from \n[this Stackoverflow answer](https://stackoverflow.com/a/8472180/3440545) by Goran Rakic.  \n**Notice**: The documentation string must not contain a slash (`/`).\n\n### Support for `@return $this` (`method_return_this.php`)\nSometimes you want to return `$this`, but then doxygen does not link the return type to the class.\nThis filter fixes this by looking for the right class name `$this` belongs to and replaces `$this`\nby the class name.\n\n### Class method type hints (`method_type_hints.php`)\nIf you have some trouble with type hints of class methods, this filter could be helpful.\n\n### Support `class_exists()` checks (`class_exists_support.php`)\nIf you use `if(!class_exists('className')){ ... }` to prevent defining a class multiple times,\ndoxygen could get confused. This filter removes the if-statement for doxygen.  \n**Notice**: If you must not define more than one class in a file that uses `if(!class_exists())`\nand you have to use the string `if(!class_exists(` to get this filter work. The whole line, \nthat contains this string gets removed.\n\n### Support/Workaround for traits (`traits.php`)\nSince PHP does not support inheritance from multiple classes, you maybe want to use [traits](https://www.php.net/manual/en/language.oop5.traits.php).\nBut doxygen does not support this at all.\n\nThis filter converts a trait into a class and transforms all usages of a trait into an inheritance.\nSo\n\n    class MyClass{\n        use MyTrait1, MyTrait2;\n        \n        ...\n    }\n\nbecomes\n\n    class MyClass extends MyTrait, MyTrait2{\n        ...\n    }\n\nThis is not valid PHP, but doxygen documents it as a multiple inheritance and you can see the methods\nof the traits in you class.\n\n**Notice**: This filter doesn't support [conflict resolution](https://www.php.net/manual/en/language.oop5.traits.php#language.oop5.traits.conflict).\nSo \n\n    class MyClass {\n        use MyTrait1, MyTrait2 {\n            MyTrait2::traitFunction1 insteadof MyTrait1;\n            MyTrait1::traitFunction2 insteadof MyTrait2;\n        }\n    }\n    \nwill not work.\n\n### Support class attributes grouped by visibility  (`attribute_grouped_visibility.php`)\nThis filter supports declarations like\n\n    class Foo\n    {\n        private\n            /// the blue color\n            $blue,\n            /// the red color\n            $red;\n            \n        ...\n    }\n    \nby iteratively copying the keywords `private`, `protected` and `public` to the attributes.\n\n### Laravel Cron Documentation (`laravel_cron.php`)\nDocumentation like\n\n    /**\n     * Docs\n     */\n    \\Cron::add('jobName', '* * * * *', function() \n    {\n        ...\n    });\n    \ngets lost because the documentation comment is not followed by a function declaration. It also \nnot works if you move the documentation comment right in front of the `function()`, because doxygen\nis missing a function name. The filter is moving the documentation comment to the right place,\nremoves the `Cron::add(...,...,` part and copies the name to the `function()` so it looks like this:\n\n    /**\n     * Docs\n     */\n    public function jobName() \n    {\n        ...\n    });\n\nThis also works if the documentation comment is already in the right place.\n\nSince this filter is very special to some users of Laravel, it is not included in the *all_filters* file.\n\n## Credits\nThanks to [Goran Rakic](https://stackoverflow.com/users/276152) for providing the class member hint filter in [this Stackoverflow answer](https://stackoverflow.com/a/8472180/3440545). \nThis gave me the first push to write more filters.  \nThanks to [Lorenz Meyer](https://stackoverflow.com/users/1951708) for improving the traits filter.  \nThanks to [madankundu](https://stackoverflow.com/users/1627702) for testing the laravel_cron filter.\n## License\nLicensed under the GPL v2.0 License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabcaeffchen%2Fdoxygen-php-filters","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabcaeffchen%2Fdoxygen-php-filters","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabcaeffchen%2Fdoxygen-php-filters/lists"}