Skip to content

Commit

Permalink
EA-5554: Update to deps and code to PHP8.2
Browse files Browse the repository at this point in the history
* dependencies update
* add rector for easy code updates
  • Loading branch information
sleipi committed Nov 30, 2023
1 parent 65115ba commit 41f04c6
Show file tree
Hide file tree
Showing 45 changed files with 2,036 additions and 2,681 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: UnitTesting

on: [push]

jobs:
tests:
name: "Tests"

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php-version:
- "8.2"

steps:
- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"
coverage: xdebug3

- name: "Checkout"
uses: actions/checkout@v2

- name: "Install dependencies"
run: composer install --prefer-dist --no-progress

- name: "Check Code Style"
run: composer phpcs-dry
env:
PHP_CS_FIXER_IGNORE_ENV: 1

- name: "Run PHP Static Analysis Tool"
run: vendor/bin/phpstan

- name: "Run static analysis"
run: vendor/bin/psalm

- name: "Run test suite"
run: vendor/bin/phpunit --coverage-clover=coverage.xml

- name: "Run mutation tests"
run: vendor/bin/infection --min-covered-msi=98 --min-msi=98

# - name: "Send coverage to codecov.io"
# uses: codecov/codecov-action@v1
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
var/
build
.php_cs.cache
**/.phpunit.result.cache
**/.phpunit.result.cache
/.phpunit.cache
/.php-cs-fixer.cache
6 changes: 4 additions & 2 deletions .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<?php declare(strict_types=1);

require_once __DIR__ . '/vendor/autoload.php';

$finder = PhpCsFixer\Finder::create();
$finder->in(['src', 'tests', 'public']);

$config = PhpCsFixer\Config::create();
$config = new PhpCsFixer\Config();
$config->setFinder($finder);
$config->setRules(['@PSR2' => true]);
$config->setRules(['@PSR12' => true]);

return $config;
2 changes: 1 addition & 1 deletion .phpunit.result.cache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
C:37:"PHPUnit\Runner\DefaultTestResultCache":4793:{a:2:{s:7:"defects";a:0:{}s:5:"times";a:63:{s:74:"JTL\OpsGenie\Client\Alert\AlertTest::testCanCreateAlertWithDefaultPriority";d:0.002;s:67:"JTL\OpsGenie\Client\Alert\AlertTest::testCanCreateAlertWithPriority";d:0;s:54:"JTL\OpsGenie\Client\Alert\AlertTest::testCanReadEntity";d:0;s:53:"JTL\OpsGenie\Client\Alert\AlertTest::testCanReadAlias";d:0;s:55:"JTL\OpsGenie\Client\Alert\AlertTest::testCanReadMessage";d:0;s:54:"JTL\OpsGenie\Client\Alert\AlertTest::testCanReadSource";d:0;s:62:"JTL\OpsGenie\Client\Alert\AlertTest::testDescriptionIsOptional";d:0;s:58:"JTL\OpsGenie\Client\Alert\AlertTest::testCanSetDescription";d:0;s:60:"JTL\OpsGenie\Client\Alert\AlertTest::testResponderIsOptional";d:0;s:53:"JTL\OpsGenie\Client\Alert\AlertTest::testSetResponder";d:0.003;s:54:"JTL\OpsGenie\Client\Alert\AlertTest::testTagIsOptional";d:0;s:50:"JTL\OpsGenie\Client\Alert\AlertTest::testAppendTag";d:0;s:72:"JTL\OpsGenie\Client\Alert\CloseAlertRequestTest::testCanCreateCorrectUrl";d:0;s:68:"JTL\OpsGenie\Client\Alert\CloseAlertRequestTest::testUrlIsUrlEncoded";d:0;s:66:"JTL\OpsGenie\Client\Alert\CloseAlertRequestTest::testNotIsOptional";d:0;s:63:"JTL\OpsGenie\Client\Alert\CloseAlertRequestTest::testCanSetNote";d:0;s:67:"JTL\OpsGenie\Client\Alert\CloseAlertRequestTest::testUserIsOptional";d:0;s:63:"JTL\OpsGenie\Client\Alert\CloseAlertRequestTest::testCanSetUser";d:0;s:69:"JTL\OpsGenie\Client\Alert\CloseAlertRequestTest::testSourceIsOptional";d:0;s:65:"JTL\OpsGenie\Client\Alert\CloseAlertRequestTest::testCanSetSource";d:0;s:69:"JTL\OpsGenie\Client\Alert\CloseAlertRequestTest::testCanGetHttpMethod";d:0;s:77:"JTL\OpsGenie\Client\Alert\CloseAlertResponseTest::testHttpCode202IsSuccessful";d:0;s:75:"JTL\OpsGenie\Client\Alert\CreateAlertRequestTest::testCanCreateAlertRequest";d:0.001;s:71:"JTL\OpsGenie\Client\Alert\CreateAlertRequestTest::testCanSetDescription";d:0.002;s:72:"JTL\OpsGenie\Client\Alert\CreateAlertRequestTest::testCanAppendResponder";d:0;s:67:"JTL\OpsGenie\Client\Alert\CreateAlertRequestTest::testCanAppendTags";d:0;s:71:"JTL\OpsGenie\Client\Alert\CreateAlertRequestTest::testCanGetRequestBody";d:0.001;s:70:"JTL\OpsGenie\Client\Alert\CreateAlertRequestTest::testHttpMethodIsPost";d:0;s:65:"JTL\OpsGenie\Client\Alert\CreateAlertRequestTest::testUrlIsAlerts";d:0;s:78:"JTL\OpsGenie\Client\Alert\CreateAlertResponseTest::testHttpCode202IsSuccessful";d:0;s:70:"JTL\OpsGenie\Client\Alert\GetAlertRequestTest::testCanCreateCorrectUrl";d:0;s:80:"JTL\OpsGenie\Client\Alert\GetAlertRequestTest::testCanCreateCorrectUrlEncodedUrl";d:0;s:58:"JTL\OpsGenie\Client\Alert\GetAlertRequestTest::testGetBody";d:0;s:64:"JTL\OpsGenie\Client\Alert\GetAlertRequestTest::testGetHttpMethod";d:0;s:64:"JTL\OpsGenie\Client\Alert\GetAlertResponseTest::testIsSuccessful";d:0;s:81:"JTL\OpsGenie\Client\Alert\GetAlertResponseTest::testCanConstructAlertFromResponse";d:0;s:82:"JTL\OpsGenie\Client\Alert\GetAlertResponseTest::testNoAlertIsConstructedWhenNoData";d:0;s:69:"JTL\OpsGenie\Client\AlertApiClientTest::testCanSendCreateAlertRequest";d:0.001;s:66:"JTL\OpsGenie\Client\AlertApiClientTest::testCanSendGetAlertRequest";d:0.001;s:68:"JTL\OpsGenie\Client\AlertApiClientTest::testCanSendCloseAlertRequest";d:0.001;s:58:"JTL\OpsGenie\Client\ErrorResponseTest::testIsNotSuccessful";d:0;s:66:"JTL\OpsGenie\Client\Heartbeat\PingRequestTest::testHttpMethodIsPut";d:0;s:62:"JTL\OpsGenie\Client\Heartbeat\PingRequestTest::testBodyIsEmpty";d:0;s:57:"JTL\OpsGenie\Client\Heartbeat\PingRequestTest::testGetUrl";d:0;s:64:"JTL\OpsGenie\Client\Heartbeat\PingResponseTest::testIsSuccessful";d:0;s:67:"JTL\OpsGenie\Client\Heartbeat\PingResponseTest::testIsNotSuccessful";d:0;s:56:"JTL\OpsGenie\Client\HeartbeatApiClientTest::testSendPing";d:0.001;s:56:"JTL\OpsGenie\Client\OpsGenieResponseTest::testGetMessage";d:0;s:59:"JTL\OpsGenie\Client\OpsGenieResponseTest::testGetStatusCode";d:0;s:58:"JTL\OpsGenie\Client\OpsGenieResponseTest::testGetRequestId";d:0;s:57:"JTL\OpsGenie\Client\OpsGenieResponseTest::testGetFromBody";d:0;s:55:"JTL\OpsGenie\Client\PriorityTest::testCanCreateCritical";d:0;s:51:"JTL\OpsGenie\Client\PriorityTest::testCanCreateHigh";d:0;s:55:"JTL\OpsGenie\Client\PriorityTest::testCanCreateModerate";d:0;s:50:"JTL\OpsGenie\Client\PriorityTest::testCanCreateLow";d:0;s:60:"JTL\OpsGenie\Client\PriorityTest::testCanCreateInformational";d:0;s:53:"JTL\OpsGenie\Client\PriorityTest::testCanCastToString";d:0;s:55:"JTL\OpsGenie\Client\ResponderTest::testCanCreateForTeam";d:0;s:55:"JTL\OpsGenie\Client\ResponderTest::testCanCreateForUser";d:0;s:61:"JTL\OpsGenie\Client\ResponderTest::testCanCreateForEscalation";d:0;s:59:"JTL\OpsGenie\Client\ResponderTest::testCanCreateForSchedule";d:0;s:48:"JTL\OpsGenie\Client\ResponderTest::testCanReadId";d:0;s:50:"JTL\OpsGenie\Client\ResponderTest::testCanReadType";d:0;}}}
{"version":1,"defects":[],"times":{"JTL\\OpsGenie\\Client\\Alert\\AlertTest::testCanCreateAlertWithDefaultPriority":0.002,"JTL\\OpsGenie\\Client\\Alert\\AlertTest::testCanCreateAlertWithPriority":0,"JTL\\OpsGenie\\Client\\Alert\\AlertTest::testCanReadEntity":0,"JTL\\OpsGenie\\Client\\Alert\\AlertTest::testCanReadAlias":0,"JTL\\OpsGenie\\Client\\Alert\\AlertTest::testCanReadMessage":0,"JTL\\OpsGenie\\Client\\Alert\\AlertTest::testCanReadSource":0,"JTL\\OpsGenie\\Client\\Alert\\AlertTest::testDescriptionIsOptional":0,"JTL\\OpsGenie\\Client\\Alert\\AlertTest::testCanSetDescription":0,"JTL\\OpsGenie\\Client\\Alert\\AlertTest::testResponderIsOptional":0,"JTL\\OpsGenie\\Client\\Alert\\AlertTest::testSetResponder":0.003,"JTL\\OpsGenie\\Client\\Alert\\AlertTest::testTagIsOptional":0,"JTL\\OpsGenie\\Client\\Alert\\AlertTest::testAppendTag":0,"JTL\\OpsGenie\\Client\\Alert\\CloseAlertRequestTest::testCanCreateCorrectUrl":0.001,"JTL\\OpsGenie\\Client\\Alert\\CloseAlertRequestTest::testUrlIsUrlEncoded":0,"JTL\\OpsGenie\\Client\\Alert\\CloseAlertRequestTest::testNotIsOptional":0.001,"JTL\\OpsGenie\\Client\\Alert\\CloseAlertRequestTest::testCanSetNote":0,"JTL\\OpsGenie\\Client\\Alert\\CloseAlertRequestTest::testUserIsOptional":0,"JTL\\OpsGenie\\Client\\Alert\\CloseAlertRequestTest::testCanSetUser":0,"JTL\\OpsGenie\\Client\\Alert\\CloseAlertRequestTest::testSourceIsOptional":0,"JTL\\OpsGenie\\Client\\Alert\\CloseAlertRequestTest::testCanSetSource":0,"JTL\\OpsGenie\\Client\\Alert\\CloseAlertRequestTest::testCanGetHttpMethod":0,"JTL\\OpsGenie\\Client\\Alert\\CloseAlertResponseTest::testHttpCode202IsSuccessful":0,"JTL\\OpsGenie\\Client\\Alert\\CreateAlertRequestTest::testCanCreateAlertRequest":0.002,"JTL\\OpsGenie\\Client\\Alert\\CreateAlertRequestTest::testCanSetDescription":0.003,"JTL\\OpsGenie\\Client\\Alert\\CreateAlertRequestTest::testCanAppendResponder":0.001,"JTL\\OpsGenie\\Client\\Alert\\CreateAlertRequestTest::testCanAppendTags":0.001,"JTL\\OpsGenie\\Client\\Alert\\CreateAlertRequestTest::testCanGetRequestBody":0.002,"JTL\\OpsGenie\\Client\\Alert\\CreateAlertRequestTest::testHttpMethodIsPost":0,"JTL\\OpsGenie\\Client\\Alert\\CreateAlertRequestTest::testUrlIsAlerts":0,"JTL\\OpsGenie\\Client\\Alert\\CreateAlertResponseTest::testHttpCode202IsSuccessful":0,"JTL\\OpsGenie\\Client\\Alert\\GetAlertRequestTest::testCanCreateCorrectUrl":0,"JTL\\OpsGenie\\Client\\Alert\\GetAlertRequestTest::testCanCreateCorrectUrlEncodedUrl":0,"JTL\\OpsGenie\\Client\\Alert\\GetAlertRequestTest::testGetBody":0,"JTL\\OpsGenie\\Client\\Alert\\GetAlertRequestTest::testGetHttpMethod":0,"JTL\\OpsGenie\\Client\\Alert\\GetAlertResponseTest::testIsSuccessful":0.001,"JTL\\OpsGenie\\Client\\Alert\\GetAlertResponseTest::testCanConstructAlertFromResponse":0,"JTL\\OpsGenie\\Client\\Alert\\GetAlertResponseTest::testNoAlertIsConstructedWhenNoData":0,"JTL\\OpsGenie\\Client\\AlertApiClientTest::testCanSendCreateAlertRequest":0.003,"JTL\\OpsGenie\\Client\\AlertApiClientTest::testCanSendGetAlertRequest":0.002,"JTL\\OpsGenie\\Client\\AlertApiClientTest::testCanSendCloseAlertRequest":0.002,"JTL\\OpsGenie\\Client\\ErrorResponseTest::testIsNotSuccessful":0,"JTL\\OpsGenie\\Client\\Heartbeat\\PingRequestTest::testHttpMethodIsPut":0,"JTL\\OpsGenie\\Client\\Heartbeat\\PingRequestTest::testBodyIsEmpty":0,"JTL\\OpsGenie\\Client\\Heartbeat\\PingRequestTest::testGetUrl":0,"JTL\\OpsGenie\\Client\\Heartbeat\\PingResponseTest::testIsSuccessful":0,"JTL\\OpsGenie\\Client\\Heartbeat\\PingResponseTest::testIsNotSuccessful":0,"JTL\\OpsGenie\\Client\\HeartbeatApiClientTest::testSendPing":0.002,"JTL\\OpsGenie\\Client\\OpsGenieResponseTest::testGetMessage":0,"JTL\\OpsGenie\\Client\\OpsGenieResponseTest::testGetStatusCode":0,"JTL\\OpsGenie\\Client\\OpsGenieResponseTest::testGetRequestId":0,"JTL\\OpsGenie\\Client\\OpsGenieResponseTest::testGetFromBody":0,"JTL\\OpsGenie\\Client\\PriorityTest::testCanCreateCritical":0,"JTL\\OpsGenie\\Client\\PriorityTest::testCanCreateHigh":0,"JTL\\OpsGenie\\Client\\PriorityTest::testCanCreateModerate":0,"JTL\\OpsGenie\\Client\\PriorityTest::testCanCreateLow":0,"JTL\\OpsGenie\\Client\\PriorityTest::testCanCreateInformational":0,"JTL\\OpsGenie\\Client\\PriorityTest::testCanCastToString":0,"JTL\\OpsGenie\\Client\\ResponderTest::testCanCreateForTeam":0,"JTL\\OpsGenie\\Client\\ResponderTest::testCanCreateForUser":0,"JTL\\OpsGenie\\Client\\ResponderTest::testCanCreateForEscalation":0,"JTL\\OpsGenie\\Client\\ResponderTest::testCanCreateForSchedule":0,"JTL\\OpsGenie\\Client\\ResponderTest::testCanReadId":0,"JTL\\OpsGenie\\Client\\ResponderTest::testCanReadType":0}}
Empty file removed .travis-ci
Empty file.
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion composer

This file was deleted.

33 changes: 22 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
}
],
"require": {
"php": ">=7.2",
"guzzlehttp/guzzle": "^7.2"
"php": "^8.2",
"guzzlehttp/guzzle": "^7.8"
},
"require-dev": {
"phpunit/phpunit": "^9.0",
"friendsofphp/php-cs-fixer": "^2.12",
"phpstan/phpstan": "^0.10.5"
"phpunit/phpunit": "^10.4.2",
"friendsofphp/php-cs-fixer": "^3.40",
"phpstan/phpstan": "^1.10.46",
"rector/rector": "^0.18.11"
},
"autoload": {
"psr-4": {
Expand All @@ -27,14 +28,24 @@
"JTL\\OpsGenie\\Client\\": "tests"
}
},
"config": {
"platform": {
"php": "7.2"
}
},
"scripts": {
"tests": [
"composer phpcs",
"composer phpstan",
"composer phpunit",
"composer infection"
],
"phpunit": [
"vendor/bin/phpunit"
],
"phpstan": [
"vendor/bin/phpstan"
],
"phpcs": [
"./php-cs-fixer fix --config=./.php_cs.dist"
"vendor/bin/php-cs-fixer fix --config=./.php-cs-fixer.dist.php"
],
"phpcs-dry": [
"vendor/bin/php-cs-fixer fix --config=./.php-cs-fixer.dist.php --dry-run"
]
}
}
Loading

0 comments on commit 41f04c6

Please sign in to comment.