Skip to content

Commit 8fb0e57

Browse files
add Improvements
1 parent c426460 commit 8fb0e57

4 files changed

Lines changed: 44 additions & 48 deletions

File tree

.github/workflows/phpcs.yml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,16 @@ on:
1313
- ".github/workflows/phpcs.yml"
1414

1515
jobs:
16-
build:
16+
phpcs:
17+
name: Run PHP_CodeSniffer
1718
runs-on: ubuntu-latest
1819
steps:
19-
- uses: actions/checkout@v2
20-
with:
21-
fetch-depth: 0
20+
- name: Checkout code
21+
uses: actions/checkout@v4
2222

23-
- name: Install PHP_CodeSniffer
24-
run: |
25-
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
26-
php phpcs.phar --version
27-
28-
- uses: chindit/actions-phpcs@master
29-
with:
30-
files: "**.php" # you may customize glob as needed
31-
phpcs_path: php phpcs.phar
32-
standard: phpcs.xml
33-
dir: src/
23+
- name: Run PHP_CodeSniffer
24+
uses: chindit/actions-phpcs@master
25+
with:
26+
files: "**.php"
27+
standard: phpcs.xml
28+
dir: src/

.github/workflows/phpstan.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,21 @@ jobs:
66
name: Run PHPStan
77
runs-on: ubuntu-latest
88
steps:
9-
# Configurar a versão correta do PHP
10-
- name: Setup PHP
9+
# Set up PHP
10+
- name: Set up PHP
1111
uses: shivammathur/setup-php@v2
1212
with:
13-
php-version: "8.3" # Ajuste conforme necessário
14-
coverage: none
13+
php-version: "8.4"
1514
extensions: mbstring, json
1615

17-
# Fazer checkout do projeto
16+
# Checkout project
1817
- name: Checkout project
19-
uses: actions/checkout@v2
18+
uses: actions/checkout@v4
2019

21-
# Executar o PHPStan
20+
# Install Composer dependencies
21+
- name: Install Composer dependencies
22+
run: composer install --prefer-dist --no-progress --no-suggest
23+
24+
# Run PHPStan
2225
- name: Run PHPStan
23-
uses: actions-x/phpstan@v1
24-
with:
25-
installComposer: 2
26-
phpstanVersion: 2.0.4
27-
level: 9
28-
paths: conf src
29-
configPath: phpstan.neon
30-
useBundled: 1
31-
arguments: --autoload-file src/resource/ConstantPhpStan.php
26+
run: vendor/bin/phpstan analyse conf src --level=9 --configuration=phpstan.neon --autoload-file=src/resource/ConstantPhpStan.php --memory-limit=512M

.github/workflows/phpunit.yml

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,44 @@
11
name: "PHPUnit - CI"
22

3-
on: [push]
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
pull_request:
48

59
jobs:
610
build-test:
711
runs-on: ubuntu-latest
812
steps:
9-
# Checkout the repository
10-
- name: Checkout code
13+
- name: Checkout repository
1114
uses: actions/checkout@v4
1215

13-
# Set up PHP
1416
- name: Set up PHP
1517
uses: shivammathur/setup-php@v2
1618
with:
1719
php-version: "8.3"
1820
extensions: xdebug
19-
ini-values: |
20-
memory_limit=512M
21+
ini-values: memory_limit=512M
2122
coverage: xdebug
23+
tools: composer:v2
2224

23-
# Show PHP version
24-
- name: Show PHP version
25-
run: php -v
25+
- name: Validate composer.json and composer.lock
26+
run: composer validate --strict
2627

27-
# Install Composer dependencies
2828
- name: Install Composer dependencies
29-
run: composer install --prefer-dist --no-progress --no-suggest
29+
run: composer install --prefer-dist --no-interaction --no-progress --no-suggest
3030

31-
# Check Composer platform requirements
3231
- name: Check Composer platform requirements
3332
run: composer check-platform-reqs
3433

35-
# Run PHPUnit tests
36-
- name: Run PHPUnit tests
37-
run: ./vendor/bin/phpunit --configuration phpunit.xml --coverage-clover ./coverage.xml
34+
- name: Show PHP version
35+
run: php -v
36+
37+
- name: Run PHPUnit tests with coverage
38+
run: ./vendor/bin/phpunit --configuration phpunit.xml --coverage-clover=coverage.xml
39+
40+
- name: Upload coverage report
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: coverage-report
44+
path: coverage.xml

src/Format.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,8 @@ public static function writeCurrencyExtensive(float $numeral): string
311311
{
312312
if ($numeral <= 0) {
313313
throw new InvalidArgumentException('O valor numeral deve ser maior que zero!');
314-
} else {
315-
return parent::extensive($numeral);
316314
}
315+
return parent::extensive($numeral);
317316
}
318317

319318
public static function restructFileArray(array $file = []): array

0 commit comments

Comments
 (0)