项目介绍

sgolemon/table-flip 是一个托管在 GitHub 上的开源项目,主要使用 PHP 编写,目前获得 340 个 Star、8 次 Fork。

仓库全名
sgolemon/table-flip
Star 数
340
Fork 数
8

README 摘要

Inspired by Adam Harvey: https://twitter.com/LGnome/status/735573024825430016 if ($situation === SHIT::HAPPENED) {(╯°□°)╯︵┻━┻(); } Usages: throw new (╯°□°)╯︵┻━┻; // TableFlip throw new (ノ゜Д゜)ノ︵┻━┻; // PudgyTableFlip throw new (ノಥ益ಥ)ノ︵┻━┻; // AgroTableFlip (╯°□°)╯︵┻━┻(); // Function shorthand assert((╯°□°)╯︵┻━┻() ); // Use in an assert to only flip in dev All three table-flip classes extend \Exception and implement…

完整内容见 GitHub 原始 README 或本页 。

常见问题

table-flip 用什么语言开发?

主要使用 PHP 编写,目前有 340 个 Star。

如何获取 table-flip 的源码?

可以直接克隆仓库:git clone https://github.com/sgolemon/table-flip.git,默认分支为 master;安装与运行步骤见仓库 README。

table-flip 最近还在维护吗?

仓库最近一次更新为 2017年10月8日,当前没有未关闭的 Issue;Star 数为 340,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

Not the exceptions we need, but the ones we deserve.

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
366
价值分
207
活跃状态
活跃

语言占比

PHP

README

Inspired by Adam Harvey: https://twitter.com/LGnome/status/735573024825430016

if ($situation === SHIT::HAPPENED) {(╯°□°)╯︵┻━┻(); }

Usages:

  • throw new (╯°□°)╯︵┻━┻; // TableFlip
  • throw new (ノ゜Д゜)ノ︵┻━┻; // PudgyTableFlip
  • throw new (ノಥ益ಥ)ノ︵┻━┻; // AgroTableFlip
  • (╯°□°)╯︵┻━┻(); // Function shorthand
  • assert((╯°□°)╯︵┻━┻() ); // Use in an assert to only flip in dev

All three table-flip classes extend \Exception and implement the ┻━┻ interface, so the following works:

try {
  $ret = doSomething();
  if ($ret === null) {
    throw new (╯°□°)╯︵┻━┻;
  } elseif ($ret === false) {
    throw new (ノಥ益ಥ)ノ︵┻━┻;
  } elseif (!is_string($ret)) {
    throw new (ノ゜Д゜)ノ︵┻━┻;
  }
} catch (┻━┻ $e) {
  ┬─┬ノ(・_・ノ);
}

Note that the parentheses used in the class/function names here are U+FF08 FULLWIDTH LEFT PARENTHESIS and U+FF09 FULLWIDTH RIGHT PARENTHESIS since normal parens (U+0028/U+0029) are not allowed in PHP labels.

Similarly, the customary space is omitted entirely to make this a valid PHP label.

评论

暂无评论