Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactors and fixes #196

Merged
merged 73 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
d73621d
fix: Ship views are not being loaded
Mohammad-Alavi Dec 7, 2023
edf9e25
chore(deps): update composer dependencies
Mohammad-Alavi Dec 14, 2023
27e1baf
docs(composer): update author names
Mohammad-Alavi Dec 14, 2023
37a2e7c
refactor: update cs fixer configs
Mohammad-Alavi Dec 14, 2023
e8cbe1a
feat: setup GitHub templates
Mohammad-Alavi Dec 14, 2023
baccf78
feat: setup php cs fixer GH action/automation
Mohammad-Alavi Dec 14, 2023
019b9b8
style: apply automated php-cs-fixer changes
Mohammad-Alavi Dec 14, 2023
77f9424
feat: setup `phpunit`
Mohammad-Alavi Dec 14, 2023
59429ff
feat: config testbench to load providers
Mohammad-Alavi Dec 14, 2023
481fdb2
feat: update cs fixer rules
Mohammad-Alavi Dec 14, 2023
e67ee9c
refactor: update generator stubs
Mohammad-Alavi Dec 14, 2023
f825a27
feat: add license
Mohammad-Alavi Dec 14, 2023
6f0fcbd
feat: add readme
Mohammad-Alavi Dec 14, 2023
bc7bfcb
feat: add code quality plugins
Mohammad-Alavi Dec 14, 2023
2155a02
feat: setup phpmd GH action/automation
Mohammad-Alavi Dec 14, 2023
70d4467
refactor: made methods public
Mohammad-Alavi Dec 14, 2023
0c7632f
fix: wrong usage
Mohammad-Alavi Dec 14, 2023
84cd392
feat: add phpmd custom Apiato rules
Mohammad-Alavi Dec 14, 2023
79159ab
style: apply automated php-cs-fixer changes
Mohammad-Alavi Dec 14, 2023
147a788
refactor: use `list` keyword instead of `getAll`
Mohammad-Alavi Dec 14, 2023
e4a67db
Merge branch '8.x' of https://github.com/apiato/core into 8.x
Mohammad-Alavi Dec 14, 2023
2e68279
feat: use custom phpmd ruleset
Mohammad-Alavi Dec 14, 2023
82dc615
fix: stub name
Mohammad-Alavi Dec 14, 2023
d98bc35
refactor: update stubs
Mohammad-Alavi Dec 14, 2023
fdd36c2
refactor: update stubs
Mohammad-Alavi Dec 14, 2023
9ce02db
refactor: set expected request properties
Mohammad-Alavi Dec 15, 2023
ee70044
refactor: remove empty comments
Mohammad-Alavi Dec 15, 2023
ed7b717
refactor: update docblock
Mohammad-Alavi Dec 15, 2023
06bdcea
refactor: update stub
Mohammad-Alavi Dec 15, 2023
f29906b
refactor: remove redundant default attribute value assignment
Mohammad-Alavi Dec 15, 2023
712dbff
fix: backward incompatibility
Mohammad-Alavi Dec 16, 2023
2af6e44
docs: add phpdoc
Mohammad-Alavi Dec 16, 2023
b5c7876
refactor: reorder to match Laravel property ordering
Mohammad-Alavi Dec 16, 2023
4a14443
refactor: made methods public to allow method overriding
Mohammad-Alavi Dec 16, 2023
f0c95e3
WIP
Mohammad-Alavi Dec 22, 2023
3a8c462
style: apply automated php-cs-fixer changes
Mohammad-Alavi Dec 22, 2023
c1c4b27
feat: remove unused changelog
Mohammad-Alavi Dec 22, 2023
100708a
chore(deps): update composer dependencies
Mohammad-Alavi Dec 22, 2023
ed31819
fix: Laravel migrations wont run
Mohammad-Alavi Dec 22, 2023
d94f2e6
refactor: move tests namespace
Mohammad-Alavi Dec 22, 2023
0b295b0
style: apply automated php-cs-fixer changes
Mohammad-Alavi Dec 22, 2023
0d24c6a
test: make tests green
Mohammad-Alavi Dec 22, 2023
aa33d38
API-1064-Core-Setup-GH-action-test-runner (#188)
Mohammad-Alavi Dec 25, 2023
f30fd10
Api 734 setup a GitHub actions (#189)
Mohammad-Alavi Dec 25, 2023
f181b96
Update README.md
Mohammad-Alavi Dec 25, 2023
70e5c36
Api 1065 restructure core folder structure (#190)
Mohammad-Alavi Dec 25, 2023
e059f3c
Create .gitattributes
Mohammad-Alavi Dec 25, 2023
707f88b
Update .gitattributes
Mohammad-Alavi Dec 26, 2023
6ed736b
Update phpunit.xml
Mohammad-Alavi Dec 26, 2023
e2558c7
Update composer.json
Mohammad-Alavi Dec 26, 2023
5dbcc1a
Update composer.lock
Mohammad-Alavi Dec 26, 2023
eb29f50
Delete UserRepository.php
Mohammad-Alavi Dec 27, 2023
8539c96
Update README.md
Mohammad-Alavi Dec 28, 2023
29fc709
Update .php-cs-fixer.dist.php
Mohammad-Alavi Dec 29, 2023
51a8afc
API-1053-add-new-test-assertions (#191)
Mohammad-Alavi Dec 29, 2023
8f13d3b
refactor: return types and php docs
Mohammad-Alavi Dec 29, 2023
bb1e3a3
fix: wrong import
Mohammad-Alavi Dec 29, 2023
90900bd
feat: throw a more informative exception code & message
Mohammad-Alavi Dec 29, 2023
b046ab6
refactor: reorder param types
Mohammad-Alavi Dec 29, 2023
cb9e8d7
fix: backward incompatibilities
Mohammad-Alavi Dec 29, 2023
bc17018
refactor: improve overridablity
Mohammad-Alavi Dec 29, 2023
85d3933
style: update status badges
Mohammad-Alavi Jan 4, 2024
cee9079
ci(github): bump github action versions
Mohammad-Alavi Jan 26, 2024
1400040
fix: fails on pr from forked repos
Mohammad-Alavi Jan 26, 2024
ea85e89
refactor: code clean up
Mohammad-Alavi Jan 31, 2024
ac23a0d
bug: cant handle array input
Mohammad-Alavi Jan 31, 2024
73cd63b
style: ran phpcsfixer
Mohammad-Alavi Jan 31, 2024
e33a48b
refactor
Mohammad-Alavi Jan 31, 2024
dda6e08
refactor
Mohammad-Alavi Jan 31, 2024
2f34113
docs: update readme
Mohammad-Alavi Jan 31, 2024
a05aa7c
chore(deps): update composer dependencies
Mohammad-Alavi Jan 31, 2024
4ab8790
revert: breaking changes
Mohammad-Alavi Jan 31, 2024
02dc46e
style: apply automated php-cs-fixer changes
Mohammad-Alavi Jan 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# http://editorconfig.org
root = true

[*]
Expand All @@ -11,3 +10,9 @@ trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2

[docker-compose.yml]
indent_size = 4
19 changes: 19 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
* text=auto

*.blade.php diff=html
*.css diff=css
*.html diff=html
*.md diff=markdown
*.php diff=php

/.github export-ignore
/tests export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.php-cs-fixer.dist.php export-ignore
composer.lock export-ignore
phpunit.xml export-ignore
psalm.xml export-ignore
ruleset.xml export-ignore
testbench.yaml export-ignore
3 changes: 3 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Code of Conduct

The Apiato Code of Conduct can be found in the [Apiato documentation](https://apiato.io/docs/prologue/contribution-guide#code-of-conduct).
3 changes: 3 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Apiato Contribution Guide

The Apiato contributing guide can be found in the [Apiato documentation](https://apiato.io/docs/prologue/contribution-guide).
6 changes: 6 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# DO NOT CHANGE THIS FILE PLEASE.

github: Mahmoudz
open_collective: apiato
custom: ['https://paypal.me/mzmmzz']
patreon: zalt
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/Bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Bug Report
description: "Report something that's broken."
body:
- type: markdown
attributes:
value: "Please read [our full contribution guide](https://apiato.io/docs/prologue/contribution-guide#bug-reports) before submitting bug reports. If you notice improper DocBlock, Psalm, or IDE warnings while using Apiato, do not create a GitHub issue. Instead, please submit a pull request to fix the problem."
- type: input
attributes:
label: Apiato Core Version
description: Provide the Apiato Core version that you are using. [Please ensure it is still supported.](https://apiato.io/docs/prologue/release-notes#support-policy)
placeholder: 8.x
validations:
required: true
- type: input
attributes:
label: PHP Version
description: Provide the PHP version that you are using.
placeholder: 8.1.x
validations:
required: true
- type: input
attributes:
label: Database Driver & Version
description: If applicable, provide the database driver and version you are using.
placeholder: "MySQL 8.0.0 for macOS 13.0 on arm64 (Homebrew)"
validations:
required: false
- type: textarea
attributes:
label: Description
description: Provide a detailed description of the issue you are facing.
validations:
required: true
- type: textarea
attributes:
label: Steps To Reproduce
description: Provide detailed steps to reproduce your issue. If necessary, please provide a GitHub repository to demonstrate your issue.
validations:
required: true

12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
blank_issues_enabled: false
contact_links:
- name: Feature request
url: https://github.com/apiato/core/discussions
about: 'For ideas or feature requests, start a new discussion'
- name: Support Questions & Other
url: https://apiato.io/docs/prologue/contribution-guide#support-questions
about: 'This repository is only for reporting bugs. If you have a question or need help using the library, click:'
- name: Documentation issue
url: https://github.com/apiato/documentation
about: For documentation issues, open a pull request at the apiato/documentation repository

15 changes: 15 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Description
[//]: # (Please include a summary of the change and which issue is fixed. )
[//]: # (Please also include relevant motivation and context. )
[//]: # (List any dependencies that are required for this change.)

## Type of change
[//]: # (Please put an x in the box that apply.)

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Refactor (refactoring a current feature, method, etc...)
- [ ] Code Coverage (adding/removing/updating/refactoring tests)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Remove feature (non-breaking change which removes functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

12 changes: 12 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Security Policy

**PLEASE DON'T DISCLOSE SECURITY-RELATED ISSUES PUBLICLY, [SEE BELOW](#reporting-a-vulnerability).**

## Supported Versions

Please see [our support policy](https://apiato.io/docs/prologue/release-notes#support-policy) for information on supported versions for security releases.

## Reporting a Vulnerability

If you discover a security vulnerability within Apiato, please email Mohammad Alavi at [email protected].
All security vulnerabilities will be promptly addressed.
6 changes: 6 additions & 0 deletions .github/SUPPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Support Questions

The Apiato support guide can be found in the [Apiato documentation](http://apiato.io/docs/prologue/contribution-guide#support-questions).

For paid professional support or consulting,
you can pick one of our [support packages](http://apiato.io/docs/consulting).
31 changes: 31 additions & 0 deletions .github/workflows/php-cs-fixer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Check & fix styling

on:
pull_request:
types: [ opened, synchronize, reopened ]

jobs:
php-cs-fixer:
name: PHP-CS-Fixer
runs-on: ubuntu-latest
permissions:
contents: write
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Use Cache
uses: actions/cache@v4
with:
path: .php-cs-fixer.cache
key: ${{ runner.OS }}-${{ github.repository }}-phpcsfixer-${{ github.sha }}
restore-keys: |
${{ runner.OS }}-${{ github.repository }}-phpcsfixer-
- name: Run PHP CS Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=.php-cs-fixer.dist.php
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "style: apply automated php-cs-fixer changes"
21 changes: 21 additions & 0 deletions .github/workflows/phpmd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: PHPMD

on:
pull_request:
types: [ opened, synchronize, reopened ]

jobs:
phpmd:
name: PHPMD
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP environment
uses: shivammathur/setup-php@v2
with:
coverage: none
tools: phpmd
- name: Run PHPMD
run: phpmd . github ruleset.xml --exclude 'tests/*,vendor/*'
46 changes: 46 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Tests

on:
push:
branches:
- master
- '*.x'
pull_request:

permissions:
contents: read

jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [ 8.1, 8.2 ]
name: PHP ${{ matrix.php }}
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite
coverage: xdebug
tools: phpunit:10.*

- name: Install Composer dependencies
run: composer install --prefer-dist --no-interaction --no-progress

- name: Execute tests
run: vendor/bin/phpunit --coverage-clover=coverage.xml

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
30 changes: 30 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

$finder = Symfony\Component\Finder\Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->name('*.php')
->notName('*.blade.php');

return (new PhpCsFixer\Config())
->setRules([
'@Symfony' => true,
'concat_space' => ['spacing' => 'one'],
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
],
'phpdoc_align' => [
'align' => 'left',
],
'trailing_comma_in_multiline' => [
'elements' => ['arguments', 'arrays', 'match', 'parameters'],
],
'blank_line_before_statement' => [
'statements' => ['return', 'throw', 'try'],
],
'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => true],
'nullable_type_declaration' => ['syntax' => 'union'],
])
->setFinder($finder);
10 changes: 0 additions & 10 deletions CHANGELOG.md

This file was deleted.

16 changes: 0 additions & 16 deletions Generator/Stubs/controllers/web/getall.stub

This file was deleted.

21 changes: 0 additions & 21 deletions Generator/Stubs/events/getall.stub

This file was deleted.

22 changes: 0 additions & 22 deletions Generator/Stubs/job.stub

This file was deleted.

28 changes: 0 additions & 28 deletions Generator/Stubs/mail.stub

This file was deleted.

Loading