Code Duplication    Length = 15-15 lines in 2 locations

src/cli/Manager/InstanceStateManager.php 2 locations

@@ 85-99 (lines=15) @@
82
	 *
83
	 * @param InstanceStateEvent $event
84
	 */
85
	public function onInstanceReachable(InstanceStateEvent $event)
86
	{
87
		$instance      = $event->getInstance();
88
		$instanceState = $this->getInstanceState($instance);
89
90
		// Update reachability state now that we know the instance is reachable
91
		if ($instanceState->getReachability() === InstanceState::MAYBE_REACHABLE)
92
		{
93
			$this->logger->notice('Instance {instanceName} is now reachable, will start polling for updates', [
94
				'instanceName' => $instance->getName(),
95
			]);
96
97
			$instanceState->setReachability(InstanceState::REACHABLE);
98
		}
99
	}
100
101
102
	/**
@@ 107-121 (lines=15) @@
104
	 *
105
	 * @param InstanceStateEvent $event
106
	 */
107
	public function onInstanceUnreachable(InstanceStateEvent $event)
108
	{
109
		$instance      = $event->getInstance();
110
		$instanceState = $this->getInstanceState($instance);
111
112
		// Mark the instance as unreachable
113
		$message = 'Instance {instanceName} not reachable, will wait for {cycles} cycles before retrying';
114
115
		$this->logger->warning($message, [
116
			'instanceName' => $instance->getName(),
117
			'cycles'       => self::UNREACHABLE_CYCLES_UNTIL_RETRY,
118
		]);
119
120
		$instanceState->setReachability(InstanceState::UNREACHABLE);
121
	}
122
123
124
	/**