Skip to content

Commit c832ae5

Browse files
committed
Added documentation to readme.
Added docblocks.
1 parent be9bed5 commit c832ae5

File tree

7 files changed

+365
-7
lines changed

7 files changed

+365
-7
lines changed

README.md

Lines changed: 329 additions & 2 deletions
Large diffs are not rendered by default.

src/Porter/Connector/CachingConnector.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,19 @@
66
use ScriptFUSION\Porter\Cache\MemoryCache;
77
use ScriptFUSION\Porter\Options\EncapsulatedOptions;
88

9+
/**
10+
* Caches remote data using PSR-6-compliant objects.
11+
*/
912
abstract class CachingConnector implements Connector, CacheToggle
1013
{
14+
/**
15+
* @var CacheItemPoolInterface
16+
*/
1117
private $cache;
1218

19+
/**
20+
* @var bool
21+
*/
1322
private $cacheEnabled = true;
1423

1524
public function __construct(CacheItemPoolInterface $cache = null)
@@ -57,6 +66,6 @@ public function isCacheEnabled()
5766

5867
private function hash(array $structure)
5968
{
60-
return sha1(json_encode($structure));
69+
return json_encode($structure);
6170
}
6271
}

src/Porter/Mapper/Strategy/SubImport.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ class SubImport implements Strategy, PorterAware
1313
private $specificationOrCallback;
1414

1515
/**
16-
* Initializes this instance with the specified import specification or
17-
* the specification callback.
16+
* Initializes this instance with the specified import specification or specification callback.
1817
*
1918
* @param ImportSpecification|callable $specificationOrCallback Import specification
2019
* or specification callback.

src/Porter/Net/Soap/SoapConnector.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
use ScriptFUSION\Porter\Type\ObjectType;
77
use ScriptFUSION\Retry\ErrorHandler\ExponentialBackoffErrorHandler;
88

9+
/**
10+
* Fetches data from a SOAP service.
11+
*/
912
class SoapConnector extends CachingConnector
1013
{
1114
private $client;

src/Porter/Net/Soap/SoapOptions.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ public function getProxyPassword()
9898
/**
9999
* Extracts a list of SOAP Client options only.
100100
*
101-
* @return array HTTP context options.
101+
* @return array SOAP context options.
102+
*
103+
* @see http://php.net/manual/en/soapclient.soapclient.php
102104
*/
103105
public function extractSoapClientOptions()
104106
{

src/Porter/Porter.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,29 @@
2020
use ScriptFUSION\Porter\Provider\Resource\ProviderResource;
2121
use ScriptFUSION\Porter\Specification\ImportSpecification;
2222

23+
/**
24+
* Imports data according to an ImportSpecification.
25+
*/
2326
class Porter
2427
{
28+
/**
29+
* @var Provider[]
30+
*/
2531
private $providers;
2632

33+
/**
34+
* @var ProviderFactory
35+
*/
2736
private $providerFactory;
2837

38+
/**
39+
* @var CollectionMapper
40+
*/
2941
private $mapper;
3042

43+
/**
44+
* @var CacheAdvice
45+
*/
3146
private $defaultCacheAdvice;
3247

3348
public function __construct()
@@ -67,7 +82,7 @@ public function import(ImportSpecification $specification)
6782
*
6883
* @param ImportSpecification $specification Import specification.
6984
*
70-
* @return mixed Data.
85+
* @return array Record.
7186
*
7287
* @throws ImportException More than one record was imported.
7388
*/

src/Porter/Specification/ImportSpecification.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
use ScriptFUSION\Porter\Cache\CacheAdvice;
66
use ScriptFUSION\Porter\Provider\Resource\ProviderResource;
77

8+
/**
9+
* Specifies which resource to import, how to import it, and how it should be transformed.
10+
*/
811
class ImportSpecification
912
{
1013
/** @var ProviderResource */

0 commit comments

Comments
 (0)