Use this method to create a new collection.

@param string $uri   The new uri
@param MkCol  $mkCol

@return array|null
161884
public function createCollection($uri, MkCol $mkCol)
    {
        list($parentUri, $newName) = Uri\split($uri);

        // Making sure the parent exists
        try {
            $parent = $this->tree->getNodeForPath($parentUri);
        } catch (Exception\NotFound $e) {
            throw new Exception\Conflict('Parent node does not exist');
        }

        // Making sure the parent is a collection
        if (!$parent instanceof ICollection) {
            throw new Exception\Conflict('Parent node is not a collection');
        }

        // Making sure the child does not already exist
        try {
            $parent->getChild($newName);

            // If we got here.. it means there's already a node on that url, and we need to throw a 405
            throw new Exception\MethodNotAllowed('The resource you tried to create already exists');
        } catch (Exception\NotFound $e) {
            // NotFound is the expected behavior.
        }

        if (!$this->emit('beforeBind', [$uri])) {
            return;
        }

        if ($parent instanceof IExtendedCollection) {
            /*
             * If the parent is an instance of IExtendedCollection, it means that
             * we can pass the MkCol object directly as it may be able to store
             * properties immediately.
             */
            $parent->createExtendedCollection($newName, $mkCol);
        } else {
            /*
             * If the parent is a standard ICollection, it means only
             * 'standard' collections can be created, so we should fail any
             * MKCOL operation that carries extra resourcetypes.
             */
            if (count($mkCol->getResourceType()) > 1) {
                throw new Exception\InvalidResourceType('The {DAV:}resourcetype you specified is not supported here.');
            }

            $parent->createDirectory($newName);
        }

        // If there are any properties that have not been handled/stored,
        // we ask the 'propPatch' event to handle them. This will allow for
        // example the propertyStorage system to store properties upon MKCOL.
        if ($mkCol->getRemainingMutations()) {
            $this->emit('propPatch', [$uri, $mkCol]);
        }
        $success = $mkCol->commit();

        if (!$success) {
            $result = $mkCol->getResult();

            $formattedResult = [
                'href' => $uri,
            ];

            foreach ($result as $propertyName => $status) {
                if (!isset($formattedResult[$status])) {
                    $formattedResult[$status] = [];
                }
                $formattedResult[$status][$propertyName] = null;
            }

            return $formattedResult;
        }

        $this->tree->markDirty($parentUri);
        $this->emit('afterBind', [$uri]);
    }
735804
protected function createCrawlerFromContent($uri, $content, $type)
    {
        if (!class_exists('Symfony\Component\DomCrawler\Crawler')) {
            return;
        }

        $crawler = new Crawler(null, $uri);
        $crawler->addContent($content, $type);

        return $crawler;
    }
809249
public function add($uri, $storage, $name = null, $methods = null){
        $route = new Route($uri, $storage, $methods);
        if($name !== null){
            $this->routes[$name] = $route;
        }else{
            $this->routes[] = $route;
        }
        return $route;
    }
851236
public static function create($type, $uri, $method = 'GET', $parameters = [], $cookies = [], $files = [], $server = [], $content = null)
    {
        self::configureFactory($type);

        return \call_user_func_array([self::getClass($type), 'create'], [$uri, $method, $parameters, $cookies, $files, $server, $content]);
    }
255205
function createUriQueryMapper (query) {
  var parameters = extractQueryParameters(query);
  return (queryValues, args) => {
    queryValues = queryValues || Object.create(null);

    Object.keys(queryValues)
      .forEach(queryKey => {
        var parameter = parameters[queryKey];

        if (!parameter) {
          return;
        }

        var value = util.isArray(queryValues[queryKey]) ?
          queryValues[queryKey]
            .map(parameter.map)
            .filter(value => value !== null) :
          parameter.map(queryValues[queryKey]);

        if (value === null) {
          return;
        }

        args[parameter.name] = value;
      });
  };
}
1009326
static function get_entity($uri)
    {
        if (isset(self::$list_entity[$uri])){
            return self::$list_entity[$uri];
        }
        return null;
    }
1071508
public function createRequest($method, $uri)
    {
        $uri = \is_string($uri)
            ? Uri::create($uri)
            : $uri;

        return new Request($method, $uri);
    }
1147543
public function withNodeUri($uri)
    {
        $builder = new RiakNodeBuilder();
        $node    = $builder
            ->withProtocol(parse_url($uri, PHP_URL_SCHEME))
            ->withHost(parse_url($uri, PHP_URL_HOST))
            ->withPort(parse_url($uri, PHP_URL_PORT))
            ->withUser(parse_url($uri, PHP_URL_USER))
            ->withPass(parse_url($uri, PHP_URL_PASS))
            ->build();

        return $this->withNode($node);
    }
1129951
public function addRoute( $uri, $controller_action )
    {
        $routeOptions = [];
        $routeOptions["uri"] = $uri;
        $routeOptions["controller_action"] = $controller_action;

        $routeDefinition = function() use ($routeOptions) {
            return $this->_createRoute( $routeOptions );
        };

        $this->_routeDefinitions[] = $routeDefinition;
    }
933437
protected function _redirectOrNotFound($uri)
    {
        //klucz bufora
        $cacheKey = 'category-redirect-' . md5($uri);
        //zbuforowany brak uri w historii
        if (-1 === $redirectUri = \App\Registry::$cache->load($cacheKey)) {
            //404
            throw new \Mmi\Mvc\MvcNotFoundException('Category not found: ' . $uri);
        }
        //przekierowanie 301
        if ($redirectUri) {
            return $this->getResponse()->setCode(301)->redirect('cms', 'category', 'dispatch', ['uri' => $redirectUri]);
        }
        //wyszukiwanie kategorii
        if (null === $category = (new CmsCategoryQuery)->whereUri()->equals($uri)
            ->orFieldCustomUri()->equals($uri)
            ->join('cms_category', 'cms_category', 'currentCategory')->on('cms_category_original_id', 'id')
            ->findFirst()) {
            //brak kategorii w historii - buforowanie informacji
            \App\Registry::$cache->save('-1', $cacheKey, 0);
            //404
            throw new \Mmi\Mvc\MvcNotFoundException('Category not found: ' . $uri);
        }
        //zapis uri przekierowania do bufora
        \App\Registry::$cache->save($category->getJoined('currentCategory')->uri, $cacheKey, 0);
        //przekierowanie 301
        return $this->getResponse()->setCode(301)->redirect('cms', 'category', 'dispatch', ['uri' => $category->getJoined('currentCategory')->uri]);
    }
441903
public function createResource(
        $uri = "",
        $content = null,
        $headers = []
    ) {
        $options = ['http_errors' => false];

        // Set content.
        $options['body'] = $content;

        // Set headers.
        $options['headers'] = $headers;

        return $this->client->request(
            'POST',
            $uri,
            $options
        );
    }
410867
public static function route($pRequestUri = NULL)
    {
        if ($pRequestUri === NULL) {
            $requestUri = (defined('REQUEST_URI')) ? REQUEST_URI : '/';
        } else {
            $requestUri = $pRequestUri;
        }

        $router = new Router($requestUri);
        $router->route();
    }
416239
public static function create(RouteCollection $routes, ?string $prefix = null): self
    {
        $uriFactory = new UriFactory();

        return new self($routes, $uriFactory, $prefix);
    }
1009026
public static function make($uri, array $queryParameters = [])
    {
        $uri = ($uri instanceof UriInterface) ? $uri : new Uri($uri);
        if ($queryParameters) {
            $uri = static::addQueryParameters($uri, $queryParameters);
        }
        return $uri;
    }
615284
public static function createServerRequest($method, $uri)
    {
        if (! static::$serverRequestFactory) {
            static::$serverRequestFactory = new ServerRequestFactory();
        }

        return static::$serverRequestFactory->createServerRequest($method, $uri);
    }
1123747
public function execute($uri, $requestMethod)
    {
        foreach ($this->routes as $route) {
            if (true === $route->matches($uri, $requestMethod)) {
                return $route;
            }
        }
        return null;
    }
1184143
protected function newRoute($methods, $uri, $action)
    {
        $route = (new Route($methods, $uri, $action))->setContainer($this->container);
        $priority = self::DEFAULT_PRIORITY - $this->routes->count();
        $route->setPriority($priority);

        return $route;
    }