Skip to content

Feature/issue 111 install contact person mobile phone validation#113

Closed
KarlsonComplete wants to merge 3 commits into
mesilov:devfrom
KarlsonComplete:feature/issue-111-install-contact-person-mobile-phone-validation
Closed

Feature/issue 111 install contact person mobile phone validation#113
KarlsonComplete wants to merge 3 commits into
mesilov:devfrom
KarlsonComplete:feature/issue-111-install-contact-person-mobile-phone-validation

Conversation

@KarlsonComplete

Copy link
Copy Markdown
Collaborator

Fixes #111

# Conflicts:
#	src/ApplicationInstallations/UseCase/OnAppInstall/Handler.php
#	src/Console/ApplicationSettingsListCommand.php
#	tests/Contract/ApplicationSettings/Infrastructure/ApplicationSettingsItemRepositoryInterfaceContractTest.php
#	tests/Unit/ApplicationSettings/Services/DefaultSettingsInstallerTest.php
#	tests/Unit/ApplicationSettings/Services/SettingsFetcherTest.php

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the contact person installation handler to allow contact creation to proceed without a mobile phone number if the provided number is invalid, updating the corresponding functional tests. It also cleans up test files by refactoring mock setups and removing redundant arguments. However, the reviewer notes that removing the ApplicationSettingsItemInterface type hints from closure parameters in ApplicationSettingsListCommand.php and its contract test reduces type safety and static analysis precision, recommending that these type hints be restored.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.


if ($globalOnly || (null === $userId && null === $departmentId)) {
$settings = array_filter($allSettings, fn (ApplicationSettingsItemInterface $setting): bool => $setting->isGlobal());
$settings = array_filter($allSettings, fn ($setting): bool => $setting->isGlobal());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Removing the ApplicationSettingsItemInterface type hint from the closure parameters reduces type safety and makes static analysis (like PHPStan or Psalm) less precise. It is highly recommended to keep explicit type hints for better maintainability and IDE autocompletion.

Please consider restoring the import of ApplicationSettingsItemInterface and keeping the type hints in the closures at lines 133, 136, and 139.

            $settings = array_filter($allSettings, fn (\Bitrix24\Lib\ApplicationSettings\Entity\ApplicationSettingsItemInterface $setting): bool => $setting->isGlobal());


// Verify each scope is present
$values = array_map(fn(\Bitrix24\Lib\ApplicationSettings\Entity\ApplicationSettingsItemInterface $s): string => $s->getValue(), $results);
$values = array_map(fn($s): string => $s->getValue(), $results);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Removing the ApplicationSettingsItemInterface type hint from the closure parameter reduces type safety and makes static analysis less precise. It is highly recommended to keep explicit type hints for better maintainability and IDE autocompletion.

        $values = array_map(fn(\Bitrix24\Lib\ApplicationSettings\Entity\ApplicationSettingsItemInterface $s): string => $s->getValue(), $results);

@KarlsonComplete KarlsonComplete deleted the feature/issue-111-install-contact-person-mobile-phone-validation branch July 9, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant