{"id":13610345,"url":"https://github.com/erichard/SublimePHPCompanion","last_synced_at":"2025-04-12T22:33:29.276Z","repository":{"id":7410869,"uuid":"8742601","full_name":"erichard/SublimePHPCompanion","owner":"erichard","description":"A Sublime Text plugin that provides cool stuff for PHP 5.3+ coding session.","archived":false,"fork":false,"pushed_at":"2022-06-23T15:41:04.000Z","size":162,"stargazers_count":931,"open_issues_count":14,"forks_count":115,"subscribers_count":22,"default_branch":"main","last_synced_at":"2024-10-11T22:12:26.610Z","etag":null,"topics":["php","sublime-text","sublime-text-plugin"],"latest_commit_sha":null,"homepage":"","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/erichard.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}},"created_at":"2013-03-13T01:36:45.000Z","updated_at":"2024-09-03T20:22:03.000Z","dependencies_parsed_at":"2022-09-02T09:53:41.092Z","dependency_job_id":null,"html_url":"https://github.com/erichard/SublimePHPCompanion","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erichard%2FSublimePHPCompanion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erichard%2FSublimePHPCompanion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erichard%2FSublimePHPCompanion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erichard%2FSublimePHPCompanion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erichard","download_url":"https://codeload.github.com/erichard/SublimePHPCompanion/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223549191,"owners_count":17163609,"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","sublime-text","sublime-text-plugin"],"created_at":"2024-08-01T19:01:43.844Z","updated_at":"2024-11-07T16:31:04.533Z","avatar_url":"https://github.com/erichard.png","language":"Python","readme":"# Sublime PHP Companion\n\nThis Sublime Text 3 Package provides cool stuff for PHP 5.3+ coding session.\n\n## Installation\n\n### Package control\n\nJust search for PHP Companion in package control and you're ready.\n\n### Keybinding\n\nThe package no longer provides keybindings. You will have to install your own shortcuts. The [Default.sublime-keymap-sample](/Default.sublime-keymap-sample) will give you the shortcuts I personally use.\n\n## Commands\n\n### find_use\n\nJust place your cursor on a class name, hit the \u003ckbd\u003eF5\u003c/kbd\u003e key (personal shortcut) and that's it.\n\nIt will show you the different namespace that match your class, pick up one and you're done.\n\nPHP Companion will sort your uses statement in alphabetical order. This can be\nconfigured to sort by line length with the `use_sort_length` user setting.\n\n### expand_fqcn\n\nThis command expands the class under the cursor to its FQCN (Fully Qualified Class Name).\nYou have two keys for this command \u003ckbd\u003eF6\u003c/kbd\u003e and \u003ckbd\u003eshift+F6\u003c/kbd\u003e (personal shortcut) that respectively expand\nwith and without the leading namespace separator `\\`.\n\n### import_namespace\n\nJust hit the \u003ckbd\u003eF4\u003c/kbd\u003e key (personal shortcut), it will add the namespace definition based on the absolute\nfilename of the current file. I use a simple trick to determine where the\nnamespace begun, actually the namespace will start at the first CamelCased\nfolder.\n\nIf a namespace is already declared, the command will shout how crazy you are in\nthe status bar.\n\n**Warning:** This feature requires a filename so the command won't work in an unsaved buffer.\n\n### goto_definition_scope\n\nHit \u003ckbd\u003eshift+F12\u003c/kbd\u003e (personal shortcut) to search for a method definition based on the current scope. It will fallback to\nthe \"goto_definition\" command if a match was not found.\n\n### insert_php_constructor_property\n\nHit \u003ckbd\u003eF7\u003c/kbd\u003e (personal shortcut) to insert both a constructor argument and its according property. The property will be `private` by default but you can change it with the `visibility` setting.\n\n### implement\n\nPlace your cursor on a class, abstract class or an interface name and hit the \u003ckbd\u003eF3\u003c/kbd\u003e key (personal shortcut). Matching interfaces or classes will be shown. Select one and then import all or one of the methods from that interface or class.\n\nSee `use_todo_implement` setting.\n\n\n## Settings\n\nSettings can be stored either in your system wide \"PHP Companion.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 phpcompanion node like this:\n\n```\n\"phpcompanion\": {\n    \"exclude_dir\": [\n        \"vendor\",\n        \"build\"\n    ]\n}\n```\n\n**IMPORTANT** : Sublime Text 4 does not index files and folders ignored by .gitignore. Update your sublime settings with :\n\n```\n\"index_exclude_gitignore\": false\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\n### use_sort_length\n\nWhen importing use statements with the \u003ckbd\u003efind_use\u003c/kbd\u003e command, sort statements by the length of the line.\n\n### use_todo_implement\n\nWhen an interface or abstract class is implemented, this option is used to customize the method body of the newly added methods.\n\nThe available options are true and false.\n\n`\"use_todo_implement\": true`:\n```\npublic function methodName()\n{\n    // TODO: Implement 'methodName' method.\n}\n```\n\n`\"use_todo_implement\": false`:\n```\npublic function methodName()\n{\n    throw new \\Exception(\"Method 'methodname' not implemented\");\n}\n```\n\n## Successor of SublimeCTagsPHP\n\nThis plugin is the successor of [SublimeCTagsPHP](https://github.com/erichard/SublimeCTagsPHP). PHP Companion uses the built-in index of Sublime Text 3 instead of CTags.\n\n**Warning!** PHP Companion does not work on Sublime Text 2 and never will.\n\n\n## Licence\n\nAll of Sublime PHP Companion is licensed under the MIT license.\n\n  Copyright (c) 2013-2020 Erwan Richard\n\n  Permission is hereby granted, free of charge, to any person obtaining a copy\n  of this software and associated documentation files (the \"Software\"), to deal\n  in the Software without restriction, including without limitation the rights\n  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n  copies of the Software, and to permit persons to whom the Software is\n  furnished to do so, subject to the following conditions:\n\n  The above copyright notice and this permission notice shall be included in\n  all copies or substantial portions of the Software.\n\n  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n  THE SOFTWARE.\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferichard%2FSublimePHPCompanion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferichard%2FSublimePHPCompanion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferichard%2FSublimePHPCompanion/lists"}