private function resolveReferences($path, $references, $flags = 0)
    {
        $result = array();

        if (!is_array($references)) {
            $references = array($references);
        }

        foreach ($references as $key => $reference) {
            // Keep non-filesystem references as they are
            if (!$this->isFilesystemReference($reference)) {
                $result[] = $reference;

                if ($flags & self::STOP_ON_FIRST) {
                    return $result;
                }

                continue;
            }

            $absoluteReference = Path::makeAbsolute($reference, $this->baseDirectory);
            $referenceExists = file_exists($absoluteReference);

            if (($flags & self::NO_CHECK_FILE_EXISTS) || $referenceExists) {
                $result[] = $absoluteReference;

                if ($flags & self::STOP_ON_FIRST) {
                    return $result;
                }
            }

            if (!$referenceExists) {
                $this->logReferenceNotFound($path, $reference, $absoluteReference);
            }
        }

        return $result;
    }
private function resolveReferences($path, $references, $flags = 0)
    {
        $result = array();

        if (!is_array($references)) {
            $references = array($references);
        }

        foreach ($references as $key => $reference) {
            // Keep non-filesystem references as they are
            if (!$this->isFilesystemReference($reference)) {
                $result[] = $reference;

                if ($flags & self::STOP_ON_FIRST) {
                    return $result;
                }

                continue;
            }

            $absoluteReference = Path::makeAbsolute($reference, $this->baseDirectory);
            $referenceExists = file_exists($absoluteReference);

            if (($flags & self::NO_CHECK_FILE_EXISTS) || $referenceExists) {
                $result[] = $absoluteReference;

                if ($flags & self::STOP_ON_FIRST) {
                    return $result;
                }
            }

            if (!$referenceExists) {
                $this->logReferenceNotFound($path, $reference, $absoluteReference);
            }
        }

        return $result;
    }
private function resolveReferences ( $ path , $ references , $ flags = 0 ) { $ result = array ( ) ; if ( ! is_array ( $ references ) ) { $ references = array ( $ references ) ; } foreach ( $ references as $ key => $ reference ) { // Keep non-filesystem references as they are if ( ! $ this -> isFilesystemReference ( $ reference ) ) { $ result [ ] = $ reference ; if ( $ flags & self :: STOP_ON_FIRST ) { return $ result ; } continue ; } $ absoluteReference = Path :: makeAbsolute ( $ reference , $ this -> baseDirectory ) ; $ referenceExists = file_exists ( $ absoluteReference ) ; if ( ( $ flags & self :: NO_CHECK_FILE_EXISTS ) || $ referenceExists ) { $ result [ ] = $ absoluteReference ; if ( $ flags & self :: STOP_ON_FIRST ) { return $ result ; } } if ( ! $ referenceExists ) { $ this -> logReferenceNotFound ( $ path , $ reference , $ absoluteReference ) ; } } return $ result ; }
Resolves a list of references stored in the JSON.

Each reference passed in can be:

* `null`
* a link starting with `@`
* a filesystem path relative to the base directory
* an absolute filesystem path

Each reference returned by this method can be:

* `null`
* a link starting with `@`
* an absolute filesystem path

Additionally, the results are guaranteed to be an array.

The flag `STOP_ON_FIRST` may be used to stop the search at the first result.
In that case, the results array has a maximum size of 1.

The flag `NO_SEARCH_FILESYSTEM` may be used to check for whether the found
paths actually exist on the filesystem.

@param string $path       The mapped Puli path.
@param mixed  $references The reference(s).
@param int    $flags      A bitwise combination of the flag constants in
this class.

@return string[]|null[] The resolved references.
Resolves a list of references stored in the JSON .