<commit_before><?php
/*
 * Copyright (c) Ouzo contributors, http://ouzoframework.org
 * This file is made available under the MIT License (view the LICENSE file for more information).
 */

namespace Ouzo\Utilities;

/**
 * Class Path
 * @package Ouzo\Utilities
 */
class Path
{
    /**
     * Returns a path created by placing DIRECTORY_SEPARATOR between each argument
     *
     * Example:
     * <code>
     * $path = Path::join('/my', 'path', 'to/file.txt');
     * </code>
     * Result:
     * <code>
     * /my/path/to/file.txt
     * </code>
     *
     * @param string ...
     * @return mixed
     */
    public static function join()
    {
        $args = Arrays::filterNotBlank(func_get_args());
        return preg_replace('~[/\\\]+~', DIRECTORY_SEPARATOR, implode(DIRECTORY_SEPARATOR, $args));
    }

    /**
     * Returns a path starting in the system temporary directory.
     *
     * Example:
     * <code>
     * $path = Path::joinWithTemp('my/file.txt');
     * </code>
     * Result:
     * <code>
     * //Unix
     * /tmp/my/file.txt
     * </code>
     *
     * @param string ...
     * @return mixed
     */
    public static function joinWithTemp()
    {<commit_msg>Fixed php 8.0 incompatibility.<commit_after><?php
/*
 * Copyright (c) Ouzo contributors, http://ouzoframework.org
 * This file is made available under the MIT License (view the LICENSE file for more information).
 */

namespace Ouzo\Utilities;

/**
 * Class Path
 * @package Ouzo\Utilities
 */
class Path
{
    /**
     * Returns a path created by placing DIRECTORY_SEPARATOR between each argument
     *
     * Example:
     * <code>
     * $path = Path::join('/my', 'path', 'to/file.txt');
     * </code>
     * Result:
     * <code>
     * /my/path/to/file.txt
     * </code>
     *
     * @param string ...
     * @return mixed
     */
    public static function join()
    {
        $args = Arrays::filterNotBlank(func_get_args());
        $path = preg_replace('~[/\\\]+~', DIRECTORY_SEPARATOR, implode(DIRECTORY_SEPARATOR, $args));
        $path = str_replace("\0", '', $path);
        return $path;
    }

    /**
     * Returns a path starting in the system temporary directory.
     *
     * Example:
     * <code>
     * $path = Path::joinWithTemp('my/file.txt');
     * </code>
     * Result:
     * <code>
     * //Unix
     * /tmp/my/file.txt
     * </code>
     *
     * @param string ...
     * @return mixed
     */
    public static function joinWithTemp()
    {
{'fraction_non_alphanumeric': 0.154126213592233, 'fraction_numerical': 0.0012135922330097086, 'mean_word_length': 2.1028858218318693, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1768273', 'n_tokens_mistral': 801, 'n_tokens_neox': 796, 'n_words': 194}