Skip to content

Commit 5387023

Browse files
authored
Upgrade dependencies (#6)
* Upgrade dependencies * Use GH Actions for test * Fix lint and analysis
1 parent 910571b commit 5387023

34 files changed

+143
-164
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Tests
2+
3+
env:
4+
PHP_VERSION: 8.3
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
tests:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: ${{ env.PHP_VERSION }}
22+
23+
- name: Install dependencies
24+
run: composer install --prefer-dist --no-progress --no-suggest
25+
26+
- name: Lint
27+
run: composer lint
28+
29+
- name: Static analysis
30+
run: composer stan
31+
32+
- name: Test
33+
run: composer test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ composer.lock
33
/vendor/
44
.phpunit.result.cache
55
.idea/
6+
.phpunit.cache

.scrutinizer.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[![Build Status](https://travis-ci.org/cgauge/password-strength-lib.svg?branch=master)](https://travis-ci.org/cgauge/password-strength-lib)
2-
[![Code Coverage](https://scrutinizer-ci.com/g/cgauge/password-strength-lib/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/cgauge/password-strength-lib/?branch=master)
3-
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/cgauge/password-strength-lib/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/cgauge/password-strength-lib/?branch=master)
41
# Password Strength Library 🔒
52

63
This library is used to validade the strength of a password. It's composed by a set of Rules that can be used individualy or aggregated by a rule chain.

composer.json

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
}
1010
],
1111
"require": {
12-
"php": ">=7.4"
12+
"php": ">=8.2"
1313
},
1414
"require-dev": {
15-
"phpunit/phpunit": "^9.5",
16-
"doctrine/coding-standard": "^9.0",
17-
"phpstan/phpstan": "^0.12.64"
15+
"phpunit/phpunit": "^12.0",
16+
"doctrine/coding-standard": "^13.0",
17+
"phpstan/phpstan": "^2.0"
1818
},
1919
"autoload": {
2020
"psr-4": {
@@ -23,11 +23,18 @@
2323
},
2424
"autoload-dev": {
2525
"psr-4": {
26-
"Test\\CustomerGauge\\Password\\": "tests/"
26+
"Tests\\CustomerGauge\\Password\\": "tests/"
2727
}
2828
},
2929
"scripts": {
30-
"phpstan": "phpstan analyze src --level 8",
31-
"static-analyze": ["phpcs", "@phpstan"]
30+
"lint": "phpcs",
31+
"stan": "phpstan analyze --level=9 ./src ./tests",
32+
"test": "phpunit",
33+
"test:coverage": "XDEBUG_MODE=coverage phpunit --coverage-text"
34+
},
35+
"config": {
36+
"allow-plugins": {
37+
"dealerdirect/phpcodesniffer-composer-installer": true
38+
}
3239
}
3340
}

phpcs.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@
1616
<rule ref="Doctrine"/>
1717

1818
<file>src</file>
19+
<file>tests</file>
1920
</ruleset>

phpunit.xml.dist

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
backupGlobals="false" backupStaticAttributes="false" bootstrap="vendor/autoload.php"
4-
colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true"
5-
convertWarningsToExceptions="true" processIsolation="false"
6-
stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
7-
<coverage processUncoveredFiles="true">
8-
<include>
9-
<directory suffix=".php">./src</directory>
10-
</include>
11-
</coverage>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/12.2/phpunit.xsd"
4+
backupGlobals="false"
5+
bootstrap="vendor/autoload.php"
6+
colors="true"
7+
processIsolation="false"
8+
stopOnFailure="false"
9+
cacheDirectory=".phpunit.cache"
10+
backupStaticProperties="false">
1211
<testsuites>
1312
<testsuite name="Unit Tests">
1413
<directory suffix="Test.php">./tests</directory>
1514
</testsuite>
1615
</testsuites>
16+
<source>
17+
<include>
18+
<directory suffix=".php">./src</directory>
19+
</include>
20+
</source>
1721
</phpunit>

src/Exception/InvalidCharacterType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public static function requires(string $type, int $required, int $provided): sel
3333
'Password should have at least %d %s character(s) but %d found.',
3434
$required,
3535
$type,
36-
$provided
36+
$provided,
3737
);
3838

3939
return new static($message);

src/Exception/InvalidLength.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public static function requires(string $type, int $required, int $provided): sel
3333
'The %s length should be %d character(s) and %d was provided.',
3434
$type,
3535
$required,
36-
$provided
36+
$provided,
3737
);
3838

3939
return new static($message);

0 commit comments

Comments
 (0)