Skip to content

Documentation #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions src/ClassDiscovery.php
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
<?php

/*
* This file is part of the Http Discovery package.
*
* (c) PHP HTTP Team <[email protected]>
*
* For the full copyright and license information, please read the LICENSE
* file that was distributed with this source code.
*/

namespace Http\Discovery;

/**
* Registry that based find results on class existence
* Registry that based find results on class existence.
*
* @author David de Boer <[email protected]>
*/
abstract class ClassDiscovery
{
/**
* Add a class (and condition) to the discovery registry
* Add a class (and condition) to the discovery registry.
*
* @param string $class Class that will be instantiated if found
* @param string $condition Optional other class to check for existence
Expand All @@ -37,7 +28,7 @@ public static function register($class, $condition = null)
}

/**
* Finds a Class
* Finds a Class.
*
* @return object
*
Expand All @@ -62,7 +53,7 @@ public static function find()
}

/**
* Evaulates conditions to boolean
* Evaulates conditions to boolean.
*
* @param mixed $condition
*
Expand Down
4 changes: 2 additions & 2 deletions src/HttpAsyncClientDiscovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Http\Client\HttpAsyncClient;

/**
* Finds an HTTP Asynchronous Client
* Finds an HTTP Asynchronous Client.
*
* @author Joel Wurtz <[email protected]>
*/
Expand All @@ -27,7 +27,7 @@ class HttpAsyncClientDiscovery extends ClassDiscovery
];

/**
* Finds an HTTP Async Client
* Finds an HTTP Async Client.
*
* @return HttpAsyncClient
*
Expand Down
15 changes: 3 additions & 12 deletions src/HttpClientDiscovery.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
<?php

/*
* This file is part of the Http Discovery package.
*
* (c) PHP HTTP Team <[email protected]>
*
* For the full copyright and license information, please read the LICENSE
* file that was distributed with this source code.
*/

namespace Http\Discovery;

use Http\Client\HttpClient;

/**
* Finds an HTTP Client
* Finds an HTTP Client.
*
* @author Márk Sági-Kazár <[email protected]>
*/
Expand All @@ -40,11 +31,11 @@ class HttpClientDiscovery extends ClassDiscovery
];

/**
* Finds an HTTP Client
* Finds an HTTP Client.
*
* @return HttpClient
*
* @throws NotFoundException If no suitable client is available
* @throws NotFoundException
*/
public static function find()
{
Expand Down
11 changes: 2 additions & 9 deletions src/MessageFactory/DiactorosFactory.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
<?php

/*
* This file is part of the Http Discovery package.
*
* (c) PHP HTTP Team <[email protected]>
*
* For the full copyright and license information, please read the LICENSE
* file that was distributed with this source code.
*/

namespace Http\Discovery\MessageFactory;

use Http\Message\MessageFactory;
Expand All @@ -18,6 +9,8 @@
use Zend\Diactoros\Stream;

/**
* Creates Diactoros messages.
*
* @author GeLo <[email protected]>
*/
class DiactorosFactory implements MessageFactory
Expand Down
11 changes: 2 additions & 9 deletions src/MessageFactory/GuzzleFactory.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
<?php

/*
* This file is part of the Http Discovery package.
*
* (c) PHP HTTP Team <[email protected]>
*
* For the full copyright and license information, please read the LICENSE
* file that was distributed with this source code.
*/

namespace Http\Discovery\MessageFactory;

use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;
use Http\Message\MessageFactory;

/**
* Creates Guzzle messages.
*
* @author Márk Sági-Kazár <[email protected]>
*/
class GuzzleFactory implements MessageFactory
Expand Down
13 changes: 2 additions & 11 deletions src/MessageFactoryDiscovery.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
<?php

/*
* This file is part of the Http Discovery package.
*
* (c) PHP HTTP Team <[email protected]>
*
* For the full copyright and license information, please read the LICENSE
* file that was distributed with this source code.
*/

namespace Http\Discovery;

use Http\Message\MessageFactory;

/**
* Finds a Message Factory
* Finds a Message Factory.
*
* @author Márk Sági-Kazár <[email protected]>
*/
Expand All @@ -40,7 +31,7 @@ class MessageFactoryDiscovery extends ClassDiscovery
];

/**
* Finds a Message Factory
* Finds a Message Factory.
*
* @return MessageFactory
*
Expand Down
11 changes: 1 addition & 10 deletions src/NotFoundException.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
<?php

/*
* This file is part of the Http Discovery package.
*
* (c) PHP HTTP Team <[email protected]>
*
* For the full copyright and license information, please read the LICENSE
* file that was distributed with this source code.
*/

namespace Http\Discovery;

/**
* Thrown when a discovery does not find any matches
* Thrown when a discovery does not find any matches.
*
* @author Márk Sági-Kazár <[email protected]>
*/
Expand Down
20 changes: 3 additions & 17 deletions src/StreamFactory/DiactorosStreamFactory.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
<?php

/*
* This file is part of the Http Discovery package.
*
* (c) PHP HTTP Team <[email protected]>
*
* For the full copyright and license information, please read the LICENSE
* file that was distributed with this source code.
*/

namespace Http\Discovery\StreamFactory;

use Http\Message\StreamFactory;
Expand All @@ -18,19 +9,14 @@
use Zend\Diactoros\Stream;

/**
* Creates Diactoros streams.
*
* @author Михаил Красильников <[email protected]>
*/
class DiactorosStreamFactory implements StreamFactory
{
/**
* Creates a stream
*
* @param string|resource|StreamInterface|null $body
*
* @return StreamInterface
*
* @throws \InvalidArgumentException If the stream body is invalid
* @throws \RuntimeException If cannot write into stream
* {@inheritdoc}
*/
public function createStream($body = null)
{
Expand Down
19 changes: 3 additions & 16 deletions src/StreamFactory/GuzzleStreamFactory.php
Original file line number Diff line number Diff line change
@@ -1,32 +1,19 @@
<?php

/*
* This file is part of the Http Discovery package.
*
* (c) PHP HTTP Team <[email protected]>
*
* For the full copyright and license information, please read the LICENSE
* file that was distributed with this source code.
*/

namespace Http\Discovery\StreamFactory;

use Http\Message\StreamFactory;
use Psr\Http\Message\StreamInterface;

/**
* Creates Guzzle streams.
*
* @author Михаил Красильников <[email protected]>
*/
class GuzzleStreamFactory implements StreamFactory
{
/**
* Creates a stream
*
* @param string|resource|StreamInterface|null $body
*
* @return StreamInterface
*
* @throws \InvalidArgumentException if the $body arg is not valid.
* {@inheritdoc}
*/
public function createStream($body = null)
{
Expand Down
13 changes: 2 additions & 11 deletions src/StreamFactoryDiscovery.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
<?php

/*
* This file is part of the Http Discovery package.
*
* (c) PHP HTTP Team <[email protected]>
*
* For the full copyright and license information, please read the LICENSE
* file that was distributed with this source code.
*/

namespace Http\Discovery;

use Http\Message\StreamFactory;

/**
* Finds a Stream Factory
* Finds a Stream Factory.
*
* @author Михаил Красильников <[email protected]>
*/
Expand All @@ -40,7 +31,7 @@ class StreamFactoryDiscovery extends ClassDiscovery
];

/**
* Finds a Stream Factory
* Finds a Stream Factory.
*
* @return StreamFactory
*
Expand Down
11 changes: 1 addition & 10 deletions src/UriFactory/DiactorosFactory.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
<?php

/*
* This file is part of the Http Discovery package.
*
* (c) PHP HTTP Team <[email protected]>
*
* For the full copyright and license information, please read the LICENSE
* file that was distributed with this source code.
*/

namespace Http\Discovery\UriFactory;

use Http\Message\UriFactory;
use Psr\Http\Message\UriInterface;
use Zend\Diactoros\Uri;

/**
* Creates a zend/diactoros URI object
* Creates Diactoros URI.
*
* @author David de Boer <[email protected]>
*/
Expand Down
11 changes: 1 addition & 10 deletions src/UriFactory/GuzzleFactory.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
<?php

/*
* This file is part of the Http Discovery package.
*
* (c) PHP HTTP Team <[email protected]>
*
* For the full copyright and license information, please read the LICENSE
* file that was distributed with this source code.
*/

namespace Http\Discovery\UriFactory;

use GuzzleHttp\Psr7;
use Http\Message\UriFactory;

/**
* Creates a guzzlehttp/psr7 URI object
* Creates Guzzle URI.
*
* @author David de Boer <[email protected]>
*/
Expand Down
13 changes: 2 additions & 11 deletions src/UriFactoryDiscovery.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
<?php

/*
* This file is part of the Http Discovery package.
*
* (c) PHP HTTP Team <[email protected]>
*
* For the full copyright and license information, please read the LICENSE
* file that was distributed with this source code.
*/

namespace Http\Discovery;

use Http\Message\UriFactory;

/**
* Finds a URI Factory
* Finds a URI Factory.
*
* @author David de Boer <[email protected]>
*/
Expand All @@ -40,7 +31,7 @@ class UriFactoryDiscovery extends ClassDiscovery
];

/**
* Finds a URI Factory
* Finds a URI Factory.
*
* @return UriFactory
*/
Expand Down