Skip to content

Commit a25b6d4

Browse files
committed
DEVSUPP-160: Added interface
1 parent 76ce4a8 commit a25b6d4

4 files changed

Lines changed: 25 additions & 4 deletions

File tree

src/Service/BaseImporter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use App\Repository\SystemRepository;
88
use App\Repository\GroupRepository;
99

10-
class BaseImporter
10+
abstract class BaseImporter implements ImportInterface
1111
{
1212
protected $entityManager;
1313
protected $reportRepository;

src/Service/ImportInterface.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
4+
namespace App\Service;
5+
6+
interface ImportInterface
7+
{
8+
/**
9+
* Import the given source.
10+
*
11+
* @param string $src
12+
* Path to the source
13+
*/
14+
function import(string $src);
15+
}

src/Service/ReportImporter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77

88
class ReportImporter extends BaseImporter
99
{
10-
public function import($src)
10+
/**
11+
* @inheritDoc
12+
*/
13+
public function import(string $src)
1114
{
1215
$systemURL = getenv('SYSTEM_URL');
1316

src/Service/SystemImporter.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@ public function __construct(
2222
SelfServiceAvailableFromItemRepository $selfServiceAvailableFromItemRepository,
2323
EntityManagerInterface $entityManager
2424
) {
25-
parent::__construct( $reportRepository, $systemRepository, $groupRepository, $entityManager);
25+
parent::__construct($reportRepository, $systemRepository, $groupRepository, $entityManager);
2626

2727
$this->selfServiceAvailableFromItemRepository = $selfServiceAvailableFromItemRepository;
2828
}
2929

30-
public function import($src)
30+
/**
31+
* @inheritDoc
32+
*/
33+
public function import(string $src)
3134
{
3235
$systemURL = getenv('SYSTEM_URL');
3336

0 commit comments

Comments
 (0)