Skip to content

Commit ee6f13e

Browse files
walmir-silvaWalmir Silva
andauthored
Adjust settings for composer repository (#8)
* add data structure contracts and tests * feat: Add and configure PHP quality and testing libraries - Added `friendsofphp/php-cs-fixer` for code style fixing. - Added `nunomaduro/phpinsights` for code quality and insights. - Updated `phpunit/phpunit` to version 10.5 for unit testing. - Added `squizlabs/php_codesniffer` for code style checking. - Added `mockery/mockery` for mocking objects in unit tests. - Added `enlightn/security-checker` for checking security vulnerabilities in dependencies. Configured these libraries to ensure code quality, consistency, and security. ### Changes Introduced 1. **Code Style Fixing**: - Added `friendsofphp/php-cs-fixer` (^3.58) to automatically fix PHP code to follow defined coding standards. 2. **Code Quality Insights**: - Added `nunomaduro/phpinsights` (^2.11) to provide code quality and performance insights. 3. **Unit Testing**: - Updated `phpunit/phpunit` to version ^10.5 to ensure robust and comprehensive testing of the codebase. 4. **Code Style Checking**: - Added `squizlabs/php_codesniffer` (^3.10) to detect violations of defined coding standards. 5. **Mocking in Unit Tests**: - Added `mockery/mockery` (^1.6) to provide an expressive and flexible API for mocking objects in unit tests. 6. **Security Vulnerability Checking**: - Added `enlightn/security-checker` (^2.0) to scan for known security vulnerabilities in project dependencies. ### Usage - **Code Style Fixing**: ```sh vendor/bin/php-cs-fixer fix ``` - **Code Quality Insights**: ```sh vendor/bin/phpinsights ``` - **Unit Testing**: ```sh vendor/bin/phpunit ``` - **Code Style Checking**: ```sh vendor/bin/phpcs ``` - **Mocking in Unit Tests**: - Use Mockery within your PHPUnit tests to create mocks and set expectations. - **Security Vulnerability Checking**: ```sh vendor/bin/security-checker security:check ``` ### Benefits - Ensures consistent code style across the project. - Provides actionable insights to improve code quality. - Enhances testing capabilities with updated PHPUnit and Mockery. - Ensures project dependencies are free from known security vulnerabilities. ### Notes - Ensure that the required binaries are executable in your environment. - Integrate these tools into your CI/CD pipeline for automated checks. * resolve style PSR * add Translate README to Brazilian Portuguese * update ci * Update composer.json to exclude unnecessary files and directories for package distribution * adjust lock composer * adjust lock composer * adjust .env.example * update .env.example * Add .phpcs-cache to .gitignore and remove from version control * update url repository in composer file * add git attributed file * remove file exclud reference * Adjust settings for composer --------- Co-authored-by: Walmir Silva <walmir.silva@growthdev.com.br>
1 parent 8171245 commit ee6f13e

File tree

3 files changed

+21
-26
lines changed

3 files changed

+21
-26
lines changed

.gitattributes

Lines changed: 17 additions & 0 deletions
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

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
/phpstan.neon.dist
99
/phpstan.neon.cache
1010
/.phpstan.result.cache
11+
/.phpcs-cache
1112

1213
# Dependências
1314
/vendor/

composer.json

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "kariricode/contract",
3-
"description": "The interface code implementations in PHP for the given namespaces and descriptions, following PSR standards, using modern PHP",
3+
"description": "Central repository for interface definitions in the KaririCode Framework. Implements interface code in PHP for specified namespaces, adhering to PSR standards and leveraging modern PHP features.",
44
"keywords": [
55
"contract",
66
"interface",
@@ -37,31 +37,8 @@
3737
}
3838
},
3939
"support": {
40-
"issues": "https://github.com/Kariri-PHP-Framework/kariri-contract/issues",
41-
"source": "https://github.com/Kariri-PHP-Framework/kariri-contract"
42-
},
43-
"archive": {
44-
"exclude": [
45-
"/.docker",
46-
"/.github",
47-
"/.vscode",
48-
"/tests",
49-
"/vendor",
50-
"/.env",
51-
"/.env.example",
52-
"/.gitignore",
53-
"/.php-cs-fixer.php",
54-
"/.phpcs-cache",
55-
"/docker-compose.yml",
56-
"/phpcs.xml",
57-
"/phpinsights.php",
58-
"/phpstan.neon",
59-
"/phpunit.xml",
60-
"/psalm.xml",
61-
"/Makefile",
62-
"/README.md",
63-
"/README.pt-br.md"
64-
]
40+
"issues": "https://github.com/KaririCode-Framework/kariricode-contract/issues",
41+
"source": "https://github.com/KaririCode-Framework/kariricode-contract"
6542
},
6643
"require-dev": {
6744
"friendsofphp/php-cs-fixer": "^3.58",

0 commit comments

Comments
 (0)