extract all voter names from a serialized feature

@param $value

@return array
194777
public static function extractFromArray($value)
    {
        /**
         * @param array $filters
         *
         * @return array
         */
        $extractVoters = function (array $filters) {
            $voters = [];
            foreach ($filters as $filter) {
                if (is_array($filter)) {
                    $voters = array_merge($voters, array_keys($filter));
                }
            }

            return array_unique($voters);
        };

        $voters = [];
        if (isset($value['filters'])) {
            $voters = array_merge($voters, $extractVoters($value['filters']));
        }
        if (isset($value['breaker'])) {
            $voters = array_merge($voters, $extractVoters($value['breaker']));
        }
        if (isset($value['values'])) {
            foreach ($value['values'] as $valueValue) {
                if (isset($valueValue['filters'])) {
                    $voters = array_merge($voters, $extractVoters($valueValue['filters']));
                }
            }
        }

        return array_values(array_unique($voters));
    }
540643
public function lex(string $value): array
    {
        $offset = 0;
        $valueLength = strlen($value);
        $tokens = [];

        while ($offset < $valueLength) {
            $valueFragment = substr($value, $offset);
            $fragmentTokens = $this->lexFragment($this->referenceLexer, $valueFragment);

            foreach ($fragmentTokens as $fragmentToken) {
                $tokens[] = $fragmentToken;
                $offset += strlen($fragmentToken->getValue());
            }
        }

        return $tokens;
    }
741731
private function getImagesInFieldValue($value)
  {
    $aImages = explode(',', $value);
    $arrImages = [];
    foreach ($aImages as $aImage)
    {
      $oImage = File::where('path',$aImage)->first();
      if (!$oImage) continue;
      $fileName = "$oImage->name.$oImage->ext";
      $arrImages[] = [
        'filename' => $fileName,
        'virtuaPath' => $oImage->path,
        'path' => $oImage->image ? $this->contentRepository->getImageUrl($oImage->path,[
          'w' => 120,
          'h' => 120,
          'fit' => 'crop',
        ]) : $this->contentRepository->getFileUrl($oImage->path),
        'pathDownload' => ($oImage->image ? $this->contentRepository->getImageUrl($oImage->path) : $this->contentRepository->getFileUrl($oImage->path))."?f=".$fileName,
        'icon' => !$oImage->image ? $this->props->genericIconPath : ''
      ];
    }
    return $arrImages;
  }
1277274
private function findAnonymousInstances($value) {
		$array = new \SplObjectStorage();
		if ($value instanceof MoufInstanceDescriptor) {
			if ($value->isAnonymous()) {
				$array->attach($value);
				$array->addAll($this->getAnonymousAttachedInstances($value));
				return $array;
			}
		} elseif (is_array($value)) {
			array_walk_recursive($value, function($item) use ($array) {
				if ($item instanceof MoufInstanceDescriptor && $item->isAnonymous()) {
					$array->attach($item);
					$array->addAll($this->getAnonymousAttachedInstances($item));
				}
			});
		}
		return $array;
	}
1328961
protected function getValues( $value, $fill = 0 )
	{
		$values	= array();
		if( substr_count( $value, "-" ) )
		{
			$parts	= explode( "-", $value );
			$min	= trim( min( $parts ) );
			$max	= trim( max( $parts ) );
			for( $i=$min; $i<=$max; $i++ )
				$values[] = $this->fill( $i, $fill );
		}
		else if( substr_count( $value, "," ) )
		{
			$parts	= explode( ",", $value );
			foreach( $parts as $part )
				$values[]	= $this->fill( $part, $fill );
		}
		else $values[]	= $this->fill( $value, $fill );
		return $values;
	}
1108472
public function searchByValue($value):array{

		$matches = [];

		foreach($this->iterator as $v){

			if($v === $value){
				$matches[$this->getPath()] = $value;
			}

		}

		return $matches;
	}
1096355
public static function allToArray($value)
    {
        if ($value instanceof DataSetInterface) {
            $value = $value->dump(true);
        } elseif ($value instanceof DataInterface) {
            $value = $value->dump(true);
        } elseif ($value instanceof \Traversable) {
            $value = iterator_to_array($value);
        } elseif (is_object($value)) {
            $value = get_object_vars($value);
        }

        if (is_array($value)) {
            foreach ($value as &$v) {
                $v = static::allToArray($v);
            }
        }

        return $value;
    }
304154
public function lex(string $value): array
    {
        if (false === $this->functionTokenizer->isTokenized($value)) {
            $value = $this->functionTokenizer->tokenize($value);
        }

        return $this->decoratedLexer->lex($value);
    }
123688
public function findAll($value): ?array
    {
        $founded = array_keys($this->items->toArray(), $value, true);

        if (0 === count($founded)) {
            return null;
        }

        return $founded;
    }
1046877
public function csvToArray($value)
    {
        if ($value === null) {
            return [];
        }

        $result = explode(',', $value);
        $result = array_map('trim', $result);
        $result = array_filter($result);

        return array_values($result);
    }
582302
public static function parseHeaderValue(string $value): array
    {
        $parts = \explode(';', $value);
        $type = \trim($parts[0]);
        unset($parts[0]);

        $parameters = [];
        foreach ($parts as $part) {
            [$k, $v] = \explode('=', $part, 2);

            $key = \strtolower(\trim($k));
            $parameters[$key] = \trim($v, ' "');
        }

        return [$type, $parameters];
    }
900459
public function getByNameFirst($value)
    {
        $users = [];
        foreach ($this as $user) {
            if ($user->get('nameFirst')) {
                $users[] = $user;
            }
        }
        return new $this($users);
    }
983659
public function serialize($value) {
        $filters = $this->getFilters();
        for ($i = count($filters) - 1; $i >= 0; --$i) {
            $value = $filters[$i]->fromValue($value);
        }
        return $this->toData($value);
    }
959708
protected function extractArray($value)
    {
        if (empty($value)) {
            return [];
        }

        if ($value instanceof \Traversable) {
            $array = [];
            foreach ($value as $key => $value) {
                $array[$key] = $value;
            }
            return $array;
        }

        return (Array) $value;
    }
667658
public function transform($value)
    {
        if (null === $value) {
            return null;
        }

        if (!$value instanceof VersionInfo) {
            throw new TransformationFailedException(
                'Value cannot be transformed because passed value is not an VersionInfo object'
            );
        }

        return ['content_info' => $value->getContentInfo(), 'version_no' => $value->versionNo];
    }
710456
protected function multiple($value)
    {
        $arguments = explode(':', $value);

        if (count($arguments) > 1) {
            $rule = $arguments[0];
            unset($arguments[0]);

            return ['multiple' => true, 'rule' => $rule, 'arguments' => array_values($arguments)];
        }

        return ['multiple' => false];
    }
1104365
public function filter($value)
    {
        if (null === $value) {
            return null;
        }
        $this->checkValueIsArrayOrThrowException($value);

        $return = [];
        foreach ($value as $header => $condition) {
            $return[$header] = $this->conditionFilter->filter($condition);
        }

        return $return;
    }