-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Introduce connection information, resolves #33
- Loading branch information
Showing
20 changed files
with
714 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
2024-10-31 Francois Suter (Idéative) <[email protected]> | ||
|
||
* Introduce connection information, resolves #33 | ||
|
||
2024-07-20 Francois Suter (Idéative) <[email protected]> | ||
|
||
* Introduce call context , resolves #30 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
namespace Cobweb\Svconnector\Domain\Model\Dto; | ||
|
||
use Cobweb\Svconnector\Exception\NoSuchDataException; | ||
|
||
/** | ||
* DTO class for managing a simple data storage. | ||
*/ | ||
abstract class AbstractDataObject | ||
{ | ||
protected array $data = []; | ||
|
||
public function get(): array | ||
{ | ||
return $this->data; | ||
} | ||
|
||
/** | ||
* @throws NoSuchDataException | ||
*/ | ||
public function getForKey(string $key): ?array | ||
{ | ||
if (array_key_exists($key, $this->data)) { | ||
return $this->data[$key]; | ||
} | ||
throw new NoSuchDataException( | ||
sprintf('No value found in context for key "%s".', $key), | ||
1721494427 | ||
); | ||
} | ||
|
||
public function set(array $data): void | ||
{ | ||
$this->data = $data; | ||
} | ||
|
||
public function add(string $key, mixed $value): void | ||
{ | ||
$this->data[$key] = $value; | ||
} | ||
|
||
public function reset(): void | ||
{ | ||
$this->data = []; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
namespace Cobweb\Svconnector\Domain\Model\Dto; | ||
|
||
/** | ||
* DTO class for managing connection information. | ||
* | ||
* Connection to third-party sources may require some form of authentication, for example | ||
* returning a token. This kind of information can be stored in the connection information, | ||
* which can later be used in the connection parameters. | ||
*/ | ||
class ConnectionInformation extends AbstractDataObject {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
namespace Cobweb\Svconnector\Event; | ||
|
||
use Cobweb\Svconnector\Service\ConnectorBase; | ||
|
||
final class InitializeConnectorEvent | ||
{ | ||
protected ConnectorBase $connector; | ||
|
||
public function __construct(ConnectorBase $connector) | ||
{ | ||
$this->connector = $connector; | ||
} | ||
|
||
public function getConnector(): ConnectorBase | ||
{ | ||
return $this->connector; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
namespace Cobweb\Svconnector\Event; | ||
|
||
final class ProcessParametersEvent | ||
{ | ||
protected array $parameters; | ||
|
||
public function __construct(array $parameters) | ||
{ | ||
$this->parameters = $parameters; | ||
} | ||
|
||
public function getParameters(): array | ||
{ | ||
return $this->parameters; | ||
} | ||
|
||
public function setParameters(array $parameters): void | ||
{ | ||
$this->parameters = $parameters; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.