Skip to content

Commit

Permalink
fix warnings in php 8.2 (#132)
Browse files Browse the repository at this point in the history
* fix warnings in php 8.2

* fix ci

* lint

* ci
  • Loading branch information
gh123man authored Dec 22, 2022
1 parent a1cb589 commit 3d9b11b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 22 deletions.
5 changes: 5 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ x-dockerbuild-5: &dockerbuild-5
- run: composer lint

jobs:
test-8.2:
<<: *dockerbuild-phpdbg
docker:
- image: cimg/php:8.2-browsers
test-8.0:
<<: *dockerbuild-phpdbg
docker:
Expand Down Expand Up @@ -52,6 +56,7 @@ workflows:
version: 2
check_compile:
jobs:
- test-8.2
- test-8.0
- test-7.4
- test-7.3
Expand Down
28 changes: 9 additions & 19 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/5.7/phpunit.xsd"
bootstrap="vendor/autoload.php"
backupGlobals="false"
beStrictAboutCoversAnnotation="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutTodoAnnotatedTests="true"
colors="true"
verbose="true">
<testsuite name="unit">
<directory suffix="Test.php">tests/UnitTests</directory>
</testsuite>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="vendor/autoload.php" backupGlobals="false" beStrictAboutCoversAnnotation="true" beStrictAboutOutputDuringTests="true" beStrictAboutTestsThatDoNotTestAnything="true" beStrictAboutTodoAnnotatedTests="true" colors="true" verbose="true">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>
<testsuite name="unit">
<directory suffix="Test.php">tests/UnitTests</directory>
</testsuite>
</phpunit>
18 changes: 15 additions & 3 deletions src/DogStatsd.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,18 @@ class DogStatsd
*/
private $metricPrefix;

// Telemetry
private $disable_telemetry;
private $telemetry_tags;
private $metrics_sent;
private $events_sent;
private $service_checks_sent;
private $bytes_sent;
private $bytes_dropped;
private $packets_sent;
private $packets_dropped;


private static $eventUrl = '/api/v1/events';

// Used for the telemetry tags
Expand Down Expand Up @@ -510,7 +522,7 @@ public function flush($message)
* @param array $vals Optional values of the event. See
* https://docs.datadoghq.com/api/?lang=bash#post-an-event
* for the valid keys
* @return null
* @return bool
**/
public function event($title, $vals = array())
{
Expand Down Expand Up @@ -602,7 +614,7 @@ public function event($title, $vals = array())
*
* @param array $vals Optional values of the event. See
* https://docs.datadoghq.com/api/?lang=bash#post-an-event for the valid keys
* @return null
* @return bool
*/
private function eventUdp($vals)
{
Expand Down Expand Up @@ -631,7 +643,7 @@ private function eventUdp($vals)
$this->events_sent += 1;
$this->report('_e{' . $title_length . ',' . $text_length . '}:' . $fields);

return null;
return true;
}

/**
Expand Down

0 comments on commit 3d9b11b

Please sign in to comment.