Skip to content

Commit 5ba94a4

Browse files
committed
Merge branch 'release/2.0.0'
2 parents b276687 + 7c88031 commit 5ba94a4

21 files changed

+1676
-0
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
; top-most EditorConfig file
2+
root = true
3+
4+
; Unix-style newlines
5+
[*]
6+
end_of_line = lf
7+
8+
[*.php]
9+
indent_style = space
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.gitattributes export-ignore
2+
.github/ export-ignore
3+
tests/ export-ignore

.github/workflows/build.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
- master
8+
- feature/**
9+
- bugfix/**
10+
- release/**
11+
paths:
12+
- src/**
13+
- tests/**
14+
- .github/workflows/build.yml
15+
pull_request:
16+
branches:
17+
- develop
18+
paths:
19+
- src/**
20+
- tests/**
21+
22+
jobs:
23+
main:
24+
name: Build [PHP ${{ matrix.php-versions }}]
25+
runs-on: ubuntu-latest
26+
if: "!contains(github.event.head_commit.message, '[ci skip]')"
27+
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
php-versions: ['7.3', '7.4']
32+
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v2
36+
37+
- name: Setup PHP, with composer and extensions
38+
uses: shivammathur/setup-php@master
39+
with:
40+
php-version: ${{ matrix.php-versions }}
41+
tools: composer
42+
extensions: curl, intl, mbstring, xdebug
43+
coverage: xdebug
44+
45+
- name: Validate composer.json
46+
run: composer validate --strict
47+
48+
- name: Get composer cache directory
49+
id: composer-cache
50+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
51+
52+
- name: Create composer cache directory
53+
run: mkdir -p ${{ steps.composer-cache.outputs.dir }}
54+
55+
- name: Cache composer dependencies
56+
uses: actions/cache@v2
57+
with:
58+
path: ${{ steps.composer-cache.outputs.dir }}
59+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
60+
restore-keys: ${{ runner.os }}-composer-
61+
62+
- name: Create PHPStan cache directory
63+
run: mkdir -p build/phpstan
64+
65+
- name: Cache PHPStan cache directory
66+
uses: actions/cache@v2
67+
with:
68+
path: build/phpstan
69+
key: ${{ runner.os }}-phpstan-${{ github.sha }}
70+
restore-keys: ${{ runner.os }}-phpstan-
71+
72+
- name: Setup Composer's GitHub OAuth access
73+
run: composer config --global github-oauth.github.com ${{ secrets.ACCESS_TOKEN }}
74+
75+
- name: Install dependencies
76+
run: composer update --ansi --no-scripts --no-interaction
77+
78+
- name: Run PHP-CS-Fixer
79+
run: vendor/bin/php-cs-fixer fix --ansi --config=.php_cs.dist --verbose --dry-run --using-cache=no
80+
81+
- name: Run PHPStan Static Analysis Check
82+
run: vendor/bin/phpstan analyse --ansi
83+
84+
- name: Run NexusPHP CS Config TestSuite
85+
run: vendor/bin/phpunit --colors=always
86+
87+
- name: Run Coveralls
88+
run: |
89+
composer global require --ansi php-coveralls/php-coveralls
90+
php-coveralls --coverage_clover=build/logs/clover.xml -v
91+
env:
92+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93+
COVERALLS_PARALLEL: true
94+
COVERALLS_FLAG_NAME: PHP ${{ matrix.php-versions }}
95+
96+
coveralls-finish:
97+
name: Coveralls Finished
98+
needs: [main]
99+
runs-on: ubuntu-latest
100+
101+
steps:
102+
- name: Upload to Coveralls API
103+
uses: coverallsapp/github-action@master
104+
with:
105+
github-token: ${{ secrets.GITHUB_TOKEN }}
106+
parallel-finished: true

.github/workflows/release.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- '**'
7+
8+
jobs:
9+
build:
10+
name: Create a release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Create release
17+
uses: actions/create-release@latest
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
20+
with:
21+
tag_name: ${{ github.ref }}
22+
release_name: NexusPHP CS Config ${{ github.ref }}
23+
draft: false
24+
prerelease: false
25+
body: |
26+
Please refer to the CHANGELOG for the detailed list of changes.

.gitignore

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#-------------------------
2+
# Test Files
3+
#-------------------------
4+
phpunit
5+
build/
6+
/phpunit*.xml
7+
/.phpunit.*.cache
8+
9+
#-------------------------
10+
# Composer
11+
#-------------------------
12+
vendor/
13+
composer.lock
14+
15+
#-------------------------
16+
# IDE / Development Files
17+
#-------------------------
18+
19+
# Jetbrains editors (PHPStorm, etc)
20+
.idea/
21+
*.iml
22+
23+
# Netbeans
24+
nbproject/
25+
nbbuild/
26+
dist/
27+
nbdist/
28+
nbactions.xml
29+
nb-configuration.xml
30+
.nb-gradle/
31+
32+
# Sublime Text
33+
*.tmlanguage.cache
34+
*.tmPreferences.cache
35+
*.stTheme.cache
36+
*.sublime-workspace
37+
*.sublime-project
38+
.phpintel
39+
/api/
40+
41+
# Visual Studio Code
42+
.vscode/
43+
44+
#-------------------------
45+
# Others
46+
#-------------------------
47+
48+
# php-cs-fixer
49+
.php_cs
50+
.php_cs.cache

.php_cs.dist

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* This file is part of NexusPHP CS Config.
7+
*
8+
* (c) 2020 John Paul E. Balandan, CPA <[email protected]>
9+
*
10+
* For the full copyright and license information, please view
11+
* the LICENSE file that was distributed with this source code.
12+
*/
13+
14+
use Nexus\CsConfig\Factory;
15+
use Nexus\CsConfig\Ruleset\Nexus73;
16+
use PhpCsFixer\Finder;
17+
18+
$finder = Finder::create()
19+
->files()
20+
->in(__DIR__)
21+
->exclude(['build'])
22+
->append([__FILE__])
23+
;
24+
25+
$options = [
26+
'finder' => $finder,
27+
'cacheFile' => 'build/.php_cs.cache',
28+
];
29+
30+
return Factory::create(new Nexus73(), [], $options)->forLibrary(
31+
'NexusPHP CS Config',
32+
'John Paul E. Balandan, CPA',
33+
34+
2020
35+
);

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Changelog
2+
3+
All notable changes to this library will be documented in this file:
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## v2.0.0 - 2020-11-28
9+
10+
### Changed
11+
12+
- Initial release in this repository. See [MIGRATION](MIGRATION.md) for the detailed changes
13+
from its predecessor library.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 John Paul E. Balandan, CPA
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

MIGRATION.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Migrating from Liaison CS Config Factory
2+
3+
The following were the changes implemented in considering the transition to NexusPHP CS Config:
4+
5+
## Added
6+
7+
- Public methods `forProjects` and `forLibrary` were added to `Factory` class.
8+
- `forProjects` accepts no arguments and acts as the old `Factory::create`.
9+
- `forLibrary` accepts two required and two optional arguments and behaves as the old `Factory::createForLibrary`.
10+
- The `Nexus73` ruleset is added and meant for use in PHP 7.3+.
11+
- `declare(strict_types=1)` was added to all PHP files for additional type safety.
12+
13+
## Changed
14+
15+
- Root namespace of `Liaison\CS\Config` was renamed to `Nexus\CsConfig`.
16+
- `Factory::create` now returns an instance of `Factory` instead of `PhpCsFixer\Config`. This allows it
17+
to be chained with either `forProjects` or `forLibrary` public methods.
18+
19+
## Removed
20+
21+
- `Factory::createForLibrary` was removed. Use the public method `forLibrary` to get similar effect.
22+
- The `Liaison` and `CodeIgniter4` rulesets were removed.
23+
- The deprecated `BaseRuleset` class was removed.
24+
- Custom fixers were removed and moved to a new repository, [NexusPHP CS Fixers][1].
25+
26+
[1]: https://github.com/NexusPHP/cs-fixers
27+
28+
Please have a look at this library's [`.php_cs.dist`](.php_cs.dist) to have a glance of the new changes
29+
in action. You can also refer to the [README](README.md) for additional details.

0 commit comments

Comments
 (0)