src/Traits/PathTrait.php
private function myCombine(PathTraitInterface $other, ?bool &$isAbsolute = null, ?int &$aboveBaseLevel = null, ?array &$directoryParts = null, ?string &$filename = null, ?string &$error = null): bool
    {
        // If other path is absolute, current path is overridden.
        if ($other->isAbsolute()) {
            $isAbsolute = $other->isAbsolute();
            $aboveBaseLevel = 0;
            $directoryParts = $other->getDirectoryParts();
            $filename = $other->getFilename();

            return true;
        }

        $isAbsolute = $this->myIsAbsolute;
        $aboveBaseLevel = $this->myAboveBaseLevel;
        $directoryParts = $this->myDirectoryParts;
        $filename = $other->getFilename();

        foreach ($other->getDirectoryParts() as $otherDirectoryPart) {
            if (!$this->myCombineDirectoryPart($otherDirectoryPart, $aboveBaseLevel, $directoryParts, $error)) {
                return false;
            }
        }

        return true;
    }
private function myCombine(PathTraitInterface $other, ?bool &$isAbsolute = null, ?int &$aboveBaseLevel = null, ?array &$directoryParts = null, ?string &$filename = null, ?string &$error = null): bool
    {
        // If other path is absolute, current path is overridden.
        if ($other->isAbsolute()) {
            $isAbsolute = $other->isAbsolute();
            $aboveBaseLevel = 0;
            $directoryParts = $other->getDirectoryParts();
            $filename = $other->getFilename();

            return true;
        }

        $isAbsolute = $this->myIsAbsolute;
        $aboveBaseLevel = $this->myAboveBaseLevel;
        $directoryParts = $this->myDirectoryParts;
        $filename = $other->getFilename();

        foreach ($other->getDirectoryParts() as $otherDirectoryPart) {
            if (!$this->myCombineDirectoryPart($otherDirectoryPart, $aboveBaseLevel, $directoryParts, $error)) {
                return false;
            }
        }

        return true;
    }
private function myCombine ( PathTraitInterface $ other , ? bool & $ isAbsolute = null , ? int & $ aboveBaseLevel = null , ? array & $ directoryParts = null , ? string & $ filename = null , ? string & $ error = null ) : bool { // If other path is absolute, current path is overridden. if ( $ other -> isAbsolute ( ) ) { $ isAbsolute = $ other -> isAbsolute ( ) ; $ aboveBaseLevel = 0 ; $ directoryParts = $ other -> getDirectoryParts ( ) ; $ filename = $ other -> getFilename ( ) ; return true ; } $ isAbsolute = $ this -> myIsAbsolute ; $ aboveBaseLevel = $ this -> myAboveBaseLevel ; $ directoryParts = $ this -> myDirectoryParts ; $ filename = $ other -> getFilename ( ) ; foreach ( $ other -> getDirectoryParts ( ) as $ otherDirectoryPart ) { if ( ! $ this -> myCombineDirectoryPart ( $ otherDirectoryPart , $ aboveBaseLevel , $ directoryParts , $ error ) ) { return false ; } } return true ; }
Tries to combine this path with another path.

@param PathTraitInterface $other          The other path.
@param bool|null          $isAbsolute     Whether the path is absolute or relative is combining was successful, undefined otherwise.
@param int|null           $aboveBaseLevel The number of directory parts above base level if combining was successful, undefined otherwise.
@param string[]|null      $directoryParts The directory parts if combining was successful, undefined otherwise.
@param string|null        $filename       The file if combining was not successful, undefined otherwise.
@param string|null        $error          The error text if combining was not successful, undefined otherwise.

@return bool True if combining was successful, false otherwise.
Tries to combine this path with another path .