public static function sortByKey($array, $key, $useDotSyntax = false)
    {
        uasort($array, function ($a, $b) use ($key, $useDotSyntax) {
            $valueA = self::get($a, $key, null, $useDotSyntax);
            $valueB = self::get($b, $key, null, $useDotSyntax);
            if ($valueA == $valueB) {
                return 0;
            }

            return ($valueA < $valueB) ? -1 : 1;
        });

        return $array;
    }