Skip to content

Commit

Permalink
Add dockblocks for classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Albin Kerouanton committed Jun 2, 2017
1 parent 6346ace commit 31b48c5
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 1 deletion.
20 changes: 20 additions & 0 deletions src/Resolvable/ResolvableFilesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,26 @@

use Gaufrette\FilesystemInterface;

/**
* Filesystem decorator providing resolve() method to resolve an object path into URI.
*
* Example:
* $client = // AwsS3 client instantiation
* $decorated = new Filesystem(new AwsS3($client, 'my_bucket', ['directory' => 'root/dir']));
* $filesystem = new ResolvableFilesystem(
* $decorated,
* new AwsS3PresignedUrlResolver($client, 'my_bucket', 'root/dir')
* );
*
* try {
* // should return something like "https://eu-west-1.blabla.aws.com/my_bucket/root/dir/foo/bar.png?token
* var_dump($filesystem->resolve('foo/bar.png'));
* } catch (ResolverException $e) {
*
* }
*
* @author Albin Kerouanton <[email protected]>
*/
class ResolvableFilesystem implements FilesystemInterface
{
/** @var FilesystemInterface */
Expand Down
2 changes: 2 additions & 0 deletions src/Resolvable/Resolver/AwsS3PresignedUrlResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
/**
* Resolves object paths into time-limited URLs, namely presigned URLs.
*
* @author Albin Kerouanton <[email protected]>
*
* @see http://docs.aws.amazon.com/AmazonS3/latest/dev/ShareObjectPreSignedURL.html
*/
class AwsS3PresignedUrlResolver implements ResolverInterface
Expand Down
4 changes: 3 additions & 1 deletion src/Resolvable/Resolver/AwsS3PublicUrlResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
use Gaufrette\Extras\Resolvable\ResolverInterface;

/**
* Resolves objects' path into public URLs.
* Resolves path of public objects into URLs.
*
* @author Albin Kerouanton <[email protected]>
*/
class AwsS3PublicUrlResolver implements ResolverInterface
{
Expand Down
2 changes: 2 additions & 0 deletions src/Resolvable/Resolver/StaticUrlResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

/**
* Resolves object path by prepending a static prefix.
*
* @author Albin Kerouanton <[email protected]>
*/
class StaticUrlResolver implements ResolverInterface
{
Expand Down
5 changes: 5 additions & 0 deletions src/Resolvable/ResolverException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

namespace Gaufrette\Extras\Resolvable;

/**
* Base exception thrown by resolvers if they fail to resolve an object path into URI.
*
* @author Albin Kerouanton <[email protected]>
*/
class ResolverException extends \Exception
{
}
5 changes: 5 additions & 0 deletions src/Resolvable/ResolverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

namespace Gaufrette\Extras\Resolvable;

/**
* Resolves an object path into an URI.
*
* @author Albin Kerouanton <[email protected]>
*/
interface ResolverInterface
{
/**
Expand Down
5 changes: 5 additions & 0 deletions src/Resolvable/UnresolvableObjectException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

namespace Gaufrette\Extras\Resolvable;

/**
* Exception thrown by the filesystem when resolution fail.
*
* @author Albin Kerouanton <[email protected]>
*/
class UnresolvableObjectException extends \Exception
{
/**
Expand Down

0 comments on commit 31b48c5

Please sign in to comment.