limingxinleo/x-trait-common

1.1.0 2018-05-28 09:02 UTC

This package is auto-updated.

Last update: 2021-10-17 13:23:45 UTC


README

常用Trait集合

Build Status

单例模式Trait

<?php
use Xin\Traits\Common\InstanceTrait;

class Ins1
{
    use InstanceTrait;

    public function str()
    {
        return 'Ins1';
    }

    public function instance()
    {
        return static::$_instance;
    }
}

echo Ins1::getInstance()->str();