Skip to content

Commit f844c75

Browse files
committed
Merge pull request #23 from php-http/documentation
Documentation
2 parents 49cca75 + 0f95805 commit f844c75

13 files changed

+28
-141
lines changed

src/ClassDiscovery.php

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,16 @@
11
<?php
22

3-
/*
4-
* This file is part of the Http Discovery package.
5-
*
6-
* (c) PHP HTTP Team <[email protected]>
7-
*
8-
* For the full copyright and license information, please read the LICENSE
9-
* file that was distributed with this source code.
10-
*/
11-
123
namespace Http\Discovery;
134

145
/**
15-
* Registry that based find results on class existence
6+
* Registry that based find results on class existence.
167
*
178
* @author David de Boer <[email protected]>
189
*/
1910
abstract class ClassDiscovery
2011
{
2112
/**
22-
* Add a class (and condition) to the discovery registry
13+
* Add a class (and condition) to the discovery registry.
2314
*
2415
* @param string $class Class that will be instantiated if found
2516
* @param string $condition Optional other class to check for existence
@@ -37,7 +28,7 @@ public static function register($class, $condition = null)
3728
}
3829

3930
/**
40-
* Finds a Class
31+
* Finds a Class.
4132
*
4233
* @return object
4334
*
@@ -62,7 +53,7 @@ public static function find()
6253
}
6354

6455
/**
65-
* Evaulates conditions to boolean
56+
* Evaulates conditions to boolean.
6657
*
6758
* @param mixed $condition
6859
*

src/HttpAsyncClientDiscovery.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Http\Client\HttpAsyncClient;
66

77
/**
8-
* Finds an HTTP Asynchronous Client
8+
* Finds an HTTP Asynchronous Client.
99
*
1010
* @author Joel Wurtz <[email protected]>
1111
*/
@@ -27,7 +27,7 @@ final class HttpAsyncClientDiscovery extends ClassDiscovery
2727
];
2828

2929
/**
30-
* Finds an HTTP Async Client
30+
* Finds an HTTP Async Client.
3131
*
3232
* @return HttpAsyncClient
3333
*

src/HttpClientDiscovery.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
<?php
22

3-
/*
4-
* This file is part of the Http Discovery package.
5-
*
6-
* (c) PHP HTTP Team <[email protected]>
7-
*
8-
* For the full copyright and license information, please read the LICENSE
9-
* file that was distributed with this source code.
10-
*/
11-
123
namespace Http\Discovery;
134

145
use Http\Client\HttpClient;
156

167
/**
17-
* Finds an HTTP Client
8+
* Finds an HTTP Client.
189
*
1910
* @author Márk Sági-Kazár <[email protected]>
2011
*/
@@ -40,11 +31,11 @@ final class HttpClientDiscovery extends ClassDiscovery
4031
];
4132

4233
/**
43-
* Finds an HTTP Client
34+
* Finds an HTTP Client.
4435
*
4536
* @return HttpClient
4637
*
47-
* @throws NotFoundException If no suitable client is available
38+
* @throws NotFoundException
4839
*/
4940
public static function find()
5041
{

src/MessageFactory/DiactorosFactory.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
<?php
22

3-
/*
4-
* This file is part of the Http Discovery package.
5-
*
6-
* (c) PHP HTTP Team <[email protected]>
7-
*
8-
* For the full copyright and license information, please read the LICENSE
9-
* file that was distributed with this source code.
10-
*/
11-
123
namespace Http\Discovery\MessageFactory;
134

145
use Http\Discovery\StreamFactory\DiactorosStreamFactory;
@@ -18,6 +9,8 @@
189
use Zend\Diactoros\Response;
1910

2011
/**
12+
* Creates Diactoros messages.
13+
*
2114
* @author GeLo <[email protected]>
2215
*/
2316
final class DiactorosFactory implements MessageFactory

src/MessageFactory/GuzzleFactory.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
11
<?php
22

3-
/*
4-
* This file is part of the Http Discovery package.
5-
*
6-
* (c) PHP HTTP Team <[email protected]>
7-
*
8-
* For the full copyright and license information, please read the LICENSE
9-
* file that was distributed with this source code.
10-
*/
11-
123
namespace Http\Discovery\MessageFactory;
134

145
use GuzzleHttp\Psr7\Request;
156
use GuzzleHttp\Psr7\Response;
167
use Http\Message\MessageFactory;
178

189
/**
10+
* Creates Guzzle messages.
11+
*
1912
* @author Márk Sági-Kazár <[email protected]>
2013
*/
2114
final class GuzzleFactory implements MessageFactory

src/MessageFactoryDiscovery.php

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
<?php
22

3-
/*
4-
* This file is part of the Http Discovery package.
5-
*
6-
* (c) PHP HTTP Team <[email protected]>
7-
*
8-
* For the full copyright and license information, please read the LICENSE
9-
* file that was distributed with this source code.
10-
*/
11-
123
namespace Http\Discovery;
134

145
use Http\Message\MessageFactory;
156

167
/**
17-
* Finds a Message Factory
8+
* Finds a Message Factory.
189
*
1910
* @author Márk Sági-Kazár <[email protected]>
2011
*/
@@ -40,7 +31,7 @@ final class MessageFactoryDiscovery extends ClassDiscovery
4031
];
4132

4233
/**
43-
* Finds a Message Factory
34+
* Finds a Message Factory.
4435
*
4536
* @return MessageFactory
4637
*

src/NotFoundException.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
<?php
22

3-
/*
4-
* This file is part of the Http Discovery package.
5-
*
6-
* (c) PHP HTTP Team <[email protected]>
7-
*
8-
* For the full copyright and license information, please read the LICENSE
9-
* file that was distributed with this source code.
10-
*/
11-
123
namespace Http\Discovery;
134

145
/**
15-
* Thrown when a discovery does not find any matches
6+
* Thrown when a discovery does not find any matches.
167
*
178
* @author Márk Sági-Kazár <[email protected]>
189
*/

src/StreamFactory/DiactorosStreamFactory.php

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
<?php
22

3-
/*
4-
* This file is part of the Http Discovery package.
5-
*
6-
* (c) PHP HTTP Team <[email protected]>
7-
*
8-
* For the full copyright and license information, please read the LICENSE
9-
* file that was distributed with this source code.
10-
*/
11-
123
namespace Http\Discovery\StreamFactory;
134

145
use Http\Message\StreamFactory;
@@ -18,19 +9,14 @@
189
use Zend\Diactoros\Stream;
1910

2011
/**
12+
* Creates Diactoros streams.
13+
*
2114
* @author Михаил Красильников <[email protected]>
2215
*/
2316
final class DiactorosStreamFactory implements StreamFactory
2417
{
2518
/**
26-
* Creates a stream
27-
*
28-
* @param string|resource|StreamInterface|null $body
29-
*
30-
* @return StreamInterface
31-
*
32-
* @throws \InvalidArgumentException If the stream body is invalid
33-
* @throws \RuntimeException If cannot write into stream
19+
* {@inheritdoc}
3420
*/
3521
public function createStream($body = null)
3622
{

src/StreamFactory/GuzzleStreamFactory.php

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,19 @@
11
<?php
22

3-
/*
4-
* This file is part of the Http Discovery package.
5-
*
6-
* (c) PHP HTTP Team <[email protected]>
7-
*
8-
* For the full copyright and license information, please read the LICENSE
9-
* file that was distributed with this source code.
10-
*/
11-
123
namespace Http\Discovery\StreamFactory;
134

145
use Http\Message\StreamFactory;
156
use Psr\Http\Message\StreamInterface;
167

178
/**
9+
* Creates Guzzle streams.
10+
*
1811
* @author Михаил Красильников <[email protected]>
1912
*/
2013
final class GuzzleStreamFactory implements StreamFactory
2114
{
2215
/**
23-
* Creates a stream
24-
*
25-
* @param string|resource|StreamInterface|null $body
26-
*
27-
* @return StreamInterface
28-
*
29-
* @throws \InvalidArgumentException if the $body arg is not valid.
16+
* {@inheritdoc}
3017
*/
3118
public function createStream($body = null)
3219
{

src/StreamFactoryDiscovery.php

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
<?php
22

3-
/*
4-
* This file is part of the Http Discovery package.
5-
*
6-
* (c) PHP HTTP Team <[email protected]>
7-
*
8-
* For the full copyright and license information, please read the LICENSE
9-
* file that was distributed with this source code.
10-
*/
11-
123
namespace Http\Discovery;
134

145
use Http\Message\StreamFactory;
156

167
/**
17-
* Finds a Stream Factory
8+
* Finds a Stream Factory.
189
*
1910
* @author Михаил Красильников <[email protected]>
2011
*/
@@ -40,7 +31,7 @@ final class StreamFactoryDiscovery extends ClassDiscovery
4031
];
4132

4233
/**
43-
* Finds a Stream Factory
34+
* Finds a Stream Factory.
4435
*
4536
* @return StreamFactory
4637
*

src/UriFactory/DiactorosFactory.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
11
<?php
22

3-
/*
4-
* This file is part of the Http Discovery package.
5-
*
6-
* (c) PHP HTTP Team <[email protected]>
7-
*
8-
* For the full copyright and license information, please read the LICENSE
9-
* file that was distributed with this source code.
10-
*/
11-
123
namespace Http\Discovery\UriFactory;
134

145
use Http\Message\UriFactory;
156
use Psr\Http\Message\UriInterface;
167
use Zend\Diactoros\Uri;
178

189
/**
19-
* Creates a zend/diactoros URI object
10+
* Creates Diactoros URI.
2011
*
2112
* @author David de Boer <[email protected]>
2213
*/

src/UriFactory/GuzzleFactory.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
11
<?php
22

3-
/*
4-
* This file is part of the Http Discovery package.
5-
*
6-
* (c) PHP HTTP Team <[email protected]>
7-
*
8-
* For the full copyright and license information, please read the LICENSE
9-
* file that was distributed with this source code.
10-
*/
11-
123
namespace Http\Discovery\UriFactory;
134

145
use GuzzleHttp\Psr7;
156
use Http\Message\UriFactory;
167

178
/**
18-
* Creates a guzzlehttp/psr7 URI object
9+
* Creates Guzzle URI.
1910
*
2011
* @author David de Boer <[email protected]>
2112
*/

src/UriFactoryDiscovery.php

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
<?php
22

3-
/*
4-
* This file is part of the Http Discovery package.
5-
*
6-
* (c) PHP HTTP Team <[email protected]>
7-
*
8-
* For the full copyright and license information, please read the LICENSE
9-
* file that was distributed with this source code.
10-
*/
11-
123
namespace Http\Discovery;
134

145
use Http\Message\UriFactory;
156

167
/**
17-
* Finds a URI Factory
8+
* Finds a URI Factory.
189
*
1910
* @author David de Boer <[email protected]>
2011
*/
@@ -40,7 +31,7 @@ final class UriFactoryDiscovery extends ClassDiscovery
4031
];
4132

4233
/**
43-
* Finds a URI Factory
34+
* Finds a URI Factory.
4435
*
4536
* @return UriFactory
4637
*/

0 commit comments

Comments
 (0)