Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

Commit b890fc4

Browse files
committed
Enhance README with formatting and additional details
Updated README for better clarity and readability by adjusting formatting and adding new sections. Improved instructions for running tests and included additional examples for application setup in Bitrix24. Signed-off-by: mesilov <mesilov.maxim@gmail.com>
1 parent 64e7577 commit b890fc4

File tree

1 file changed

+67
-37
lines changed

1 file changed

+67
-37
lines changed

README.md

Lines changed: 67 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ A powerful PHP library for the Bitrix24 REST API
77

88
## Build status
99

10-
| CI\CD [status](https://github.com/mesilov/bitrix24-php-sdk/actions) on `master` |
10+
| CI\CD [status](https://github.com/mesilov/bitrix24-php-sdk/actions) on `master` |
1111
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
1212
| [![phpstan check](https://github.com/mesilov/bitrix24-php-sdk/actions/workflows/phpstan.yml/badge.svg)](https://github.com/mesilov/bitrix24-php-sdk/actions/workflows/phpstan.yml) |
1313
| [![unit-tests status](https://github.com/mesilov/bitrix24-php-sdk/actions/workflows/phpunit.yml/badge.svg)](https://github.com/mesilov/bitrix24-php-sdk/actions/workflows/phpunit.yml) |
1414
| [![integration-tests status](https://github.com/mesilov/bitrix24-php-sdk/actions/workflows/integration.yml/badge.svg)](https://github.com/mesilov/bitrix24-php-sdk/actions/workflows/integration.yml) |
1515

16-
Integration tests run in GitHub actions with real Bitrix24 portal
16+
Integration tests run in GitHub actions with real Bitrix24 portal
1717

1818
## BITRIX24-PHP-SDK ✨FEATURES✨
1919

@@ -23,8 +23,9 @@ Support both auth modes:
2323
- [x] work with incoming webhooks for simple integration projects for current portal
2424

2525
Domain core events:
26-
- [x] Access Token expired
27-
- [x] Bitrix24 portal domain url changed
26+
27+
- [x] Access Token expired
28+
- [x] Bitrix24 portal domain url changed
2829

2930
API - level features
3031

@@ -34,18 +35,10 @@ API - level features
3435

3536
Performance improvements 🚀
3637

37-
- Batch queries implemented with [PHP Generators](https://www.php.net/manual/en/language.generators.overview.php) – constant low memory and
38-
low CPI usage
39-
- [x] batch read data from bitrix24
40-
- [x] batch write data to bitrix24
41-
- [ ] write and read in one batch package
42-
- [ ] composite batch queries to many entities (work in progress)
43-
- [ ] read without count flag
44-
45-
Low-level tools to devs:
46-
- [ ] Rate-limit strategy
47-
- [ ] Retry strategy for safe methods
48-
38+
- [x] Batch queries implemented with [PHP Generators](https://www.php.net/manual/en/language.generators.overview.php) – constant low memory and low CPI usage:
39+
- [x] batch read data from bitrix24
40+
- [x] batch write data to bitrix24
41+
- [x] read without count flag
4942

5043
## Development principles
5144

@@ -67,6 +60,7 @@ Low-level tools to devs:
6760
- Reliable:
6861
- test coverage: unit, integration, contract
6962
- typical examples typical for different modes of operation and they are optimized for memory \ performance
63+
7064
## Architecture
7165

7266
### Abstraction layers
@@ -83,6 +77,7 @@ Low-level tools to devs:
8377
output: b24 response dto
8478
process: b24 entities, operate with immutable objects
8579
```
80+
8681
## Sponsors
8782

8883
Help bitrix24-php-sdk by [boosty.to/bitrix24-php-sdk](https://boosty.to/bitrix24-php-sdk)
@@ -98,7 +93,9 @@ Help bitrix24-php-sdk by [boosty.to/bitrix24-php-sdk](https://boosty.to/bitrix24
9893
Add `"mesilov/bitrix24-php-sdk": "2.x"` to `composer.json` of your application. Or clone repo to your project.
9994

10095
## Examples
96+
10197
### Work with webhook
98+
10299
```php
103100
declare(strict_types=1);
104101

@@ -121,17 +118,58 @@ var_dump($b24Service->getMainScope()->main()->getCurrentUserProfile()->getUserPr
121118
var_dump($b24Service->getCRMScope()->lead()->list([],[],['ID','TITLE'])->getLeads()[0]->TITLE);
122119
```
123120

121+
### Create application for Bitrix24 marketplace
122+
123+
if you want to create application you can use production-ready contracts in namespace
124+
`Bitrix24\SDK\Application\Contracts`:
125+
126+
- `Bitrix24Accounts` — Store auth tokens and
127+
provides [methods](src/Application/Contracts/Bitrix24Accounts/Docs/Bitrix24Accounts.md) for work with Bitrix24
128+
account.
129+
- `ApplicationInstallations` — Store information about [application installation](src/Application/Contracts/ApplicationInstallations/Docs/ApplicationInstallations.md), linked with Bitrix24 Account with auth
130+
tokens. Optional can store links to:
131+
- Client contact person: client person who responsible for application usage
132+
- Bitrix24 Partner contact person: partner contact person who supports client and configure application
133+
- Bitrix24 Partner: partner who supports client portal
134+
- `ContactPersons` – Store information [about person](src/Application/Contracts/ContactPersons/Docs/ContactPersons.md) who installed application.
135+
- `Bitrix24Partners` – Store information about [Bitrix24 Partner](src/Application/Contracts/Bitrix24Partners/Docs/Bitrix24Partners.md) who supports client portal and install or configure application.
136+
137+
Steps:
138+
1. Create own entity of this bounded contexts.
139+
2. Implement all methods in contract interfaces.
140+
3. Test own implementation behavior with contract-tests `tests/Unit/Application/Contracts/*` – examples.
141+
124142
## Tests
125143

126144
Tests locate in folder `tests` and we have two test types.
127145
In folder tests create file `.env.local` and fill environment variables from `.env`.
128146

147+
### PHP Static Analysis Tool – phpstan
148+
149+
Call in command line
150+
151+
```shell
152+
make lint-phpstan
153+
```
154+
### PHP Static Analysis Tool – rector
155+
156+
Call in command line for validate
157+
158+
```shell
159+
make lint-rector
160+
```
161+
Call in command line for fix codebase
162+
163+
```shell
164+
make lint-rector-fix
165+
```
166+
129167
### Unit tests
130168

131169
**Fast**, in-memory tests without a network I\O For run unit tests you must call in command line
132170

133171
```shell
134-
composer phpunit-run-unit-test
172+
make test-unit
135173
```
136174

137175
### Integration tests
@@ -142,12 +180,12 @@ composer phpunit-run-unit-test
142180

143181
For run integration test you must:
144182

145-
1. Create [new Bitrix24 portal](https://www.bitrix24.ru/create.php?p=255670) for development tests
146-
2. Go to left menu, click «Sitemap»
147-
3. Find menu item «Developer resources»
148-
4. Click on menu item «Other»
149-
5. Click on menu item «Inbound webhook»
150-
6. Assign all permisions with webhook and click «save» button
183+
1. Create new Bitrix24 portal for development tests.
184+
2. Go to left menu, click «Sitemap».
185+
3. Find menu item «Developer resources».
186+
4. Click on menu item «Other».
187+
5. Click on menu item «Inbound webhook».
188+
6. Assign all permisions with webhook and click «save» button.
151189
7. Create file `/tests/.env.local` with same settings, see comments in `/tests/.env` file.
152190

153191
```yaml
@@ -159,15 +197,10 @@ INTEGRATION_TEST_LOG_LEVEL=500
159197
8. call in command line
160198

161199
```shell
162-
composer composer phpunit-run-integration-tests
163-
```
164-
165-
#### PHP Static Analysis Tool – phpstan
166-
167-
Call in command line
168-
169-
```shell
170-
composer phpstan-analyse
200+
make test-integration-core
201+
make test-integration-scope-telephony
202+
make test-integration-scope-workflows
203+
make test-integration-scope-user
171204
```
172205

173206
## Submitting bugs and feature requests
@@ -182,16 +215,13 @@ bitrix24-php-sdk is licensed under the MIT License - see the `MIT-LICENSE.txt` f
182215

183216
Maksim Mesilov - mesilov.maxim@gmail.com
184217

185-
See also the list of [contributors](https://github.com/mesilov/bitrix24-php-sdk/graphs/contributors) which participated in this project.
218+
See also the list of [contributors](https://github.com/mesilov/bitrix24-php-sdk/graphs/contributors) which participated
219+
in this project.
186220

187221
## Need custom Bitrix24 application?
188222

189223
mesilov.maxim@gmail.com for private consultations or dedicated support
190224

191225
## Documentation
192226

193-
[Bitrix24 API documentation - Russian](http://dev.1c-bitrix.ru/rest_help/)
194-
195227
[Bitrix24 API documentation - English](https://training.bitrix24.com/rest_help/)
196-
197-
[Register new Bitrix24 account](https://www.bitrix24.ru/create.php?p=255670)

0 commit comments

Comments
 (0)