28
28
use function Amp \call ;
29
29
30
30
/**
31
- * Imports data from a provider defined in the providers container or internal factory.
31
+ * Imports data from a provider defined in the container of providers or the internal factory.
32
32
*/
33
33
class Porter
34
34
{
@@ -53,11 +53,12 @@ public function __construct(ContainerInterface $providers)
53
53
}
54
54
55
55
/**
56
- * Imports data according to the design of the specified import specification.
56
+ * Imports a one or more records from the resource contained in the specified import specification.
57
57
*
58
58
* @param ImportSpecification $specification Import specification.
59
59
*
60
- * @return PorterRecords|CountablePorterRecords
60
+ * @return PorterRecords|CountablePorterRecords Collection of records. If the total size of the collection is known,
61
+ * the collection may implement Countable, otherwise PorterRecords is returned.
61
62
*/
62
63
public function import (ImportSpecification $ specification ): PorterRecords
63
64
{
@@ -75,7 +76,7 @@ public function import(ImportSpecification $specification): PorterRecords
75
76
}
76
77
77
78
/**
78
- * Imports one record according to the design of the specified import specification.
79
+ * Imports one record from the resource contained in the specified import specification.
79
80
*
80
81
* @param ImportSpecification $specification Import specification.
81
82
*
@@ -122,11 +123,13 @@ private function fetch(ImportSpecification $specification): \Iterator
122
123
}
123
124
124
125
/**
125
- * Imports data asynchronously according to the design of the specified asynchronous import specification.
126
+ * Imports one or more records asynchronously from the resource contained in the specified asynchronous import
127
+ * specification.
126
128
*
127
129
* @param AsyncImportSpecification $specification Asynchronous import specification.
128
130
*
129
- * @return AsyncPorterRecords|CountableAsyncPorterRecords
131
+ * @return AsyncPorterRecords|CountableAsyncPorterRecords Collection of records. If the total size of the
132
+ * collection is known, the collection may implement Countable, otherwise AsyncPorterRecords is returned.
130
133
*/
131
134
public function importAsync (AsyncImportSpecification $ specification ): AsyncRecordCollection
132
135
{
@@ -148,11 +151,11 @@ public function importAsync(AsyncImportSpecification $specification): AsyncRecor
148
151
}
149
152
150
153
/**
151
- * Imports one record according to the design of the specified asynchronous import specification.
154
+ * Imports one record from the resource contained in the specified asynchronous import specification.
152
155
*
153
156
* @param AsyncImportSpecification $specification Asynchronous import specification.
154
157
*
155
- * @return Promise Promise that resolves to a record .
158
+ * @return Promise<array|null> Record .
156
159
*/
157
160
public function importOneAsync (AsyncImportSpecification $ specification ): Promise
158
161
{
@@ -265,7 +268,7 @@ private function createAsyncPorterRecords(
265
268
*
266
269
* @param string $name Provider name.
267
270
*
268
- * @return Provider|AsyncProvider
271
+ * @return Provider|AsyncProvider Provider.
269
272
*
270
273
* @throws ProviderNotFoundException The specified provider was not found.
271
274
*/
0 commit comments