From d20fd49de7449db9bf506a07fa0dec18dfcfb561 Mon Sep 17 00:00:00 2001 From: Artsem Kamarou Date: Sun, 28 Apr 2024 15:14:24 +0300 Subject: [PATCH] Feat: add internals (#7) --- .gitattributes | 1 + .github/workflows/publish-new-tag.yaml | 26 +++++++++++++++++++ CHANGELOD.md | 3 +++ src/Processor/Condition/CompareProcessor.php | 3 +++ src/Processor/Condition/ExactlyProcessor.php | 3 +++ .../Condition/ProcessorInterface.php | 3 +++ src/Processor/Sort/ByCallbackProcessor.php | 3 +++ src/Processor/Sort/ByFieldProcessor.php | 3 +++ src/Processor/Sort/ByKeysProcessor.php | 3 +++ src/Processor/Sort/ByValuesProcessor.php | 3 +++ src/Processor/Sort/ProcessorInterface.php | 3 +++ src/Processor/Sum/ByFieldProcessor.php | 3 +++ src/Processor/Sum/DefaultProcessor.php | 3 +++ src/Processor/Sum/ProcessorInterface.php | 3 +++ src/Processor/Unique/ByFieldProcessor.php | 3 +++ src/Processor/Unique/DefaultProcessor.php | 3 +++ src/Processor/Unique/ProcessorInterface.php | 3 +++ src/Provider/ConditionProcessorProvider.php | 3 +++ src/Provider/SortProcessorProvider.php | 3 +++ src/Provider/SumProcessorProvider.php | 3 +++ src/Provider/UniqueProcessorProvider.php | 3 +++ src/Trait/ValueRetrieverTrait.php | 3 +++ 22 files changed, 87 insertions(+) create mode 100644 .github/workflows/publish-new-tag.yaml create mode 100644 CHANGELOD.md diff --git a/.gitattributes b/.gitattributes index 04dc636..09a3294 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,3 +4,4 @@ /tests export-ignore /.github export-ignore CODEOWNERS export-ignore +CHANGELOG.md export-ignore diff --git a/.github/workflows/publish-new-tag.yaml b/.github/workflows/publish-new-tag.yaml new file mode 100644 index 0000000..e82b25c --- /dev/null +++ b/.github/workflows/publish-new-tag.yaml @@ -0,0 +1,26 @@ +name: Publish new tag +on: + pull_request: + types: + - closed + branches: + - master + +jobs: + generate-tag: + if: github.event.pull_request.merged == true + runs-on: ubuntu-22.04 + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.merge_commit_sha }} + fetch-depth: '0' + + - name: Bump version and push tag + uses: anothrNick/github-tag-action@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + WITH_V: true + DEFAULT_BUMP: patch diff --git a/CHANGELOD.md b/CHANGELOD.md new file mode 100644 index 0000000..380bff6 --- /dev/null +++ b/CHANGELOD.md @@ -0,0 +1,3 @@ +### v0.0.1 +##### Features: +- Base implementation. diff --git a/src/Processor/Condition/CompareProcessor.php b/src/Processor/Condition/CompareProcessor.php index de02450..d5d9c83 100644 --- a/src/Processor/Condition/CompareProcessor.php +++ b/src/Processor/Condition/CompareProcessor.php @@ -11,6 +11,9 @@ use Temkaa\SimpleCollections\Model\ConditionInterface; use Temkaa\SimpleCollections\Trait\ValueRetrieverTrait; +/** + * @internal + */ final class CompareProcessor implements ProcessorInterface { use ValueRetrieverTrait; diff --git a/src/Processor/Condition/ExactlyProcessor.php b/src/Processor/Condition/ExactlyProcessor.php index 61b9e4e..580105b 100644 --- a/src/Processor/Condition/ExactlyProcessor.php +++ b/src/Processor/Condition/ExactlyProcessor.php @@ -10,6 +10,9 @@ use Temkaa\SimpleCollections\Model\ConditionInterface; use Temkaa\SimpleCollections\Trait\ValueRetrieverTrait; +/** + * @internal + */ final class ExactlyProcessor implements ProcessorInterface { use ValueRetrieverTrait; diff --git a/src/Processor/Condition/ProcessorInterface.php b/src/Processor/Condition/ProcessorInterface.php index b8551c4..4a71cc2 100644 --- a/src/Processor/Condition/ProcessorInterface.php +++ b/src/Processor/Condition/ProcessorInterface.php @@ -6,6 +6,9 @@ use Temkaa\SimpleCollections\Model\ConditionInterface; +/** + * @internal + */ interface ProcessorInterface { public function process(array $elements, ConditionInterface $condition): array; diff --git a/src/Processor/Sort/ByCallbackProcessor.php b/src/Processor/Sort/ByCallbackProcessor.php index 3927cd8..59a50cc 100644 --- a/src/Processor/Sort/ByCallbackProcessor.php +++ b/src/Processor/Sort/ByCallbackProcessor.php @@ -7,6 +7,9 @@ use Temkaa\SimpleCollections\Model\Sort\ByCallback; use Temkaa\SimpleCollections\Model\SortCriteriaInterface; +/** + * @internal + */ final class ByCallbackProcessor implements ProcessorInterface { /** diff --git a/src/Processor/Sort/ByFieldProcessor.php b/src/Processor/Sort/ByFieldProcessor.php index 0ed8df8..5f071ab 100644 --- a/src/Processor/Sort/ByFieldProcessor.php +++ b/src/Processor/Sort/ByFieldProcessor.php @@ -10,6 +10,9 @@ use Temkaa\SimpleCollections\Model\SortCriteriaInterface; use Temkaa\SimpleCollections\Trait\ValueRetrieverTrait; +/** + * @internal + */ final class ByFieldProcessor implements ProcessorInterface { use ValueRetrieverTrait; diff --git a/src/Processor/Sort/ByKeysProcessor.php b/src/Processor/Sort/ByKeysProcessor.php index 7af6c4f..7a4c4c8 100644 --- a/src/Processor/Sort/ByKeysProcessor.php +++ b/src/Processor/Sort/ByKeysProcessor.php @@ -8,6 +8,9 @@ use Temkaa\SimpleCollections\Model\Sort\ByKeys; use Temkaa\SimpleCollections\Model\SortCriteriaInterface; +/** + * @internal + */ final class ByKeysProcessor implements ProcessorInterface { /** diff --git a/src/Processor/Sort/ByValuesProcessor.php b/src/Processor/Sort/ByValuesProcessor.php index 7c93ab6..5979539 100644 --- a/src/Processor/Sort/ByValuesProcessor.php +++ b/src/Processor/Sort/ByValuesProcessor.php @@ -8,6 +8,9 @@ use Temkaa\SimpleCollections\Model\Sort\ByValues; use Temkaa\SimpleCollections\Model\SortCriteriaInterface; +/** + * @internal + */ final class ByValuesProcessor implements ProcessorInterface { /** diff --git a/src/Processor/Sort/ProcessorInterface.php b/src/Processor/Sort/ProcessorInterface.php index d54d438..3c23544 100644 --- a/src/Processor/Sort/ProcessorInterface.php +++ b/src/Processor/Sort/ProcessorInterface.php @@ -6,6 +6,9 @@ use Temkaa\SimpleCollections\Model\SortCriteriaInterface; +/** + * @internal + */ interface ProcessorInterface { public function process(array $elements, SortCriteriaInterface $criteria): array; diff --git a/src/Processor/Sum/ByFieldProcessor.php b/src/Processor/Sum/ByFieldProcessor.php index 69e4181..8cba1fb 100644 --- a/src/Processor/Sum/ByFieldProcessor.php +++ b/src/Processor/Sum/ByFieldProcessor.php @@ -9,6 +9,9 @@ use Temkaa\SimpleCollections\Model\SumCriteriaInterface; use Temkaa\SimpleCollections\Trait\ValueRetrieverTrait; +/** + * @internal + */ final class ByFieldProcessor implements ProcessorInterface { use ValueRetrieverTrait; diff --git a/src/Processor/Sum/DefaultProcessor.php b/src/Processor/Sum/DefaultProcessor.php index 0e47001..ce9c7e3 100644 --- a/src/Processor/Sum/DefaultProcessor.php +++ b/src/Processor/Sum/DefaultProcessor.php @@ -6,6 +6,9 @@ use Temkaa\SimpleCollections\Model\SumCriteriaInterface; +/** + * @internal + */ final class DefaultProcessor implements ProcessorInterface { public function process(array $elements, ?SumCriteriaInterface $criteria): float|int diff --git a/src/Processor/Sum/ProcessorInterface.php b/src/Processor/Sum/ProcessorInterface.php index cba75e8..2eecebd 100644 --- a/src/Processor/Sum/ProcessorInterface.php +++ b/src/Processor/Sum/ProcessorInterface.php @@ -6,6 +6,9 @@ use Temkaa\SimpleCollections\Model\SumCriteriaInterface; +/** + * @internal + */ interface ProcessorInterface { public function process(array $elements, ?SumCriteriaInterface $criteria): float|int; diff --git a/src/Processor/Unique/ByFieldProcessor.php b/src/Processor/Unique/ByFieldProcessor.php index d54c735..9b521a5 100644 --- a/src/Processor/Unique/ByFieldProcessor.php +++ b/src/Processor/Unique/ByFieldProcessor.php @@ -9,6 +9,9 @@ use Temkaa\SimpleCollections\Model\UniqueCriteriaInterface; use Temkaa\SimpleCollections\Trait\ValueRetrieverTrait; +/** + * @internal + */ final class ByFieldProcessor implements ProcessorInterface { use ValueRetrieverTrait; diff --git a/src/Processor/Unique/DefaultProcessor.php b/src/Processor/Unique/DefaultProcessor.php index c701d94..ca4e378 100644 --- a/src/Processor/Unique/DefaultProcessor.php +++ b/src/Processor/Unique/DefaultProcessor.php @@ -6,6 +6,9 @@ use Temkaa\SimpleCollections\Model\UniqueCriteriaInterface; +/** + * @internal + */ final class DefaultProcessor implements ProcessorInterface { public function process(array $elements, ?UniqueCriteriaInterface $criteria): array diff --git a/src/Processor/Unique/ProcessorInterface.php b/src/Processor/Unique/ProcessorInterface.php index 45bbf97..29187fb 100644 --- a/src/Processor/Unique/ProcessorInterface.php +++ b/src/Processor/Unique/ProcessorInterface.php @@ -6,6 +6,9 @@ use Temkaa\SimpleCollections\Model\UniqueCriteriaInterface; +/** + * @internal + */ interface ProcessorInterface { public function process(array $elements, ?UniqueCriteriaInterface $criteria): array; diff --git a/src/Provider/ConditionProcessorProvider.php b/src/Provider/ConditionProcessorProvider.php index f9793f1..3d2c6f7 100644 --- a/src/Provider/ConditionProcessorProvider.php +++ b/src/Provider/ConditionProcessorProvider.php @@ -10,6 +10,9 @@ use Temkaa\SimpleCollections\Processor\Condition\ExactlyProcessor; use Temkaa\SimpleCollections\Processor\Condition\ProcessorInterface; +/** + * @internal + */ final readonly class ConditionProcessorProvider { public function __construct( diff --git a/src/Provider/SortProcessorProvider.php b/src/Provider/SortProcessorProvider.php index 7ce33c5..fbe7c1f 100644 --- a/src/Provider/SortProcessorProvider.php +++ b/src/Provider/SortProcessorProvider.php @@ -12,6 +12,9 @@ use Temkaa\SimpleCollections\Processor\Sort\ByValuesProcessor; use Temkaa\SimpleCollections\Processor\Sort\ProcessorInterface; +/** + * @internal + */ final readonly class SortProcessorProvider { public function __construct( diff --git a/src/Provider/SumProcessorProvider.php b/src/Provider/SumProcessorProvider.php index 881ab44..e76b678 100644 --- a/src/Provider/SumProcessorProvider.php +++ b/src/Provider/SumProcessorProvider.php @@ -10,6 +10,9 @@ use Temkaa\SimpleCollections\Processor\Sum\DefaultProcessor; use Temkaa\SimpleCollections\Processor\Sum\ProcessorInterface; +/** + * @internal + */ final readonly class SumProcessorProvider { public function __construct( diff --git a/src/Provider/UniqueProcessorProvider.php b/src/Provider/UniqueProcessorProvider.php index 4a7f0b1..df607e4 100644 --- a/src/Provider/UniqueProcessorProvider.php +++ b/src/Provider/UniqueProcessorProvider.php @@ -10,6 +10,9 @@ use Temkaa\SimpleCollections\Processor\Unique\DefaultProcessor; use Temkaa\SimpleCollections\Processor\Unique\ProcessorInterface; +/** + * @internal + */ final readonly class UniqueProcessorProvider { public function __construct( diff --git a/src/Trait/ValueRetrieverTrait.php b/src/Trait/ValueRetrieverTrait.php index 561f2dd..00b6893 100644 --- a/src/Trait/ValueRetrieverTrait.php +++ b/src/Trait/ValueRetrieverTrait.php @@ -7,6 +7,9 @@ use ReflectionClass; use ReflectionException; +/** + * @internal + */ trait ValueRetrieverTrait { /**