src/Carbon/Carbon.php
public static function mixin($mixin)
    {
        $reflection = new \ReflectionClass($mixin);
        $methods = $reflection->getMethods(
            \ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED
        );

        foreach ($methods as $method) {
            $method->setAccessible(true);

            static::macro($method->name, $method->invoke($mixin));
        }
    }
public static function mixin($mixin)
    {
        $reflection = new \ReflectionClass($mixin);
        $methods = $reflection->getMethods(
            \ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED
        );

        foreach ($methods as $method) {
            $method->setAccessible(true);

            static::macro($method->name, $method->invoke($mixin));
        }
    }
public static function mixin ( $ mixin ) { $ reflection = new \ ReflectionClass ( $ mixin ) ; $ methods = $ reflection -> getMethods ( \ ReflectionMethod :: IS_PUBLIC | \ ReflectionMethod :: IS_PROTECTED ) ; foreach ( $ methods as $ method ) { $ method -> setAccessible ( true ) ; static :: macro ( $ method -> name , $ method -> invoke ( $ mixin ) ) ; } }
Mix another object into the class.

@param object $mixin

@throws \ReflectionException

@return void
Mix another object into the class .