Skip to content

Commit 593a528

Browse files
committed
Primeiro commit
Signed-off-by: Vitor Mattos <vitor@php.rio>
0 parents  commit 593a528

32 files changed

Lines changed: 7357 additions & 0 deletions

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 4
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = false
12+
insert_final_newline = false

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: librecodecoop

.github/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Comment to be posted to on PRs from first time contributors in your repository
2+
newPRWelcomeComment: "Thanks for opening your first pull request in this repository! :v:"

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
# Maintain dependencies for Composer
9+
- package-ecosystem: "composer" # See documentation for possible values
10+
directory: "/" # Location of package manifests
11+
schedule:
12+
interval: "daily"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Dependabot auto approve
2+
on: pull_request_target
3+
4+
jobs:
5+
auto-aprove:
6+
runs-on: ubuntu-latest
7+
permissions:
8+
pull-requests: write
9+
if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
10+
steps:
11+
- uses: hmarr/auto-approve-action@v3

.github/workflows/lint-php-cs.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Lint
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '.github/workflows/**'
7+
- 'src/**'
8+
- 'tests/**'
9+
- 'vendor/**'
10+
- 'vendor-bin/**'
11+
- '.php-cs-fixer.dist.php'
12+
- 'composer.json'
13+
- 'composer.lock'
14+
15+
permissions:
16+
contents: read
17+
18+
concurrency:
19+
group: lint-php-cs-${{ github.head_ref || github.run_id }}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
lint:
24+
runs-on: ubuntu-latest
25+
26+
name: php-cs
27+
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
31+
32+
- name: Set up php
33+
uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2
34+
with:
35+
php-version: 8.3
36+
coverage: none
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
40+
- name: Install dependencies
41+
run: composer i
42+
43+
- name: Lint
44+
run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )

.github/workflows/lint-php.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Lint
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '.github/workflows/**'
7+
- 'src/**'
8+
- 'tests/**'
9+
- 'vendor/**'
10+
- 'vendor-bin/**'
11+
- '.php-cs-fixer.dist.php'
12+
- 'composer.json'
13+
- 'composer.lock'
14+
15+
permissions:
16+
contents: read
17+
18+
concurrency:
19+
group: lint-php-${{ github.head_ref || github.run_id }}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
php-lint:
24+
runs-on: ubuntu-latest
25+
strategy:
26+
matrix:
27+
php-versions: [ "8.3" ]
28+
29+
name: php-lint
30+
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3
34+
35+
- name: Set up php ${{ matrix.php-versions }}
36+
uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d # v2
37+
with:
38+
php-version: ${{ matrix.php-versions }}
39+
coverage: none
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
43+
- name: Lint
44+
run: composer run lint
45+
46+
summary:
47+
permissions:
48+
contents: none
49+
runs-on: ubuntu-latest
50+
needs: php-lint
51+
52+
if: always()
53+
54+
name: php-lint-summary
55+
56+
steps:
57+
- name: Summary status
58+
run: if ${{ needs.php-lint.result != 'success' && needs.php-lint.result != 'skipped' }}; then exit 1; fi

.github/workflows/phpunit.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This workflow is provided via the organization template repository
2+
#
3+
# https://github.com/nextcloud/.github
4+
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
6+
name: PHPUnit
7+
8+
on: pull_request
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: phpunit-${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
phpunit:
19+
runs-on: ubuntu-latest
20+
21+
strategy:
22+
matrix:
23+
php-versions: ['8.3']
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
28+
29+
- name: Set up php ${{ matrix.php-versions }}
30+
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
31+
with:
32+
php-version: ${{ matrix.php-versions }}
33+
coverage: none
34+
ini-file: development
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Set up dependencies
39+
run: composer i
40+
41+
- name: PHPUnit
42+
run: composer run test:unit

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/vendor-bin/**/vendor/
2+
/vendor/
3+
.vscode
4+
.env
5+
.php-cs-fixer.cache
6+
.~lock.*#
7+
.phpunit.cache
8+
clover.xml

.php-cs-fixer.dist.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
/**
3+
* @copyright Copyright (c) 2023, Vitor Mattos <vitor@php.rio>
4+
*
5+
* @author Vitor Mattos <vitor@php.rio>
6+
*
7+
* @license GNU AGPL version 3 or any later version
8+
*
9+
* This program is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU Affero General Public License as
11+
* published by the Free Software Foundation, either version 3 of the
12+
* License, or (at your option) any later version.
13+
*
14+
* This program is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU Affero General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU Affero General Public License
20+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
21+
*
22+
*/
23+
24+
declare(strict_types=1);
25+
26+
require_once './vendor/autoload.php';
27+
28+
$config = new PhpCsFixer\Config();
29+
$config
30+
->getFinder()
31+
->ignoreVCSIgnored(true)
32+
->notPath('vendor')
33+
->notPath('vendor-bin')
34+
->in(__DIR__);
35+
return $config;

0 commit comments

Comments
 (0)