- Create AnsibleDeployStage using framework's Process module for secure command execution - Integrate AnsibleDeployStage into DeploymentPipelineCommands for production deployments - Add force_deploy flag support in Ansible playbook to override stale locks - Use PHP deployment module as orchestrator (php console.php deploy:production) - Fix ErrorAggregationInitializer to use Environment class instead of $_ENV superglobal Architecture: - BuildStage → AnsibleDeployStage → HealthCheckStage for production - Process module provides timeout, error handling, and output capture - Ansible playbook supports rollback via rollback-git-based.yml - Zero-downtime deployments with health checks
40 lines
900 B
PHP
40 lines
900 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Framework\Notification\Channels\WhatsApp;
|
|
|
|
use App\Framework\Core\ValueObjects\PhoneNumber;
|
|
|
|
/**
|
|
* Fixed phone number resolver
|
|
*
|
|
* Returns a single hardcoded phone number for all users
|
|
* Useful for development/testing or single-user scenarios
|
|
*/
|
|
final readonly class FixedPhoneNumberResolver implements UserPhoneNumberResolver
|
|
{
|
|
public function __construct(
|
|
private PhoneNumber $phoneNumber
|
|
) {
|
|
}
|
|
|
|
/**
|
|
* Always returns the same phone number regardless of user ID
|
|
*/
|
|
public function resolvePhoneNumber(string $userId): ?PhoneNumber
|
|
{
|
|
return $this->phoneNumber;
|
|
}
|
|
|
|
/**
|
|
* Create resolver with default phone number
|
|
*/
|
|
public static function createDefault(): self
|
|
{
|
|
return new self(
|
|
phoneNumber: PhoneNumber::fromString('+4917941122213')
|
|
);
|
|
}
|
|
}
|