Skip to content
This repository was archived by the owner on May 13, 2023. It is now read-only.

Commit 4182d59

Browse files
committed
Adds URI factory
1 parent 41600f3 commit 4182d59

File tree

3 files changed

+98
-0
lines changed

3 files changed

+98
-0
lines changed

src/UriFactory.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Http Message Factory package.
5+
*
6+
* (c) PHP HTTP Team
7+
*
8+
* For the full copyright and license information, please read the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Http\Message;
13+
14+
use Psr\Http\Message\UriInterface;
15+
16+
/**
17+
* @author Márk Sági-Kazár <[email protected]>
18+
*/
19+
interface UriFactory
20+
{
21+
/**
22+
* Creates an URI
23+
*
24+
* @param mixed $uri
25+
*
26+
* @return UriInterface
27+
*
28+
* @throws \InvalidArgumentException If the URI is invalid
29+
*/
30+
public function createUri($uri = null);
31+
}

src/UriFactoryAware.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Http Message Factory package.
5+
*
6+
* (c) PHP HTTP Team
7+
*
8+
* For the full copyright and license information, please read the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Http\Message;
13+
14+
/**
15+
* @author Márk Sági-Kazár <[email protected]>
16+
*/
17+
interface UriFactoryAware
18+
{
19+
/**
20+
* @return UriFactory
21+
*/
22+
public function getUriFactory();
23+
24+
/**
25+
* @param UriFactory $uriFactory
26+
*/
27+
public function setUriFactory(UriFactory $uriFactory);
28+
}

src/UriFactoryHelper.php

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Http Message Factory package.
5+
*
6+
* (c) PHP HTTP Team
7+
*
8+
* For the full copyright and license information, please read the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Http\Message;
13+
14+
/**
15+
* @author Márk Sági-Kazár <[email protected]>
16+
*/
17+
interface UriFactoryHelper
18+
{
19+
/**
20+
* @var UriFactory
21+
*/
22+
protected $uriFactory;
23+
24+
/**
25+
* {@inheritdoc}
26+
*/
27+
public function getUriFactory()
28+
{
29+
return $this->uriFactory;
30+
}
31+
32+
/**
33+
* {@inheritdoc}
34+
*/
35+
public function setUriFactory(UriFactory $uriFactory)
36+
{
37+
$this->uriFactory = $uriFactory;
38+
}
39+
}

0 commit comments

Comments
 (0)