-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It has been four years since I've changed anything in this library, and this commit will make the code more up-to-date. - Configure GitHub actions - Configure integration with Codecov - Configure PHPStan - Remove integration with Scrutinizer - Remove integration with Travis - Upgrade Composer scripts - Upgrade PHPUnit's version - Upgrade Respect's coding standard - Upgrade LICENSE file - Upgrade license headers Because of the new coding standards, there have been some backward compatibility changes, but that's not a problem because it won't change much of the final API. Because of the upgraded packages, I had to drop the support PHP versions before 8.1. Signed-off-by: Henrique Moody <[email protected]>
- Loading branch information
1 parent
868216d
commit e88515f
Showing
48 changed files
with
449 additions
and
884 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 |
---|---|---|
@@ -1,8 +1,5 @@ | ||
/* | ||
* This file is part of Respect/Stringifier. | ||
* | ||
* (c) Henrique Moody <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the "LICENSE.md" | ||
* file that was distributed with this source code. | ||
* Copyright (c) Henrique Moody <[email protected]> | ||
* SPDX-License-Identifier: MIT | ||
*/ |
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,87 @@ | ||
name: Continuous Integration | ||
|
||
on: | ||
push: ~ | ||
pull_request: ~ | ||
|
||
jobs: | ||
tests: | ||
name: Tests | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
php-version: | ||
- "8.1" | ||
- "8.2" | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
coverage: none | ||
|
||
- name: Install Dependencies | ||
run: composer install --prefer-dist | ||
|
||
- name: Run Unit Tests | ||
run: ./vendor/bin/phpunit --testsuite=unit | ||
|
||
- name: Run Integration Tests | ||
run: ./vendor/bin/phpunit --testsuite=integration | ||
|
||
code-coverage: | ||
name: Code coverage | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.1 | ||
coverage: pcov | ||
|
||
- name: Install Dependencies | ||
run: composer install --prefer-dist | ||
|
||
- name: Generating Code Coverage Report | ||
run: ./vendor/bin/phpunit --testsuite=unit --coverage-clover=coverage.xml | ||
|
||
- name: Send Code Coverage Report to Codecov.io | ||
uses: codecov/codecov-action@v3 | ||
|
||
static-analysis: | ||
name: Static Analysis | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.1 | ||
coverage: none | ||
|
||
- name: Install dependencies | ||
run: composer install --prefer-dist | ||
|
||
- name: Run DocHeader | ||
run: vendor/bin/docheader check src/ tests/ | ||
|
||
- name: Run PHP_CodeSniffer | ||
run: vendor/bin/phpcs | ||
|
||
- name: Run PHPStan | ||
run: vendor/bin/phpstan |
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,4 +1,5 @@ | ||
.phpcs.cache | ||
.phpunit.cache | ||
composer.lock | ||
phpcs.xml | ||
phpunit.xml | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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
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,8 @@ | ||
parameters: | ||
level: max | ||
paths: | ||
- src/ | ||
- tests/ | ||
fileExtensions: | ||
- php | ||
- phpt |
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,26 +1,19 @@ | ||
<phpunit bootstrap="vendor/autoload.php" | ||
backupGlobals="false" | ||
backupStaticAttributes="false" | ||
cacheTokens="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
syntaxCheck="false" | ||
colors="true" | ||
verbose="true"> | ||
<testsuites> | ||
<testsuite name="unit"> | ||
<directory suffix="Test.php">tests/unit/</directory> | ||
</testsuite> | ||
<testsuite name="integration"> | ||
<directory suffix=".phpt">tests/integration/</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist processUncoveredFilesFromWhitelist="true"> | ||
<directory>src/</directory> | ||
</whitelist> | ||
</filter> | ||
<?xml version="1.0"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
bootstrap="vendor/autoload.php" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" | ||
cacheDirectory=".phpunit.cache"> | ||
<coverage> | ||
<include> | ||
<directory>src/</directory> | ||
</include> | ||
</coverage> | ||
<testsuites> | ||
<testsuite name="integration"> | ||
<directory suffix="Test.php">tests/integration/</directory> | ||
</testsuite> | ||
<testsuite name="unit"> | ||
<directory suffix="Test.php">tests/unit/</directory> | ||
</testsuite> | ||
</testsuites> | ||
</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 |
---|---|---|
|
@@ -2,11 +2,8 @@ | |
|
||
/* | ||
* This file is part of Respect/Stringifier. | ||
* | ||
* (c) Henrique Moody <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the "LICENSE.md" | ||
* file that was distributed with this source code. | ||
* Copyright (c) Henrique Moody <[email protected]> | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
@@ -15,12 +12,5 @@ | |
|
||
interface Quoter | ||
{ | ||
/** | ||
* Should add quotes to the given string. | ||
* | ||
* @param string $string The string to add quotes to | ||
* @param int $depth The current depth | ||
* | ||
*/ | ||
public function quote(string $string, int $depth): string; | ||
} |
Oops, something went wrong.