-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add VariablesService, remove support for TYPO3 10 (#29)
- Loading branch information
Showing
21 changed files
with
393 additions
and
280 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
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,31 @@ | ||
<?php | ||
/* | ||
* 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 TYPO3 source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
namespace Sinso\Variables\Domain\Model; | ||
|
||
class Marker | ||
{ | ||
public function __construct( | ||
public int $uid, | ||
public string $key, | ||
public string $replacement, | ||
// public ?int $smallestValueFromTimeFields, | ||
) { | ||
} | ||
|
||
public function getMarkerWithBrackets(): string | ||
{ | ||
return '{{' . $this->key . '}}'; | ||
} | ||
} |
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,47 @@ | ||
<?php | ||
/* | ||
* 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 TYPO3 source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
namespace Sinso\Variables\Domain\Model; | ||
|
||
use Ramsey\Collection\AbstractArray; | ||
|
||
class MarkerCollection extends AbstractArray | ||
{ | ||
public function getType(): string | ||
{ | ||
return Marker::class; | ||
} | ||
|
||
public function add(Marker $marker): void | ||
{ | ||
$this[$marker->getMarkerWithBrackets()] = $marker; | ||
} | ||
|
||
/** | ||
* @throws \RuntimeException | ||
*/ | ||
public function get(string $markerKey): Marker | ||
{ | ||
if (!isset($this[$markerKey])) { | ||
throw new \RuntimeException('Marker not found'); | ||
} | ||
|
||
return $this[$markerKey]; | ||
} | ||
|
||
public function getMarkerKeys(): array | ||
{ | ||
return array_keys($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
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.