Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/daycry/settings-1 into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
daycry committed Sep 5, 2022
2 parents 79406ed + 1d48c98 commit 980dc30
Show file tree
Hide file tree
Showing 21 changed files with 418 additions and 71 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/compare.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/deptrac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.1'
tools: phive
extensions: intl, json, mbstring, xml
coverage: none
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpcpd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.1'
tools: phpcpd
extensions: dom, mbstring
coverage: none
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/phpcsfixer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: PHPCSFixer

on:
pull_request:
branches:
- develop
paths:
- '**.php'
- '.github/workflows/phpcsfixer.yml'
push:
branches:
- develop
paths:
- '**.php'
- '.github/workflows/phpcsfixer.yml'

jobs:
build:
name: Coding Standards
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: json, tokenizer
coverage: none
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: |
if [ -f composer.lock ]; then
composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
else
composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
fi
- name: Check code for standards compliance
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --using-cache=no --diff
71 changes: 71 additions & 0 deletions .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Psalm

on:
pull_request:
branches:
- develop
paths:
- '**.php'
- 'composer.*'
- 'psalm*'
- '.github/workflows/psalm.yml'
push:
branches:
- develop
paths:
- '**.php'
- 'composer.*'
- 'psalm*'
- '.github/workflows/psalm.yml'

jobs:
build:
name: Psalm Analysis
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: phpstan, phpunit
extensions: intl, json, mbstring, xml
coverage: none
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Create Psalm cache directory
run: mkdir -p build/psalm

- name: Cache Psalm results
uses: actions/cache@v3
with:
path: build/psalm
key: ${{ runner.os }}-psalm-${{ github.sha }}
restore-keys: ${{ runner.os }}-psalm-

- name: Install dependencies
run: |
if [ -f composer.lock ]; then
composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
else
composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
fi
- name: Run Psalm analysis
run: vendor/bin/psalm
67 changes: 67 additions & 0 deletions .github/workflows/rector.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Rector

on:
pull_request:
branches:
- develop
paths:
- '**.php'
- 'composer.*'
- 'rector.php'
- '.github/workflows/rector.yml'
push:
branches:
- develop
paths:
- '**.php'
- 'composer.*'
- 'rector.php'
- '.github/workflows/rector.yml'

jobs:
build:
name: PHP ${{ matrix.php-versions }} Rector Analysis
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
strategy:
fail-fast: false
matrix:
php-versions: ['7.4', '8.0', '8.1']

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: phpstan
extensions: intl, json, mbstring, xml
coverage: none
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: |
if [ -f composer.lock ]; then
composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
else
composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
fi
- name: Analyze for refactoring
run: |
composer global require --dev rector/rector:^0.14
rector process --dry-run --no-progress-bar
8 changes: 3 additions & 5 deletions .github/workflows/unused.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# When a PR is opened or a push is made, check code
# for unused packages with Composer Unused.
name: Unused

on:
Expand Down Expand Up @@ -31,7 +29,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.1'
tools: composer, composer-unused
extensions: intl, json, mbstring, xml
coverage: none
Expand All @@ -52,9 +50,9 @@ jobs:
- name: Install dependencies
run: |
if [ -f composer.lock ]; then
composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
else
composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
fi
- name: Detect unused packages
Expand Down
5 changes: 4 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@

$finder = Finder::create()
->files()
->in(__DIR__)
->in([
__DIR__ . '/src/',
__DIR__ . '/tests/',
])
->exclude('build')
->append([__FILE__]);

Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The development team and community take all security issues seriously. **Please

Thank you for improving the security of our code! Any assistance in removing security flaws will be acknowledged.

**Please report security flaws by emailing the development team directly: **security@codeigniter.com**.
**Please report security flaws by emailing the development team directly: security@codeigniter.com**.

The lead maintainer will acknowledge your email within 48 hours, and will send a more detailed response within 48 hours indicating
the next steps in handling your report. After the initial reply to your report, the security team will endeavor to keep you informed of the
Expand Down
15 changes: 15 additions & 0 deletions composer-unused.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

declare(strict_types=1);

use ComposerUnused\ComposerUnused\Configuration\Configuration;
use ComposerUnused\ComposerUnused\Configuration\NamedFilter;
use ComposerUnused\ComposerUnused\Configuration\PatternFilter;
use Webmozart\Glob\Glob;

return static fn (Configuration $config): Configuration => $config
// ->addNamedFilter(NamedFilter::fromString('symfony/config'))
// ->addPatternFilter(PatternFilter::fromString('/symfony-.*/'))
->setAdditionalFilesFor('codeigniter4/framework', [
...Glob::glob(__DIR__ . '/vendor/codeigniter4/framework/system/Helpers/*.php'),
]);
32 changes: 17 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,31 @@
{
"name": "codeigniter4/settings",
"type": "library",
"description": "Settings library for CodeIgniter 4",
"license": "MIT",
"type": "library",
"keywords": [
"codeigniter",
"codeigniter4",
"settings"
],
"homepage": "https://github.com/codeigniter4/settings",
"license": "MIT",
"authors": [
{
"name": "Lonnie Ezell",
"email": "lonnieje@gmail.com",
"role": "Developer"
}
],
"homepage": "https://github.com/codeigniter4/settings",
"require": {
"php": "^7.4 || ^8.0"
},
"require-dev": {
"codeigniter/coding-standard": "^1.1",
"codeigniter4/devkit": "^1.0",
"codeigniter4/framework": "^4.2.3",
"fakerphp/faker": "^1.9",
"mockery/mockery": "^1.0",
"nexusphp/cs-config": "^3.1",
"nexusphp/tachycardia": "^1.0",
"php-coveralls/php-coveralls": "^2.4",
"phpstan/phpstan": "^1.0",
"phpunit/phpunit": "^9.0",
"squizlabs/php_codesniffer": "^3.3"
"rector/rector": "0.14"
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"psr-4": {
"CodeIgniter\\Settings\\": "src"
Expand All @@ -45,13 +40,20 @@
"Tests\\Support\\": "tests/_support"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"allow-plugins": {
"phpstan/extension-installer": true
}
},
"scripts": {
"post-update-cmd": [
"bash -c \"if [ -f admin/setup.sh ]; then bash admin/setup.sh; fi\""
],
"analyze": "phpstan analyze",
"analyze": [
"phpstan analyze",
"psalm",
"rector process --dry-run"
],
"sa": "@analyze",
"ci": [
"Composer\\Config::disableProcessTimeout",
Expand Down
4 changes: 2 additions & 2 deletions deptrac.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
parameters:
paths:
- ./src
- ./vendor/codeigniter4/framework/system
- ./src/
- ./vendor/codeigniter4/framework/system/
exclude_files:
- '#.*test.*#i'
layers:
Expand Down
4 changes: 2 additions & 2 deletions infection.json.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"source": {
"directories": [
"src"
"src/"
],
"excludes": [
"Config",
Expand All @@ -15,5 +15,5 @@
"mutators": {
"@default": true
},
"bootstrap": "vendor/codeigniter4/codeigniter4/system/Test/bootstrap.php"
"bootstrap": "vendor/codeigniter4/framework/system/Test/bootstrap.php"
}
Loading

0 comments on commit 980dc30

Please sign in to comment.