connectholland/timechimp-bundle

Timechimp bundle for Symfony 4 projects

1.1.1 2020-11-05 08:59 UTC

This package is auto-updated.

Last update: 2021-07-05 11:42:26 UTC


README

Scrutinizer Code Quality Code Coverage Build Status

Timechimp bundle for Symfony 4 projects

Installation

composer require connectholland/timechimp-bundle

Environment

Set the environment variables to be able to connect to the Timchimp API.

TIMECHIMP_ACCESS_TOKEN=the-api-key

Usage

Autowire the client, e.g.:

<?php

declare(strict_types=1);

namespace App;

use ConnectHolland\TimechimpBundle\Api\Client\Client;

class SomeService
{
    private Client $client;

    public function __construct(Client $client)
    {
        $this->client = $client;
    }
    
    public function someMethod()
    {
        $this->client->getTimeByDateRange((new \DateTime('yesterday'))->format('Y-m-d'), (new \DateTime('now'))->format('Y-m-d'));
    }
}