public static function set($object, $property, $value)
    {
        $property = self::getReflectionProperty($object, $property);

        if (is_string($object) || $property->isStatic()) {
            if (($declaringClass = $property->getDeclaringClass()->getName()) !== self::toClassName($object)) {
                self::getReflectionProperty($declaringClass, $property->getName())->setValue(null, $value);
                return;
            }

            $property->setValue(null, $value);
            return;
        }

        $property->setValue($object, $value);
    }