{"id":23115491,"url":"https://github.com/eghojansu/phpme","last_synced_at":"2025-04-04T01:12:18.695Z","repository":{"id":98786946,"uuid":"113893611","full_name":"eghojansu/phpme","owner":"eghojansu","description":"Make your PHP coding session more fun than ever","archived":false,"fork":false,"pushed_at":"2018-11-22T14:32:49.000Z","size":72,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-09T12:43:10.089Z","etag":null,"topics":["php-coding-plugin","sublime-plugin"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/eghojansu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-12-11T18:26:49.000Z","updated_at":"2018-11-22T14:32:51.000Z","dependencies_parsed_at":"2023-05-25T09:15:08.945Z","dependency_job_id":null,"html_url":"https://github.com/eghojansu/phpme","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eghojansu%2Fphpme","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eghojansu%2Fphpme/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eghojansu%2Fphpme/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eghojansu%2Fphpme/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eghojansu","download_url":"https://codeload.github.com/eghojansu/phpme/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247103307,"owners_count":20884023,"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":["php-coding-plugin","sublime-plugin"],"created_at":"2024-12-17T03:41:33.434Z","updated_at":"2025-04-04T01:12:18.676Z","avatar_url":"https://github.com/eghojansu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHPME\n\nMake your PHP coding session more fun than ever.\n\nThis plugin developed based on [PHP Companion][4] plugin, but works differently.\n\n## Installation\n\n### Package control\n\nYou can install this plugin easily with [Sublime Package Control][5].\n\nThen there is two option:\n- ~~Search for PHPMe in package control, select install then you're ready.~~\n- Add this plugin repository [https://github.com/eghojansu/phpme.git][2].\n  (`Package Control: Add Repository` to insert repository url).\n\n\u003e Currently this package was not accepted by Sublime Package [#6793][7]\n\n### Download Manually\n\nDownload tar/zip from [this plugin repository][1], extract them then put the extracted folder into your sublime package folder.\n\n## Commands\n\nAll command prefixed by `phpme_`\n\n### insert_namespace\n\nInsert namespace on the current file. This feature use composer.json file (if exists) to guest namespace.\nIf there is no composer.json you can configure in your project/global setting. See settings below.\n\n### use_class\n\nUse/import class.\n\nTo use this feature you need to put cursor on valid class symbol then trigger this command.\n\n(Support multiple selection).\n\n### expand_fqcn\n\nExpand class to Fully Qualified Name Space.\n\nTo use this feature you need to put cursor on valid class symbol then trigger this command.\n\n(Support multiple selection).\n\n### implements\n\nImplements interface method.\n\nTo use this feature you need to implements your class with one or more interface. Trigger this command then pick one or more methods you wants to implement.\n\n(Support parent tree).\n\n### override_method\n\nTo use this feature you need to extends your class with parent class. Trigger this command then pick one or more methods you wants to override.\n\n(Support parent tree).\n\n### getter_setter\n\nGenerate getter and setter method based on properties on your class.\nThis command accept `mode` as argument and its value can be 1, 2 or 3.\n\n    (1) generate getter;\n    (2) generate setter and;\n    (3) generate getter and setter.\n\nTo use this feature you do not need to put cursor on valid symbol, just trigger this command.\n\n### generate_constructor\n\nGenerate class constructor. You can pick declared properties as its parameter.\n\nTo use this feature you do not need to put cursor on valid symbol, just trigger this command.\n\n### goto_definition_scope\n\nSearch for a method definition based on the current scope. It will fallback to the \"goto_definition\" command if a match was not found.\n\nTo use this feature you need to put cursor on a method name, then trigger this command.\n\n(Not support multiple cursor).\n\n### project_meta\n\nGenerate project meta for current file. Template can be configured, see setting below.\nTo use this feature, open command pallet then trigger this command. The project meta will be inserted after first php open tag.\n\n### copy_method\n\nCopy selected class method definition.\n\nTo use this feature you need to put cursor on valid class symbol then trigger this command.\n\n(Support multiple selection, classes from globals is not supported).\n\n### generate_test_method\n\nGenerate test method for PHPUnit TestCase. It use test case name to generate proposed test method. Default guess is to match ```^(\\w+)Test$```. Note that pattern should contain one parenthesis.\n\nTo use this feature you do not need to put cursor on valid symbol, just trigger this command.\n\n(Classes from globals is not supported).\n\n## Settings\n\nSettings can be stored either in your system wide \"PHPMe.sublime-settings\" file or in the project\nsettings file. This allows you to set preferences per-project if you need to.\n\nIf you're storing settings in a project file, put them in a phpme node like this:\n\n```\n\"phpme\": {\n    \"exclude_dir\": [\n        \"vendor\",\n        \"build\"\n    ]\n}\n```\n\n### native_hint\n\nShould we include native hint too? eg: string, array bool etc.\nSet to true will add native hint declared on your variable docblock as method parameter hint.\n\nExample:\n```php\nclass AClass\n{\n    /** @var string \u003c- this will be used as parameter hint if you generate getter/setter */\n    public $myProperty;\n\n    /**\n     * @var bool \u003c- this will be used as parameter hint if you generate getter/setter\n     */\n    public $mySecondProperty;\n}\n```\n\n### hint_default_null\n\nShould we add ```$param = null``` on non-native parameter when generate method?\n\nType: bool\n\n### namespaces\nNamespace and relative path to current folder pairs, trailing slash/backslash are optional.\nRelative path can be array. This configuration mimic composer.json autoload psr-4/psr-0 schema.\n\nType: json, examples:\n```\n\"namespaces\": {\n     \"App\\\\\": \"src/\",\n     \"App\\\\Test\\\\\": \"tests/src/\"\n     \"AnotherNamespace\\\\\": [\"other/\", \"other2/\"]\n}\n```\n\n### exclude_dir\n\nList of directories to exclude when searching for the class declaration file.\nPath is relative to the project directory.\n\nPlease note that the filtering is done after the search in the index. So this option has no impact on performance,\nit's just a convenient way to avoid duplicate namespace declaration in some case.\n\nType: array of exclude dir pattern\n\n### use_sort_length\n\nWhen importing use statements with the `phpme_use_class` command, sort statements by the length of the line.\n\nType: boolean, defaults to false.\n\n### allow_use_from_global_namespace\n\nSet to true to allow plugin search class in globals namespace.\nNeed the php binary to work.\n\nType: boolean, defaults to true.\n\n### docblock_inherit\n\nCopy comment doc from parent or interface to implemented class.\n\nType: string, valid options are \"none\", \"copy\" or \"inheritdoc\" defaults to \"none\"\n\n### generate_docblock\n\nGenerate docblocks for getter, setter and constructor.\n\nType: boolean, defaults to false.\n\n### setter_chainable\n\nMake generated setter chainable (return $this).\n\nType: boolean, defaults to true.\n\n### static_property\n\nKeyword to use for static property.\n\nType: string, valid options are \"static\" or \"self\" defaults to \"static\"\n\n### project_meta\n\nGenerate project meta template.\nAvailable placeholder:\n- project:\n\n  Defaults to project name in composer.json (if available)\n\n- type:\n\n  Defaults to project type in composer.json (if available)\n\n- author:\n\n  First, read from composer.json, if not available get from git config,\n  if not available get from current login user\n\n- email:\n\n  First, read from composer.json, if not available get from git config\n\n- time:\n\n  For time placeholder, you can add time format as parameter. (See this [link][6])\n\nType: string[], defaults to:\n```json\n{\n    \"project_meta\": [\n        \"This file is part of the {project} {type}.\",\n        \"\",\n        \"(c) {author} \u003c{email}\u003e\",\n        \"\",\n        \"For the full copyright and license information, please view the LICENSE\",\n        \"file that was distributed with this source code.\",\n        \"\",\n        \"Created at {time(%b %d, %Y %H:%I)}\"\n    ]\n}\n```\n\n### test_case_pattern\n\nHow to get test case class.\n\nType: string, defaults to: ```^(\\w+)Test$```\n\n### test_public_only\n\nInclude public method only.\n\nType: boolean, defaults to: true\n\n### test_generate_content\n\nGenerate sample method content.\n\nType: boolean, defaults to: true\n\n### log_message\n\nLog status message\n\nType: boolean, defaults to: false\n\n### declare_strict\n\nDeclare strict, this will append strict delcaration on first opening php tag\n_when inserting namespace_\n\nType: boolean, defaults to: false\n\n\n## Keybinding\n\nThis plugin do not provide keybindings. You will have to install your own shortcuts. This examples will give you the shortcuts I personally use.\n\n```json\n[\n    { \"keys\": [\"f3\"], \"command\": \"phpme_implements\" },\n    { \"keys\": [\"shift+f3\"], \"command\": \"phpme_override_method\" },\n    { \"keys\": [\"f4\"], \"command\": \"phpme_insert_namespace\" },\n    { \"keys\": [\"f5\"], \"command\": \"phpme_use_class\" },\n    { \"keys\": [\"f6\"], \"command\": \"phpme_expand_fqcn\" },\n    { \"keys\": [\"f7\"], \"command\": \"phpme_generate_constructor\" },\n    { \"keys\": [\"f8\"], \"command\": \"phpme_getter_setter\", \"args\": {\"mode\": 3} },\n    { \"keys\": [\"shift+f12\"], \"command\": \"phpme_goto_definition_scope\" }\n]\n```\n\n## Known Issues\n\n- This plugin works based on Regex. If you feel this plugin sucks detecting your code, please let me know.\n\n  [Submit issues][3].\n\n\n```sh\nHappy coding,\n\nekokurniawan\n(Web Developer)\n```\n\n[1]: https://github.com/eghojansu/phpme\n[2]: https://github.com/eghojansu/phpme.git\n[3]: https://github.com/eghojansu/phpme/issues\n[4]: https://packagecontrol.io/packages/PHP%20Companion\n[5]: https://packagecontrol.io/installation\n[6]: https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior\n[7]: https://github.com/wbond/package_control_channel/pull/6793","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feghojansu%2Fphpme","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feghojansu%2Fphpme","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feghojansu%2Fphpme/lists"}