php-explorer


Ⅰ. 插件描述

A vim plugin for intelligently jumping into class and function declarations. PHP Explorer understands use statements, parameter typehinting and method calls.

Ⅱ. 基本信息

创建日期:  2015-02-01
使用用户:  1
Github星:  4
插件作者:  Phil Grayson

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'philgrayson/php-explorer'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'philgrayson/php-explorer'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'philgrayson/php-explorer'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/philgrayson/php-explorer

Ⅳ. 文档说明

# PHP Explorer
A vim plugin for intelligently jumping into class and function declarations. PHP Explorer understands use statements, parameter typehinting and method calls.

Usage

  • <Leader>gt : Go To a class or function declaration under the cursor.

Install

Assuming Pathogen

    cd ~/.vim/bundle
    git clone https://github.com/philgrayson/php-explorer.git

Assumptions

  • PHP 5.3 or greater is installed
  • Contains a vendor/autoload.php file that registers the project's autoloader. See [Composer] (https://getcomposer.org/)
  • The project is written in PHP 5.3 or greater

TODO

  • Fix Go To function calls working by accident. The same local variable defined in multiple methods confuses the resolve.
    class A {
      function A (A $a) {
          $a->method();
      }

      function B(B $a) {
          $a->method();
      }
    }
  • Allow Go To to work over mutli-line expressions, for example, functionB() in;
    $this->field->functionA()
                ->functionB();
  • Trigger a phpunit test under the cursor. Perhaps <leader>rt Run Test. What about data providers?
    public function testPatience()
    {
        $this->assertEqual(42, rand(0, 100));
    }
  • Add Submlime Text bindings
  • Handle functions from traits, recursing traits if necessary.
  • Handle class constants
  • Auto-infer namespace imports - see bradfitz/goimports
  • Auto delete unused namespaces. Code sniffer already did this
  • Ask for a list of exceptions a line of code can throw

    • Hint on uncaught exceptions

添加新评论