fieg/statistico-bundle

5.0.1 2020-11-02 16:33 UTC

This package is auto-updated.

Last update: 2024-11-29 04:52:10 UTC


README

Wrapper bundle for the Statistico library.

Build Status Code Coverage Scrutinizer Code Quality

Installation

Using composer:

composer require fieg/statistico-bundle:dev-master

Add to AppKernel.php:

$bundles = [
  new Fieg\StatisticoBundle\FiegStatisticoBundle(),
];

Configuration in app/config/config.yml:

fieg_statistico:
  driver:
    redis:
      client: 'your_redis_service'

Usage

Inject statistico into some service:

some_service:
    class: Acme\SomeService
    arguments: [@statistico]

Usage:

namespace Acme;

class SomeService
{
    public function __construct(Statistico $statistico)
    {
        $this->statistico = $statistico;
    }
    
    public function someAction()
    {
        $this->statistico->increment('some.statistic.indentitier');  // increases the statistic with 1
    }
}