Skip to content

Commit 9caaab7

Browse files
Merge pull request #153 from Akecel/main
Make the description dependent on the deployment environment
2 parents 9fe3ca7 + 745e497 commit 9caaab7

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

docs/functions/customization.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,26 @@ You likely won't need to change this, but if you do, *you must include the envir
231231
}
232232
```
233233

234+
### Description
235+
236+
By default, Sidecar will generate a description for your Lambda function based on the deployment environment and the name of your app.
237+
238+
You likely won't need to customise it, however, you can if you want, although it has no direct impact.
239+
240+
```php
241+
class ExampleFunction extends LambdaFunction
242+
{
243+
public function description()
244+
{
245+
return sprintf('%s [%s]: Sidecar function `%s`.', ...[
246+
config('sidecar.app_name'),
247+
Sidecar::getEnvironment(),
248+
static::class,
249+
]);
250+
}
251+
}
252+
```
253+
234254
## Tags
235255

236256
A key-value array of strings of tags to be applied to your function, this can be used to organize your functions by owner, project or departement.

src/LambdaFunction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function description()
161161
{
162162
return sprintf('%s [%s]: Sidecar function `%s`.', ...[
163163
config('sidecar.app_name'),
164-
config('app.env'),
164+
Sidecar::getEnvironment(),
165165
static::class,
166166
]);
167167
}

0 commit comments

Comments
 (0)