Returns the Service Conditionals.
public static getServiceConditionals ( mixed $value ) : array | ||
$value | mixed | An array of conditionals to return |
return | array | An array of Service conditionals |
protected function wrapServiceConditionals($value, $code) { if (!($services = ContainerBuilder::getServiceConditionals($value))) { return $code; } $conditions = array(); foreach ($services as $service) { $conditions[] = sprintf("\$this->has('%s')", $service); } // re-indent the wrapped code $code = implode("\n", array_map(function ($line) { return $line ? ' ' . $line : $line; }, explode("\n", $code))); return sprintf(" if (%s) {\n%s }\n", implode(' && ', $conditions), $code); }
public static function getServiceConditionals($value) { return $this->delegate->getServiceConditionals($value); }