Dotink\Parody\Mime::using PHP Method

using() public method

Tell the class we're defining to use a given trait and if it doesn't exist, create it
public using ( string $trait ) : Mime
$trait string The trait to use
return Mime The mime for method chaining
    public function using($trait)
    {
        foreach (func_get_args() as $trait) {
            $fqtn = ltrim($trait, '\\');
            $parts = explode('\\', $fqtn);
            $class = array_pop($parts);
            $ns = implode('\\', $parts);
            //
            // We want to create the trait if it doesn't exist yet.  We don't want to
            // qualify the namespace until below.
            //
            if (!trait_exists($trait)) {
                eval(call_user_func(function () use($ns, $trait) {
                    ob_start();
                    ?>
							namespace <?php 
                    echo $ns;
                    ?>
							{
								trait <?php 
                    echo $trait;
                    ?>
 {

								}
							}
						<?php 
                    return ob_get_clean();
                }));
            }
            self::$traits[$this->class][] = self::qualify($trait);
        }
        return $this;
    }