webignition/symfony-console-typed-input 问题修复 & 功能扩展

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

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

webignition/symfony-console-typed-input

最新稳定版本:1.1

Composer 安装命令:

composer require webignition/symfony-console-typed-input

包简介

Symfony InputInterface providing type-specific getters for options and arguments

README 文档

README

A wrapper for Symfony\Component\Console\Input\InputInterface adding integer- and boolean-specific argument and option getters.

For fans of strongly-typed PHP, or just those tired of battling with phpstan --level max when analysing Symfony console commands.

Methods

public function getIntegerArgument(string $name): int;
public function getIntegerOption(string $name): int;
public function getBooleanArgument(string $name): bool;
public function getBooleanOption(string $name): bool;

All other InputInterface method calls are proxied to the wrapped InputInterface instance.

Usage

use webignition\SymfonyConsole\TypedInput\TypedInput;

// Assuming we're in a console command and $input is an InputInterface instance

$typedInput = new TypedInput($input);

// Guaranteed to return an integer
$integerArgument = $typedInput->getIntegerArgument('integer-argument-name');
$integerOption = $typedInput->getIntegerOption('integer-option-name');

// Guaranteed to return a boolean
$booleanArgument = $typedInput->getBooleanArgument('boolean-argument-name');
$booleanOption = $typedInput->getBooleanOption('boolean-option-name');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04