Skip to content

Commit 60e6df0

Browse files
author
Italo Israel Baeza Cabrera
committed
[1.x] First commit
0 parents  commit 60e6df0

23 files changed

Lines changed: 1208 additions & 0 deletions

.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
; This file is for unifying the coding style for different editors and IDEs.
2+
; More information at http://editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
indent_size = 4
9+
indent_style = space
10+
end_of_line = lf
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
14+
[*.md]
15+
trim_trailing_whitespace = false
16+
17+
[*.yml]
18+
indent_size = 2

.gitattributes

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Path-based git attributes
2+
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
3+
4+
# Ignore all test and documentation with "export-ignore".
5+
/.gitattributes export-ignore
6+
/.gitignore export-ignore
7+
/.travis.yml export-ignore
8+
/phpunit.xml export-ignore
9+
/phpunit.xml.dist export-ignore
10+
/.styleci.yml export-ignore
11+
/tests export-ignore
12+
/.editorconfig export-ignore
13+
/.github export-ignore

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Let's keep it free and up to date
2+
github: DarkGhostHunter
3+
custom: "https://paypal.me/darkghosthunter"
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Bug Report
2+
description: |
3+
File a bug report to be fixed.
4+
5+
Sponsors get priority issues, PRs, fixes and requests. Not a sponsor? [You're a just click away!](https://github.com/sponsors/DarkGhostHunter).
6+
title: "[X.x] What does happen that is considered an error or bug?"
7+
labels: ["bug"]
8+
assignees:
9+
- DarkGhostHunter
10+
body:
11+
- type: markdown
12+
attributes:
13+
value: |
14+
Thanks for taking the time to fill out this bug report!
15+
16+
The more detailed this bug report is, the faster it can be reviewed and fixed.
17+
- type: input
18+
id: version-php-os
19+
attributes:
20+
label: PHP & Platform
21+
description: Exact PHP and Platform (OS) versions using this package.
22+
placeholder: 8.1.2 - Ubuntu 22.04 x64
23+
validations:
24+
required: true
25+
- type: input
26+
id: version-db
27+
attributes:
28+
label: Database
29+
description: Exact DB version using this package, if applicable.
30+
placeholder: MySQL 8.0.28
31+
validations:
32+
required: false
33+
- type: input
34+
id: version-laravel
35+
attributes:
36+
label: Laravel version
37+
description: Exact Laravel version using this package.
38+
placeholder: 9.2.3
39+
validations:
40+
required: true
41+
- type: checkboxes
42+
id: requirements
43+
attributes:
44+
label: Have you done this?
45+
options:
46+
- label: I have checked my logs and I'm sure is a bug in this package.
47+
required: true
48+
- label: I can reproduce this bug in isolation (vanilla Laravel install)
49+
required: true
50+
- label: I can suggest a workaround as a Pull Request
51+
required: false
52+
- type: textarea
53+
id: expectation
54+
attributes:
55+
label: Expectation
56+
description: Write what you expect to (correctly) happen.
57+
placeholder: When I do this, I expect to happen that.
58+
validations:
59+
required: true
60+
- type: textarea
61+
id: description
62+
attributes:
63+
label: Description
64+
description: Write what (incorrectly) happens instead.
65+
placeholder: Instead, when I do this, I receive that.
66+
validations:
67+
required: true
68+
- type: textarea
69+
id: reproduction
70+
attributes:
71+
label: Reproduction
72+
description: Paste the code to assert in a test, or just comment with the repository with the bug to download.
73+
render: php
74+
placeholder: |
75+
$test = Laragear::make()->break();
76+
77+
static::assertFalse($test);
78+
79+
// or comment with "https://github.com/my-name/my-bug-report"
80+
validations:
81+
required: true
82+
- type: textarea
83+
id: logs
84+
attributes:
85+
label: Stack trace & logs
86+
description: If you have a **full** stack trace, you can copy it here. You may hide sensible information.
87+
placeholder: This is automatically formatted into code, no need for ``` backticks.
88+
render: shell
89+
validations:
90+
required: false

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: false
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Feature request
2+
description: |
3+
Suggest a feature for this package.
4+
5+
Sponsors get priority issues, PRs, fixes and requests. Not a sponsor? [You're a just click away!](https://github.com/sponsors/DarkGhostHunter).
6+
title: "[X.x] Add this cool feature for this package"
7+
labels: ["enhancement"]
8+
assignees:
9+
- DarkGhostHunter
10+
body:
11+
- type: markdown
12+
attributes:
13+
value: |
14+
Thanks for contributing to this package!
15+
New features keep this package fresh and fun for everybody to use.
16+
- type: checkboxes
17+
id: requirements
18+
attributes:
19+
label: Please check these requirements
20+
options:
21+
- label: This feature helps everyone using this package
22+
required: true
23+
- label: It's feasible and maintainable
24+
required: true
25+
- label: It's non breaking
26+
required: true
27+
- label: I issued a PR with the implementation (optional)
28+
required: false
29+
- type: textarea
30+
id: description
31+
attributes:
32+
label: Description
33+
description: Describe how the feature works
34+
placeholder: |
35+
This new feature would accomplish...
36+
37+
It could be implemented by doing...
38+
39+
And it would be cool because...
40+
validations:
41+
required: true
42+
- type: textarea
43+
id: sample
44+
attributes:
45+
label: Code sample
46+
description: Sample a small snippet on how the feature works
47+
placeholder: |
48+
Laragear::newFeature()->cool();
49+
render: php
50+
validations:
51+
required: true

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!--
2+
Thanks for contributing to this package! We only accept PR to the latest stable version.
3+
4+
If you're pushing a Feature:
5+
- Title it: "[X.x] This new feature"
6+
- Describe what the new feature enables
7+
- Show a small code snippet of the new feature
8+
- Ensure it doesn't break backward compatibility.
9+
10+
If you're pushing a Fix:
11+
- Title it: "[X.x] FIX: The bug name"
12+
- Describe how it fixes in a few words.
13+
- Ensure it doesn't break backward compatibility.
14+
15+
All Pull Requests run with extensive tests for stable and latest versions of PHP and Laravel.
16+
Ensure your tests pass or your PR may be taken down.
17+
18+
If you're a Sponsor, this PR will have priority review.
19+
Not a Sponsor? Become one at https://github.com/sponsors/DarkGhostHunter
20+
-->
21+
22+
# Description
23+
24+
This feature/fix allows to...
25+
26+
# Code samples
27+
28+
```php
29+
Laragear::sample();
30+
```

.github/assets/support.png

69 KB
Loading

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: composer
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "09:00"
8+
open-pull-requests-limit: 10

.github/workflows/php.yml

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
byte_level:
9+
name: 0️⃣ Byte-level
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Check file permissions
18+
run: |
19+
test "$(find . -type f -not -path './.git/*' -executable)" == ""
20+
21+
- name: Find non-printable ASCII characters
22+
run: |
23+
! LC_ALL=C.UTF-8 find ./src -type f -name "*.php" -print0 | xargs -0 -- grep -PHn "[^ -~]"
24+
25+
syntax_errors:
26+
name: 1️⃣ Syntax errors
27+
28+
runs-on: ubuntu-latest
29+
30+
steps:
31+
- name: Set up PHP
32+
uses: shivammathur/setup-php@v2
33+
with:
34+
php-version: latest
35+
tools: parallel-lint
36+
37+
- name: Checkout code
38+
uses: actions/checkout@v4
39+
40+
- name: Validate Composer configuration
41+
run: composer validate --strict
42+
43+
- name: Check source code for syntax errors
44+
run: composer exec -- parallel-lint src/
45+
46+
unit_tests:
47+
name: 2️⃣ Unit and Feature tests
48+
needs:
49+
- byte_level
50+
- syntax_errors
51+
52+
runs-on: ubuntu-latest
53+
54+
strategy:
55+
matrix:
56+
php-version:
57+
- 8.1
58+
- 8.2
59+
- 8.3
60+
laravel-constraint:
61+
- 10.*
62+
- 11.*
63+
dependencies: [ lowest, highest ]
64+
exclude:
65+
- laravel-constraint: 11.*
66+
php-version: 8.1
67+
68+
steps:
69+
- name: Set up PHP
70+
uses: shivammathur/setup-php@v2
71+
with:
72+
php-version: ${{ matrix.php-version }}
73+
extensions: mbstring, intl
74+
coverage: xdebug
75+
76+
- name: Checkout code
77+
uses: actions/checkout@v4
78+
79+
- name: Install dependencies
80+
uses: ramsey/composer-install@v3
81+
with:
82+
dependency-versions: ${{ matrix.dependencies }}
83+
composer-options: --with=laravel/framework:${{ matrix.laravel-constraint }}
84+
85+
- name: Execute unit tests
86+
run: composer run-script test
87+
88+
- name: Upload coverage to Codecov
89+
uses: codecov/codecov-action@v4
90+
91+
static_analysis:
92+
name: 3️⃣ Static Analysis
93+
needs:
94+
- byte_level
95+
- syntax_errors
96+
97+
runs-on: ubuntu-latest
98+
99+
steps:
100+
- name: Set up PHP
101+
uses: shivammathur/setup-php@v2
102+
with:
103+
tools: phpstan
104+
php-version: latest
105+
coverage: none
106+
107+
- name: Checkout code
108+
uses: actions/checkout@v4
109+
110+
- name: Install dependencies
111+
uses: ramsey/composer-install@v3
112+
113+
- name: Execute static analysis
114+
run: composer exec -- phpstan analyze -l 5 src/
115+
116+
exported_files:
117+
name: 4️⃣ Exported files
118+
needs:
119+
- byte_level
120+
- syntax_errors
121+
122+
runs-on: ubuntu-latest
123+
124+
steps:
125+
- name: Checkout code
126+
uses: actions/checkout@v4
127+
128+
- name: Check exported files
129+
run: |
130+
EXPECTED="LICENSE.md,README.md,composer.json"
131+
CURRENT="$(git archive HEAD | tar --list --exclude="src" --exclude="src/*" --exclude=".stubs" --exclude=".stubs/*" --exclude="routes" --exclude="routes/*" --exclude="stubs" --exclude="stubs/*" --exclude="lang" --exclude="lang/*" --exclude="config" --exclude="config/*" --exclude="database" --exclude="database/*" --exclude="resources" --exclude="resources/*" | paste -s -d ",")"
132+
echo "CURRENT =${CURRENT}"
133+
echo "EXPECTED=${EXPECTED}"
134+
test "${CURRENT}" == "${EXPECTED}"

0 commit comments

Comments
 (0)