Skip to content

Commit d335097

Browse files
authored
Merge pull request #2 from appsignal/change-namespace
Update top-level namespace
2 parents b4d4541 + 4b114f3 commit d335097

38 files changed

Lines changed: 241 additions & 240 deletions

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,47 +48,47 @@ For more ways to install `opentelemetry` extension (pie, pickle, Docker), see th
4848
> For Symfony application auto-instrumentation install `open-telemetry/opentelemetry-auto-symfony` package.
4949

5050
```php
51-
use AppSignal\AppSignal;
51+
use Appsignal\Appsignal;
5252
5353
// add a custom instrumentation span to the current trace
54-
AppSignal::instrument('some_event', fn() => sleep(1));
54+
Appsignal::instrument('some_event', fn() => sleep(1));
5555
5656
// add a custom instrumentation span to the current trace with data
57-
AppSignal::instrument('some_event', ['region' => 'eu'], fn() => sleep(1));
57+
Appsignal::instrument('some_event', ['region' => 'eu'], fn() => sleep(1));
5858
5959
// customize the name of the trace
60-
AppSignal::setAction('my action'),
60+
Appsignal::setAction('my action'),
6161
6262
// add custom data to current span
63-
AppSignal::addCustomData([
63+
Appsignal::addCustomData([
6464
'string-attribute' => 'abcdef',
6565
'int-attribute' => 1234,
6666
'bool-attribute' => true,
6767
]);
6868
6969
// add tags to current span
70-
AppSignal::addTags([
70+
Appsignal::addTags([
7171
'string-tag' => 'some value',
7272
'integer-tag' => 1234,
7373
'bool-tag' => true,
7474
]);
7575
7676
// report a handled exception
77-
AppSignal::reportError($exception);
77+
Appsignal::reportError($exception);
7878
7979
// add metrics
80-
AppSignal::setGauge('my_gauge', 12);
81-
AppSignal::setGauge('my_gauge_with_attributes', 13, ['region' => 'eu']);
80+
Appsignal::setGauge('my_gauge', 12);
81+
Appsignal::setGauge('my_gauge_with_attributes', 13, ['region' => 'eu']);
8282
83-
AppSignal::addDistributionValue('memory_usage', 50);
84-
AppSignal::addDistributionValue('memory_usage', 70);
83+
Appsignal::addDistributionValue('memory_usage', 50);
84+
Appsignal::addDistributionValue('memory_usage', 70);
8585
86-
AppSignal::addDistributionValue('with_attributes', 10, ['region' => 'eu']);
87-
AppSignal::addDistributionValue('with_attributes', 20, ['region' => 'eu']);
88-
AppSignal::addDistributionValue('with_attributes', 30, ['region' => 'eu']);
86+
Appsignal::addDistributionValue('with_attributes', 10, ['region' => 'eu']);
87+
Appsignal::addDistributionValue('with_attributes', 20, ['region' => 'eu']);
88+
Appsignal::addDistributionValue('with_attributes', 30, ['region' => 'eu']);
8989
90-
AppSignal::incrementCounter('my_counter', 1);
91-
AppSignal::incrementCounter('my_counter', 3, ['region' => 'eu']);
90+
Appsignal::incrementCounter('my_counter', 1);
91+
Appsignal::incrementCounter('my_counter', 3, ['region' => 'eu']);
9292
```
9393
9494
## Development

_autoload.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<?php
22

3-
use AppSignal\AppSignal;
3+
use Appsignal\Appsignal;
44

55
// Skip for CLI unless it's artisan or integration tests
66
if (PHP_SAPI === 'cli' && !isset($_ENV['LARAVEL_ARTISAN']) && !isset($_ENV['_APPSIGNAL_TEST'])) {
7-
return;
7+
return;
88
}
99

10-
if (!AppSignal::extensionIsLoaded()) {
11-
trigger_error('The "opentelemetry" extension must be loaded to use AppSignal', E_USER_WARNING);
10+
if (!Appsignal::extensionIsLoaded()) {
11+
trigger_error('The "opentelemetry" extension must be loaded to use Appsignal', E_USER_WARNING);
1212

13-
return;
13+
return;
1414
}
1515

16-
AppSignal::getInstance()->initialize();
16+
Appsignal::getInstance()->initialize();

bin/appsignal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ case "${1:-}" in
2929

3030
mkdir -p "$TARGET_DIR"
3131
cp "$TEMPLATE" "$TARGET"
32-
echo "AppSignal config file created at $TARGET"
32+
echo "Appsignal config file created at $TARGET"
3333
;;
3434
*)
3535
echo "Usage: appsignal <command>"
3636
echo ""
3737
echo "Commands:"
38-
echo " init Scaffold the AppSignal config file for your application"
38+
echo " init Scaffold the Appsignal config file for your application"
3939
;;
4040
esac

composer.json

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,53 +3,53 @@
33
"description": "AppSignal for PHP",
44
"license": "MIT",
55
"scripts": {
6-
"cs": "php-cs-fixer check --diff",
7-
"cs:fix": "php-cs-fixer fix",
8-
"cs:ci": "php-cs-fixer fix --dry-run --diff",
9-
"lint": "phpstan analyse --memory-limit=256M",
10-
"test": "phpunit --exclude-group no-extension",
11-
"test:no-ext": "phpunit --group no-extension"
6+
"cs": "php-cs-fixer check --diff",
7+
"cs:fix": "php-cs-fixer fix",
8+
"cs:ci": "php-cs-fixer fix --dry-run --diff",
9+
"lint": "phpstan analyse --memory-limit=256M",
10+
"test": "phpunit --exclude-group no-extension",
11+
"test:no-ext": "phpunit --group no-extension"
1212
},
1313
"require": {
14-
"php": ">=8.4.0",
15-
"open-telemetry/exporter-otlp": "*",
16-
"open-telemetry/opentelemetry-logger-monolog": "*",
17-
"open-telemetry/sdk": "*",
18-
"vlucas/phpdotenv": "*"
14+
"php": ">=8.4.0",
15+
"open-telemetry/exporter-otlp": "*",
16+
"open-telemetry/opentelemetry-logger-monolog": "*",
17+
"open-telemetry/sdk": "*",
18+
"vlucas/phpdotenv": "*"
1919
},
20-
"require-dev": {
21-
"phpunit/phpunit": "^13.0",
20+
"require-dev": {
21+
"phpunit/phpunit": "^13.0",
2222
"phpstan/phpstan": "^2.1",
2323
"symfony/routing": "^8.0",
2424
"symfony/http-kernel": "^8.0",
2525
"mockery/mockery": "^1.6",
2626
"friendsofphp/php-cs-fixer": "^3.94"
2727
},
2828
"autoload": {
29-
"psr-4": {
30-
"AppSignal\\": "src"
31-
},
32-
"files": [
33-
"_autoload.php"
34-
]
29+
"psr-4": {
30+
"Appsignal\\": "src"
31+
},
32+
"files": [
33+
"_autoload.php"
34+
]
3535
},
3636
"autoload-dev": {
37-
"psr-4": {
38-
"AppSignal\\Tests\\": "tests/"
39-
}
37+
"psr-4": {
38+
"Appsignal\\Tests\\": "tests/"
39+
}
4040
},
4141
"extra": {
42-
"laravel": {
43-
"providers": [
44-
"AppSignal\\Integrations\\Laravel\\AppSignalServiceProvider"
45-
]
46-
}
42+
"laravel": {
43+
"providers": [
44+
"Appsignal\\Integrations\\Laravel\\AppsignalServiceProvider"
45+
]
46+
}
4747
},
4848
"bin": ["bin/appsignal"],
4949
"config": {
50-
"allow-plugins": {
51-
"php-http/discovery": false,
52-
"tbachert/spi": false
53-
}
50+
"allow-plugins": {
51+
"php-http/discovery": false,
52+
"tbachert/spi": false
53+
}
5454
}
5555
}
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22

3-
namespace AppSignal;
3+
namespace Appsignal;
44

5-
use AppSignal\Environments\Environment;
6-
use AppSignal\Environments\Laravel;
7-
use AppSignal\Environments\Symfony;
8-
use AppSignal\Environments\Vanilla;
9-
use AppSignal\Patches\StackTraceFormatterPatch;
5+
use Appsignal\Environments\Environment;
6+
use Appsignal\Environments\Laravel;
7+
use Appsignal\Environments\Symfony;
8+
use Appsignal\Environments\Vanilla;
9+
use Appsignal\Patches\StackTraceFormatterPatch;
1010
use Dotenv\Dotenv;
1111
use OpenTelemetry\API\Trace\Propagation\TraceContextPropagator;
1212
use OpenTelemetry\Contrib\Otlp\MetricExporter;
@@ -26,7 +26,7 @@
2626
use OpenTelemetry\SDK\Resource\ResourceInfo;
2727
use OpenTelemetry\SDK\Resource\ResourceInfoFactory;
2828

29-
class AppSignal
29+
class Appsignal
3030
{
3131
use RecordsInstrumentation;
3232
use RecordsMetrics;
@@ -114,7 +114,7 @@ public function initialize(): void
114114

115115
if (!$this->extensionIsLoaded()) {
116116
trigger_error(
117-
'AppSignal: the "opentelemetry" PHP extension is not loaded. AppSignal will not be initialized.',
117+
'Appsignal: the "opentelemetry" PHP extension is not loaded. Appsignal will not be initialized.',
118118
E_USER_WARNING,
119119
);
120120

@@ -135,9 +135,9 @@ public function initialize(): void
135135
$missing = $config->getMissingFields();
136136

137137
trigger_error(
138-
'AppSignal: configuration is invalid. Missing required fields: '
138+
'Appsignal: configuration is invalid. Missing required fields: '
139139
. implode(', ', $missing)
140-
. '. AppSignal will not be initialized.',
140+
. '. Appsignal will not be initialized.',
141141
E_USER_WARNING,
142142
);
143143

src/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace AppSignal;
3+
namespace Appsignal;
44

55
use Throwable;
66

src/Environments/Environment.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
namespace AppSignal\Environments;
3+
namespace Appsignal\Environments;
44

5-
use AppSignal\Config;
5+
use Appsignal\Config;
66

77
interface Environment
88
{

src/Environments/HasPatches.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace AppSignal\Environments;
3+
namespace Appsignal\Environments;
44

55
trait HasPatches
66
{

src/Environments/Laravel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
namespace AppSignal\Environments;
3+
namespace Appsignal\Environments;
44

5-
use AppSignal\Config;
5+
use Appsignal\Config;
66

77
class Laravel implements Environment
88
{

src/Environments/Symfony.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

3-
namespace AppSignal\Environments;
3+
namespace Appsignal\Environments;
44

5-
use AppSignal\Config;
6-
use AppSignal\Patches\Symfony\HttpRoutePatch;
7-
use AppSignal\Patches\Symfony\LoggerPatch;
5+
use Appsignal\Config;
6+
use Appsignal\Patches\Symfony\HttpRoutePatch;
7+
use Appsignal\Patches\Symfony\LoggerPatch;
88

99
class Symfony implements Environment
1010
{

0 commit comments

Comments
 (0)