@param string      $property
@param string      $value
@param Environment $environment
@param bool        $noWait

@return int
518235
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(sprintf(
                'Property <info>%s</info> already set as: %s',
                $property,
                $this->formatter->format($environment->getProperty($property, false), $property)
            ));

            return 0;
        }
        $result = $environment->update([$property => $value]);
        $this->stdErr->writeln(sprintf(
            'Property <info>%s</info> set to: %s',
            $property,
            $this->formatter->format($environment->$property, $property)
        ));

        $this->api()->clearEnvironmentsCache($environment->project);

        $rebuildProperties = ['enable_smtp', 'restrict_robots'];
        $success = true;
        if ($result->countActivities() && !$noWait) {
            /** @var \Platformsh\Cli\Service\ActivityMonitor $activityMonitor */
            $activityMonitor = $this->getService('activity_monitor');
            $success = $activityMonitor->waitMultiple($result->getActivities(), $this->getSelectedProject());
        } elseif (!$result->countActivities() && in_array($property, $rebuildProperties)) {
            $this->redeployWarning();
        }

        return $success ? 0 : 1;
    }
1243349
public static function setPropertyValue($obj,$propertyName,$value,$fieldAccess=false)
    {
        $setter=self::getSetter($obj, $propertyName);
        if(!empty($setter)){
            $obj->$setter($value);
        }else if($fieldAccess && property_exists($obj, $propertyName)){
            $obj->$propertyName=$value;
        }
    }
450341
function findOneMatchBy($property, $value)
    {
        switch ($property) {
            case 'owner_identifier':
                return $this->federation->getAccountInfoByUid($value);
                break;
            default:
                throw new \Exception(sprintf(
                    'Identity Provider Can`t Attain with (%s).'
                    , $property
                ));
        }
    }
366059
private function isPropertyAllowedByIntersectProperties(
        PropertyInterface $property,
        EnvironmentInterface $environment
    ) {
        $sessionStorage = $environment->getSessionStorage();
        $inputProvider  = $environment->getInputProvider();
        $dataDefinition = $environment->getDataDefinition();

        $session = $sessionStorage->get($dataDefinition->getName() . '.' . $inputProvider->getParameter('mode'));

        return \array_key_exists($property->getName(), $session['intersectProperties']);
    }
521910
private function MaybeModifyValueBeforeNudge(
        string $property,
        $value,
        bool $autoTrimStrings = self::BOOL_DEFAULT_AUTOTRIMSTRINGS,
        bool $throwIfNotUnique = self::BOOL_DEFAULT_THROWIFNOTUNIQUE
    ) {
        $spec = null;

        if (
            is_a(
                static::class,
                DaftObjectHasPropertiesWithMultiTypedArraysOfUniqueValues::class,
                true
            )
        ) {
            $spec = (
                static::DaftObjectPropertiesWithMultiTypedArraysOfUniqueValues()[$property] ?? null
            );
        }

        if (is_array($spec)) {
            $value = DefinitionAssistant::MaybeThrowIfValueDoesNotMatchMultiTypedArray(
                $autoTrimStrings,
                $throwIfNotUnique,
                $value,
                ...$spec
            );
        }

        if (is_string($value) && $autoTrimStrings) {
            $value = trim($value);
        }

        return $value;
    }
252362
public function objectWhere($property, $value)
    {
        foreach ($this->objects as $key => $obj) {
            if ($obj->{$property} === $value) {
                return $this->objects[$key];
            }
        }
        return false;
    }
874188
public function doSetValue($value)
    {
        $items = $value;
        if ($value instanceof PropertyValue) {
            $items = $value->getValue();
        }

        if (null == $items) {
            return;
        }

        // check value for single value
        if (array_keys($items) !== range(0, count($items) - 1)) {
            $items = [$items];
        }

        $this->properties = [];

        for ($i = 0; $i < count($items); ++$i) {
            $item = $items[$i];
            $type = $this->initProperties($i, $item['type']);

            /** @var PropertyInterface $subProperty */
            foreach ($type->getChildProperties() as $subProperty) {
                if (!isset($item[$subProperty->getName()])) {
                    continue;
                }

                $subName = $subProperty->getName();
                $subValue = $item[$subName];

                if ($subValue instanceof PropertyValue) {
                    $subValueProperty = new PropertyValue($subName, $subValue);
                    $subProperty->setPropertyValue($subValueProperty);
                    $item[$subName] = $subValueProperty;
                } else {
                    $subProperty->setValue($subValue);
                }
            }

            $items[$i] = $item;
        }

        if ($value instanceof PropertyValue) {
            $value->setValue($items);
        }
    }
384777
public function keyWhere($property, $value)
    {
        foreach ($this->objects as $key => $obj) {
            if ($obj->{$property} === $value) {
                $keys[] = $key;
            }
        }
        if (count($keys)) {
            return $keys;
        }
        return false;
    }
1334991
protected function getNumericValue(string $property)
    {
        return ($property === 'time')
               ? (float) $this->accumulate('getTotalTime')
               : (int) $this->accumulate('getTotal' . ucfirst($property));
    }
453156
public function formatPropertyValue($value, string $property) : string
    {
        $valueOutput = (string) $value;

        switch ($this->propertyHolder->getPropertyType($property)) {
            case PropertyHolder::TYPE_STRING:
                $valueOutput = trim((string) $value);

                break;
            case PropertyHolder::TYPE_BOOLEAN:
                if (true === $value || 'true' === $value) {
                    $valueOutput = 'true';
                } elseif (false === $value || 'false' === $value) {
                    $valueOutput = 'false';
                } else {
                    $valueOutput = '';
                }

                break;
            case PropertyHolder::TYPE_IN_ARRAY:
                try {
                    $valueOutput = $this->propertyHolder->checkValueInArray($property, (string) $value);
                } catch (\InvalidArgumentException $ex) {
                    $valueOutput = '';
                }

                break;
            default:
                // nothing t do here
                break;
        }

        if ('unknown' === $valueOutput) {
            $valueOutput = '';
        }

        return '"' . str_replace('"', '""', $valueOutput) . '"';
    }
1017961
protected function isInCurrentEnv(string $currentEnv = '*', array $envList = []): bool
    {
        if (in_array('*', $envList, false)) {
            return true;
        }

        if (in_array($currentEnv, $envList, false)) {
            return true;
        }

        return false;
    }
1157284
private function convertEnvValue($value, $environmentVariable)
    {
        $value = trim(trim(trim($value, '\''), '"'));

        if ($this->isBoolean($value)) {
            $value = $this->convertBoolean($value);
        } elseif ($this->isInteger($value)) {
            $value = $this->convertInteger($value);
        } elseif ($this->isJson($value)) {
            $value = $this->convertJson($value, $environmentVariable);
        }

        return $value;
    }
163097
public function propertyValue(&$value, $keyName = null) {
$values = array();

if ($keyName !== null) $this->env->currentProperty = $keyName;

$s = null;
while ($this->expressionList($v)) {
$values[] = $v;
$s = $this->seek();
if (!$this->literal(',')) break;
}

if ($s) $this->seek($s);

if ($keyName !== null) unset($this->env->currentProperty);

if (count($values) == 0) return false;

$value = \ATPCore\Lessc::compressList($values, ', ');
return true;
}
115585
public function setEnv($properties)
    {
        $envPath = app()->environmentFilePath();

        $contents = File::get($envPath);
        if(!$contents) {
            throw new \Exception('Could not read env file');
        }

        foreach($properties as $key => $value){
            // Env value must be set so the already loaded file reflect changes
            $this->setEnvValue($key, $value);

            // Change content
            $contents = preg_replace('/' . $key . '=(.*)/', $key . '=' . $value, $contents);
        }

        if (File::put($envPath, $contents) === false) {
            throw new \Exception('Could not write env file');
        }

        return true;
    }
1221918
public function set($propertyName, $value, $status = null)
    {
        if (is_null($status)) {
            $status = is_null($value) ? 404 : 200;
        }
        $this->result[$propertyName] = [$status, $value];
    }
672624
public static function definer(string $env):int
    {
        $base = realpath(__DIR__ . "/../../../../../../")."/";

        define('IUMIO_ENV', $env);
        define('IUMIO_ROOT', $base);

        $current = self::getProtocol()."://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']);
        $current_temp = substr($current, 0, strpos($current, self::getFileEnv($env)));
        if (strlen($current_temp) > 0) {
            $current = $current_temp;
        }
        if ($current[strlen($current) - 1] == "/") {
            $current = substr($current, 0, (strlen($current) - 1));
        }

        self::__setPaths($base, $env, $current);

        foreach (self::$framework_paths as $one => $val) {
            $container = FrameworkContainer::getInstance();
            $container->set($one, $val);
        }

        return (1);
    }
838298
public function getUser($property, $value)
    {
        $class = new \core_kernel_classes_Class(GenerisRdf::CLASS_GENERIS_USER);

        $users = \tao_models_classes_UserService::singleton()->searchInstances(
            array($property => $value), 
            $class,
            array('like' => false, 'recursive' => true)
        );
        $user = empty($users) ? null : current($users);
        
        return $user;
    }