diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..bd17639 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: [staabm] diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..0f111c6 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +# Dependabot config reference +# https://help.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: composer + directory: / + versioning-strategy: increase + schedule: + interval: monthly + + - package-ecosystem: github-actions + directory: / + schedule: + interval: monthly diff --git a/.github/workflows/php-linter.yml b/.github/workflows/php-linter.yml new file mode 100644 index 0000000..9a8180b --- /dev/null +++ b/.github/workflows/php-linter.yml @@ -0,0 +1,29 @@ +name: PHP Linter + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +jobs: + php-linter: + runs-on: ubuntu-latest + if: github.event.pull_request.draft == false + + steps: + - uses: actions/checkout@v4 + with: + repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }} + ref: ${{ github.event.client_payload.pull_request.head.ref }} + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + coverage: none + tools: parallel-lint + + - name: Lint PHP + run: composer exec --no-interaction -- parallel-lint bin/ lib/ tests/ diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 0000000..0ae22d9 --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,45 @@ +name: Unit tests + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +jobs: + phpunit: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + include: + - os: ubuntu-latest + php-version: '7.4' + - os: ubuntu-latest + php-version: '8.0' + - os: ubuntu-latest + php-version: '8.1' + - os: ubuntu-latest + php-version: '8.2' + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + coverage: none # disable xdebug, pcov + + - name: Composer install + uses: ramsey/composer-install@v3 + with: + composer-options: '--ansi --prefer-dist' + + - name: Setup Problem Matchers for PHPUnit + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: Run unit tests + run: vendor/bin/phpunit --colors=always diff --git a/.gitignore b/.gitignore index f6134a2..92f7dcb 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ bundles/* !bundles/. -.idea \ No newline at end of file +.idea +.phpunit.result.cache diff --git a/src/AbstractPasswordExposedChecker.php b/src/AbstractPasswordExposedChecker.php index ef8d7a5..bc6a268 100644 --- a/src/AbstractPasswordExposedChecker.php +++ b/src/AbstractPasswordExposedChecker.php @@ -106,7 +106,7 @@ public function isExposedByHash(string $hash): ?bool } /** - * @param $hash + * @param string $hash * * @throws \Psr\Http\Client\ClientExceptionInterface * @@ -121,7 +121,7 @@ protected function makeRequest(string $hash): ResponseInterface } /** - * @param $string + * @param string $string * * @return string */