private function normalizeDefinition($definition)
    {
        if (!is_array($definition)) {
            if (!is_string($definition) || strpos($definition, 'shared:files') === false) {
                throw new \RuntimeException('Failed to parse mount definition: ' . json_encode($definition));
            }
            $definition = [
                'source' => 'local',
                'source_path' => str_replace('shared:files', '', $definition),
            ];
        } elseif (!isset($definition['source'])) {
            throw new \InvalidArgumentException('Invalid mount definition: ' . json_encode($definition));
        }
        if (isset($definition['source_path'])) {
            $definition['source_path'] = $this->normalizeRelativePath($definition['source_path']);
        }

        return $definition;
    }
private function normalizeDefinition($definition)
    {
        if (!is_array($definition)) {
            if (!is_string($definition) || strpos($definition, 'shared:files') === false) {
                throw new \RuntimeException('Failed to parse mount definition: ' . json_encode($definition));
            }
            $definition = [
                'source' => 'local',
                'source_path' => str_replace('shared:files', '', $definition),
            ];
        } elseif (!isset($definition['source'])) {
            throw new \InvalidArgumentException('Invalid mount definition: ' . json_encode($definition));
        }
        if (isset($definition['source_path'])) {
            $definition['source_path'] = $this->normalizeRelativePath($definition['source_path']);
        }

        return $definition;
    }
private function normalizeDefinition ( $ definition ) { if ( ! is_array ( $ definition ) ) { if ( ! is_string ( $ definition ) || strpos ( $ definition , 'shared:files' ) === false ) { throw new \ RuntimeException ( 'Failed to parse mount definition: ' . json_encode ( $ definition ) ) ; } $ definition = [ 'source' => 'local' , 'source_path' => str_replace ( 'shared:files' , '' , $ definition ) , ] ; } elseif ( ! isset ( $ definition [ 'source' ] ) ) { throw new \ InvalidArgumentException ( 'Invalid mount definition: ' . json_encode ( $ definition ) ) ; } if ( isset ( $ definition [ 'source_path' ] ) ) { $ definition [ 'source_path' ] = $ this -> normalizeRelativePath ( $ definition [ 'source_path' ] ) ; } return $ definition ; }
Normalize a mount definition.

@param array|string $definition

@return array
An array containing at least 'source', and probably 'source_path'.
Normalize a mount definition .