Skip to content

Commit

Permalink
Enhancement: Synchronize with ergebnis/php-library-template
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Jan 19, 2020
1 parent 7a0cb8d commit 491ddff
Show file tree
Hide file tree
Showing 24 changed files with 204 additions and 58 deletions.
6 changes: 0 additions & 6 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,8 @@ update_configs:
commit_message:
include_scope: true
prefix: "Build"
default_assignees:
- "ergebnis-bot"
- "localheinz"
default_labels:
- "dependency"
default_reviewers:
- "ergebnis-bot"
- "localheinz"
directory: "/"
package_manager: "php:composer"
update_schedule: "live"
Expand Down
2 changes: 2 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ repository:
allow_merge_commit: true
allow_rebase_merge: false
allow_squash_merge: false
archived: false
default_branch: "master"
delete_branch_on_merge: true
description: ":mag: Provides a finder for classy elements."
has_downloads: true
has_issues: true
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
uses: "actions/checkout@v2.0.0"

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@1.7.0"
uses: "shivammathur/setup-php@1.7.3"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
uses: "actions/checkout@v2.0.0"

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@1.7.0"
uses: "shivammathur/setup-php@1.7.3"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
Expand Down Expand Up @@ -140,7 +140,7 @@ jobs:
uses: "actions/checkout@v2.0.0"

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@1.7.0"
uses: "shivammathur/setup-php@1.7.3"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
Expand Down Expand Up @@ -200,7 +200,7 @@ jobs:
uses: "actions/checkout@v2.0.0"

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@1.7.0"
uses: "shivammathur/setup-php@1.7.3"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
Expand Down Expand Up @@ -252,7 +252,7 @@ jobs:
uses: "actions/checkout@v2.0.0"

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@1.7.0"
uses: "shivammathur/setup-php@1.7.3"
with:
coverage: "xdebug"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
Expand Down Expand Up @@ -306,7 +306,7 @@ jobs:
uses: "actions/checkout@v2.0.0"

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@1.7.0"
uses: "shivammathur/setup-php@1.7.3"
with:
coverage: "xdebug"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
Expand Down
85 changes: 85 additions & 0 deletions .github/workflows/license.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

name: "License"

on:
schedule:
- cron: "1 0 1 1 *"

env:
REQUIRED_PHP_EXTENSIONS: "mbstring, tokenizer"

jobs:
license:
name: "License"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.1"

dependencies:
- "locked"

steps:
- name: "Checkout"
uses: "actions/checkout@v2.0.0"

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@1.7.3"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"

- name: "Validate composer.json and composer.lock"
run: "composer validate --strict"

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v1.0.3"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Install lowest dependencies with composer"
if: "matrix.dependencies == 'lowest'"
run: "composer update --no-interaction --no-progress --no-suggest --prefer-lowest"

- name: "Install locked dependencies with composer"
if: "matrix.dependencies == 'locked'"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Install highest dependencies with composer"
if: "matrix.dependencies == 'highest'"
run: "composer update --no-interaction --no-progress --no-suggest"

- name: "Create cache directory for friendsofphp/php-cs-fixer"
run: "mkdir -p .build/php-cs-fixer"

- name: "Cache cache directory for friendsofphp/php-cs-fixer"
uses: "actions/cache@v1.0.3"
with:
path: ".build/php-cs-fixer"
key: "php-${{ matrix.php-version }}-php-cs-fixer-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-php-cs-fixer-"

- name: "Run friendsofphp/php-cs-fixer"
run: "vendor/bin/php-cs-fixer fix --config=.php_cs --diff --diff-format=udiff --dry-run --verbose"

- name: "Open pull request updating license year"
uses: "gr2m/create-or-update-pull-request-action@v1.2.9"
with:
author: "ergebnis-bot <bot@ergebn.is>"
branch: "feature/license-year"
body: |
This PR
* [x] updates the license year
commit-message: "Enhancement: Update license year"
path: "."
title: "Enhancement: Update license year"
env:
GITHUB_TOKEN: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"
24 changes: 14 additions & 10 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,30 @@
declare(strict_types=1);

/**
* Copyright (c) 2017 Andreas Möller
* Copyright (c) 2017-2020 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
* the LICENSE.md file that was distributed with this source code.
*
* @see https://github.com/ergebnis/classy
*/

use Ergebnis\License;
use Ergebnis\PhpCsFixer\Config;

$header = <<<'EOF'
Copyright (c) 2017 Andreas Möller
$license = License\Type\MIT::markdown(
__DIR__ . '/LICENSE.md',
License\Range::since(
License\Year::fromString('2017'),
new \DateTimeZone('UTC')
),
License\Holder::fromString('Andreas Möller'),
License\Url::fromString('https://github.com/ergebnis/classy')
);

For the full copyright and license information, please view
the LICENSE file that was distributed with this source code.
$license->save();

@see https://github.com/ergebnis/classy
EOF;

$config = Config\Factory::fromRuleSet(new Config\RuleSet\Php71($header));
$config = Config\Factory::fromRuleSet(new Config\RuleSet\Php71($license->header()));

$config->getFinder()
->ignoreDotFiles(false)
Expand Down
8 changes: 4 additions & 4 deletions LICENSE → LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
The MIT License (MIT)
# The MIT License (MIT)

Copyright (c) 2017 Andreas Möller
Copyright (c) 2017-2020 Andreas Möller

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
documentation files (the _Software_), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
THE SOFTWARE IS PROVIDED **AS IS**, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

[![Continuous Deployment](https://github.com/ergebnis/classy/workflows/Continuous%20Deployment/badge.svg)](https://github.com/ergebnis/classy/actions)
[![Continuous Integration](https://github.com/ergebnis/classy/workflows/Continuous%20Integration/badge.svg)](https://github.com/ergebnis/classy/actions)

[![Code Coverage](https://codecov.io/gh/ergebnis/classy/branch/master/graph/badge.svg)](https://codecov.io/gh/ergebnis/classy)
[![Type Coverage](https://shepherd.dev/github/ergebnis/classy/coverage.svg)](https://shepherd.dev/github/ergebnis/classy)

[![Latest Stable Version](https://poser.pugx.org/ergebnis/classy/v/stable)](https://packagist.org/packages/ergebnis/classy)
[![Total Downloads](https://poser.pugx.org/ergebnis/classy/downloads)](https://packagist.org/packages/ergebnis/classy)

Expand Down Expand Up @@ -86,7 +88,7 @@ Please have a look at [`CODE_OF_CONDUCT.md`](https://github.com/ergebnis/.github

## License

This package is licensed using the MIT License.
This package is licensed using the [MIT License](LICENSE.md).

## Credits

Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
},
"require-dev": {
"ergebnis/composer-normalize": "^2.2.2",
"ergebnis/license": "~0.1.0",
"ergebnis/php-cs-fixer-config": "^1.1.3",
"ergebnis/phpstan-rules": "~0.14.2",
"ergebnis/test-util": "~0.7.0",
Expand Down
60 changes: 59 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Construct.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
declare(strict_types=1);

/**
* Copyright (c) 2017 Andreas Möller
* Copyright (c) 2017-2020 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
* the LICENSE.md file that was distributed with this source code.
*
* @see https://github.com/ergebnis/classy
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Constructs.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
declare(strict_types=1);

/**
* Copyright (c) 2017 Andreas Möller
* Copyright (c) 2017-2020 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
* the LICENSE.md file that was distributed with this source code.
*
* @see https://github.com/ergebnis/classy
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Exception/DirectoryDoesNotExist.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
declare(strict_types=1);

/**
* Copyright (c) 2017 Andreas Möller
* Copyright (c) 2017-2020 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
* the LICENSE.md file that was distributed with this source code.
*
* @see https://github.com/ergebnis/classy
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
declare(strict_types=1);

/**
* Copyright (c) 2017 Andreas Möller
* Copyright (c) 2017-2020 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
* the LICENSE.md file that was distributed with this source code.
*
* @see https://github.com/ergebnis/classy
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Exception/MultipleDefinitionsFound.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
declare(strict_types=1);

/**
* Copyright (c) 2017 Andreas Möller
* Copyright (c) 2017-2020 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
* the LICENSE.md file that was distributed with this source code.
*
* @see https://github.com/ergebnis/classy
*/
Expand Down
Loading

0 comments on commit 491ddff

Please sign in to comment.