devnull-ir/facades

此包已被 废弃 并不再维护。未建议替代包。

Laravel Facade for Pure php!

v1.1.1 2023-05-29 15:08 UTC

This package is auto-updated.

Last update: 2024-07-05 15:11:27 UTC


README

纯php的 Facade

使用

一步

include __DIR__ . "/vendor/autoload.php";

第二步

创建您的动态类

第三步:创建静态 Facade 类,例如

<?php

namespace Facades;

class TestFacade extends Facade
{
    /**
     * @return string
     */
    public static function setNameSpace(): string
    {
        return Test::class; // TODO: Change the autogenerated stub
    }
}

并展示依赖

在顶层类中添加注释中的方法

<?php

namespace Facades;


/**
 * Method for Test Class
 *
 * @method static string string()
 * @method static string abs()
 */
class TestFacade extends Facade
{
    /**
     * @return string
     */
    public static function setNameSpace(): string
    {
        return Test::class; // TODO: Change the autogenerated stub
    }
}

动态类的 facade 扩展为 Facades\Facade