tatsh / constantine
此包已被废弃,不再维护。未建议替代包。
缺少PHP的常量和枚举。
dev-master
2017-12-19 08:04 UTC
This package is not auto-updated.
Last update: 2020-01-24 17:21:44 UTC
README
此包包含缺少有用常量的各种包的常量和枚举。
用法
<?php use Constantine\Aws\S3\CommandOptions; $client->putObject([ CommandOptions::KEY => 'key to use', CommandOptions::BUCKET => 'A bucket name', ]);
为什么?
因为魔法字符串很糟糕。常量可以防止输入错误,并且大多数IDE都支持自动完成。
贡献
请参考src/Constanstine/Aws/S3/CommandOptions.php
查看格式示例。此代码库使用PSR-2样式。
为方便使用,当适用时使用与原始包相同的命名空间,前面加上Constantine\
。为您的类名使用后缀,如Options、Keys等(总是复数形式)。