Skip to content

Commit 0ab71d9

Browse files
authored
Merge pull request #1 from KaririCode-Framework/develop
Implementation of ProcessorPipeline Component
2 parents 65ac8c3 + 6465130 commit 0ab71d9

26 files changed

+6751
-0
lines changed

.docker/php/Dockerfile

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
ARG PHP_VERSION=8.3
2+
3+
FROM php:${PHP_VERSION}-alpine
4+
5+
# Install system dependencies
6+
RUN apk update && apk add --no-cache \
7+
$PHPIZE_DEPS \
8+
linux-headers \
9+
zlib-dev \
10+
libmemcached-dev \
11+
cyrus-sasl-dev
12+
13+
RUN pecl install xdebug redis memcached \
14+
&& docker-php-ext-enable xdebug redis memcached
15+
16+
# Copy custom PHP configuration
17+
COPY .docker/php/kariricode-php.ini /usr/local/etc/php/conf.d/
18+
19+
# Instalação do Composer
20+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
21+
22+
RUN apk del --purge $PHPIZE_DEPS && rm -rf /var/cache/apk/*
23+
24+
# Mantém o contêiner ativo sem fazer nada
25+
CMD tail -f /dev/null

.docker/php/kariricode-php.ini

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[PHP]
2+
memory_limit = 256M
3+
upload_max_filesize = 50M
4+
post_max_size = 50M
5+
date.timezone = America/Sao_Paulo
6+
7+
[Xdebug]
8+
; zend_extension=xdebug.so
9+
xdebug.mode=debug
10+
xdebug.start_with_request=yes
11+
xdebug.client_host=host.docker.internal
12+
xdebug.client_port=9003
13+
xdebug.log=/tmp/xdebug.log
14+
xdebug.idekey=VSCODE

.env.example

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
KARIRI_APP_ENV=develop
2+
KARIRI_PHP_VERSION=8.3
3+
KARIRI_PHP_PORT=9003

.gitattributes

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/.docker export-ignore
2+
/.github export-ignore
3+
/.vscode export-ignore
4+
/tests export-ignore
5+
/vendor export-ignore
6+
/.env export-ignore
7+
/.env.example export-ignore
8+
/.gitignore export-ignore
9+
/.php-cs-fixer.php export-ignore
10+
/.phpcs-cache export-ignore
11+
/docker-compose.yml export-ignore
12+
/phpcs.xml export-ignore
13+
/phpinsights.php export-ignore
14+
/phpstan.neon export-ignore
15+
/phpunit.xml export-ignore
16+
/psalm.xml export-ignore
17+
/Makefile export-ignore

.github/workflows/kariri-ci-cd.yml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Kariri CI Pipeline
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
setup-and-lint:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
php: ["8.3"]
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Cache Composer dependencies
20+
uses: actions/cache@v3
21+
with:
22+
path: vendor
23+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
24+
restore-keys: |
25+
${{ runner.os }}-composer-
26+
27+
- name: Set up PHP ${{ matrix.php }}
28+
uses: shivammathur/setup-php@v2
29+
with:
30+
php-version: ${{ matrix.php }}
31+
extensions: mbstring, xml
32+
tools: composer:v2, php-cs-fixer, phpunit
33+
34+
- name: Install dependencies
35+
run: composer install --prefer-dist --no-progress
36+
37+
- name: Validate composer.json
38+
run: composer validate
39+
40+
- name: Coding Standards Check
41+
run: vendor/bin/php-cs-fixer fix --dry-run --diff
42+
43+
unit-tests:
44+
needs: setup-and-lint
45+
runs-on: ubuntu-latest
46+
47+
steps:
48+
- uses: actions/checkout@v3
49+
50+
- name: Download Composer Cache
51+
uses: actions/cache@v3
52+
with:
53+
path: vendor
54+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
55+
restore-keys: |
56+
${{ runner.os }}-composer-
57+
58+
- name: Set up PHP ${{ matrix.php }}
59+
uses: shivammathur/setup-php@v2
60+
with:
61+
php-version: ${{ matrix.php }}
62+
extensions: mbstring, xml
63+
tools: composer:v2, php-cs-fixer, phpunit
64+
65+
- name: Install dependencies
66+
run: composer install --prefer-dist --no-progress
67+
68+
- name: Run PHPUnit Tests
69+
run: XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-text
70+
71+
- name: Security Check
72+
run: vendor/bin/security-checker security:check

.gitignore

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Arquivos de configuração do sistema
2+
/.idea/
3+
*.sublime-project
4+
*.sublime-workspace
5+
/.phpunit.result.cache
6+
/.php_cs.cache
7+
/.php_cs.dist.cache
8+
/phpstan.neon.dist
9+
/phpstan.neon.cache
10+
/.phpstan.result.cache
11+
/.phpcs-cache
12+
13+
# Dependências
14+
/vendor/
15+
/node_modules/
16+
17+
# Arquivos específicos do sistema operacional
18+
.DS_Store
19+
Thumbs.db
20+
21+
# Arquivos de build e compilação
22+
/build/
23+
/dist/
24+
*.log
25+
*.tlog
26+
*.tmp
27+
*.temp
28+
29+
# Arquivos e pastas de ambientes virtuais
30+
.env
31+
32+
# Arquivos de cache
33+
/cache/
34+
*.cache
35+
*.class
36+
37+
# Arquivos de log
38+
*.log
39+
*.sql
40+
*.sqlite
41+
42+
# Pasta de testes que não devem ser incluídas no repositório
43+
coverage/
44+
coverage*
45+
46+
# Arquivos de pacotes
47+
*.jar
48+
*.war
49+
*.ear
50+
*.zip
51+
*.tar.gz
52+
*.rar
53+
54+
# Outros arquivos e pastas
55+
*.swp
56+
*~
57+
._*
58+
temp/
59+
tmp/
60+
.vscode/launch.json
61+
.vscode/extensions.json
62+
tests/lista_de_arquivos.php
63+
tests/lista_de_arquivos_test.php
64+
lista_de_arquivos.txt
65+
lista_de_arquivos_tests.txt
66+
add_static_to_providers.php

.php-cs-fixer.php

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->in(__DIR__ . '/src')
5+
->in(__DIR__ . '/tests')
6+
->exclude('var')
7+
->exclude('config')
8+
->exclude('vendor');
9+
10+
return (new PhpCsFixer\Config())
11+
->setParallelConfig(new PhpCsFixer\Runner\Parallel\ParallelConfig(4, 20))
12+
->setRules([
13+
'@PSR12' => true,
14+
'@Symfony' => true,
15+
'full_opening_tag' => false,
16+
'phpdoc_var_without_name' => false,
17+
'phpdoc_to_comment' => false,
18+
'array_syntax' => ['syntax' => 'short'],
19+
'concat_space' => ['spacing' => 'one'],
20+
'binary_operator_spaces' => [
21+
'default' => 'single_space',
22+
'operators' => [
23+
'=' => 'single_space',
24+
'=>' => 'single_space',
25+
],
26+
],
27+
'blank_line_before_statement' => [
28+
'statements' => ['return']
29+
],
30+
'cast_spaces' => ['space' => 'single'],
31+
'class_attributes_separation' => [
32+
'elements' => [
33+
'const' => 'none',
34+
'method' => 'one',
35+
'property' => 'none'
36+
]
37+
],
38+
'declare_equal_normalize' => ['space' => 'none'],
39+
'function_typehint_space' => true,
40+
'lowercase_cast' => true,
41+
'no_unused_imports' => true,
42+
'not_operator_with_successor_space' => true,
43+
'ordered_imports' => true,
44+
'phpdoc_align' => ['align' => 'left'],
45+
'phpdoc_no_alias_tag' => ['replacements' => ['type' => 'var', 'link' => 'see']],
46+
'phpdoc_order' => true,
47+
'phpdoc_scalar' => true,
48+
'single_quote' => true,
49+
'standardize_not_equals' => true,
50+
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
51+
'trim_array_spaces' => true,
52+
'space_after_semicolon' => true,
53+
'no_spaces_inside_parenthesis' => true,
54+
'no_whitespace_before_comma_in_array' => true,
55+
'whitespace_after_comma_in_array' => true,
56+
'visibility_required' => ['elements' => ['const', 'method', 'property']],
57+
'multiline_whitespace_before_semicolons' => [
58+
'strategy' => 'no_multi_line',
59+
],
60+
'method_chaining_indentation' => true,
61+
'class_definition' => [
62+
'single_item_single_line' => false,
63+
'multi_line_extends_each_single_line' => true,
64+
],
65+
'not_operator_with_successor_space' => false
66+
])
67+
->setRiskyAllowed(true)
68+
->setFinder($finder)
69+
->setUsingCache(false);

.vscode/settings.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"[php]": {
3+
"editor.defaultFormatter": "junstyle.php-cs-fixer"
4+
},
5+
"php-cs-fixer.executablePath": "${workspaceFolder}/vendor/bin/php-cs-fixer",
6+
"php-cs-fixer.onsave": true,
7+
"php-cs-fixer.rules": "@PSR12",
8+
"php-cs-fixer.config": ".php_cs.dist",
9+
"php-cs-fixer.formatHtml": true
10+
}

0 commit comments

Comments
 (0)