From 6d814b99bfe76ad509022aa52c07e3656f05e228 Mon Sep 17 00:00:00 2001 From: Romans Malinovskis Date: Sun, 1 Dec 2019 23:08:17 +0000 Subject: [PATCH 1/8] Clean up badges in README file (#116) * improve badges * cleanup * wip * wip * wip --- .github/workflows/unit-tests.yml | 7 ++++++- README.md | 5 +---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 3284891b..cf671a36 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -1,7 +1,12 @@ name: Unit Testing on: - pull_request + pull_request: + branches: '*' + push: + branches: + - master + - develop jobs: unit-test: diff --git a/README.md b/README.md index 29e71132..13834f9f 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,11 @@ **Collection of PHP Traits for designing object-oriented frameworks.** -[![Build Status](https://travis-ci.org/atk4/core.png?branch=develop)](https://travis-ci.org/atk4/core) +![Build](https://github.com/atk4/core/workflows/Unit%20Testing/badge.svg) [![Code Climate](https://codeclimate.com/github/atk4/core/badges/gpa.svg)](https://codeclimate.com/github/atk4/core) [![StyleCI](https://styleci.io/repos/57242416/shield)](https://styleci.io/repos/57242416) [![CodeCov](https://codecov.io/gh/atk4/core/branch/develop/graph/badge.svg)](https://codecov.io/gh/atk4/core) [![Test Coverage](https://codeclimate.com/github/atk4/core/badges/coverage.svg)](https://codeclimate.com/github/atk4/core/coverage) -[![Issue Count](https://codeclimate.com/github/atk4/core/badges/issue_count.svg)](https://codeclimate.com/github/atk4/core) - -[![License](https://poser.pugx.org/atk4/core/license)](https://packagist.org/packages/atk4/core) [![GitHub release](https://img.shields.io/github/release/atk4/core.svg?maxAge=2592000)](CHANGELOG.md) From fb62b2893c489e5bf49b910d4c4e5aa5b837a197 Mon Sep 17 00:00:00 2001 From: Georg Marx Date: Mon, 20 Jan 2020 13:05:40 +0100 Subject: [PATCH 2/8] Configuration Elements cannot be replaced (#117) --- src/ConfigTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ConfigTrait.php b/src/ConfigTrait.php index d01bc028..6bec6f97 100644 --- a/src/ConfigTrait.php +++ b/src/ConfigTrait.php @@ -94,7 +94,7 @@ public function readConfig($files = ['config.php'], $format = 'php') $configs[] = $tempConfig; } - $this->config = array_merge_recursive($this->config, ...$configs); + $this->config = array_replace_recursive($this->config, ...$configs); return $this; } From 2872fdbb38f99df2c01f007f87ab11154e29826f Mon Sep 17 00:00:00 2001 From: Imants Horsts Date: Mon, 20 Jan 2020 12:06:10 +0000 Subject: [PATCH 3/8] Apply fixes from StyleCI --- src/CollectionTrait.php | 2 +- src/DynamicMethodTrait.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/CollectionTrait.php b/src/CollectionTrait.php index 6635277b..ca62b6cc 100644 --- a/src/CollectionTrait.php +++ b/src/CollectionTrait.php @@ -54,7 +54,7 @@ public function _addIntoCollection(string $name, object $object, string $collect 'Object with requested name already exist in collection', 'name' => $name, 'collection'=> $collection, - ]); + ]); } $this->{$collection}[$name] = $object; diff --git a/src/DynamicMethodTrait.php b/src/DynamicMethodTrait.php index 75e30308..ecc67edb 100644 --- a/src/DynamicMethodTrait.php +++ b/src/DynamicMethodTrait.php @@ -30,10 +30,10 @@ public function __call(string $method, $arguments) throw new Exception([ 'Method '.$method.' is not defined for this object', - 'class' => get_class($this), - 'method' => $method, - 'arguments' => $arguments, - ]); + 'class' => get_class($this), + 'method' => $method, + 'arguments' => $arguments, + ]); } /** From 7b08c270b4c1f418d774007710a6fe7cb278f731 Mon Sep 17 00:00:00 2001 From: Imants Horsts Date: Tue, 11 Feb 2020 16:52:12 +0200 Subject: [PATCH 4/8] Update composer.json --- composer.json | 95 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 56 insertions(+), 39 deletions(-) diff --git a/composer.json b/composer.json index a32f3948..493d6068 100644 --- a/composer.json +++ b/composer.json @@ -1,42 +1,59 @@ { - "name": "atk4/core", - "type": "library", - "description": "Agile Core - collection of PHP Traits for designing object-oriented frameworks", - "keywords": ["php", "framework", "trains", "agile toolkit"], - "homepage": "https://github.com/atk4/core", - "license": "MIT", - "minimum-stability": "dev", - "prefer-stable": true, - "authors": [ - { - "name": "Romans Malinovskis", - "email": "romans@agiletoolkit.org", - "homepage": "https://nearly.guru/" - } - ], - "require": { - "php": ">=7.2.0", - "psr/log": "~1.0", - "ext-json": "*" - }, - "require-dev": { - "phpunit/phpunit": "*", - "symfony/yaml": "~2.1|~3.0|~4.0", - "satooshi/php-coveralls": "^1.0", - "codeclimate/php-test-reporter": "*", - "symfony/contracts": "^1.1", - "atk4/data": "dev-develop" - }, - "replace": { - "atk4/core": "self.version" - }, - "suggest": { - "symfony/yaml": "~2.1|~3.0|~4.0" - }, - "autoload": { - "psr-4": {"atk4\\core\\":"src/"} - }, - "autoload-dev": { - "psr-4": {"atk4\\core\\tests\\":"tests/"} + "name": "atk4/core", + "type": "library", + "description": "Agile Core - collection of PHP Traits for designing object-oriented frameworks", + "keywords": [ + "php", + "framework", + "traits", + "agile toolkit" + ], + "homepage": "https://github.com/atk4/core", + "license": "MIT", + "minimum-stability": "dev", + "prefer-stable": true, + "authors": [ + { + "name": "Romans Malinovskis", + "email": "romans@agiletoolkit.org", + "homepage": "https://nearly.guru/" } + ], + "require": { + "php": ">=7.2.0", + "psr/log": "~1.0", + "ext-json": "*" + }, + "require-dev": { + "phpunit/phpunit": "*", + "symfony/yaml": "~2.1|~3.0|~4.0", + "satooshi/php-coveralls": "^1.0", + "codeclimate/php-test-reporter": "*", + "symfony/contracts": "^1.1", + "atk4/data": "dev-develop" + }, + "require-dev-release": { + "phpunit/phpunit": "*", + "symfony/yaml": "~2.1|~3.0|~4.0", + "satooshi/php-coveralls": "^1.0", + "codeclimate/php-test-reporter": "*", + "symfony/contracts": "^1.1", + "atk4/data": "^2.0" + }, + "replace": { + "atk4/core": "self.version" + }, + "suggest": { + "symfony/yaml": "~2.1|~3.0|~4.0" + }, + "autoload": { + "psr-4": { + "atk4\\core\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "atk4\\core\\tests\\": "tests/" + } + } } From 6b016459249f60f820a55128913a17c0efbbb9c4 Mon Sep 17 00:00:00 2001 From: Imants Horsts Date: Tue, 11 Feb 2020 16:53:33 +0200 Subject: [PATCH 5/8] Update release-drafter.yml --- .github/release-drafter.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 27bcee3f..937faadd 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -1,3 +1,4 @@ +# See https://github.com/release-drafter/release-drafter#configuration template: | ## What’s Changed From 410e491291d8624169c8a64de02f990645d2fd28 Mon Sep 17 00:00:00 2001 From: Imants Horsts Date: Tue, 11 Feb 2020 16:54:38 +0200 Subject: [PATCH 6/8] Update release-drafter.yml --- .github/workflows/release-drafter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 59fb9817..68fcd9a7 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -11,6 +11,6 @@ jobs: runs-on: ubuntu-latest steps: # Drafts your next Release notes as Pull Requests are merged into "master" - - uses: toolmantim/release-drafter@v5.2.0 + - uses: toolmantim/release-drafter@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From d3612e5efdde47230802a7368c3d6ddda3deed62 Mon Sep 17 00:00:00 2001 From: Imants Horsts Date: Tue, 11 Feb 2020 16:57:20 +0200 Subject: [PATCH 7/8] Create bundler.yml --- .github/workflows/bundler.yml | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/bundler.yml diff --git a/.github/workflows/bundler.yml b/.github/workflows/bundler.yml new file mode 100644 index 00000000..107fac9c --- /dev/null +++ b/.github/workflows/bundler.yml @@ -0,0 +1,43 @@ +name: Bundler + +on: create + +jobs: + autocommit: + name: Update to stable dependencies + if: startsWith(github.ref, 'refs/heads/release/') + runs-on: ubuntu-latest + container: + image: atk4/image:latest # https://github.com/atk4/image + steps: + - uses: actions/checkout@master + - run: echo ${{ github.ref }} + - name: Update to stable dependencies + run: | + # replaces X keys with X-release keys + jq '. as $in | reduce (keys_unsorted[] | select(endswith("-release")|not)) as $k ({}; . + {($k) : (($k + "-release") as $kr | $in | if has($kr) then .[$kr] else .[$k] end) } )' < composer.json > tmp && mv tmp composer.json + v=$(echo ${{ github.ref }} | cut -d / -f 4) + echo "::set-env name=version::$v" + + - uses: teaminkling/autocommit@master + with: + commit-message: Setting release dependencies + - uses: ad-m/github-push-action@master + with: + branch: ${{ github.ref }} + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: pull-request + uses: romaninsh/pull-request@master + with: + source_branch: "release/${{ env.version }}" + destination_branch: "master" # If blank, default: master + pr_title: "Releasing ${{ env.version }} into master" + pr_body: | + - [ ] Review changes (must include stable dependencies) + - [ ] Merge this PR into master (will delete ${{ github.ref }}) + - [ ] Go to Releases and create TAG from master + Do not merge master into develop + pr_reviewer: "romaninsh" + pr_assignee: "romaninsh" + github_token: ${{ secrets.GITHUB_TOKEN }} From 1642bd65c5dbf2ef953b7d0c8acca651a1a2ce2a Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 11 Feb 2020 15:00:09 +0000 Subject: [PATCH 8/8] Setting release dependencies --- composer.json | 8 -------- 1 file changed, 8 deletions(-) diff --git a/composer.json b/composer.json index 493d6068..7fde8761 100644 --- a/composer.json +++ b/composer.json @@ -25,14 +25,6 @@ "ext-json": "*" }, "require-dev": { - "phpunit/phpunit": "*", - "symfony/yaml": "~2.1|~3.0|~4.0", - "satooshi/php-coveralls": "^1.0", - "codeclimate/php-test-reporter": "*", - "symfony/contracts": "^1.1", - "atk4/data": "dev-develop" - }, - "require-dev-release": { "phpunit/phpunit": "*", "symfony/yaml": "~2.1|~3.0|~4.0", "satooshi/php-coveralls": "^1.0",