Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/reiterus/mcx-info-symfony

Information card of the Russian Federation Agriculture Ministry as Symfony Bundle
https://github.com/reiterus/mcx-info-symfony

agriculture bundle reiterus symfony symfony-bundle

Last synced: 18 days ago
JSON representation

Information card of the Russian Federation Agriculture Ministry as Symfony Bundle

Awesome Lists containing this project

README

        

# Card of the Russia Agriculture Ministry
Summary information on the Ministry of Agriculture of the Russian Federation
as a Symfony bundle that provides a REST API URL
with response in json format.

Default URL: `/bundle/mcx/info/index`

All data was obtained from the public Internet resource of the ministry.

[![screenshot from the website Agriculture Ministry](picture.png)](https://mcx.gov.ru)

Some of the response content can be manipulated:
- main data (main): title, address, site, etc
- officials of the ministry (persons)
- contacts

The `app` directory contains ready-to-use files,
which need to be moved to the appropriate directories
your project, which will lead to the completion of the default information.

# Response
The output can be show in two formats:
- in one line
- beautifully formatted
```json
{
"title": "Министерство сельского хозяйства Российской Федерации",
"description": "Федеральный орган исполнительной власти...",
"address": "107996, Москва, Орликов переулок, 1\/11",
"site": "https:\/\/mcx.gov.ru",
"contacts": [
"Тел.: +7 (495) 607-80-00",
"Факс: +7 (495) 607-83-62",
"[email protected]"
],
"persons": [
[
"Патрушев Дмитрий Николаевич",
"Министр сельского хозяйства Российской Федерации",
"[email protected]",
"Тел.: +7 (495) 607-80-00",
"Факс: +7 (495) 607-83-62"
],
[
"..."
]
]
}
```

# Usage
URL setting
```yaml
# connecting config with route
reiterus_mcx_info:
resource: '@McxInfoBundle/Resources/config/routes.xml'
prefix: /bundle/mcx/info
```

Package setup
```yaml
# adding contacts and formatting the output
reiterus_mcx_info:
contacts:
- 'Тел.: +7 (495) 607-80-00'
- 'Факс: +7 (495) 607-83-62'
- '[email protected]'
pretty: true

# addition of personalities through a service with a specific tag
services:
app.reiterus_mcx_info_persons:
class: App\Util\McxPersons
tags:
- { name: 'tag_mcx_info_persons' }
```

# Installation
You can install the bundle in two ways

From packagist.org
```shell
composer require reiterus/mcx-info-symfony
```

From GitHub repository
```json
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/reiterus/mcx-info-symfony.git"
}
]
}
```

# Tests

To run tests with visual code coverage, launch the command as follows:

```shell
XDEBUG_MODE=coverage ./vendor/phpunit/phpunit/phpunit \
--configuration phpunit.xml \
--testsuite default \
--coverage-html coverage/
```

Test results will be saved in the `coverage` directory.

![Coverage](coverage.png)

**Tip**: `vendor/bin/phpunit --generate-configuration`

# License

This library is released under the [MIT license](LICENSE).