<?php

namespace Sargilla\Flatlab4\Console;

/**
 * Class HasEmail.
 *
 * @package Sargilla\Flatlab4\Console
 */
trait HasEmail
{
    /**
     * Obtain admin email.
     *
     * @return bool|string
     */
    protected function email()
    {
        if (($email = env('ADMIN_EMAIL', null)) != null) {
            return $email;
        }

        if (($email = git_user_email()) != null) {
            return $email;
        }

        return "admin@example.com";
    }
}
