protected function setProperty($property, $value, Environment $environment, $noWait)
{
if (!$this->validateValue($property, $value)) {
return 1;
}
$type = $this->getType($property);
if ($type === 'boolean' && $value === 'false') {
$value = false;
}
settype($value, $type);
$currentValue = $environment->getProperty($property, false);
if ($currentValue === $value) {
$this->stdErr->writeln("Property <info>{$property}</info> already set as: " . $this->formatter->format($environment->getProperty($property, false), $property));
return 0;
}
$result = $environment->update([$property => $value]);
$this->stdErr->writeln("Property <info>{$property}</info> set to: " . $this->formatter->format($environment->{$property}, $property));
$this->api()->clearEnvironmentsCache($environment->project);
$rebuildProperties = ['enable_smtp', 'restrict_robots'];
$success = true;
if ($result->countActivities() && !$noWait) {
$success = ActivityUtil::waitMultiple($result->getActivities(), $this->stdErr, $this->getSelectedProject());
} elseif (!$result->countActivities() && in_array($property, $rebuildProperties)) {
$this->rebuildWarning();
}
return $success ? 0 : 1;
}