public static function getClassName($source, $withoutNamespace = false)
    {
        /*
         * First argument is not proper source of class?
         * Nothing to do
         */
        if (empty($source) || (!is_array($source) && !is_object($source) && !is_string($source))) {
            return null;
        }

        $name = '';

        /*
         * An array of objects was provided?
         * Let's use first of them
         */
        if (is_array($source)) {
            $source = Arrays::getFirstElement($source);
        }

        // Let's prepare name of class
        if (is_object($source)) {
            $name = get_class($source);
        } elseif (is_string($source) && (class_exists($source) || trait_exists($source))) {
            $name = $source;
        }

        /*
         * Name of class is still unknown?
         * Nothing to do
         */
        if (empty($name)) {
            return null;
        }

        /*
         * Namespace is not required?
         * Let's return name of class only
         */
        if ($withoutNamespace) {
            $classOnly = Miscellaneous::getLastElementOfString($name, '\\');

            if (null !== $classOnly) {
                $name = $classOnly;
            }

            return $name;
        }

        return static::getRealClass($name);
    }