Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/skrepr/teams-connector-bundle

Symfony bundle integration of the skrepr/teams-connector library.
https://github.com/skrepr/teams-connector-bundle

connector-library php php74 php8 php80 php81 php82 symfony symfony-bundle symfony6 teams

Last synced: 2 days ago
JSON representation

Symfony bundle integration of the skrepr/teams-connector library.

Awesome Lists containing this project

README

        



skrepr_logo



Skrepr Teams Connector Bundle



Releases
LICENSE
Issues
Stars

Symfony bundle integration of the [skrepr/teams-connector](https://github.com/skrepr/teams-connector) library.

## Documentation

All the how to manipulate the Teams client is on the [skrepr/teams documentation](https://github.com/skrepr/teams-connector#create-a-simple-card).

## Prerequisites

This version of the project requires:
* PHP 7.4+
* Symfony 4.4/5.4/6.0+ (any stable or lts version of Symfony)

## Installation

You can install the library through composer:

``` bash
$ composer require skrepr/teams-connector-bundle
```

The bundle should be enabled by syfmony/flex but if not:

``` php
// config/bundles.php

['dev' => true, 'test' => true],
];

```

You can get an error message because the configuration isn't done yet.

## Configuration

To configure the bundle you only need to specify your Teams endpoint:

```yaml
skrepr_teams_connector:
endpoint: 'https://...'
```

It is the easiest to create this in a new file `config/packages/teams-connector.yaml`.

## Usage
The Teams client instance can be retrieved from the `skrepr_teams_connector.client` service.

Here is an example:

```php
declare(strict_types=1);

namespace App\Controller;

use Psr\Http\Client\ClientExceptionInterface;
use Skrepr\TeamsConnector\Card;
use Skrepr\TeamsConnector\Client;
use Symfony\Component\HttpFoundation\Response;

class TestController
{
private Client $client;

public function __construct(Client $client)
{
$this->client = $client;
}

public function index(): Response
{
$card = new Card('Hello teams!');

try {
$this->client->send($card);
} catch (ClientExceptionInterface $e) {
return new Response($e->getMessage());
}

return new Response('Card has been send');
}
}
```

All the how to manipulate the Teams connector client is on [skrepr/teams-connector](https://github.com/skrepr/teams-connector).

## Test
To test this module you can use our docker test script which will execute phpunit on several PHP versions.
You must have docker installed to run this script.

```shell
./phpunit-in-docker.sh
```