Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
485 changes: 485 additions & 0 deletions .tasks/589/plan.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

### Added

- Added service `Services\Catalog\UserfieldDocument` with support methods,
see [catalog.userfield.document.* methods](https://apidocs.bitrix24.com/api-reference/catalog/userfield-document/index.html) ([#589](https://github.com/bitrix24/b24phpsdk/issues/589)):
- `list` gets a paginated list of userfield values for warehouse accounting documents
- `update` updates userfield values of a warehouse accounting document, with batch calls support
- Added service `Services\Catalog\Document` with support methods,
see [catalog.document.* methods](https://apidocs.bitrix24.com/api-reference/catalog/document/index.html) ([#559](https://github.com/bitrix24/b24phpsdk/issues/559)):
- `add` creates a new warehouse accounting document, with batch calls support
Expand Down
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,13 @@ test-integration-catalog-document-element:
test-integration-catalog-document-element-annotations:
docker compose run --rm php-cli $(PHPUNIT) --testsuite integration_tests_catalog_document_element_annotations

.PHONY: test-integration-catalog-userfield-document
test-integration-catalog-userfield-document:
docker compose run --rm php-cli $(PHPUNIT) --testsuite integration_tests_catalog_userfield_document
.PHONY: test-integration-catalog-userfield-document-annotations
test-integration-catalog-userfield-document-annotations:
docker compose run --rm php-cli $(PHPUNIT) --testsuite integration_tests_catalog_userfield_document_annotations

# work dev environment
.PHONY: php-dev-server-up
php-dev-server-up:
Expand Down
2 changes: 1 addition & 1 deletion docs/open-api/openapi.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ skip_violations:
| `make test-integration-catalog-document-annotations` | Warehouse accounting document result annotations |
| `make test-integration-catalog-document-element` | Warehouse accounting document line items |
| `make test-integration-catalog-document-element-annotations` | Warehouse accounting document line item result annotations |
| `make test-integration-catalog-userfield-document` | Warehouse accounting document userfield values |
| `make test-integration-catalog-userfield-document-annotations` | Warehouse accounting document userfield result annotations |

### Tests — integration (Tasks)

Expand Down
6 changes: 6 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,12 @@
<testsuite name="integration_tests_catalog_document_element_annotations">
<file>./tests/Integration/Services/Catalog/DocumentElement/Result/DocumentElementItemResultTest.php</file>
</testsuite>
<testsuite name="integration_tests_catalog_userfield_document">
<directory>./tests/Integration/Services/Catalog/UserfieldDocument/Service/</directory>
</testsuite>
<testsuite name="integration_tests_catalog_userfield_document_annotations">
<file>./tests/Integration/Services/Catalog/UserfieldDocument/Result/UserfieldDocumentItemResultTest.php</file>
</testsuite>
</testsuites>
<source>
<include>
Expand Down
3 changes: 1 addition & 2 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
->withSets(
[
LevelSetList::UP_TO_PHP_84,
PHPUnitSetList::PHPUNIT_110
PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES
]
)
->withImportNames(
Expand Down Expand Up @@ -142,7 +142,6 @@
\Rector\Naming\Rector\Foreach_\RenameForeachValueVariableToMatchExprVariableRector::class,
\Rector\Naming\Rector\Foreach_\RenameForeachValueVariableToMatchMethodCallReturnTypeRector::class,
\Rector\Php83\Rector\ClassConst\AddTypeToConstRector::class,
\Rector\Php84\Rector\Class_\DeprecatedAnnotationToDeprecatedAttributeRector::class,
\Rector\Php84\Rector\Foreach_\ForeachToArrayAnyRector::class,
\Rector\Php84\Rector\Foreach_\ForeachToArrayFindRector::class,
\Rector\Php84\Rector\MethodCall\NewMethodCallWithoutParenthesesRector::class,
Expand Down
40 changes: 10 additions & 30 deletions src/Services/Booking/BookingServiceBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ class BookingServiceBuilder extends AbstractServiceBuilder
*/
public function booking(): Booking
{
if (!isset($this->serviceCache[__METHOD__])) {
$this->serviceCache[__METHOD__] = new Booking($this->core, $this->log);
}
$this->serviceCache[__METHOD__] ??= new Booking($this->core, $this->log);

return $this->serviceCache[__METHOD__];
}
Expand All @@ -47,9 +45,7 @@ public function booking(): Booking
*/
public function bookingClient(): BookingClient
{
if (!isset($this->serviceCache[__METHOD__])) {
$this->serviceCache[__METHOD__] = new BookingClient($this->core, $this->log);
}
$this->serviceCache[__METHOD__] ??= new BookingClient($this->core, $this->log);

return $this->serviceCache[__METHOD__];
}
Expand All @@ -59,9 +55,7 @@ public function bookingClient(): BookingClient
*/
public function bookingExternalData(): BookingExternalData
{
if (!isset($this->serviceCache[__METHOD__])) {
$this->serviceCache[__METHOD__] = new BookingExternalData($this->core, $this->log);
}
$this->serviceCache[__METHOD__] ??= new BookingExternalData($this->core, $this->log);

return $this->serviceCache[__METHOD__];
}
Expand All @@ -71,9 +65,7 @@ public function bookingExternalData(): BookingExternalData
*/
public function resource(): Resource
{
if (!isset($this->serviceCache[__METHOD__])) {
$this->serviceCache[__METHOD__] = new Resource($this->core, $this->log);
}
$this->serviceCache[__METHOD__] ??= new Resource($this->core, $this->log);

return $this->serviceCache[__METHOD__];
}
Expand All @@ -83,9 +75,7 @@ public function resource(): Resource
*/
public function resourceSlots(): ResourceSlots
{
if (!isset($this->serviceCache[__METHOD__])) {
$this->serviceCache[__METHOD__] = new ResourceSlots($this->core, $this->log);
}
$this->serviceCache[__METHOD__] ??= new ResourceSlots($this->core, $this->log);

return $this->serviceCache[__METHOD__];
}
Expand All @@ -95,9 +85,7 @@ public function resourceSlots(): ResourceSlots
*/
public function resourceType(): ResourceType
{
if (!isset($this->serviceCache[__METHOD__])) {
$this->serviceCache[__METHOD__] = new ResourceType($this->core, $this->log);
}
$this->serviceCache[__METHOD__] ??= new ResourceType($this->core, $this->log);

return $this->serviceCache[__METHOD__];
}
Expand All @@ -107,9 +95,7 @@ public function resourceType(): ResourceType
*/
public function clientType(): ClientType
{
if (!isset($this->serviceCache[__METHOD__])) {
$this->serviceCache[__METHOD__] = new ClientType($this->core, $this->log);
}
$this->serviceCache[__METHOD__] ??= new ClientType($this->core, $this->log);

return $this->serviceCache[__METHOD__];
}
Expand All @@ -119,9 +105,7 @@ public function clientType(): ClientType
*/
public function waitlist(): Waitlist
{
if (!isset($this->serviceCache[__METHOD__])) {
$this->serviceCache[__METHOD__] = new Waitlist($this->core, $this->log);
}
$this->serviceCache[__METHOD__] ??= new Waitlist($this->core, $this->log);

return $this->serviceCache[__METHOD__];
}
Expand All @@ -131,9 +115,7 @@ public function waitlist(): Waitlist
*/
public function waitlistClient(): WaitlistClient
{
if (!isset($this->serviceCache[__METHOD__])) {
$this->serviceCache[__METHOD__] = new WaitlistClient($this->core, $this->log);
}
$this->serviceCache[__METHOD__] ??= new WaitlistClient($this->core, $this->log);

return $this->serviceCache[__METHOD__];
}
Expand All @@ -143,9 +125,7 @@ public function waitlistClient(): WaitlistClient
*/
public function waitlistExternalData(): WaitlistExternalData
{
if (!isset($this->serviceCache[__METHOD__])) {
$this->serviceCache[__METHOD__] = new WaitlistExternalData($this->core, $this->log);
}
$this->serviceCache[__METHOD__] ??= new WaitlistExternalData($this->core, $this->log);

return $this->serviceCache[__METHOD__];
}
Expand Down
20 changes: 8 additions & 12 deletions src/Services/Calendar/CalendarServiceBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@ class CalendarServiceBuilder extends AbstractServiceBuilder
*/
public function calendar(): Service\Calendar
{
if (!isset($this->serviceCache[__METHOD__])) {
$this->serviceCache[__METHOD__] = new Service\Calendar(
$this->core,
$this->log
);
}
$this->serviceCache[__METHOD__] ??= new Service\Calendar(
$this->core,
$this->log
);

return $this->serviceCache[__METHOD__];
}
Expand Down Expand Up @@ -65,12 +63,10 @@ public function event(): Event\Service\Event
*/
public function resource(): Resource\Service\Resource
{
if (!isset($this->serviceCache[__METHOD__])) {
$this->serviceCache[__METHOD__] = new Resource\Service\Resource(
$this->core,
$this->log
);
}
$this->serviceCache[__METHOD__] ??= new Resource\Service\Resource(
$this->core,
$this->log
);

return $this->serviceCache[__METHOD__];
}
Expand Down
Loading
Loading