Skip to content

Commit 93ce095

Browse files
committed
Added quickstart badges to Readme.
Changed ImportSpecification -> Import in quick start guides. Changed PHPUnit tests to execute in random instead of deterministic order. Fixed old reference to AsyncImportSpecification in Readme.
1 parent 934e199 commit 93ce095

File tree

6 files changed

+41
-22
lines changed

6 files changed

+41
-22
lines changed

.github/workflows/Quickstart Symfony.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ jobs:
5050
ScriptFUSION\Porter\Porter:
5151
arguments:
5252
- '@providers'
53-
53+
5454
providers:
5555
class: Symfony\Component\DependencyInjection\ServiceLocator
5656
arguments:
5757
-
5858
- '@ScriptFUSION\Porter\Provider\Steam\SteamProvider'
59-
59+
6060
ScriptFUSION\Porter\Provider\Steam\SteamProvider: ~
6161
.
6262
@@ -65,25 +65,25 @@ jobs:
6565
cat <<'.' | >src/Controller/AppListAction.php sed 's/ *//'
6666
<?php
6767
declare(strict_types=1);
68-
68+
6969
namespace App\Controller;
70-
70+
71+
use ScriptFUSION\Porter\Import\Import;
7172
use ScriptFUSION\Porter\Porter;
7273
use ScriptFUSION\Porter\Provider\Steam\Resource\GetAppList;
73-
use ScriptFUSION\Porter\Specification\ImportSpecification;
7474
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
7575
use Symfony\Component\HttpFoundation\Response;
7676
use Symfony\Component\HttpFoundation\StreamedResponse;
7777
use Symfony\Component\Routing\Annotation\Route;
78-
78+
7979
final class AppListAction extends AbstractController
8080
{
8181
#[Route('/')]
8282
public function __invoke(Porter $porter): Response
8383
{
8484
return new StreamedResponse(
8585
function () use ($porter): void {
86-
foreach ($porter->import(new ImportSpecification(new GetAppList())) as $app) {
86+
foreach ($porter->import(new Import(new GetAppList())) as $app) {
8787
echo "$app[appid]\n";
8888
}
8989
},

.github/workflows/Quickstart.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ jobs:
3333
- name: Initialize Composer project
3434
run: composer init --name foo/bar
3535

36+
- name: Configure minimum stability for Amp v3.
37+
run: |
38+
composer config minimum-stability beta
39+
composer config prefer-stable true
40+
3641
- name: Require ECB
3742
run: composer require provider/european-central-bank
3843

@@ -45,26 +50,26 @@ jobs:
4550
<?php
4651
4752
use Joomla\DI\Container;
53+
use ScriptFUSION\Porter\Import\Import;
4854
use ScriptFUSION\Porter\Porter;
4955
use ScriptFUSION\Porter\Provider\EuropeanCentralBank\Provider\EuropeanCentralBankProvider;
5056
use ScriptFUSION\Porter\Provider\EuropeanCentralBank\Provider\Resource\DailyForexRates;
51-
use ScriptFUSION\Porter\Specification\ImportSpecification;
5257
5358
require 'vendor/autoload.php';
5459
5560
$container = new Container;
5661
$container->set(EuropeanCentralBankProvider::class, new EuropeanCentralBankProvider);
5762
5863
$porter = new Porter($container);
59-
$rates = $porter->import(new ImportSpecification(new DailyForexRates));
64+
$rates = $porter->import(new Import(new DailyForexRates));
6065
6166
foreach ($rates as $rate) {
6267
echo "$rate[currency]: $rate[rate]\n";
6368
}
6469
.
6570
6671
- name: Test output contains USD
67-
run: "grep --perl-regexp '^USD: [\\d.]+$' out"
72+
run: 'grep --perl-regexp ''^USD: [\d.]+$'' out'
6873

6974
- name: Test output contains between 30-40 lines
7075
run: |

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
Porter <img src="https://github.com/ScriptFUSION/Porter/blob/master/docs/images/porter%20222x.png?raw=true" align="right">
22
======
33

4-
[![Latest version][Version image]][Releases]
5-
[![Total downloads][Downloads image]][Downloads]
6-
[![Build status][Build image]][Build]
7-
[![Mutation score][MSI image]][MSI report]
8-
[![Test coverage][Coverage image]][Coverage]
4+
[![Version image]][Releases]
5+
[![Downloads image]][Downloads]
6+
[![Build image]][Build]
7+
[![Quickstart image]][Quickstart build]
8+
[![Quickstart Symfony image]][Quickstart Symfony build]
9+
[![Coverage image]][Coverage]
10+
[![Mutation score image][MSI image]][MSI report]
911

1012
### Durable and concurrent data imports for consuming data at scale and publishing testable SDKs
1113

@@ -214,7 +216,7 @@ Synchronously, we seldom trip protection measures even for high volume imports,
214216
A `DualThrottle` can be assigned by modifying the import specification as follows.
215217
216218
```php
217-
(new AsyncImportSpecification)->setThrottle(new DualThrottle)
219+
(new Import)->setThrottle(new DualThrottle)
218220
```
219221
220222
#### ThrottledConnector
@@ -534,15 +536,19 @@ Porter is supported by [JetBrains for Open Source][] products.
534536
[Downloads image]: https://poser.pugx.org/scriptfusion/porter/downloads "Total downloads"
535537
[Build]: https://github.com/ScriptFUSION/Porter/actions/workflows/Tests.yaml
536538
[Build image]: https://github.com/ScriptFUSION/Porter/actions/workflows/Tests.yaml/badge.svg "Build status"
537-
[MSI image]: https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2FScriptFUSION%2FPorter%2Fmaster
539+
[Quickstart build]: https://github.com/ScriptFUSION/Porter/actions/workflows/Quickstart.yaml
540+
[Quickstart image]: https://github.com/ScriptFUSION/Porter/actions/workflows/Quickstart.yaml/badge.svg "Quick start build status"
541+
[Quickstart Symfony build]: https://github.com/ScriptFUSION/Porter/actions/workflows/Quickstart%20Symfony.yaml
542+
[Quickstart Symfony image]: https://github.com/ScriptFUSION/Porter/actions/workflows/Quickstart%20Symfony.yaml/badge.svg "Symfony quick start build status"
538543
[MSI report]: https://dashboard.stryker-mutator.io/reports/github.com/ScriptFUSION/Porter/master
544+
[MSI image]: https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2FScriptFUSION%2FPorter%2Fmaster "Mutation score"
539545
[Coverage]: https://codecov.io/gh/ScriptFUSION/Porter
540546
[Coverage image]: https://codecov.io/gh/ScriptFUSION/Porter/branch/master/graphs/badge.svg "Test coverage"
541547

542548
[Issues]: https://github.com/ScriptFUSION/Porter/issues
543549
[PRs]: https://github.com/ScriptFUSION/Porter/pulls
544550
[Quickstart]: https://github.com/ScriptFUSION/Porter/tree/master/docs/Quickstart.md
545-
[Symfony quickstart]: https://github.com/ScriptFUSION/Porter/tree/master/docs/Quickstart%20Symfony.md
551+
[Symfony quickstart]: https://github.com/ScriptFUSION/Porter/tree/master/docs/Quickstart%20Symfony.md
546552
[Provider]: https://github.com/provider
547553
[Porter transformers]: https://github.com/Porter-transformers
548554
[Porter connectors]: https://github.com/Porter-connectors

docs/Quickstart Symfony.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,14 @@ Refreshing our browser now should recompile the Symfony DI container and show us
137137
Let's replace the previous `StreamedResponse` closure with a new implementation that uses Porter to import data from the `GetAppList` resource (a resource belonging to `SteamProvider`).
138138

139139
```diff
140+
+use ScriptFUSION\Porter\Import\Import;
140141
use ScriptFUSION\Porter\Porter;
141142
+use ScriptFUSION\Porter\Provider\Steam\Resource\GetAppList;
142-
+use ScriptFUSION\Porter\Specification\ImportSpecification;
143143
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
144144
145145
- fn () => print 'Hello, Porter!',
146146
+ function () use ($porter): void {
147-
+ foreach ($porter->import(new ImportSpecification(new GetAppList())) as $app) {
147+
+ foreach ($porter->import(new Import(new GetAppList())) as $app) {
148148
+ echo "$app[appid]\n";
149149
+ }
150150
+ },
@@ -158,9 +158,9 @@ declare(strict_types=1);
158158
159159
namespace App\Controller;
160160
161+
use ScriptFUSION\Porter\Import\Import;
161162
use ScriptFUSION\Porter\Porter;
162163
use ScriptFUSION\Porter\Provider\Steam\Resource\GetAppList;
163-
use ScriptFUSION\Porter\Specification\ImportSpecification;
164164
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
165165
use Symfony\Component\HttpFoundation\Response;
166166
use Symfony\Component\HttpFoundation\StreamedResponse;
@@ -173,7 +173,7 @@ final class AppListAction extends AbstractController
173173
{
174174
return new StreamedResponse(
175175
function () use ($porter): void {
176-
foreach ($porter->import(new ImportSpecification(new GetAppList())) as $app) {
176+
foreach ($porter->import(new Import(new GetAppList())) as $app) {
177177
echo "$app[appid]\n";
178178
}
179179
},

docs/Quickstart.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ composer init
1313

1414
For this demo we'll use the [European Central Bank][ECB provider] (ECB) provider by including it in our `composer.json` with the following command.
1515

16+
>Note: The ECB provider requires [Amp v3][], which is currently in beta, so we need to allow beta dependencies temporarily. This can be enabled with the following commands.
17+
> ```sh
18+
> composer config minimum-stability beta
19+
> composer config prefer-stable true
20+
> ```
21+
1622
```sh
1723
composer require provider/european-central-bank
1824
```
@@ -77,3 +83,4 @@ This just scratches the surface of Porter without going into any details. Explor
7783
[PSR-11 search]: https://packagist.org/explore/?type=library&tags=psr-11
7884
[Joomla DI]: https://github.com/joomla-framework/di
7985
[Symfony quickstart guide]: Quickstart%20Symfony.md
86+
[Amp v3]: https://v3.amphp.org

test/phpunit.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<phpunit
22
beStrictAboutOutputDuringTests="true"
3+
executionOrder="random"
34
>
45
<testsuite name="all">
56
<directory>.</directory>

0 commit comments

Comments
 (0)