-
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
Showing
5 changed files
with
123 additions
and
4 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,44 @@ | ||
name: PHP Composer | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up PHP 8.2 | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.2 | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate | ||
|
||
- name: Cache Composer packages | ||
id: composer-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-php- | ||
- name: Install dependencies | ||
run: composer install --prefer-dist --no-progress | ||
|
||
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" | ||
# Docs: https://getcomposer.org/doc/articles/scripts.md | ||
|
||
# - name: Run test suite | ||
# run: composer run-script test |
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,43 @@ | ||
name: PHP Lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
php-version: ['8.2'] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
|
||
- name: Install PHP_CodeSniffer | ||
run: composer global require "squizlabs/php_codesniffer=*" | ||
|
||
- name: Run PHP_CodeSniffer | ||
run: ~/.composer/vendor/bin/phpcs | ||
|
||
- name: Upload PHP_CodeSniffer results | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: phpcs-results | ||
path: phpcs.xml | ||
|
||
- name: Display PHP_CodeSniffer results | ||
if: always() | ||
run: cat phpcs.xml |
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,28 @@ | ||
name: PHPUnit Tests | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.2' # PHP version updated to 8.2 | ||
extensions: mbstring, intl | ||
coverage: xdebug # If you need code coverage | ||
|
||
- name: Install dependencies | ||
run: composer install --prefer-dist --no-progress --no-suggest | ||
|
||
- name: Run PHPUnit | ||
run: vendor/bin/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 |
---|---|---|
@@ -1 +1 @@ | ||
{"config":{"phpVersion":80226,"phpExtensions":"6444a8d24aa127a4fe13989038fc4447","tabWidth":4,"encoding":"utf-8","recordErrors":true,"annotations":true,"configData":[],"codeHash":"b5dc58ae9d1a395f86384fd9a1678bb4","rulesetHash":"670f8348153700c3a70fc6127ca0e484"},"\/home\/carlos\/Projects\/factory\/src\/Exceptions\/ClassNotFoundException.php":{"hash":"ef42127b99db182750f3cb885f5a00a233204","errors":[],"warnings":[],"metrics":{"Declarations and side effects mixed":{"values":{"no":1}},"PHP short open tag used":{"values":{"no":1}},"EOL char":{"values":{"\\n":1}},"Number of newlines at EOF":{"values":{"1":1}},"PHP closing tag at end of PHP-only file":{"values":{"no":1}},"Line length":{"values":{"80 or less":5}},"PHP keyword case":{"values":{"lower":3}},"Multiple statements on same line":{"values":{"no":1}},"One class per file":{"values":{"yes":1}},"Class defined in namespace":{"values":{"yes":1}},"PascalCase class name":{"values":{"yes":1}},"Class opening brace placement":{"values":{"new line":1}}},"errorCount":0,"warningCount":0,"fixableCount":0,"numTokens":23},"\/home\/carlos\/Projects\/factory\/src\/Exceptions\/ServiceNotFoundException.php":{"hash":"fd4d95418d462fa9339b8f96cf301a7533204","errors":[],"warnings":[],"metrics":{"Declarations and side effects mixed":{"values":{"no":1}},"PHP short open tag used":{"values":{"no":1}},"EOL char":{"values":{"\\n":1}},"Number of newlines at EOF":{"values":{"1":1}},"PHP closing tag at end of PHP-only file":{"values":{"no":1}},"Line length":{"values":{"80 or less":5}},"PHP keyword case":{"values":{"lower":3}},"Multiple statements on same line":{"values":{"no":1}},"One class per file":{"values":{"yes":1}},"Class defined in namespace":{"values":{"yes":1}},"PascalCase class name":{"values":{"yes":1}},"Class opening brace placement":{"values":{"new line":1}}},"errorCount":0,"warningCount":0,"fixableCount":0,"numTokens":23},"\/home\/carlos\/Projects\/factory\/src\/ServiceFactory.php":{"hash":"56e242256f0874adfa49963d1503e82333204","errors":[],"warnings":[],"metrics":{"Declarations and side effects mixed":{"values":{"no":1}},"PHP short open tag used":{"values":{"no":1}},"EOL char":{"values":{"\\n":1}},"Number of newlines at EOF":{"values":{"1":1}},"PHP closing tag at end of PHP-only file":{"values":{"no":1}},"Line length":{"values":{"80 or less":77,"81-120":11}},"Line indent":{"values":{"spaces":81}},"PHP keyword case":{"values":{"lower":51}},"Multiple statements on same line":{"values":{"no":25}},"One class per file":{"values":{"yes":1}},"Class defined in namespace":{"values":{"yes":1}},"PascalCase class name":{"values":{"yes":1}},"Class opening brace placement":{"values":{"new line":1}},"PHP type case":{"values":{"lower":19}},"CamelCase method name":{"values":{"yes":5}},"Function opening brace placement":{"values":{"new line":5}},"Spaces after control structure open parenthesis":{"values":[8]},"Spaces before control structure close parenthesis":{"values":[8]},"Blank lines at start of control structure":{"values":[8]},"Blank lines at end of control structure":{"values":[8]},"Control structure defined inline":{"values":{"no":7}},"PHP constant case":{"values":{"lower":5}}},"errorCount":0,"warningCount":0,"fixableCount":0,"numTokens":757}} | ||
{"config":{"phpVersion":80226,"phpExtensions":"6444a8d24aa127a4fe13989038fc4447","tabWidth":4,"encoding":"utf-8","recordErrors":true,"annotations":true,"configData":[],"codeHash":"b5dc58ae9d1a395f86384fd9a1678bb4","rulesetHash":"670f8348153700c3a70fc6127ca0e484"},"\/home\/carlos\/Projects\/factory\/src\/Exceptions\/ClassNotFoundException.php":{"hash":"ef42127b99db182750f3cb885f5a00a233204","errors":[],"warnings":[],"metrics":{"Declarations and side effects mixed":{"values":{"no":1}},"PHP short open tag used":{"values":{"no":1}},"EOL char":{"values":{"\\n":1}},"Number of newlines at EOF":{"values":{"1":1}},"PHP closing tag at end of PHP-only file":{"values":{"no":1}},"Line length":{"values":{"80 or less":5}},"PHP keyword case":{"values":{"lower":3}},"Multiple statements on same line":{"values":{"no":1}},"One class per file":{"values":{"yes":1}},"Class defined in namespace":{"values":{"yes":1}},"PascalCase class name":{"values":{"yes":1}},"Class opening brace placement":{"values":{"new line":1}}},"errorCount":0,"warningCount":0,"fixableCount":0,"numTokens":23},"\/home\/carlos\/Projects\/factory\/src\/Exceptions\/ServiceNotFoundException.php":{"hash":"fd4d95418d462fa9339b8f96cf301a7533204","errors":[],"warnings":[],"metrics":{"Declarations and side effects mixed":{"values":{"no":1}},"PHP short open tag used":{"values":{"no":1}},"EOL char":{"values":{"\\n":1}},"Number of newlines at EOF":{"values":{"1":1}},"PHP closing tag at end of PHP-only file":{"values":{"no":1}},"Line length":{"values":{"80 or less":5}},"PHP keyword case":{"values":{"lower":3}},"Multiple statements on same line":{"values":{"no":1}},"One class per file":{"values":{"yes":1}},"Class defined in namespace":{"values":{"yes":1}},"PascalCase class name":{"values":{"yes":1}},"Class opening brace placement":{"values":{"new line":1}}},"errorCount":0,"warningCount":0,"fixableCount":0,"numTokens":23},"\/home\/carlos\/Projects\/factory\/src\/ServiceFactory.php":{"hash":"8af11ef2a53563eb49f1e8f2415d9a7b33204","errors":{"125":{"13":[{"message":"No blank line found after control structure","source":"Squiz.WhiteSpace.ControlStructureSpacing.NoLineAfterClose","listener":"PHP_CodeSniffer\\Standards\\Squiz\\Sniffs\\WhiteSpace\\ControlStructureSpacingSniff","severity":0,"fixable":true}]}},"warnings":[],"metrics":{"Declarations and side effects mixed":{"values":{"no":1}},"PHP short open tag used":{"values":{"no":1}},"EOL char":{"values":{"\\n":1}},"Number of newlines at EOF":{"values":{"1":1}},"PHP closing tag at end of PHP-only file":{"values":{"no":1}},"Line length":{"values":{"80 or less":100,"81-120":11}},"Line indent":{"values":{"spaces":104}},"PHP keyword case":{"values":{"lower":64}},"Multiple statements on same line":{"values":{"no":26}},"One class per file":{"values":{"yes":1}},"Class defined in namespace":{"values":{"yes":1}},"PascalCase class name":{"values":{"yes":1}},"Class opening brace placement":{"values":{"new line":1}},"PHP type case":{"values":{"lower":19}},"CamelCase method name":{"values":{"yes":6}},"Function opening brace placement":{"values":{"new line":6}},"Spaces after control structure open parenthesis":{"values":[12]},"Spaces before control structure close parenthesis":{"values":[12]},"Blank lines at start of control structure":{"values":[13]},"Blank lines at end of control structure":{"values":[13]},"Control structure defined inline":{"values":{"no":10}},"PHP constant case":{"values":{"lower":8}}},"errorCount":1,"warningCount":0,"fixableCount":1,"numTokens":870}} |
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