Skip to content

Commit

Permalink
Added documentation to readme.
Browse files Browse the repository at this point in the history
Added docblocks.
  • Loading branch information
Bilge committed Oct 9, 2016
1 parent be9bed5 commit c4bed21
Show file tree
Hide file tree
Showing 7 changed files with 348 additions and 7 deletions.
314 changes: 312 additions & 2 deletions README.md

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion src/Porter/Connector/CachingConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,19 @@
use ScriptFUSION\Porter\Cache\MemoryCache;
use ScriptFUSION\Porter\Options\EncapsulatedOptions;

/**
* Caches remote data using PSR-6-compliant objects.
*/
abstract class CachingConnector implements Connector, CacheToggle
{
/**
* @var CacheItemPoolInterface
*/
private $cache;

/**
* @var bool
*/
private $cacheEnabled = true;

public function __construct(CacheItemPoolInterface $cache = null)
Expand Down Expand Up @@ -57,6 +66,6 @@ public function isCacheEnabled()

private function hash(array $structure)
{
return sha1(json_encode($structure));
return json_encode($structure);
}
}
3 changes: 1 addition & 2 deletions src/Porter/Mapper/Strategy/SubImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ class SubImport implements Strategy, PorterAware
private $specificationOrCallback;

/**
* Initializes this instance with the specified import specification or
* the specification callback.
* Initializes this instance with the specified import specification or specification callback.
*
* @param ImportSpecification|callable $specificationOrCallback Import specification
* or specification callback.
Expand Down
3 changes: 3 additions & 0 deletions src/Porter/Net/Soap/SoapConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
use ScriptFUSION\Porter\Type\ObjectType;
use ScriptFUSION\Retry\ErrorHandler\ExponentialBackoffErrorHandler;

/**
* Fetches data from a SOAP service.
*/
class SoapConnector extends CachingConnector
{
private $client;
Expand Down
4 changes: 3 additions & 1 deletion src/Porter/Net/Soap/SoapOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ public function getProxyPassword()
/**
* Extracts a list of SOAP Client options only.
*
* @return array HTTP context options.
* @return array SOAP context options.
*
* @see http://php.net/manual/en/soapclient.soapclient.php
*/
public function extractSoapClientOptions()
{
Expand Down
17 changes: 16 additions & 1 deletion src/Porter/Porter.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,29 @@
use ScriptFUSION\Porter\Provider\Resource\ProviderResource;
use ScriptFUSION\Porter\Specification\ImportSpecification;

/**
* Imports data according to an ImportSpecification.
*/
class Porter
{
/**
* @var Provider[]
*/
private $providers;

/**
* @var ProviderFactory
*/
private $providerFactory;

/**
* @var CollectionMapper
*/
private $mapper;

/**
* @var CacheAdvice
*/
private $defaultCacheAdvice;

public function __construct()
Expand Down Expand Up @@ -67,7 +82,7 @@ public function import(ImportSpecification $specification)
*
* @param ImportSpecification $specification Import specification.
*
* @return mixed Data.
* @return array Record.
*
* @throws ImportException More than one record was imported.
*/
Expand Down
3 changes: 3 additions & 0 deletions src/Porter/Specification/ImportSpecification.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
use ScriptFUSION\Porter\Cache\CacheAdvice;
use ScriptFUSION\Porter\Provider\Resource\ProviderResource;

/**
* Specifies which resource to import, how to import it, and how it should be transformed.
*/
class ImportSpecification
{
/** @var ProviderResource */
Expand Down

0 comments on commit c4bed21

Please sign in to comment.