gajmohan/random-wait-message

此包最新版本(dev-main)没有提供许可信息。

获取随机等待信息的简单包

dev-main 2022-06-09 10:54 UTC

This package is auto-updated.

Last update: 2024-09-09 15:36:41 UTC


README

简单的PHP包,用于生成随机的有趣等待信息

用法

获取一个随机信息

    echo RandomWaitMessage::getMessageString();
    // "Put your headphones on and have a personal dance party 🎶💃🕺"
    
    # without an emoji
    echo RandomWaitMessage::getMessageString(false);
    // "Catch up on the 16,527 unread emails you have"

获取一个随机信息作为数组

    print_r(RandomWaitMessage::getMessageArray());
    // ['message' => 'Meditate', 'emoji' => '🧘‍']

获取所有随机信息

    print_r(RandomWaitMessage::getAllMessage());
    // [['message' => 'Pretend you are a ninja', 'emoji' => '🥷🏻‍'],...]

包含自定义信息

    $customMessage = Message::newMessage('Fork this repo', '🍴');
    $secondCustomMessage = Message::newMessage('Make a PR', '👩‍💻');
    
    # single message
    RandomWaitMessage::getMessageString($includeEmoji = true, $customMessage, $secondCustomMessage...);
    
    # single message array
    RandomWaitMessage::getMessageArray($customMessage, $secondCustomMessage...);
    
    # all messages
    RandomWaitMessage::getAllMessage($customMessage, $secondCustomMessage...)