Skip to content

Commit

Permalink
Merge pull request #196 from apiato/refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammad-Alavi authored Jan 31, 2024
2 parents 149282f + 02dc46e commit 03e2bef
Show file tree
Hide file tree
Showing 260 changed files with 6,783 additions and 3,600 deletions.
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

0 comments on commit 03e2bef

Please sign in to comment.