Skip to content

Commit

Permalink
Merge pull request #95 from BedrockStreaming/fix/cast-string
Browse files Browse the repository at this point in the history
  • Loading branch information
Yokann authored Aug 9, 2023
2 parents c00c1f3 + 53a23b1 commit 658a73e
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 36 deletions.
5 changes: 1 addition & 4 deletions src/Client/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ public function handleEvent($event, $name = null)
* @param Event $event
* @param string $method
*
* @return mixed
*
* @throws Exception
*/
private function getEventValue($event, $method)
Expand Down Expand Up @@ -187,7 +185,7 @@ private function replaceConfigPlaceholder($event, $eventName, $string)
if ((preg_match_all('/<([^>]*)>/', $string, $matches) > 0) and ($this->propertyAccessor !== null)) {
$tokens = $matches[1];
foreach ($tokens as $token) {
$value = $this->propertyAccessor->getValue($event, $token);
$value = (string) $this->propertyAccessor->getValue($event, $token);
$string = str_replace('<'.$token.'>', $value, $string);
}
}
Expand All @@ -198,7 +196,6 @@ private function replaceConfigPlaceholder($event, $eventName, $string)
/**
* Merge config tags with tags manually sent with the event
*
* @param mixed $event
* @param array $config
*
* @return array of tags
Expand Down
5 changes: 0 additions & 5 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
*/
class Configuration implements ConfigurationInterface
{
/**
* {@inheritDoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('m6_statsd');
Expand Down Expand Up @@ -100,8 +97,6 @@ private function addClientsSection($rootNode)

/**
* addDefaultEventSection
*
* @param mixed $rootNode
*/
private function addDefaultEventSection($rootNode)
{
Expand Down
3 changes: 0 additions & 3 deletions src/DependencyInjection/M6WebStatsdExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
*/
class M6WebStatsdExtension extends Extension
{
/**
* {@inheritDoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
Expand Down
3 changes: 0 additions & 3 deletions src/Event/ConsoleCommandEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
*/
class ConsoleCommandEvent extends ConsoleEvent
{
/**
* {@inheritDoc}
*/
protected static function support(BaseConsoleEvent $e)
{
return $e instanceof BaseEvent;
Expand Down
3 changes: 0 additions & 3 deletions src/Event/ConsoleErrorEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
*/
class ConsoleErrorEvent extends ConsoleEvent
{
/**
* {@inheritDoc}
*/
protected static function support(BaseConsoleEvent $e)
{
return $e instanceof BaseEvent;
Expand Down
2 changes: 0 additions & 2 deletions src/Event/ConsoleEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ final public function __construct(BaseConsoleEvent $originalEvent, $startTime =
*
* @param string $name
* @param array $parameters
*
* @return mixed
*/
public function __call($name, $parameters)
{
Expand Down
3 changes: 0 additions & 3 deletions src/Event/ConsoleTerminateEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
*/
class ConsoleTerminateEvent extends ConsoleEvent
{
/**
* {@inheritDoc}
*/
protected static function support(BaseConsoleEvent $e)
{
return $e instanceof BaseEvent;
Expand Down
14 changes: 10 additions & 4 deletions src/Listener/ConsoleListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,21 @@
*/
class ConsoleListener
{
/** @var EventDispatcherInterface */
protected $eventDispatcher = null;
/** @var ?EventDispatcherInterface */
protected $eventDispatcher;

/**
* Time when command started
*
* @var float
* @var ?float
*/
protected $startTime = null;
protected $startTime;

public function __construct()
{
$this->startTime = null;
$this->eventDispatcher = null;
}

/**
* Define event dispatch
Expand Down
2 changes: 0 additions & 2 deletions src/Statsd/MonitorableEventInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ interface MonitorableEventInterface
{
/**
* the measured value
*
* @return mixed
*/
public function getValue();

Expand Down
4 changes: 0 additions & 4 deletions src/Statsd/StatsdEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ class StatsdEvent extends GenericEvent implements MonitorableEventInterface
{
/**
* getTiming
*
* @return mixed
*/
public function getTiming()
{
Expand All @@ -23,8 +21,6 @@ public function getTiming()

/**
* getValue
*
* @return mixed
*/
public function getValue()
{
Expand Down
3 changes: 0 additions & 3 deletions src/Validator/Constraints/NodeValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
*/
class NodeValidator extends ConstraintValidator
{
/**
* {@inheritDoc}
*/
public function validate($value, Constraint $constraint)
{
if (!is_scalar($value) && !(is_object($value) && method_exists($value, '__toString'))) {
Expand Down

0 comments on commit 658a73e

Please sign in to comment.