Skip to content

Commit

Permalink
rename to hooks class
Browse files Browse the repository at this point in the history
  • Loading branch information
xinghengwang committed Mar 29, 2024
1 parent 7acfb5a commit c91593e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ moesif:
options:
max_queue_size: 50
max_batch_size: 25
user_hooks_class: 'App\Configuration\MyMoesifHooks'
hooks_class: 'App\Configuration\MyMoesifHooks'
```
Your Moesif Application Id can be found in the [_Moesif Portal_](https://www.moesif.com/).
Expand Down Expand Up @@ -64,10 +64,10 @@ If set, will override the default max queue size before data is sent over to Moe
Type: Int
If set, will override the default max batch size that is sent over to Moesif. The default is `10`.

#### __`user_hooks_class`__
#### __`hooks_class`__

Type: String
Options, if set, this should be your implementation of the MoesifHooksInterface.
Optional, if set, this should be your implementation of the `Moesif\MoesifBundle\Interfaces\MoesifHooksInterface`.

## User Hook class Options

Expand All @@ -86,6 +86,7 @@ class MyMoesifHooks implements MoesifHooksInterface {
}
```

The method you should implement is:

### __`identifyUserId`__

Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function getConfigTreeBuilder(): TreeBuilder
->booleanNode('debug')
->defaultFalse()
->end()
->scalarNode('user_hooks_class')
->scalarNode('hooks_class')
->defaultValue('Moesif\MoesifBundle\Interfaces\MoesifDefaultHooks')
->end()
->arrayNode('options')
Expand Down
4 changes: 2 additions & 2 deletions src/DependencyInjection/MoesifExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public function load(array $configs, ContainerBuilder $container)
$container->setParameter('moesif.moesif_application_id', $config['moesif_application_id']);
}

if ($config['user_hooks_class']) {
$userMoesifConfigClass = $config['user_hooks_class'];
if ($config['hooks_class']) {
$userMoesifConfigClass = $config['hooks_class'];
$definition = new Definition($userMoesifConfigClass);
$container->setDefinition('moesif.user_hooks', $definition);
}
Expand Down

0 comments on commit c91593e

Please sign in to comment.