Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/skrepr/teams-connector-bundle
- Owner: skrepr
- License: mit
- Created: 2021-11-17T14:36:00.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-01-09T09:14:41.000Z (over 1 year ago)
- Last Synced: 2024-09-24T20:04:37.406Z (2 days ago)
- Topics: connector-library, php, php74, php8, php80, php81, php82, symfony, symfony-bundle, symfony6, teams
- Language: PHP
- Homepage:
- Size: 9.77 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
Skrepr Teams Connector Bundle
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
```