digitalkaoz/typehint-to-docblock 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

digitalkaoz/typehint-to-docblock

最新稳定版本:0.2.2

Composer 安装命令:

composer require digitalkaoz/typehint-to-docblock

包简介

converts typehints to docblocks and vice versa

README 文档

README

the intention for this tiny Project is the lack of support for typehinted Collaborators in PHPSpec on PHP7+

phpspec/phpspec#659

this library can convert typehinted methods to docblocks (and removing the typehints) and the other way around

Build Status Dependency Status Scrutinizer Code Quality Code Coverage SensioLabsInsight Latest Stable Version Total Downloads StyleCI

Installation

$ composer require digitalkaoz/typehint-to-docblock

Usage

$ bin/typehint-to-docblock transform FOLDER
$ bin/typehint-to-docblock transform --pattern=/^foo$/ FOLDER

where FOLDER is one or more paths to php classes if --pattern is provided only methods which matches this regex pattern will be modified

Use on TravisCI

simple use this in your before_scripts

php:
  - 7.0

before_script:
  - bash -c 'if [ "$TRAVIS_PHP_VERSION" == "7.0" ]; then wget https://github.com/digitalkaoz/typehint-to-docblock/releases/download/0.2.2/typehint-to-docblock.phar && php typehint-to-docblock.phar transform spec; fi;'

Examples

this

namespace Foo\Bar;

use Lol\Cat;
use Bar\Bazz;

class Test
{
    function it_can_do_something(Cat $cat, Bazz $bazz)
    {
    }
}

will be converted to this

namespace Foo\Bar;

use Lol\Cat;
use Bar\Bazz;

class Test
{
    /**
     * it_can_do_something
     * 
     * @param \Lol\Cat $cat
     * @param \Bar\Bazz $bazz
     */
    function it_can_do_something($cat, $bazz)
    {
    }
}

Tests

$ composer test

TODO

  • make the resaving of files a bit less obstrusive
  • write a reverse Visitor which converts from DocBlock to TypeHint

统计信息

  • 总下载量: 24
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 4
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-09-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固