定制 staabm/rector-view-scope 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

staabm/rector-view-scope

Composer 安装命令:

composer require staabm/rector-view-scope

包简介

README 文档

README

ViewScopeRector is your helper to make static analysis tools aware of variable-types within view-scripts infered from a external context.

Summary

This rector includes the mechanics of scanning procedural php files (e.g. views) and calling a given ContextInferer. It afterwards updates the view-files global @var phpdocs to reflect the types, the ContextInferer determinded beforehand.

A example implementation is shipped with ViewContextInferer, which implements Ruby'on Rails like view <–> controller type inference.

example big picture

this rector is meant to introduce @var phpdocs into analyzed view files, e.g. based on declared public properties of a corresponding controller.

example Controller:

class Controller {
   /**
    * @var string
    */
   public $hello;
}

example view:

echo $hello;

the rector should lookup the controller-class via static reflection, infer the type of its properties and with this knowledge adjust/create a @var phpdoc in the view file.

so in the end the rector will change the example view to

/**
 * @var string
 */
echo $hello;

统计信息

  • 总下载量: 1.16k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-04-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固