generated from likesistemas/composer-empty
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e7dc8cd
Showing
14 changed files
with
311 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "like/composer-empty", | ||
"dockerComposeFile": [ | ||
"../docker-compose.yml" | ||
], | ||
"service": "php", | ||
"shutdownAction": "none", | ||
"workspaceFolder": "/var/www/public/", | ||
"extensions": [ | ||
"bmewburn.vscode-intelephense-client", | ||
"hbenl.vscode-test-explorer", | ||
"recca0120.vscode-phpunit", | ||
"eamodio.gitlens", | ||
"mhutchie.git-graph", | ||
"junstyle.php-cs-fixer", | ||
"janbn.git-last-commit-message" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
GITHUB_TOKEN= | ||
CODECOMMIT_USER= | ||
CODECOMMIT_PASSWORD= | ||
PHP_VERSION=56|73|74|80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
pull_request: | ||
|
||
jobs: | ||
|
||
test: | ||
strategy: | ||
matrix: | ||
PHP: [56, 73, 74, 80] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Prepare code | ||
env: | ||
PHP_VERSION: ${{ matrix.PHP }} | ||
run: | | ||
touch .env | ||
echo "CODECOMMIT_USER=${{ secrets.CODECOMMIT_USER }}" >> .env | ||
echo "CODECOMMIT_PASSWORD=${{ secrets.CODECOMMIT_PASSWORD }}" >> .env | ||
echo "GITHUB_TOKEN=${{ secrets.GH_TOKEN }}" >> .env | ||
echo "PHP_VERSION=$PHP_VERSION" >> .env | ||
- name: Prepare environment | ||
run: | | ||
docker-compose up -d | ||
echo $(docker run -t --network github jwilder/dockerize -wait tcp://php:9000 -timeout 120s) | ||
docker-compose ps | ||
docker-compose logs php | ||
- name: Run PHP Unit | ||
run: | | ||
docker-compose exec -T php composer test | ||
- name: Run PHP Stan | ||
if: matrix.PHP != '56' | ||
run: | | ||
docker-compose exec -T php composer analyse | ||
- name: Run PHP CS Fixer | ||
if: matrix.PHP != '56' | ||
run: | | ||
docker-compose exec -T php composer fix:ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/.idea/ | ||
/nbproject/ | ||
desktop.ini | ||
/vendor/ | ||
.env | ||
composer.lock | ||
tests/phpunit.*.xml | ||
.phpunit.result.cache | ||
.php_cs.cache | ||
.php-cs-fixer.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
$rules = [ | ||
'@PSR2' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
'multiline_whitespace_before_semicolons' => false, | ||
'echo_tag_syntax' => false, | ||
'no_unused_imports' => true, | ||
'not_operator_with_successor_space' => true, | ||
'no_useless_else' => true, | ||
'ordered_imports' => ['sort_algorithm' => 'none', 'imports_order' => ['const', 'class', 'function']], | ||
'phpdoc_add_missing_param_annotation' => true, | ||
'phpdoc_indent' => true, | ||
'phpdoc_no_package' => true, | ||
'phpdoc_order' => true, | ||
'phpdoc_separation' => true, | ||
'phpdoc_single_line_var_spacing' => true, | ||
'phpdoc_trim' => true, | ||
'phpdoc_var_without_name' => true, | ||
'phpdoc_to_comment' => true, | ||
'single_quote' => true, | ||
'ternary_operator_spaces' => true, | ||
'trailing_comma_in_multiline' => true, | ||
'trim_array_spaces' => true, | ||
'braces' => [ | ||
'allow_single_line_closure' => true, | ||
'position_after_functions_and_oop_constructs' => 'same', | ||
], | ||
]; | ||
|
||
$excludes = [ | ||
'vendor', | ||
'.vscode', | ||
'.github', | ||
'.devcontainer' | ||
]; | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->in(__DIR__) | ||
->exclude($excludes) | ||
->notName('README.md') | ||
->notName('*.xml') | ||
->notName('*.yml') | ||
->notName('_ide_helper.php') | ||
; | ||
|
||
return (new PhpCsFixer\Config()) | ||
->setRules($rules) | ||
->setFinder($finder) | ||
->setIndent("\t") | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
|
||
$rules = [ | ||
'@PSR2' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
'no_multiline_whitespace_before_semicolons' => true, | ||
'no_short_echo_tag' => true, | ||
'no_unused_imports' => true, | ||
'not_operator_with_successor_space' => true, | ||
'no_useless_else' => true, | ||
'ordered_imports' => ['sort_algorithm' => 'none', 'imports_order' => ['const', 'class', 'function']], | ||
'phpdoc_add_missing_param_annotation' => true, | ||
'phpdoc_indent' => true, | ||
'phpdoc_no_package' => true, | ||
'phpdoc_order' => true, | ||
'phpdoc_separation' => true, | ||
'phpdoc_single_line_var_spacing' => true, | ||
'phpdoc_trim' => true, | ||
'phpdoc_var_without_name' => true, | ||
'phpdoc_to_comment' => true, | ||
'single_quote' => true, | ||
'ternary_operator_spaces' => true, | ||
'trailing_comma_in_multiline_array' => true, | ||
'trim_array_spaces' => true, | ||
'braces' => [ | ||
'allow_single_line_closure' => true, | ||
'position_after_functions_and_oop_constructs' => 'same' | ||
] | ||
]; | ||
|
||
$excludes = [ | ||
'vendor', | ||
'storage', | ||
'node_modules', | ||
'.vscode', | ||
'.github', | ||
'.devcontainer', | ||
'logs', | ||
'files', | ||
'k8s', | ||
'socket', | ||
'temp' | ||
]; | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->in(__DIR__) | ||
->exclude($excludes) | ||
->notName('README.md') | ||
->notName('*.xml') | ||
->notName('*.yml') | ||
->notName('_ide_helper.php') | ||
; | ||
|
||
return PhpCsFixer\Config::create() | ||
->setRules($rules) | ||
->setFinder($finder) | ||
->setIndent("\t") | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"recommendations": [ | ||
"bmewburn.vscode-intelephense-client", | ||
"hbenl.vscode-test-explorer", | ||
"recca0120.vscode-phpunit", | ||
"eamodio.gitlens", | ||
"mhutchie.git-graph", | ||
"junstyle.php-cs-fixer", | ||
"janbn.git-last-commit-message" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"files.encoding": "iso88591", | ||
"[php]": { | ||
"editor.defaultFormatter": "junstyle.php-cs-fixer" | ||
}, | ||
"[json]": { | ||
"files.encoding": "utf8", | ||
}, | ||
"php-cs-fixer.onsave": true, | ||
"php-cs-fixer.showOutput": false, | ||
"php-cs-fixer.autoFixByBracket": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"name": "likesistemas/nomedalib", | ||
"type": "library", | ||
"description": "Descriçãoo da biblioteca.", | ||
"repositories": [ | ||
{"type": "composer", "url": "https://composer.likesistemas.com.br/"} | ||
], | ||
"require": { | ||
"php": ">=5.6" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^5.0 || ^9.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Like\\NomeDaLib\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Like\\NomeDaLib\\Tests\\": "tests/" | ||
} | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "Like Sistemas", | ||
"email": "[email protected]", | ||
"homepage": "https://www.likesistemas.com.br/" | ||
} | ||
], | ||
"scripts": { | ||
"fix": "php-cs-fixer fix", | ||
"fix:ci": "php-cs-fixer fix --dry-run --stop-on-violation", | ||
"test": "phpunit", | ||
"analyse": "phpstan analyse" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
version: '3.7' | ||
networks: | ||
github: | ||
name: github | ||
driver: bridge | ||
|
||
services: | ||
|
||
php: | ||
image: likesistemas/php-dev:${PHP_VERSION:-56} | ||
environment: | ||
- CODECOMMIT_HOST=git-codecommit.us-east-1.amazonaws.com | ||
- GITHUB_TOKEN=$GITHUB_TOKEN | ||
- CODECOMMIT_USER=$CODECOMMIT_USER | ||
- CODECOMMIT_PASSWORD=$CODECOMMIT_PASSWORD | ||
- URL_SENTRY=${URL_SENTRY} | ||
volumes: | ||
- ./:/var/www/public/ | ||
networks: | ||
- github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
parameters: | ||
level: 5 | ||
paths: | ||
- src | ||
- tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<phpunit> | ||
<testsuites> | ||
<testsuite name="tests"> | ||
<directory>./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist processUncoveredFilesFromWhitelist="true"> | ||
<directory suffix=".php">./src/</directory> | ||
</whitelist> | ||
</filter> | ||
<logging> | ||
<log type="coverage-clover" target="./tests/phpunit.coverage.xml"/> | ||
<log type="junit" target="./tests/phpunit.report.xml" /> | ||
</logging> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
|
||
namespace Like\NomeDaLib; | ||
|
||
class NomeDaLib { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
namespace Like\NomeDaLib\Tests; | ||
|
||
use Like\NomeDaLib\NomeDaLib; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class NomeDaLibTest extends TestCase { | ||
public function testInstance() { | ||
$this->assertInstanceOf(NomeDaLib::class, new NomeDaLib()); | ||
} | ||
} |