klimick/psalm-show-type 问题修复 & 功能扩展

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

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

klimick/psalm-show-type

最新稳定版本:v1.0.3

Composer 安装命令:

composer require klimick/psalm-show-type

包简介

Analog for psalm-trace but with pretty print

README 文档

README

Analog for psalm-trace but with pretty print

Installation

$ composer require --dev klimick/psalm-show-type
$ vendor/bin/psalm-plugin enable Klimick\\PsalmShowType\\ShowTypePlugin

Usage

<?php

// With assignment:
/** @show-type */
$a = 42;

// With return statement (not supported by @psalm-trace):
$fn = function(): array {
    /** @show-type */
    return [
        'value' => 42,
    ];
};

// Type from arrow fn expression (not supported by @psalm-trace):
$arrowFn = fn() => /** @show-type */ str_contains('psalm-show-type', 'show-type');

Output examples

class

@psalm-trace: Foo\Bar\Str
@show-type: Str

generic class

@psalm-trace: SplDoublyLinkedList<int, Foo\Bar\Str>
@show-type: SplDoublyLinkedList<TKey: int, TValue: Str>

array/iterable

@psalm-trace: array<int, Foo\Bar\Str>
@show-type: array<TKey: int, TValue: Str>

list

@psalm-trace: list<Foo\Bar\Str>
@show-type: list<TValue: Str>

array shape

@psalm-trace: array{prop1: Foo\Bar\Str, prop2: SplDoublyLinkedList<int, Foo\Bar\Str>}
@show-type: array{
    prop1: Str,
    prop2: SplDoublyLinkedList<TKey: int, TValue: Str>,
}

callable/closure

@psalm-trace: callable(Foo\Bar\Num): array{prop1: Foo\Bar\Str, prop2: SplDoublyLinkedList<int, Foo\Bar\Str>}
@show-type: callable(Num): array{
    prop1: Str,
    prop2: SplDoublyLinkedList<TKey: int, TValue: Str>,
}

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固