id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
28,700 | php-deal/framework | src/Contract/Fetcher/Parent/AbstractFetcher.php | AbstractFetcher.filterContractAnnotation | protected function filterContractAnnotation(array $annotations): array
{
$contractAnnotations = [];
foreach ($annotations as $annotation) {
$annotationClass = \get_class($annotation);
if (\in_array($annotationClass, $this->expectedAnnotationTypes, true)) {
$... | php | protected function filterContractAnnotation(array $annotations): array
{
$contractAnnotations = [];
foreach ($annotations as $annotation) {
$annotationClass = \get_class($annotation);
if (\in_array($annotationClass, $this->expectedAnnotationTypes, true)) {
$... | [
"protected",
"function",
"filterContractAnnotation",
"(",
"array",
"$",
"annotations",
")",
":",
"array",
"{",
"$",
"contractAnnotations",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"annotations",
"as",
"$",
"annotation",
")",
"{",
"$",
"annotationClass",
"=",
... | Performs filtering of annotations by the requested class name
@param array $annotations
@return array | [
"Performs",
"filtering",
"of",
"annotations",
"by",
"the",
"requested",
"class",
"name"
] | 31ff0b8fe6c76e4df8cc60b4a0da68a0177b7d43 | https://github.com/php-deal/framework/blob/31ff0b8fe6c76e4df8cc60b4a0da68a0177b7d43/src/Contract/Fetcher/Parent/AbstractFetcher.php#L45-L58 |
28,701 | smartboxgroup/integration-framework-bundle | Core/Processors/ControlFlow/ThrowException.php | ThrowException.doProcess | protected function doProcess(Exchange $exchange, SerializableArray $processingContext)
{
if (empty($this->exceptionClass)) {
throw new \RuntimeException('Exception class not found');
}
/** @var ExchangeAwareInterface $exception */
$exception = new $this->exceptionClass($... | php | protected function doProcess(Exchange $exchange, SerializableArray $processingContext)
{
if (empty($this->exceptionClass)) {
throw new \RuntimeException('Exception class not found');
}
/** @var ExchangeAwareInterface $exception */
$exception = new $this->exceptionClass($... | [
"protected",
"function",
"doProcess",
"(",
"Exchange",
"$",
"exchange",
",",
"SerializableArray",
"$",
"processingContext",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"exceptionClass",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
... | The ThrowException will create an exception of the type specified in Ref.
@param Exchange $exchange
@return bool
@throws ExchangeAwareInterface | [
"The",
"ThrowException",
"will",
"create",
"an",
"exception",
"of",
"the",
"type",
"specified",
"in",
"Ref",
"."
] | 5f0bf8ff86337a51f6d208bd38df39017643b905 | https://github.com/smartboxgroup/integration-framework-bundle/blob/5f0bf8ff86337a51f6d208bd38df39017643b905/Core/Processors/ControlFlow/ThrowException.php#L82-L92 |
28,702 | cedx/coveralls.php | lib/Configuration.php | Configuration.fromYaml | static function fromYaml(string $document): self {
if (!mb_strlen($document)) throw new \InvalidArgumentException('The specified YAML document is empty.');
try {
$yaml = Yaml::parse($document);
if (!is_array($yaml)) throw new \InvalidArgumentException('The specified YAML document is invalid.');
... | php | static function fromYaml(string $document): self {
if (!mb_strlen($document)) throw new \InvalidArgumentException('The specified YAML document is empty.');
try {
$yaml = Yaml::parse($document);
if (!is_array($yaml)) throw new \InvalidArgumentException('The specified YAML document is invalid.');
... | [
"static",
"function",
"fromYaml",
"(",
"string",
"$",
"document",
")",
":",
"self",
"{",
"if",
"(",
"!",
"mb_strlen",
"(",
"$",
"document",
")",
")",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'The specified YAML document is empty.'",
")",
";",
"t... | Creates a new configuration from the specified YAML document.
@param string $document A YAML document providing configuration parameters.
@return static The instance corresponding to the specified YAML document.
@throws \InvalidArgumentException The specified document is invalid. | [
"Creates",
"a",
"new",
"configuration",
"from",
"the",
"specified",
"YAML",
"document",
"."
] | c196de0f92e06d5143ba90ebab18c8e384316cc0 | https://github.com/cedx/coveralls.php/blob/c196de0f92e06d5143ba90ebab18c8e384316cc0/lib/Configuration.php#L89-L101 |
28,703 | cedx/coveralls.php | lib/Configuration.php | Configuration.loadDefaults | static function loadDefaults(string $coverallsFile = '.coveralls.yml'): self {
$defaults = static::fromEnvironment();
try {
$defaults->merge(static::fromYaml((string) @file_get_contents($coverallsFile)));
return $defaults;
}
catch (\Throwable $e) {
return $defaults;
}
} | php | static function loadDefaults(string $coverallsFile = '.coveralls.yml'): self {
$defaults = static::fromEnvironment();
try {
$defaults->merge(static::fromYaml((string) @file_get_contents($coverallsFile)));
return $defaults;
}
catch (\Throwable $e) {
return $defaults;
}
} | [
"static",
"function",
"loadDefaults",
"(",
"string",
"$",
"coverallsFile",
"=",
"'.coveralls.yml'",
")",
":",
"self",
"{",
"$",
"defaults",
"=",
"static",
"::",
"fromEnvironment",
"(",
")",
";",
"try",
"{",
"$",
"defaults",
"->",
"merge",
"(",
"static",
":... | Loads the default configuration.
The default values are read from the environment variables and an optional `.coveralls.yml` file.
@param string $coverallsFile The path to the `.coveralls.yml` file. Defaults to the file found in the current directory.
@return Configuration The default configuration. | [
"Loads",
"the",
"default",
"configuration",
".",
"The",
"default",
"values",
"are",
"read",
"from",
"the",
"environment",
"variables",
"and",
"an",
"optional",
".",
"coveralls",
".",
"yml",
"file",
"."
] | c196de0f92e06d5143ba90ebab18c8e384316cc0 | https://github.com/cedx/coveralls.php/blob/c196de0f92e06d5143ba90ebab18c8e384316cc0/lib/Configuration.php#L109-L120 |
28,704 | cedx/coveralls.php | lib/Configuration.php | Configuration.merge | function merge(self $config): void {
foreach ($config as $key => $value) $this[$key] = $value;
} | php | function merge(self $config): void {
foreach ($config as $key => $value) $this[$key] = $value;
} | [
"function",
"merge",
"(",
"self",
"$",
"config",
")",
":",
"void",
"{",
"foreach",
"(",
"$",
"config",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"$",
"this",
"[",
"$",
"key",
"]",
"=",
"$",
"value",
";",
"}"
] | Adds all entries of the specified configuration to this one.
@param self $config The configuration to be merged. | [
"Adds",
"all",
"entries",
"of",
"the",
"specified",
"configuration",
"to",
"this",
"one",
"."
] | c196de0f92e06d5143ba90ebab18c8e384316cc0 | https://github.com/cedx/coveralls.php/blob/c196de0f92e06d5143ba90ebab18c8e384316cc0/lib/Configuration.php#L158-L160 |
28,705 | netgen/site-bundle | bundle/Menu/Factory/LocationFactory.php | LocationFactory.getExtension | protected function getExtension(Location $location): ExtensionInterface
{
foreach ($this->extensions as $extension) {
if ($extension->matches($location)) {
return $extension;
}
}
return $this->fallbackExtension;
} | php | protected function getExtension(Location $location): ExtensionInterface
{
foreach ($this->extensions as $extension) {
if ($extension->matches($location)) {
return $extension;
}
}
return $this->fallbackExtension;
} | [
"protected",
"function",
"getExtension",
"(",
"Location",
"$",
"location",
")",
":",
"ExtensionInterface",
"{",
"foreach",
"(",
"$",
"this",
"->",
"extensions",
"as",
"$",
"extension",
")",
"{",
"if",
"(",
"$",
"extension",
"->",
"matches",
"(",
"$",
"loca... | Returns the first extension that matches the provided location.
If none match, fallback extension is returned. | [
"Returns",
"the",
"first",
"extension",
"that",
"matches",
"the",
"provided",
"location",
"."
] | 4198c8412ffdb6692b80d35e05c8ba331365b746 | https://github.com/netgen/site-bundle/blob/4198c8412ffdb6692b80d35e05c8ba331365b746/bundle/Menu/Factory/LocationFactory.php#L73-L82 |
28,706 | netgen/site-bundle | bundle/DependencyInjection/Compiler/ContentDownloadUrlGeneratorPass.php | ContentDownloadUrlGeneratorPass.process | public function process(ContainerBuilder $container): void
{
if ($container->has('ezpublish.fieldType.ease.download_url_generator')) {
$container
->findDefinition('ezpublish.fieldType.ezbinarybase.download_url_generator')
->setClass(ContentDownloadUrlGenerator::cl... | php | public function process(ContainerBuilder $container): void
{
if ($container->has('ezpublish.fieldType.ease.download_url_generator')) {
$container
->findDefinition('ezpublish.fieldType.ezbinarybase.download_url_generator')
->setClass(ContentDownloadUrlGenerator::cl... | [
"public",
"function",
"process",
"(",
"ContainerBuilder",
"$",
"container",
")",
":",
"void",
"{",
"if",
"(",
"$",
"container",
"->",
"has",
"(",
"'ezpublish.fieldType.ease.download_url_generator'",
")",
")",
"{",
"$",
"container",
"->",
"findDefinition",
"(",
"... | Override content download URL generator to generate download links
to files with Netgen Site download route. | [
"Override",
"content",
"download",
"URL",
"generator",
"to",
"generate",
"download",
"links",
"to",
"files",
"with",
"Netgen",
"Site",
"download",
"route",
"."
] | 4198c8412ffdb6692b80d35e05c8ba331365b746 | https://github.com/netgen/site-bundle/blob/4198c8412ffdb6692b80d35e05c8ba331365b746/bundle/DependencyInjection/Compiler/ContentDownloadUrlGeneratorPass.php#L17-L24 |
28,707 | cedx/coveralls.php | lib/SourceFile.php | SourceFile.fromJson | static function fromJson(object $map): self {
return new static(
isset($map->name) && is_string($map->name) ? $map->name : '',
isset($map->source_digest) && is_string($map->source_digest) ? $map->source_digest : '',
isset($map->source) && is_string($map->source) ? $map->source : '',
isset($m... | php | static function fromJson(object $map): self {
return new static(
isset($map->name) && is_string($map->name) ? $map->name : '',
isset($map->source_digest) && is_string($map->source_digest) ? $map->source_digest : '',
isset($map->source) && is_string($map->source) ? $map->source : '',
isset($m... | [
"static",
"function",
"fromJson",
"(",
"object",
"$",
"map",
")",
":",
"self",
"{",
"return",
"new",
"static",
"(",
"isset",
"(",
"$",
"map",
"->",
"name",
")",
"&&",
"is_string",
"(",
"$",
"map",
"->",
"name",
")",
"?",
"$",
"map",
"->",
"name",
... | Creates a new source file from the specified JSON map.
@param object $map A JSON map representing a source file.
@return static The instance corresponding to the specified JSON map. | [
"Creates",
"a",
"new",
"source",
"file",
"from",
"the",
"specified",
"JSON",
"map",
"."
] | c196de0f92e06d5143ba90ebab18c8e384316cc0 | https://github.com/cedx/coveralls.php/blob/c196de0f92e06d5143ba90ebab18c8e384316cc0/lib/SourceFile.php#L38-L45 |
28,708 | adminarchitect/options | src/Terranet/Options/Drivers/DatabaseOptionsDriver.php | DatabaseOptionsDriver.fetchAll | public function fetchAll(string $group = null)
{
if (static::$options === null) {
static::$options = $this
->createModel()
->when($group, function ($query, $group) {
return $query->where('group', $group);
})
->or... | php | public function fetchAll(string $group = null)
{
if (static::$options === null) {
static::$options = $this
->createModel()
->when($group, function ($query, $group) {
return $query->where('group', $group);
})
->or... | [
"public",
"function",
"fetchAll",
"(",
"string",
"$",
"group",
"=",
"null",
")",
"{",
"if",
"(",
"static",
"::",
"$",
"options",
"===",
"null",
")",
"{",
"static",
"::",
"$",
"options",
"=",
"$",
"this",
"->",
"createModel",
"(",
")",
"->",
"when",
... | Fetch all options
@param null|string $group
@return mixed | [
"Fetch",
"all",
"options"
] | b3b43dc3bfc34710143c8e34a79603e925f07fd2 | https://github.com/adminarchitect/options/blob/b3b43dc3bfc34710143c8e34a79603e925f07fd2/src/Terranet/Options/Drivers/DatabaseOptionsDriver.php#L40-L54 |
28,709 | adminarchitect/options | src/Terranet/Options/Drivers/DatabaseOptionsDriver.php | DatabaseOptionsDriver.find | public function find($name, $default = null)
{
foreach ($this->fetchAll() as $option) {
if ($option->key == $name) {
return $option->value;
}
}
return $default;
} | php | public function find($name, $default = null)
{
foreach ($this->fetchAll() as $option) {
if ($option->key == $name) {
return $option->value;
}
}
return $default;
} | [
"public",
"function",
"find",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"fetchAll",
"(",
")",
"as",
"$",
"option",
")",
"{",
"if",
"(",
"$",
"option",
"->",
"key",
"==",
"$",
"name",
")",
"... | Find an option by name
@param $name
@param $default
@return mixed | [
"Find",
"an",
"option",
"by",
"name"
] | b3b43dc3bfc34710143c8e34a79603e925f07fd2 | https://github.com/adminarchitect/options/blob/b3b43dc3bfc34710143c8e34a79603e925f07fd2/src/Terranet/Options/Drivers/DatabaseOptionsDriver.php#L63-L72 |
28,710 | smartboxgroup/integration-framework-bundle | Tools/Mapper/Mapper.php | Mapper.dateFromFormat | public function dateFromFormat($format, $date)
{
if (!empty($format) && !empty($date)) {
return \DateTime::createFromFormat($format, $date);
}
} | php | public function dateFromFormat($format, $date)
{
if (!empty($format) && !empty($date)) {
return \DateTime::createFromFormat($format, $date);
}
} | [
"public",
"function",
"dateFromFormat",
"(",
"$",
"format",
",",
"$",
"date",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"format",
")",
"&&",
"!",
"empty",
"(",
"$",
"date",
")",
")",
"{",
"return",
"\\",
"DateTime",
"::",
"createFromFormat",
"(",
... | Convert a formatted string to a date.
The portions of the generated time not provided in format, will be set to corresponding values from the Unix epoch.
Ex: dateFromFormat('d/m/Y', '23/03/2018').
@param string $format
@param string $date
@return bool|\DateTime | [
"Convert",
"a",
"formatted",
"string",
"to",
"a",
"date",
"."
] | 5f0bf8ff86337a51f6d208bd38df39017643b905 | https://github.com/smartboxgroup/integration-framework-bundle/blob/5f0bf8ff86337a51f6d208bd38df39017643b905/Tools/Mapper/Mapper.php#L230-L235 |
28,711 | smartboxgroup/integration-framework-bundle | Tools/Mapper/Mapper.php | Mapper.flattenArrayByKey | public function flattenArrayByKey(array $data, $key)
{
$array = [];
foreach ($data as $value) {
if (is_array($value) && isset($value[$key])) {
$array[] = $value[$key];
}
}
return $array;
} | php | public function flattenArrayByKey(array $data, $key)
{
$array = [];
foreach ($data as $value) {
if (is_array($value) && isset($value[$key])) {
$array[] = $value[$key];
}
}
return $array;
} | [
"public",
"function",
"flattenArrayByKey",
"(",
"array",
"$",
"data",
",",
"$",
"key",
")",
"{",
"$",
"array",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
"&&",
"is... | Flatten an array by key.
@param array $data The array to flatten
@param string $key The common key
@return array | [
"Flatten",
"an",
"array",
"by",
"key",
"."
] | 5f0bf8ff86337a51f6d208bd38df39017643b905 | https://github.com/smartboxgroup/integration-framework-bundle/blob/5f0bf8ff86337a51f6d208bd38df39017643b905/Tools/Mapper/Mapper.php#L322-L332 |
28,712 | smartboxgroup/integration-framework-bundle | Tools/Mapper/Mapper.php | Mapper.serializeWithGroup | public function serializeWithGroup($data, $format, $group)
{
$serializer = $this->evaluator->getSerializer();
return $serializer->serialize($data, $format, SerializationContext::create()->setGroups([$group]));
} | php | public function serializeWithGroup($data, $format, $group)
{
$serializer = $this->evaluator->getSerializer();
return $serializer->serialize($data, $format, SerializationContext::create()->setGroups([$group]));
} | [
"public",
"function",
"serializeWithGroup",
"(",
"$",
"data",
",",
"$",
"format",
",",
"$",
"group",
")",
"{",
"$",
"serializer",
"=",
"$",
"this",
"->",
"evaluator",
"->",
"getSerializer",
"(",
")",
";",
"return",
"$",
"serializer",
"->",
"serialize",
"... | Serialize the given datas into the expected format with a group.
@param $data
@param $format
@param $group
@return string | [
"Serialize",
"the",
"given",
"datas",
"into",
"the",
"expected",
"format",
"with",
"a",
"group",
"."
] | 5f0bf8ff86337a51f6d208bd38df39017643b905 | https://github.com/smartboxgroup/integration-framework-bundle/blob/5f0bf8ff86337a51f6d208bd38df39017643b905/Tools/Mapper/Mapper.php#L369-L374 |
28,713 | smartboxgroup/integration-framework-bundle | Tools/Mapper/Mapper.php | Mapper.wordWrap | public function wordWrap($string, $length, $section)
{
$wrapped = wordwrap($string, $length, '\mapperDelimiter', true);
$lines = explode('\mapperDelimiter', $wrapped);
--$section;
$result = '';
if (isset($lines[$section])) {
$result = $lines[$section];
}
... | php | public function wordWrap($string, $length, $section)
{
$wrapped = wordwrap($string, $length, '\mapperDelimiter', true);
$lines = explode('\mapperDelimiter', $wrapped);
--$section;
$result = '';
if (isset($lines[$section])) {
$result = $lines[$section];
}
... | [
"public",
"function",
"wordWrap",
"(",
"$",
"string",
",",
"$",
"length",
",",
"$",
"section",
")",
"{",
"$",
"wrapped",
"=",
"wordwrap",
"(",
"$",
"string",
",",
"$",
"length",
",",
"'\\mapperDelimiter'",
",",
"true",
")",
";",
"$",
"lines",
"=",
"e... | Return the n-th section of the given string splitted by piece of the given length.
@param string $string
@param int $length
@param int $section
@return string | [
"Return",
"the",
"n",
"-",
"th",
"section",
"of",
"the",
"given",
"string",
"splitted",
"by",
"piece",
"of",
"the",
"given",
"length",
"."
] | 5f0bf8ff86337a51f6d208bd38df39017643b905 | https://github.com/smartboxgroup/integration-framework-bundle/blob/5f0bf8ff86337a51f6d208bd38df39017643b905/Tools/Mapper/Mapper.php#L385-L397 |
28,714 | IconoCoders/otp-simple-sdk | Source/SimpleBase.php | SimpleBase.merchantByCurrency | public function merchantByCurrency($config = array(), $currency = '')
{
if (!is_array($config)) {
$this->errorMessage[] = 'config is not array!';
return false;
} elseif (count($config) == 0) {
$this->errorMessage[] = 'Empty config array!';
return false... | php | public function merchantByCurrency($config = array(), $currency = '')
{
if (!is_array($config)) {
$this->errorMessage[] = 'config is not array!';
return false;
} elseif (count($config) == 0) {
$this->errorMessage[] = 'Empty config array!';
return false... | [
"public",
"function",
"merchantByCurrency",
"(",
"$",
"config",
"=",
"array",
"(",
")",
",",
"$",
"currency",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"config",
")",
")",
"{",
"$",
"this",
"->",
"errorMessage",
"[",
"]",
"=",
"'co... | Initialize MERCHANT, SECRET_KEY and CURRENCY
@param string $config Config array
@param string $currency Currency
@return array $this->config Initialized config array | [
"Initialize",
"MERCHANT",
"SECRET_KEY",
"and",
"CURRENCY"
] | d2808bf52e8d34be69414b444a00f1a9c8564930 | https://github.com/IconoCoders/otp-simple-sdk/blob/d2808bf52e8d34be69414b444a00f1a9c8564930/Source/SimpleBase.php#L107-L137 |
28,715 | IconoCoders/otp-simple-sdk | Source/SimpleBase.php | SimpleBase.processConfig | public function processConfig($config = array())
{
foreach (array_keys($config) as $setting) {
if (array_key_exists($setting, $this->settings)) {
$prop = $this->settings[$setting];
$this->$prop = $config[$setting];
}
}
} | php | public function processConfig($config = array())
{
foreach (array_keys($config) as $setting) {
if (array_key_exists($setting, $this->settings)) {
$prop = $this->settings[$setting];
$this->$prop = $config[$setting];
}
}
} | [
"public",
"function",
"processConfig",
"(",
"$",
"config",
"=",
"array",
"(",
")",
")",
"{",
"foreach",
"(",
"array_keys",
"(",
"$",
"config",
")",
"as",
"$",
"setting",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"setting",
",",
"$",
"this",
... | Set config options
@param array $config Array with config options
@return void | [
"Set",
"config",
"options"
] | d2808bf52e8d34be69414b444a00f1a9c8564930 | https://github.com/IconoCoders/otp-simple-sdk/blob/d2808bf52e8d34be69414b444a00f1a9c8564930/Source/SimpleBase.php#L175-L183 |
28,716 | IconoCoders/otp-simple-sdk | Source/SimpleBase.php | SimpleBase.hmac | protected function hmac($key = '', $data = '')
{
if ($data == '') {
$this->errorMessage[] = 'DATA FOR HMAC: MISSING!';
return false;
}
if ($key == '') {
$this->errorMessage[] = 'KEY FOR HMAC: MISSING!';
return false;
}
return ha... | php | protected function hmac($key = '', $data = '')
{
if ($data == '') {
$this->errorMessage[] = 'DATA FOR HMAC: MISSING!';
return false;
}
if ($key == '') {
$this->errorMessage[] = 'KEY FOR HMAC: MISSING!';
return false;
}
return ha... | [
"protected",
"function",
"hmac",
"(",
"$",
"key",
"=",
"''",
",",
"$",
"data",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"data",
"==",
"''",
")",
"{",
"$",
"this",
"->",
"errorMessage",
"[",
"]",
"=",
"'DATA FOR HMAC: MISSING!'",
";",
"return",
"false",
... | HMAC HASH creation
@param string $key Secret key for encryption
@param string $data String to encode
@return string HMAC hash | [
"HMAC",
"HASH",
"creation"
] | d2808bf52e8d34be69414b444a00f1a9c8564930 | https://github.com/IconoCoders/otp-simple-sdk/blob/d2808bf52e8d34be69414b444a00f1a9c8564930/Source/SimpleBase.php#L194-L205 |
28,717 | IconoCoders/otp-simple-sdk | Source/SimpleBase.php | SimpleBase.flatArray | public function flatArray($array = array(), $skip = array())
{
if (count($array) == 0) {
$this->errorMessage[] = 'FLAT_ARRAY: array for flatArray is empty';
return array();
}
$return = array();
foreach ($array as $name => $item) {
if (!in_array($na... | php | public function flatArray($array = array(), $skip = array())
{
if (count($array) == 0) {
$this->errorMessage[] = 'FLAT_ARRAY: array for flatArray is empty';
return array();
}
$return = array();
foreach ($array as $name => $item) {
if (!in_array($na... | [
"public",
"function",
"flatArray",
"(",
"$",
"array",
"=",
"array",
"(",
")",
",",
"$",
"skip",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"array",
")",
"==",
"0",
")",
"{",
"$",
"this",
"->",
"errorMessage",
"[",
"]",
"=",... | Creates a 1-dimension array from a 2-dimension one
@param array $array Array to be processed
@param array $skip Array of keys to be skipped when creating the new array
@return array $return Flat array | [
"Creates",
"a",
"1",
"-",
"dimension",
"array",
"from",
"a",
"2",
"-",
"dimension",
"one"
] | d2808bf52e8d34be69414b444a00f1a9c8564930 | https://github.com/IconoCoders/otp-simple-sdk/blob/d2808bf52e8d34be69414b444a00f1a9c8564930/Source/SimpleBase.php#L253-L272 |
28,718 | IconoCoders/otp-simple-sdk | Source/SimpleBase.php | SimpleBase.getErrorMessage | public function getErrorMessage()
{
$message = $this->getDebugMessage();
$message .= '<font color="red">ERROR START</font><br>';
foreach ($this->errorMessage as $items) {
$message .= "-----------------------------------------------------------------------------------<br>";
... | php | public function getErrorMessage()
{
$message = $this->getDebugMessage();
$message .= '<font color="red">ERROR START</font><br>';
foreach ($this->errorMessage as $items) {
$message .= "-----------------------------------------------------------------------------------<br>";
... | [
"public",
"function",
"getErrorMessage",
"(",
")",
"{",
"$",
"message",
"=",
"$",
"this",
"->",
"getDebugMessage",
"(",
")",
";",
"$",
"message",
".=",
"'<font color=\"red\">ERROR START</font><br>'",
";",
"foreach",
"(",
"$",
"this",
"->",
"errorMessage",
"as",
... | Prints all of error message
@return void | [
"Prints",
"all",
"of",
"error",
"message"
] | d2808bf52e8d34be69414b444a00f1a9c8564930 | https://github.com/IconoCoders/otp-simple-sdk/blob/d2808bf52e8d34be69414b444a00f1a9c8564930/Source/SimpleBase.php#L431-L449 |
28,719 | IconoCoders/otp-simple-sdk | Source/SimpleBase.php | SimpleBase.getDebugMessage | public function getDebugMessage()
{
$message = '<font color="red">DEBUG START</font><br>';
foreach ($this->debugMessage as $items) {
if (is_array($items) || is_object($items)) {
$message .= "<pre>";
$message .= print_r($items, true) . '<br/>';
... | php | public function getDebugMessage()
{
$message = '<font color="red">DEBUG START</font><br>';
foreach ($this->debugMessage as $items) {
if (is_array($items) || is_object($items)) {
$message .= "<pre>";
$message .= print_r($items, true) . '<br/>';
... | [
"public",
"function",
"getDebugMessage",
"(",
")",
"{",
"$",
"message",
"=",
"'<font color=\"red\">DEBUG START</font><br>'",
";",
"foreach",
"(",
"$",
"this",
"->",
"debugMessage",
"as",
"$",
"items",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"items",
")",
... | Prints all of debug elements
@return void | [
"Prints",
"all",
"of",
"debug",
"elements"
] | d2808bf52e8d34be69414b444a00f1a9c8564930 | https://github.com/IconoCoders/otp-simple-sdk/blob/d2808bf52e8d34be69414b444a00f1a9c8564930/Source/SimpleBase.php#L457-L491 |
28,720 | netgen/site-bundle | bundle/EventListener/User/PostPasswordResetEventListener.php | PostPasswordResetEventListener.onPasswordReset | public function onPasswordReset(PostPasswordResetEvent $event): void
{
$user = $event->getUser();
$this->mailHelper
->sendMail(
[$user->email => $this->getUserName($user)],
'ngsite.user.forgot_password.password_changed.subject',
$this->con... | php | public function onPasswordReset(PostPasswordResetEvent $event): void
{
$user = $event->getUser();
$this->mailHelper
->sendMail(
[$user->email => $this->getUserName($user)],
'ngsite.user.forgot_password.password_changed.subject',
$this->con... | [
"public",
"function",
"onPasswordReset",
"(",
"PostPasswordResetEvent",
"$",
"event",
")",
":",
"void",
"{",
"$",
"user",
"=",
"$",
"event",
"->",
"getUser",
"(",
")",
";",
"$",
"this",
"->",
"mailHelper",
"->",
"sendMail",
"(",
"[",
"$",
"user",
"->",
... | Listens to the event triggered after the password has been reset.
Event contains the information about the user who has changed the password. | [
"Listens",
"to",
"the",
"event",
"triggered",
"after",
"the",
"password",
"has",
"been",
"reset",
".",
"Event",
"contains",
"the",
"information",
"about",
"the",
"user",
"who",
"has",
"changed",
"the",
"password",
"."
] | 4198c8412ffdb6692b80d35e05c8ba331365b746 | https://github.com/netgen/site-bundle/blob/4198c8412ffdb6692b80d35e05c8ba331365b746/bundle/EventListener/User/PostPasswordResetEventListener.php#L30-L45 |
28,721 | smartboxgroup/integration-framework-bundle | Components/DB/NoSQL/Drivers/MongoDB/MongoDBDriver.php | MongoDBDriver.configure | public function configure(array $configuration)
{
// allows to use the default options when a null value is passed
if (array_key_exists('options', $configuration) && $configuration['options'] === null) {
unset($configuration['options']);
}
$optionsResolver = new OptionsR... | php | public function configure(array $configuration)
{
// allows to use the default options when a null value is passed
if (array_key_exists('options', $configuration) && $configuration['options'] === null) {
unset($configuration['options']);
}
$optionsResolver = new OptionsR... | [
"public",
"function",
"configure",
"(",
"array",
"$",
"configuration",
")",
"{",
"// allows to use the default options when a null value is passed",
"if",
"(",
"array_key_exists",
"(",
"'options'",
",",
"$",
"configuration",
")",
"&&",
"$",
"configuration",
"[",
"'optio... | Define and apply the expected configuration for the driver.
@param array $configuration
@throws \Smartbox\Integration\FrameworkBundle\Components\DB\NoSQL\Exceptions\NoSQLDriverException | [
"Define",
"and",
"apply",
"the",
"expected",
"configuration",
"for",
"the",
"driver",
"."
] | 5f0bf8ff86337a51f6d208bd38df39017643b905 | https://github.com/smartboxgroup/integration-framework-bundle/blob/5f0bf8ff86337a51f6d208bd38df39017643b905/Components/DB/NoSQL/Drivers/MongoDB/MongoDBDriver.php#L46-L72 |
28,722 | smartboxgroup/integration-framework-bundle | Components/DB/NoSQL/Drivers/MongoDB/MongoDBDriver.php | MongoDBDriver.connect | public function connect()
{
if (!isset($this->configuration['host']) || !isset($this->configuration['database'])) {
throw new NoSQLDriverException('Can not connect to MongoDB because configuration for this driver was not provided.');
}
try {
$this->connection = new \... | php | public function connect()
{
if (!isset($this->configuration['host']) || !isset($this->configuration['database'])) {
throw new NoSQLDriverException('Can not connect to MongoDB because configuration for this driver was not provided.');
}
try {
$this->connection = new \... | [
"public",
"function",
"connect",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"configuration",
"[",
"'host'",
"]",
")",
"||",
"!",
"isset",
"(",
"$",
"this",
"->",
"configuration",
"[",
"'database'",
"]",
")",
")",
"{",
"throw",
... | Connect to the mongoDatabase.
@return \MongoDB\Client
@throws \Smartbox\Integration\FrameworkBundle\Components\DB\NoSQL\Exceptions\NoSQLDriverException | [
"Connect",
"to",
"the",
"mongoDatabase",
"."
] | 5f0bf8ff86337a51f6d208bd38df39017643b905 | https://github.com/smartboxgroup/integration-framework-bundle/blob/5f0bf8ff86337a51f6d208bd38df39017643b905/Components/DB/NoSQL/Drivers/MongoDB/MongoDBDriver.php#L81-L100 |
28,723 | smartboxgroup/integration-framework-bundle | Components/DB/NoSQL/Drivers/MongoDB/MongoDBDriver.php | MongoDBDriver.deleteById | public function deleteById($collection, $id)
{
try {
$id = new \MongoDB\BSON\ObjectID((string) $id);
} catch (\Exception $e) {
return;
}
$queryOptions = new QueryOptions();
$queryOptions->setQueryParams([
'_id' => $id,
]);
... | php | public function deleteById($collection, $id)
{
try {
$id = new \MongoDB\BSON\ObjectID((string) $id);
} catch (\Exception $e) {
return;
}
$queryOptions = new QueryOptions();
$queryOptions->setQueryParams([
'_id' => $id,
]);
... | [
"public",
"function",
"deleteById",
"(",
"$",
"collection",
",",
"$",
"id",
")",
"{",
"try",
"{",
"$",
"id",
"=",
"new",
"\\",
"MongoDB",
"\\",
"BSON",
"\\",
"ObjectID",
"(",
"(",
"string",
")",
"$",
"id",
")",
";",
"}",
"catch",
"(",
"\\",
"Exce... | Remove an entry of the mongo database.
@param $collection
@param $id | [
"Remove",
"an",
"entry",
"of",
"the",
"mongo",
"database",
"."
] | 5f0bf8ff86337a51f6d208bd38df39017643b905 | https://github.com/smartboxgroup/integration-framework-bundle/blob/5f0bf8ff86337a51f6d208bd38df39017643b905/Components/DB/NoSQL/Drivers/MongoDB/MongoDBDriver.php#L270-L285 |
28,724 | smartboxgroup/integration-framework-bundle | Configurability/ConfigurableServiceHelper.php | ConfigurableServiceHelper.debug | protected function debug($actions, &$context)
{
if (!is_array($actions)) {
return;
}
foreach ($actions as $action => $parameters) {
if ('display' == $action) {
foreach ($parameters as $var) {
echo "\n";
echo $var... | php | protected function debug($actions, &$context)
{
if (!is_array($actions)) {
return;
}
foreach ($actions as $action => $parameters) {
if ('display' == $action) {
foreach ($parameters as $var) {
echo "\n";
echo $var... | [
"protected",
"function",
"debug",
"(",
"$",
"actions",
",",
"&",
"$",
"context",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"actions",
")",
")",
"{",
"return",
";",
"}",
"foreach",
"(",
"$",
"actions",
"as",
"$",
"action",
"=>",
"$",
"paramete... | Nasty hack to be able to easily display context variables in producers.
@param array $actions
@param $context | [
"Nasty",
"hack",
"to",
"be",
"able",
"to",
"easily",
"display",
"context",
"variables",
"in",
"producers",
"."
] | 5f0bf8ff86337a51f6d208bd38df39017643b905 | https://github.com/smartboxgroup/integration-framework-bundle/blob/5f0bf8ff86337a51f6d208bd38df39017643b905/Configurability/ConfigurableServiceHelper.php#L241-L276 |
28,725 | abhi1693/yii2-config | components/Config.php | Config._setCache | private function _setCache()
{
if ($this->_cache !== null) {
$this->_cache->set($this->cacheKey, $this->_data, $this->cacheDuration);
}
} | php | private function _setCache()
{
if ($this->_cache !== null) {
$this->_cache->set($this->cacheKey, $this->_data, $this->cacheDuration);
}
} | [
"private",
"function",
"_setCache",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_cache",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"_cache",
"->",
"set",
"(",
"$",
"this",
"->",
"cacheKey",
",",
"$",
"this",
"->",
"_data",
",",
"$",
"this",
"... | Sets the cache | [
"Sets",
"the",
"cache"
] | 1dd5161d3bc1e6e587e75e44218467ff644c22bf | https://github.com/abhi1693/yii2-config/blob/1dd5161d3bc1e6e587e75e44218467ff644c22bf/components/Config.php#L129-L134 |
28,726 | abhi1693/yii2-config | components/Config.php | Config.get | public function get($name, $default = null)
{
if (is_array($name)) {
$result = [];
foreach ($name as $key => $value) {
if (is_int($key)) {
$result[$value] = $this->_get($value, $default);
} else {
$result[$key] ... | php | public function get($name, $default = null)
{
if (is_array($name)) {
$result = [];
foreach ($name as $key => $value) {
if (is_int($key)) {
$result[$value] = $this->_get($value, $default);
} else {
$result[$key] ... | [
"public",
"function",
"get",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"name",
")",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"name",
"as",
"$",
"key",
"=>",
"$",
"v... | Get configuration variable
@param $name
@param mixed $default
@return mixed | [
"Get",
"configuration",
"variable"
] | 1dd5161d3bc1e6e587e75e44218467ff644c22bf | https://github.com/abhi1693/yii2-config/blob/1dd5161d3bc1e6e587e75e44218467ff644c22bf/components/Config.php#L143-L158 |
28,727 | abhi1693/yii2-config | components/Config.php | Config._get | private function _get($name, $default = null)
{
return array_key_exists($name, $this->getData()) ? $this->getData()[$name] : $default;
} | php | private function _get($name, $default = null)
{
return array_key_exists($name, $this->getData()) ? $this->getData()[$name] : $default;
} | [
"private",
"function",
"_get",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"return",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"getData",
"(",
")",
")",
"?",
"$",
"this",
"->",
"getData",
"(",
")",
"[",
"$",
... | Find and decode configuration variable
@param string $name
@param mixed $default
@return mixed | [
"Find",
"and",
"decode",
"configuration",
"variable"
] | 1dd5161d3bc1e6e587e75e44218467ff644c22bf | https://github.com/abhi1693/yii2-config/blob/1dd5161d3bc1e6e587e75e44218467ff644c22bf/components/Config.php#L166-L169 |
28,728 | abhi1693/yii2-config | components/Config.php | Config.getAll | public function getAll()
{
$result = [];
foreach ($this->getData() as $key => $value) {
$result[$key] = $this->get($key);
}
return $result;
} | php | public function getAll()
{
$result = [];
foreach ($this->getData() as $key => $value) {
$result[$key] = $this->get($key);
}
return $result;
} | [
"public",
"function",
"getAll",
"(",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getData",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"result",
"[",
"$",
"key",
"]",
"=",
"$",
"this",
"... | Returns all parameters
@return array | [
"Returns",
"all",
"parameters"
] | 1dd5161d3bc1e6e587e75e44218467ff644c22bf | https://github.com/abhi1693/yii2-config/blob/1dd5161d3bc1e6e587e75e44218467ff644c22bf/components/Config.php#L176-L185 |
28,729 | abhi1693/yii2-config | components/Config.php | Config.set | public function set($name, $value = null)
{
if (is_array($name)) {
$insert = [];
$delete = [];
foreach ($name as $key => $val) {
$val = $this->_merge($key, $val);
$insert[] = [$key, $val];
$delete[] = $key;
... | php | public function set($name, $value = null)
{
if (is_array($name)) {
$insert = [];
$delete = [];
foreach ($name as $key => $val) {
$val = $this->_merge($key, $val);
$insert[] = [$key, $val];
$delete[] = $key;
... | [
"public",
"function",
"set",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"name",
")",
")",
"{",
"$",
"insert",
"=",
"[",
"]",
";",
"$",
"delete",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"name"... | Sets configuration variable
@param $name
@param mixed $value
@return mixed | [
"Sets",
"configuration",
"variable"
] | 1dd5161d3bc1e6e587e75e44218467ff644c22bf | https://github.com/abhi1693/yii2-config/blob/1dd5161d3bc1e6e587e75e44218467ff644c22bf/components/Config.php#L194-L223 |
28,730 | smartboxgroup/integration-framework-bundle | Core/Itinerary/ItineraryResolver.php | ItineraryResolver.filterItineraryParamsToPropagate | public function filterItineraryParamsToPropagate($params)
{
$res = [];
foreach ($params as $key => $value) {
if (!empty($value) && is_string($value)) {
$res[$key] = $value;
}
}
return $res;
} | php | public function filterItineraryParamsToPropagate($params)
{
$res = [];
foreach ($params as $key => $value) {
if (!empty($value) && is_string($value)) {
$res[$key] = $value;
}
}
return $res;
} | [
"public",
"function",
"filterItineraryParamsToPropagate",
"(",
"$",
"params",
")",
"{",
"$",
"res",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"params",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"value",
")",
... | Returns the parameters that should be propagated through the route using the exchange headers.
@param $params
@return array | [
"Returns",
"the",
"parameters",
"that",
"should",
"be",
"propagated",
"through",
"the",
"route",
"using",
"the",
"exchange",
"headers",
"."
] | 5f0bf8ff86337a51f6d208bd38df39017643b905 | https://github.com/smartboxgroup/integration-framework-bundle/blob/5f0bf8ff86337a51f6d208bd38df39017643b905/Core/Itinerary/ItineraryResolver.php#L68-L79 |
28,731 | smartboxgroup/integration-framework-bundle | Components/JsonFileLoader/JsonFileLoaderProtocol.php | JsonFileLoaderProtocol.getOptionsDescriptions | public function getOptionsDescriptions()
{
return array_merge_recursive(parent::getOptionsDescriptions(), [
self::OPTION_BASE_PATH => ['Base path to look for the json file', []],
self::OPTION_FILENAME => ['Name of the file to load', []],
self::OPTION_TYPE => ['Name of the... | php | public function getOptionsDescriptions()
{
return array_merge_recursive(parent::getOptionsDescriptions(), [
self::OPTION_BASE_PATH => ['Base path to look for the json file', []],
self::OPTION_FILENAME => ['Name of the file to load', []],
self::OPTION_TYPE => ['Name of the... | [
"public",
"function",
"getOptionsDescriptions",
"(",
")",
"{",
"return",
"array_merge_recursive",
"(",
"parent",
"::",
"getOptionsDescriptions",
"(",
")",
",",
"[",
"self",
"::",
"OPTION_BASE_PATH",
"=>",
"[",
"'Base path to look for the json file'",
",",
"[",
"]",
... | Key-Value array with the option name as key and the details as value.
[OptionName => [description, array of valid values],..]
@return array | [
"Key",
"-",
"Value",
"array",
"with",
"the",
"option",
"name",
"as",
"key",
"and",
"the",
"details",
"as",
"value",
"."
] | 5f0bf8ff86337a51f6d208bd38df39017643b905 | https://github.com/smartboxgroup/integration-framework-bundle/blob/5f0bf8ff86337a51f6d208bd38df39017643b905/Components/JsonFileLoader/JsonFileLoaderProtocol.php#L32-L39 |
28,732 | netgen/ngsymfonytools | classes/ngsymfonytoolspathurloperator.php | NgSymfonyToolsPathUrlOperator.getPath | public static function getPath( $name, $parameters = array(), $relative = false )
{
$serviceContainer = ezpKernel::instance()->getServiceContainer();
return $serviceContainer->get('router')->generate(
$name,
$parameters,
$relative ? UrlGeneratorInterface::RELATIV... | php | public static function getPath( $name, $parameters = array(), $relative = false )
{
$serviceContainer = ezpKernel::instance()->getServiceContainer();
return $serviceContainer->get('router')->generate(
$name,
$parameters,
$relative ? UrlGeneratorInterface::RELATIV... | [
"public",
"static",
"function",
"getPath",
"(",
"$",
"name",
",",
"$",
"parameters",
"=",
"array",
"(",
")",
",",
"$",
"relative",
"=",
"false",
")",
"{",
"$",
"serviceContainer",
"=",
"ezpKernel",
"::",
"instance",
"(",
")",
"->",
"getServiceContainer",
... | Returns the path for provided route and parameters
@param string $name
@param array $parameters
@param bool $relative
@return string | [
"Returns",
"the",
"path",
"for",
"provided",
"route",
"and",
"parameters"
] | 58abf97996ddd1d4f969d8c64ce6998b9d1a5c27 | https://github.com/netgen/ngsymfonytools/blob/58abf97996ddd1d4f969d8c64ce6998b9d1a5c27/classes/ngsymfonytoolspathurloperator.php#L121-L130 |
28,733 | netgen/ngsymfonytools | classes/ngsymfonytoolspathurloperator.php | NgSymfonyToolsPathUrlOperator.getUrl | public static function getUrl( $name, $parameters = array(), $schemeRelative = false )
{
$serviceContainer = ezpKernel::instance()->getServiceContainer();
return $serviceContainer->get('router')->generate(
$name,
$parameters,
$schemeRelative ? UrlGeneratorInterfa... | php | public static function getUrl( $name, $parameters = array(), $schemeRelative = false )
{
$serviceContainer = ezpKernel::instance()->getServiceContainer();
return $serviceContainer->get('router')->generate(
$name,
$parameters,
$schemeRelative ? UrlGeneratorInterfa... | [
"public",
"static",
"function",
"getUrl",
"(",
"$",
"name",
",",
"$",
"parameters",
"=",
"array",
"(",
")",
",",
"$",
"schemeRelative",
"=",
"false",
")",
"{",
"$",
"serviceContainer",
"=",
"ezpKernel",
"::",
"instance",
"(",
")",
"->",
"getServiceContaine... | Returns the URL for provided route and parameters
@param string $name
@param array $parameters
@param bool $schemeRelative
@return string | [
"Returns",
"the",
"URL",
"for",
"provided",
"route",
"and",
"parameters"
] | 58abf97996ddd1d4f969d8c64ce6998b9d1a5c27 | https://github.com/netgen/ngsymfonytools/blob/58abf97996ddd1d4f969d8c64ce6998b9d1a5c27/classes/ngsymfonytoolspathurloperator.php#L141-L150 |
28,734 | seregazhuk/php-react-memcached | src/Client.php | Client.end | public function end(): void
{
$this->isEnding = true;
if ($this->pool->isEmpty()) {
$this->close();
}
} | php | public function end(): void
{
$this->isEnding = true;
if ($this->pool->isEmpty()) {
$this->close();
}
} | [
"public",
"function",
"end",
"(",
")",
":",
"void",
"{",
"$",
"this",
"->",
"isEnding",
"=",
"true",
";",
"if",
"(",
"$",
"this",
"->",
"pool",
"->",
"isEmpty",
"(",
")",
")",
"{",
"$",
"this",
"->",
"close",
"(",
")",
";",
"}",
"}"
] | Closes the connection when all requests are resolved | [
"Closes",
"the",
"connection",
"when",
"all",
"requests",
"are",
"resolved"
] | 4fa5bd0cd09a296b7abdcce07fc749e7c6c911e1 | https://github.com/seregazhuk/php-react-memcached/blob/4fa5bd0cd09a296b7abdcce07fc749e7c6c911e1/src/Client.php#L146-L153 |
28,735 | seregazhuk/php-react-memcached | src/Client.php | Client.close | public function close(): void
{
if ($this->isClosed) {
return;
}
$this->isEnding = true;
$this->isClosed = true;
$this->connection->close();
$this->emit('close');
$this->pool->rejectAll(new ConnectionClosedException());
} | php | public function close(): void
{
if ($this->isClosed) {
return;
}
$this->isEnding = true;
$this->isClosed = true;
$this->connection->close();
$this->emit('close');
$this->pool->rejectAll(new ConnectionClosedException());
} | [
"public",
"function",
"close",
"(",
")",
":",
"void",
"{",
"if",
"(",
"$",
"this",
"->",
"isClosed",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"isEnding",
"=",
"true",
";",
"$",
"this",
"->",
"isClosed",
"=",
"true",
";",
"$",
"this",
"->"... | Forces closing the connection and rejects all pending requests | [
"Forces",
"closing",
"the",
"connection",
"and",
"rejects",
"all",
"pending",
"requests"
] | 4fa5bd0cd09a296b7abdcce07fc749e7c6c911e1 | https://github.com/seregazhuk/php-react-memcached/blob/4fa5bd0cd09a296b7abdcce07fc749e7c6c911e1/src/Client.php#L158-L171 |
28,736 | netgen/site-bundle | bundle/Topic/UrlGenerator.php | UrlGenerator.getTopicValueObject | private function getTopicValueObject(Tag $tag)
{
$rootLocation = $this->loadService->loadLocation(
$this->configResolver->getParameter('content.tree_root.location_id')
);
$query = new LocationQuery();
$query->limit = 1;
$query->filter = new Criterion\LogicalAnd(... | php | private function getTopicValueObject(Tag $tag)
{
$rootLocation = $this->loadService->loadLocation(
$this->configResolver->getParameter('content.tree_root.location_id')
);
$query = new LocationQuery();
$query->limit = 1;
$query->filter = new Criterion\LogicalAnd(... | [
"private",
"function",
"getTopicValueObject",
"(",
"Tag",
"$",
"tag",
")",
"{",
"$",
"rootLocation",
"=",
"$",
"this",
"->",
"loadService",
"->",
"loadLocation",
"(",
"$",
"this",
"->",
"configResolver",
"->",
"getParameter",
"(",
"'content.tree_root.location_id'"... | If exists, returns the location of the content with ng_topic identifier connected to provided tag.
Otherwise, the tag itself is returned.
@return \Netgen\EzPlatformSiteApi\API\Values\Location|\Netgen\TagsBundle\API\Repository\Values\Tags\Tag | [
"If",
"exists",
"returns",
"the",
"location",
"of",
"the",
"content",
"with",
"ng_topic",
"identifier",
"connected",
"to",
"provided",
"tag",
"."
] | 4198c8412ffdb6692b80d35e05c8ba331365b746 | https://github.com/netgen/site-bundle/blob/4198c8412ffdb6692b80d35e05c8ba331365b746/bundle/Topic/UrlGenerator.php#L65-L92 |
28,737 | cedx/coveralls.php | lib/Http/Client.php | Client.upload | function upload(string $coverage, Configuration $configuration = null): void {
$report = trim($coverage);
if (!mb_strlen($report)) throw new \InvalidArgumentException('The specified coverage report is empty.');
$job = null;
$isClover = mb_substr($report, 0, 5) == '<?xml' || mb_substr($report, 0, 10) ==... | php | function upload(string $coverage, Configuration $configuration = null): void {
$report = trim($coverage);
if (!mb_strlen($report)) throw new \InvalidArgumentException('The specified coverage report is empty.');
$job = null;
$isClover = mb_substr($report, 0, 5) == '<?xml' || mb_substr($report, 0, 10) ==... | [
"function",
"upload",
"(",
"string",
"$",
"coverage",
",",
"Configuration",
"$",
"configuration",
"=",
"null",
")",
":",
"void",
"{",
"$",
"report",
"=",
"trim",
"(",
"$",
"coverage",
")",
";",
"if",
"(",
"!",
"mb_strlen",
"(",
"$",
"report",
")",
")... | Uploads the specified code coverage report to the Coveralls service.
@param string $coverage A coverage report.
@param Configuration $configuration The environment settings.
@throws \InvalidArgumentException The specified coverage report is empty or its format is not supported. | [
"Uploads",
"the",
"specified",
"code",
"coverage",
"report",
"to",
"the",
"Coveralls",
"service",
"."
] | c196de0f92e06d5143ba90ebab18c8e384316cc0 | https://github.com/cedx/coveralls.php/blob/c196de0f92e06d5143ba90ebab18c8e384316cc0/lib/Http/Client.php#L50-L76 |
28,738 | cedx/coveralls.php | lib/Http/Client.php | Client.uploadJob | function uploadJob(Job $job): void {
if (!$job->getRepoToken() && !$job->getServiceName())
throw new \InvalidArgumentException('The job does not meet the requirements.');
$uri = UriResolver::resolve($this->getEndPoint(), new Uri('jobs'));
$body = new MultipartStream([[
'contents' => json_encode... | php | function uploadJob(Job $job): void {
if (!$job->getRepoToken() && !$job->getServiceName())
throw new \InvalidArgumentException('The job does not meet the requirements.');
$uri = UriResolver::resolve($this->getEndPoint(), new Uri('jobs'));
$body = new MultipartStream([[
'contents' => json_encode... | [
"function",
"uploadJob",
"(",
"Job",
"$",
"job",
")",
":",
"void",
"{",
"if",
"(",
"!",
"$",
"job",
"->",
"getRepoToken",
"(",
")",
"&&",
"!",
"$",
"job",
"->",
"getServiceName",
"(",
")",
")",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"... | Uploads the specified job to the Coveralls service.
@param Job $job The job to be uploaded.
@throws \InvalidArgumentException The job does not meet the requirements.
@throws ClientException An error occurred while uploading the report. | [
"Uploads",
"the",
"specified",
"job",
"to",
"the",
"Coveralls",
"service",
"."
] | c196de0f92e06d5143ba90ebab18c8e384316cc0 | https://github.com/cedx/coveralls.php/blob/c196de0f92e06d5143ba90ebab18c8e384316cc0/lib/Http/Client.php#L84-L111 |
28,739 | cedx/coveralls.php | lib/Http/Client.php | Client.updateJob | private function updateJob(Job $job, Configuration $config): void {
if (isset($config['repo_token'])) $job->setRepoToken($config['repo_token']);
else if (isset($config['repo_secret_token'])) $job->setRepoToken($config['repo_secret_token']);
if (isset($config['parallel'])) $job->setParallel($config['paralle... | php | private function updateJob(Job $job, Configuration $config): void {
if (isset($config['repo_token'])) $job->setRepoToken($config['repo_token']);
else if (isset($config['repo_secret_token'])) $job->setRepoToken($config['repo_secret_token']);
if (isset($config['parallel'])) $job->setParallel($config['paralle... | [
"private",
"function",
"updateJob",
"(",
"Job",
"$",
"job",
",",
"Configuration",
"$",
"config",
")",
":",
"void",
"{",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'repo_token'",
"]",
")",
")",
"$",
"job",
"->",
"setRepoToken",
"(",
"$",
"config",
... | Updates the properties of the specified job using the given configuration parameters.
@param Job $job The job to update.
@param Configuration $config The parameters to define. | [
"Updates",
"the",
"properties",
"of",
"the",
"specified",
"job",
"using",
"the",
"given",
"configuration",
"parameters",
"."
] | c196de0f92e06d5143ba90ebab18c8e384316cc0 | https://github.com/cedx/coveralls.php/blob/c196de0f92e06d5143ba90ebab18c8e384316cc0/lib/Http/Client.php#L118-L143 |
28,740 | netgen/site-bundle | bundle/ContextProvider/SessionContextProvider.php | SessionContextProvider.updateUserContext | public function updateUserContext(UserContext $context): void
{
if ($this->session->isStarted()) {
$context->addParameter('sessionId', $this->session->getId());
}
} | php | public function updateUserContext(UserContext $context): void
{
if ($this->session->isStarted()) {
$context->addParameter('sessionId', $this->session->getId());
}
} | [
"public",
"function",
"updateUserContext",
"(",
"UserContext",
"$",
"context",
")",
":",
"void",
"{",
"if",
"(",
"$",
"this",
"->",
"session",
"->",
"isStarted",
"(",
")",
")",
"{",
"$",
"context",
"->",
"addParameter",
"(",
"'sessionId'",
",",
"$",
"thi... | If the session is started, adds the session ID to user context. This allows
varying the cache per session. | [
"If",
"the",
"session",
"is",
"started",
"adds",
"the",
"session",
"ID",
"to",
"user",
"context",
".",
"This",
"allows",
"varying",
"the",
"cache",
"per",
"session",
"."
] | 4198c8412ffdb6692b80d35e05c8ba331365b746 | https://github.com/netgen/site-bundle/blob/4198c8412ffdb6692b80d35e05c8ba331365b746/bundle/ContextProvider/SessionContextProvider.php#L27-L32 |
28,741 | smartboxgroup/integration-framework-bundle | Core/Processors/Routing/Multicast.php | Multicast.doProcess | protected function doProcess(Exchange $mainExchange, SerializableArray $processingContext)
{
foreach ($this->itineraries as $itinerary) {
$exchange = new Exchange();
// Set headers
if (!empty($mainExchange->getHeaders())) {
$exchange->setHeaders($mainExch... | php | protected function doProcess(Exchange $mainExchange, SerializableArray $processingContext)
{
foreach ($this->itineraries as $itinerary) {
$exchange = new Exchange();
// Set headers
if (!empty($mainExchange->getHeaders())) {
$exchange->setHeaders($mainExch... | [
"protected",
"function",
"doProcess",
"(",
"Exchange",
"$",
"mainExchange",
",",
"SerializableArray",
"$",
"processingContext",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"itineraries",
"as",
"$",
"itinerary",
")",
"{",
"$",
"exchange",
"=",
"new",
"Exchange... | The current implementation assumes the existence of only one aggregation strategy which ignores the child
exchanges.
@param Exchange $mainExchange | [
"The",
"current",
"implementation",
"assumes",
"the",
"existence",
"of",
"only",
"one",
"aggregation",
"strategy",
"which",
"ignores",
"the",
"child",
"exchanges",
"."
] | 5f0bf8ff86337a51f6d208bd38df39017643b905 | https://github.com/smartboxgroup/integration-framework-bundle/blob/5f0bf8ff86337a51f6d208bd38df39017643b905/Core/Processors/Routing/Multicast.php#L89-L115 |
28,742 | netgen/site-bundle | bundle/Controller/PartsController.php | PartsController.viewRelatedItems | public function viewRelatedItems(Request $request, Content $content, string $fieldDefinitionIdentifier, string $template): Response
{
return $this->render(
$template,
[
'content' => $content,
'location' => $content->mainLocation,
'field... | php | public function viewRelatedItems(Request $request, Content $content, string $fieldDefinitionIdentifier, string $template): Response
{
return $this->render(
$template,
[
'content' => $content,
'location' => $content->mainLocation,
'field... | [
"public",
"function",
"viewRelatedItems",
"(",
"Request",
"$",
"request",
",",
"Content",
"$",
"content",
",",
"string",
"$",
"fieldDefinitionIdentifier",
",",
"string",
"$",
"template",
")",
":",
"Response",
"{",
"return",
"$",
"this",
"->",
"render",
"(",
... | Action for rendering related items of a provided content. | [
"Action",
"for",
"rendering",
"related",
"items",
"of",
"a",
"provided",
"content",
"."
] | 4198c8412ffdb6692b80d35e05c8ba331365b746 | https://github.com/netgen/site-bundle/blob/4198c8412ffdb6692b80d35e05c8ba331365b746/bundle/Controller/PartsController.php#L36-L48 |
28,743 | dereuromark/cakephp-markup | src/View/Helper/HighlighterHelper.php | HighlighterHelper.highlight | public function highlight($text, array $options = []) {
if ($this->_config['debug']) {
$this->_startTimer();
}
$highlightedText = $this->_getHighlighter()->highlight($text, $options);
if ($this->_config['debug']) {
$highlightedText .= $this->_timeElapsedFormatted($this->_endTimer());
}
return $highlig... | php | public function highlight($text, array $options = []) {
if ($this->_config['debug']) {
$this->_startTimer();
}
$highlightedText = $this->_getHighlighter()->highlight($text, $options);
if ($this->_config['debug']) {
$highlightedText .= $this->_timeElapsedFormatted($this->_endTimer());
}
return $highlig... | [
"public",
"function",
"highlight",
"(",
"$",
"text",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_config",
"[",
"'debug'",
"]",
")",
"{",
"$",
"this",
"->",
"_startTimer",
"(",
")",
";",
"}",
"$",
"highli... | Highlight a string.
Options, depending on the specific highlighter class used:
- templates
- escape (defaults to true)
- tabToSpaces (defaults to 4)
- prefix (defaults to `language-`)
@param string $text
@param array $options
@return string | [
"Highlight",
"a",
"string",
"."
] | 658c52b05b1e800b5640fceda77dce94eba90c2c | https://github.com/dereuromark/cakephp-markup/blob/658c52b05b1e800b5640fceda77dce94eba90c2c/src/View/Helper/HighlighterHelper.php#L58-L67 |
28,744 | netgen/site-bundle | bundle/Menu/RelationListMenuBuilder.php | RelationListMenuBuilder.createRelationListMenu | public function createRelationListMenu(string $fieldIdentifier, $contentId = null): ItemInterface
{
$content = $contentId !== null ?
$this->loadService->loadContent($contentId) :
$this->siteInfoHelper->getSiteInfoContent();
$menu = $this->factory->createItem('root');
... | php | public function createRelationListMenu(string $fieldIdentifier, $contentId = null): ItemInterface
{
$content = $contentId !== null ?
$this->loadService->loadContent($contentId) :
$this->siteInfoHelper->getSiteInfoContent();
$menu = $this->factory->createItem('root');
... | [
"public",
"function",
"createRelationListMenu",
"(",
"string",
"$",
"fieldIdentifier",
",",
"$",
"contentId",
"=",
"null",
")",
":",
"ItemInterface",
"{",
"$",
"content",
"=",
"$",
"contentId",
"!==",
"null",
"?",
"$",
"this",
"->",
"loadService",
"->",
"loa... | Creates the KNP menu from provided content and field identifier.
@param mixed|null $contentId | [
"Creates",
"the",
"KNP",
"menu",
"from",
"provided",
"content",
"and",
"field",
"identifier",
"."
] | 4198c8412ffdb6692b80d35e05c8ba331365b746 | https://github.com/netgen/site-bundle/blob/4198c8412ffdb6692b80d35e05c8ba331365b746/bundle/Menu/RelationListMenuBuilder.php#L55-L94 |
28,745 | IconoCoders/otp-simple-sdk | Source/SimpleLiveUpdate.php | SimpleLiveUpdate.createHtmlForm | public function createHtmlForm($formName = 'SimplePayForm', $submitElement = 'button', $submitElementText = 'Start Payment')
{
if (count($this->errorMessage) > 0) {
return false;
}
if (!$this->prepareFields("ORDER_HASH")) {
$this->errorMessage[] = 'HASH FIELD: Missing... | php | public function createHtmlForm($formName = 'SimplePayForm', $submitElement = 'button', $submitElementText = 'Start Payment')
{
if (count($this->errorMessage) > 0) {
return false;
}
if (!$this->prepareFields("ORDER_HASH")) {
$this->errorMessage[] = 'HASH FIELD: Missing... | [
"public",
"function",
"createHtmlForm",
"(",
"$",
"formName",
"=",
"'SimplePayForm'",
",",
"$",
"submitElement",
"=",
"'button'",
",",
"$",
"submitElementText",
"=",
"'Start Payment'",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"errorMessage",
")",
... | Generates a ready-to-insert HTML FORM
@param string $formName The ID parameter of the form
@param string $submitElement The type of the submit element ('button' or 'link')
@param string $submitElementText The label for the submit element
@return string HTML form | [
"Generates",
"a",
"ready",
"-",
"to",
"-",
"insert",
"HTML",
"FORM"
] | d2808bf52e8d34be69414b444a00f1a9c8564930 | https://github.com/IconoCoders/otp-simple-sdk/blob/d2808bf52e8d34be69414b444a00f1a9c8564930/Source/SimpleLiveUpdate.php#L154-L191 |
28,746 | IconoCoders/otp-simple-sdk | Source/SimpleLiveUpdate.php | SimpleLiveUpdate.formSubmitElement | protected function formSubmitElement($formName = '', $submitElement = 'button', $submitElementText = '')
{
switch ($submitElement) {
case 'link':
$element = "\n<a href='javascript:document.getElementById(\"" . $formName ."\").submit()'>" . addslashes($submitElementText) . "</a>";... | php | protected function formSubmitElement($formName = '', $submitElement = 'button', $submitElementText = '')
{
switch ($submitElement) {
case 'link':
$element = "\n<a href='javascript:document.getElementById(\"" . $formName ."\").submit()'>" . addslashes($submitElementText) . "</a>";... | [
"protected",
"function",
"formSubmitElement",
"(",
"$",
"formName",
"=",
"''",
",",
"$",
"submitElement",
"=",
"'button'",
",",
"$",
"submitElementText",
"=",
"''",
")",
"{",
"switch",
"(",
"$",
"submitElement",
")",
"{",
"case",
"'link'",
":",
"$",
"eleme... | Generates HTML submit element
@param string $formName The ID parameter of the form
@param string $submitElement The type of the submit element ('button' or 'link')
@param string $submitElementText The lebel for the submit element
@return string HTML submit | [
"Generates",
"HTML",
"submit",
"element"
] | d2808bf52e8d34be69414b444a00f1a9c8564930 | https://github.com/IconoCoders/otp-simple-sdk/blob/d2808bf52e8d34be69414b444a00f1a9c8564930/Source/SimpleLiveUpdate.php#L204-L222 |
28,747 | IconoCoders/otp-simple-sdk | Source/SimpleIpn.php | SimpleIpn.validateReceived | public function validateReceived()
{
$this->debugMessage[] = 'IPN VALIDATION: START';
if (!$this->ipnPostDataCheck()) {
$this->debugMessage[] = 'IPN VALIDATION: END';
return false;
}
//'ORDERSTATUS'
$this->logFunc("IPN", $this->postData, @$this->postD... | php | public function validateReceived()
{
$this->debugMessage[] = 'IPN VALIDATION: START';
if (!$this->ipnPostDataCheck()) {
$this->debugMessage[] = 'IPN VALIDATION: END';
return false;
}
//'ORDERSTATUS'
$this->logFunc("IPN", $this->postData, @$this->postD... | [
"public",
"function",
"validateReceived",
"(",
")",
"{",
"$",
"this",
"->",
"debugMessage",
"[",
"]",
"=",
"'IPN VALIDATION: START'",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"ipnPostDataCheck",
"(",
")",
")",
"{",
"$",
"this",
"->",
"debugMessage",
"[",
... | Validate recceived data against HMAC HASH
@return boolean | [
"Validate",
"recceived",
"data",
"against",
"HMAC",
"HASH"
] | d2808bf52e8d34be69414b444a00f1a9c8564930 | https://github.com/IconoCoders/otp-simple-sdk/blob/d2808bf52e8d34be69414b444a00f1a9c8564930/Source/SimpleIpn.php#L81-L115 |
28,748 | IconoCoders/otp-simple-sdk | Source/SimpleIpn.php | SimpleIpn.confirmReceived | public function confirmReceived()
{
$this->debugMessage[] = 'IPN CONFIRM: START';
if (!$this->ipnPostDataCheck()) {
$this->debugMessage[] = 'IPN CONFIRM: END';
return false;
}
$serverDate = @date("YmdHis");
$hashArray = array(
$this->postD... | php | public function confirmReceived()
{
$this->debugMessage[] = 'IPN CONFIRM: START';
if (!$this->ipnPostDataCheck()) {
$this->debugMessage[] = 'IPN CONFIRM: END';
return false;
}
$serverDate = @date("YmdHis");
$hashArray = array(
$this->postD... | [
"public",
"function",
"confirmReceived",
"(",
")",
"{",
"$",
"this",
"->",
"debugMessage",
"[",
"]",
"=",
"'IPN CONFIRM: START'",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"ipnPostDataCheck",
"(",
")",
")",
"{",
"$",
"this",
"->",
"debugMessage",
"[",
"]",... | Creates INLINE string for corfirmation
@return string $string <EPAYMENT> tag | [
"Creates",
"INLINE",
"string",
"for",
"corfirmation"
] | d2808bf52e8d34be69414b444a00f1a9c8564930 | https://github.com/IconoCoders/otp-simple-sdk/blob/d2808bf52e8d34be69414b444a00f1a9c8564930/Source/SimpleIpn.php#L123-L146 |
28,749 | IconoCoders/otp-simple-sdk | Source/SimpleIpn.php | SimpleIpn.ipnPostDataCheck | protected function ipnPostDataCheck()
{
if (count($this->postData) < 1 || !array_key_exists('REFNOEXT', $this->postData)) {
$this->debugMessage[] = 'IPN POST: MISSING CONTENT';
$this->errorMessage[] = 'IPN POST: MISSING CONTENT';
return false;
}
return tru... | php | protected function ipnPostDataCheck()
{
if (count($this->postData) < 1 || !array_key_exists('REFNOEXT', $this->postData)) {
$this->debugMessage[] = 'IPN POST: MISSING CONTENT';
$this->errorMessage[] = 'IPN POST: MISSING CONTENT';
return false;
}
return tru... | [
"protected",
"function",
"ipnPostDataCheck",
"(",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"postData",
")",
"<",
"1",
"||",
"!",
"array_key_exists",
"(",
"'REFNOEXT'",
",",
"$",
"this",
"->",
"postData",
")",
")",
"{",
"$",
"this",
"->",
... | Check post data if contains REFNOEXT variable
@return boolean | [
"Check",
"post",
"data",
"if",
"contains",
"REFNOEXT",
"variable"
] | d2808bf52e8d34be69414b444a00f1a9c8564930 | https://github.com/IconoCoders/otp-simple-sdk/blob/d2808bf52e8d34be69414b444a00f1a9c8564930/Source/SimpleIpn.php#L154-L162 |
28,750 | netgen/site-bundle | bundle/DependencyInjection/Compiler/XslRegisterPass.php | XslRegisterPass.process | public function process(ContainerBuilder $container): void
{
$scopes = array_merge(
[ConfigResolver::SCOPE_DEFAULT],
$container->getParameter('ezpublish.siteaccess.list')
);
// Adding ezxml_tags.xsl to all scopes
foreach ($scopes as $scope) {
if (... | php | public function process(ContainerBuilder $container): void
{
$scopes = array_merge(
[ConfigResolver::SCOPE_DEFAULT],
$container->getParameter('ezpublish.siteaccess.list')
);
// Adding ezxml_tags.xsl to all scopes
foreach ($scopes as $scope) {
if (... | [
"public",
"function",
"process",
"(",
"ContainerBuilder",
"$",
"container",
")",
":",
"void",
"{",
"$",
"scopes",
"=",
"array_merge",
"(",
"[",
"ConfigResolver",
"::",
"SCOPE_DEFAULT",
"]",
",",
"$",
"container",
"->",
"getParameter",
"(",
"'ezpublish.siteaccess... | Registers ezxml_tags.xsl as custom XSL stylesheet for ezxmltext field type. | [
"Registers",
"ezxml_tags",
".",
"xsl",
"as",
"custom",
"XSL",
"stylesheet",
"for",
"ezxmltext",
"field",
"type",
"."
] | 4198c8412ffdb6692b80d35e05c8ba331365b746 | https://github.com/netgen/site-bundle/blob/4198c8412ffdb6692b80d35e05c8ba331365b746/bundle/DependencyInjection/Compiler/XslRegisterPass.php#L16-L33 |
28,751 | alaxos/cakephp3-libs | src/View/Helper/AlaxosHtmlHelper.php | AlaxosHtmlHelper.encodeEmail | public function encodeEmail($email)
{
$this->includeAlaxosEncodeJS();
$js_code = '<script type="text/javascript">';
$email_id = substr(str_shuffle('abcdefghijklmnopqrstuvwxyz'), 0, 1) . intval(mt_rand()); //valid XHTML tag id can not start with a number
$js_code .= 'alaxos_' . $email_id . '=';
for($i = 0;... | php | public function encodeEmail($email)
{
$this->includeAlaxosEncodeJS();
$js_code = '<script type="text/javascript">';
$email_id = substr(str_shuffle('abcdefghijklmnopqrstuvwxyz'), 0, 1) . intval(mt_rand()); //valid XHTML tag id can not start with a number
$js_code .= 'alaxos_' . $email_id . '=';
for($i = 0;... | [
"public",
"function",
"encodeEmail",
"(",
"$",
"email",
")",
"{",
"$",
"this",
"->",
"includeAlaxosEncodeJS",
"(",
")",
";",
"$",
"js_code",
"=",
"'<script type=\"text/javascript\">'",
";",
"$",
"email_id",
"=",
"substr",
"(",
"str_shuffle",
"(",
"'abcdefghijklm... | Return a string that is a JS encoded email address.
Printing this JS string instead of the plain email text should reduce the probability to get the email harvested by spamming robots.
Note:
The returned string is made of a <script> block and a <a> block.
@param $email | [
"Return",
"a",
"string",
"that",
"is",
"a",
"JS",
"encoded",
"email",
"address",
"."
] | 685e9f17a3fbe3550c59a03a65c4d75df763e804 | https://github.com/alaxos/cakephp3-libs/blob/685e9f17a3fbe3550c59a03a65c4d75df763e804/src/View/Helper/AlaxosHtmlHelper.php#L242-L287 |
28,752 | alaxos/cakephp3-libs | src/Model/Behavior/TimezonedBehavior.php | TimezonedBehavior.prepareTimezonedDatetimeValuesForSaving | public function prepareTimezonedDatetimeValuesForSaving(\ArrayObject $data)
{
$display_timezone = null;
if(Configure::check('display_timezone'))
{
$display_timezone = Configure::read('display_timezone');
}
elseif(Configure::check('default_display_timezone'))
... | php | public function prepareTimezonedDatetimeValuesForSaving(\ArrayObject $data)
{
$display_timezone = null;
if(Configure::check('display_timezone'))
{
$display_timezone = Configure::read('display_timezone');
}
elseif(Configure::check('default_display_timezone'))
... | [
"public",
"function",
"prepareTimezonedDatetimeValuesForSaving",
"(",
"\\",
"ArrayObject",
"$",
"data",
")",
"{",
"$",
"display_timezone",
"=",
"null",
";",
"if",
"(",
"Configure",
"::",
"check",
"(",
"'display_timezone'",
")",
")",
"{",
"$",
"display_timezone",
... | Convert datetime strings that are entered in the display time zone to UTC Time objects that will allow to save datetime in UTC
@param \ArrayObject $data | [
"Convert",
"datetime",
"strings",
"that",
"are",
"entered",
"in",
"the",
"display",
"time",
"zone",
"to",
"UTC",
"Time",
"objects",
"that",
"will",
"allow",
"to",
"save",
"datetime",
"in",
"UTC"
] | 685e9f17a3fbe3550c59a03a65c4d75df763e804 | https://github.com/alaxos/cakephp3-libs/blob/685e9f17a3fbe3550c59a03a65c4d75df763e804/src/Model/Behavior/TimezonedBehavior.php#L27-L71 |
28,753 | netgen/site-bundle | bundle/EventListener/User/PostActivateEventListener.php | PostActivateEventListener.onPostActivate | public function onPostActivate(PostActivateEvent $event): void
{
$user = $event->getUser();
$this->ezUserAccountKeyRepository->removeByUserId($user->id);
$this->ngUserSettingRepository->activateUser($user->id);
$this->mailHelper
->sendMail(
[$user->email... | php | public function onPostActivate(PostActivateEvent $event): void
{
$user = $event->getUser();
$this->ezUserAccountKeyRepository->removeByUserId($user->id);
$this->ngUserSettingRepository->activateUser($user->id);
$this->mailHelper
->sendMail(
[$user->email... | [
"public",
"function",
"onPostActivate",
"(",
"PostActivateEvent",
"$",
"event",
")",
":",
"void",
"{",
"$",
"user",
"=",
"$",
"event",
"->",
"getUser",
"(",
")",
";",
"$",
"this",
"->",
"ezUserAccountKeyRepository",
"->",
"removeByUserId",
"(",
"$",
"user",
... | Listens to the event triggered after the user activation has been finished.
Event contains information about activated user. | [
"Listens",
"to",
"the",
"event",
"triggered",
"after",
"the",
"user",
"activation",
"has",
"been",
"finished",
".",
"Event",
"contains",
"information",
"about",
"activated",
"user",
"."
] | 4198c8412ffdb6692b80d35e05c8ba331365b746 | https://github.com/netgen/site-bundle/blob/4198c8412ffdb6692b80d35e05c8ba331365b746/bundle/EventListener/User/PostActivateEventListener.php#L30-L46 |
28,754 | nilportugues/php-api-transformer | src/Transformer/Helpers/RecursiveFormatterHelper.php | RecursiveFormatterHelper.namespaceAsArrayKey | public static function namespaceAsArrayKey(string $key) : string
{
$keys = \explode('\\', $key);
$className = \end($keys);
return self::camelCaseToUnderscore($className);
} | php | public static function namespaceAsArrayKey(string $key) : string
{
$keys = \explode('\\', $key);
$className = \end($keys);
return self::camelCaseToUnderscore($className);
} | [
"public",
"static",
"function",
"namespaceAsArrayKey",
"(",
"string",
"$",
"key",
")",
":",
"string",
"{",
"$",
"keys",
"=",
"\\",
"explode",
"(",
"'\\\\'",
",",
"$",
"key",
")",
";",
"$",
"className",
"=",
"\\",
"end",
"(",
"$",
"keys",
")",
";",
... | Given a class name will return its name without the namespace and
in under_score to be used as a key in an array.
@param string $key
@return string | [
"Given",
"a",
"class",
"name",
"will",
"return",
"its",
"name",
"without",
"the",
"namespace",
"and",
"in",
"under_score",
"to",
"be",
"used",
"as",
"a",
"key",
"in",
"an",
"array",
"."
] | a9f20fbe1580d98e3d462a0ebe13fb7595cbd683 | https://github.com/nilportugues/php-api-transformer/blob/a9f20fbe1580d98e3d462a0ebe13fb7595cbd683/src/Transformer/Helpers/RecursiveFormatterHelper.php#L26-L32 |
28,755 | nilportugues/php-api-transformer | src/Transformer/Helpers/RecursiveFormatterHelper.php | RecursiveFormatterHelper.camelCaseToUnderscore | public static function camelCaseToUnderscore(string $camel, string $splitter = '_') : string
{
$camel = \preg_replace(
'/(?!^)[[:upper:]][[:lower:]]/',
'$0',
\preg_replace('/(?!^)[[:upper:]]+/', $splitter.'$0', $camel)
);
return \strtolower($camel);
} | php | public static function camelCaseToUnderscore(string $camel, string $splitter = '_') : string
{
$camel = \preg_replace(
'/(?!^)[[:upper:]][[:lower:]]/',
'$0',
\preg_replace('/(?!^)[[:upper:]]+/', $splitter.'$0', $camel)
);
return \strtolower($camel);
} | [
"public",
"static",
"function",
"camelCaseToUnderscore",
"(",
"string",
"$",
"camel",
",",
"string",
"$",
"splitter",
"=",
"'_'",
")",
":",
"string",
"{",
"$",
"camel",
"=",
"\\",
"preg_replace",
"(",
"'/(?!^)[[:upper:]][[:lower:]]/'",
",",
"'$0'",
",",
"\\",
... | Transforms a given string from camelCase to under_score style.
@param string $camel
@param string $splitter
@return string | [
"Transforms",
"a",
"given",
"string",
"from",
"camelCase",
"to",
"under_score",
"style",
"."
] | a9f20fbe1580d98e3d462a0ebe13fb7595cbd683 | https://github.com/nilportugues/php-api-transformer/blob/a9f20fbe1580d98e3d462a0ebe13fb7595cbd683/src/Transformer/Helpers/RecursiveFormatterHelper.php#L42-L51 |
28,756 | netgen/site-bundle | bundle/Entity/Repository/EzUserAccountKeyRepository.php | EzUserAccountKeyRepository.create | public function create($userId): EzUserAccountKey
{
$this->removeByUserId($userId);
$randomBytes = false;
if (function_exists('openssl_random_pseudo_bytes')) {
$randomBytes = openssl_random_pseudo_bytes(32);
}
if ($randomBytes === false) {
$randomBy... | php | public function create($userId): EzUserAccountKey
{
$this->removeByUserId($userId);
$randomBytes = false;
if (function_exists('openssl_random_pseudo_bytes')) {
$randomBytes = openssl_random_pseudo_bytes(32);
}
if ($randomBytes === false) {
$randomBy... | [
"public",
"function",
"create",
"(",
"$",
"userId",
")",
":",
"EzUserAccountKey",
"{",
"$",
"this",
"->",
"removeByUserId",
"(",
"$",
"userId",
")",
";",
"$",
"randomBytes",
"=",
"false",
";",
"if",
"(",
"function_exists",
"(",
"'openssl_random_pseudo_bytes'",... | Creates a user account key.
@param mixed $userId
@return \Netgen\Bundle\SiteBundle\Entity\EzUserAccountKey | [
"Creates",
"a",
"user",
"account",
"key",
"."
] | 4198c8412ffdb6692b80d35e05c8ba331365b746 | https://github.com/netgen/site-bundle/blob/4198c8412ffdb6692b80d35e05c8ba331365b746/bundle/Entity/Repository/EzUserAccountKeyRepository.php#L19-L44 |
28,757 | netgen/site-bundle | bundle/Entity/Repository/EzUserAccountKeyRepository.php | EzUserAccountKeyRepository.removeByHash | public function removeByHash(string $hash): void
{
$results = $this->findBy(['hashKey' => $hash]);
foreach ($results as $result) {
$this->getEntityManager()->remove($result);
}
$this->getEntityManager()->flush();
} | php | public function removeByHash(string $hash): void
{
$results = $this->findBy(['hashKey' => $hash]);
foreach ($results as $result) {
$this->getEntityManager()->remove($result);
}
$this->getEntityManager()->flush();
} | [
"public",
"function",
"removeByHash",
"(",
"string",
"$",
"hash",
")",
":",
"void",
"{",
"$",
"results",
"=",
"$",
"this",
"->",
"findBy",
"(",
"[",
"'hashKey'",
"=>",
"$",
"hash",
"]",
")",
";",
"foreach",
"(",
"$",
"results",
"as",
"$",
"result",
... | Removes user account key by user hash.
@param string $hash | [
"Removes",
"user",
"account",
"key",
"by",
"user",
"hash",
"."
] | 4198c8412ffdb6692b80d35e05c8ba331365b746 | https://github.com/netgen/site-bundle/blob/4198c8412ffdb6692b80d35e05c8ba331365b746/bundle/Entity/Repository/EzUserAccountKeyRepository.php#L79-L88 |
28,758 | spiral/core | src/ContainerScope.php | ContainerScope.runScope | public static function runScope(ContainerInterface $container, callable $scope)
{
list ($previous, self::$container) = [self::$container, $container];
try {
return $scope();
} catch (\Throwable $e) {
throw $e;
} finally {
self::$container = $previo... | php | public static function runScope(ContainerInterface $container, callable $scope)
{
list ($previous, self::$container) = [self::$container, $container];
try {
return $scope();
} catch (\Throwable $e) {
throw $e;
} finally {
self::$container = $previo... | [
"public",
"static",
"function",
"runScope",
"(",
"ContainerInterface",
"$",
"container",
",",
"callable",
"$",
"scope",
")",
"{",
"list",
"(",
"$",
"previous",
",",
"self",
"::",
"$",
"container",
")",
"=",
"[",
"self",
"::",
"$",
"container",
",",
"$",
... | Invokes given closure or function withing global IoC scope.
@param ContainerInterface $container
@param callable $scope
@return mixed
@throws \Throwable | [
"Invokes",
"given",
"closure",
"or",
"function",
"withing",
"global",
"IoC",
"scope",
"."
] | 02580dff7f1fcbc5e74caa1f78ea84c0e4c0d92e | https://github.com/spiral/core/blob/02580dff7f1fcbc5e74caa1f78ea84c0e4c0d92e/src/ContainerScope.php#L44-L54 |
28,759 | smartboxgroup/integration-framework-bundle | Components/FileService/Csv/CsvConfigurableStepsProvider.php | CsvConfigurableStepsProvider.getFileHandle | protected function getFileHandle($fullPath, $mode)
{
$key = md5($fullPath.$mode);
if (array_key_exists($key, $this->openFileHandles)) {
$handle = $this->openFileHandles[$key];
} else {
$handle = fopen($fullPath, $mode);
$this->openFileHandles[$key] = $hand... | php | protected function getFileHandle($fullPath, $mode)
{
$key = md5($fullPath.$mode);
if (array_key_exists($key, $this->openFileHandles)) {
$handle = $this->openFileHandles[$key];
} else {
$handle = fopen($fullPath, $mode);
$this->openFileHandles[$key] = $hand... | [
"protected",
"function",
"getFileHandle",
"(",
"$",
"fullPath",
",",
"$",
"mode",
")",
"{",
"$",
"key",
"=",
"md5",
"(",
"$",
"fullPath",
".",
"$",
"mode",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"openFileHan... | Open a file handle and store the hash so we can reuse it.
@param $fullPath
@param $mode
@return resource
@throws \Exception | [
"Open",
"a",
"file",
"handle",
"and",
"store",
"the",
"hash",
"so",
"we",
"can",
"reuse",
"it",
"."
] | 5f0bf8ff86337a51f6d208bd38df39017643b905 | https://github.com/smartboxgroup/integration-framework-bundle/blob/5f0bf8ff86337a51f6d208bd38df39017643b905/Components/FileService/Csv/CsvConfigurableStepsProvider.php#L69-L90 |
28,760 | smartboxgroup/integration-framework-bundle | Components/FileService/Csv/CsvConfigurableStepsProvider.php | CsvConfigurableStepsProvider.writeToFile | protected function writeToFile(array &$stepActionParams, array &$endpointOptions, array &$context)
{
$stepParamsResolver = new OptionsResolver();
$stepParamsResolver->setRequired([
self::PARAM_FILE_NAME,
self::PARAM_CSV_ROWS,
]);
$params = $stepParamsResolver-... | php | protected function writeToFile(array &$stepActionParams, array &$endpointOptions, array &$context)
{
$stepParamsResolver = new OptionsResolver();
$stepParamsResolver->setRequired([
self::PARAM_FILE_NAME,
self::PARAM_CSV_ROWS,
]);
$params = $stepParamsResolver-... | [
"protected",
"function",
"writeToFile",
"(",
"array",
"&",
"$",
"stepActionParams",
",",
"array",
"&",
"$",
"endpointOptions",
",",
"array",
"&",
"$",
"context",
")",
"{",
"$",
"stepParamsResolver",
"=",
"new",
"OptionsResolver",
"(",
")",
";",
"$",
"stepPar... | Write rows out to a csv file.
Required Params:
- CsvConfigurableProducer::PARAM_CSV_ROWS
Optional Params:
- CsvConfigurableProducer::PARAM_FILE_NAME
@param array $stepActionParams
@param array $endpointOptions
@param array $context | [
"Write",
"rows",
"out",
"to",
"a",
"csv",
"file",
"."
] | 5f0bf8ff86337a51f6d208bd38df39017643b905 | https://github.com/smartboxgroup/integration-framework-bundle/blob/5f0bf8ff86337a51f6d208bd38df39017643b905/Components/FileService/Csv/CsvConfigurableStepsProvider.php#L191-L218 |
28,761 | smartboxgroup/integration-framework-bundle | Components/FileService/Csv/CsvConfigurableStepsProvider.php | CsvConfigurableStepsProvider.appendLines | protected function appendLines(array &$stepActionParams, array &$endpointOptions, array &$context)
{
$stepParamsResolver = new OptionsResolver();
$stepParamsResolver->setRequired([
self::PARAM_CSV_ROWS,
]);
$stepParamsResolver->setDefault(self::PARAM_FILE_NAME, $endpointO... | php | protected function appendLines(array &$stepActionParams, array &$endpointOptions, array &$context)
{
$stepParamsResolver = new OptionsResolver();
$stepParamsResolver->setRequired([
self::PARAM_CSV_ROWS,
]);
$stepParamsResolver->setDefault(self::PARAM_FILE_NAME, $endpointO... | [
"protected",
"function",
"appendLines",
"(",
"array",
"&",
"$",
"stepActionParams",
",",
"array",
"&",
"$",
"endpointOptions",
",",
"array",
"&",
"$",
"context",
")",
"{",
"$",
"stepParamsResolver",
"=",
"new",
"OptionsResolver",
"(",
")",
";",
"$",
"stepPar... | Write an array of lines to a csv file in to a context variable
it is assumed the file handle is in the context.
Required Params:
- CsvConfigurableProducer::PARAM_CSV_ROWS
@param array $stepActionParams
@param array $endpointOptions
@param array $context | [
"Write",
"an",
"array",
"of",
"lines",
"to",
"a",
"csv",
"file",
"in",
"to",
"a",
"context",
"variable",
"it",
"is",
"assumed",
"the",
"file",
"handle",
"is",
"in",
"the",
"context",
"."
] | 5f0bf8ff86337a51f6d208bd38df39017643b905 | https://github.com/smartboxgroup/integration-framework-bundle/blob/5f0bf8ff86337a51f6d208bd38df39017643b905/Components/FileService/Csv/CsvConfigurableStepsProvider.php#L231-L261 |
28,762 | smartboxgroup/integration-framework-bundle | Components/FileService/Csv/CsvConfigurableStepsProvider.php | CsvConfigurableStepsProvider.readFile | protected function readFile(array &$stepActionParams, array &$endpointOptions, array &$context)
{
$stepParamsResolver = new OptionsResolver();
$stepParamsResolver->setRequired([
self::PARAM_FILE_NAME,
self::PARAM_CONTEXT_RESULT_NAME,
]);
$params = $stepParamsR... | php | protected function readFile(array &$stepActionParams, array &$endpointOptions, array &$context)
{
$stepParamsResolver = new OptionsResolver();
$stepParamsResolver->setRequired([
self::PARAM_FILE_NAME,
self::PARAM_CONTEXT_RESULT_NAME,
]);
$params = $stepParamsR... | [
"protected",
"function",
"readFile",
"(",
"array",
"&",
"$",
"stepActionParams",
",",
"array",
"&",
"$",
"endpointOptions",
",",
"array",
"&",
"$",
"context",
")",
"{",
"$",
"stepParamsResolver",
"=",
"new",
"OptionsResolver",
"(",
")",
";",
"$",
"stepParams... | Read a csv file in to a context variable.
Required Params:
- CsvConfigurableProducer::PARAM_CONTEXT_RESULT_NAME
Optional Params:
- CsvConfigurableProducer::PARAM_FILE_NAME
@param array $stepActionParams
@param array $endpointOptions
@param array $context | [
"Read",
"a",
"csv",
"file",
"in",
"to",
"a",
"context",
"variable",
"."
] | 5f0bf8ff86337a51f6d208bd38df39017643b905 | https://github.com/smartboxgroup/integration-framework-bundle/blob/5f0bf8ff86337a51f6d208bd38df39017643b905/Components/FileService/Csv/CsvConfigurableStepsProvider.php#L275-L302 |
28,763 | smartboxgroup/integration-framework-bundle | Components/FileService/Csv/CsvConfigurableStepsProvider.php | CsvConfigurableStepsProvider.readLines | protected function readLines(array &$stepActionParams, array &$endpointOptions, array &$context)
{
$stepParamsResolver = new OptionsResolver();
$stepParamsResolver->setRequired([
self::PARAM_CONTEXT_RESULT_NAME,
]);
$stepParamsResolver->setDefault(self::PARAM_MAX_LINES, ... | php | protected function readLines(array &$stepActionParams, array &$endpointOptions, array &$context)
{
$stepParamsResolver = new OptionsResolver();
$stepParamsResolver->setRequired([
self::PARAM_CONTEXT_RESULT_NAME,
]);
$stepParamsResolver->setDefault(self::PARAM_MAX_LINES, ... | [
"protected",
"function",
"readLines",
"(",
"array",
"&",
"$",
"stepActionParams",
",",
"array",
"&",
"$",
"endpointOptions",
",",
"array",
"&",
"$",
"context",
")",
"{",
"$",
"stepParamsResolver",
"=",
"new",
"OptionsResolver",
"(",
")",
";",
"$",
"stepParam... | Read a line from a csv file in to a context variable
it is assumed the file handle is in the context.
Required Params:
- CsvConfigurableProducer::PARAM_CONTEXT_RESULT_NAME
Optional Params:
- CsvConfigurableProducer::PARAM_MAX_LINES Defaults to 1
@param array $stepActionParams
@param array $endpointOptions
@param arra... | [
"Read",
"a",
"line",
"from",
"a",
"csv",
"file",
"in",
"to",
"a",
"context",
"variable",
"it",
"is",
"assumed",
"the",
"file",
"handle",
"is",
"in",
"the",
"context",
"."
] | 5f0bf8ff86337a51f6d208bd38df39017643b905 | https://github.com/smartboxgroup/integration-framework-bundle/blob/5f0bf8ff86337a51f6d208bd38df39017643b905/Components/FileService/Csv/CsvConfigurableStepsProvider.php#L319-L363 |
28,764 | smartboxgroup/integration-framework-bundle | Components/FileService/Csv/CsvConfigurableStepsProvider.php | CsvConfigurableStepsProvider.copyFile | protected function copyFile(array &$stepActionParams, array &$endpointOptions, array &$context)
{
$rootPath = $this->getRootPath($endpointOptions, $stepActionParams);
$stepParamsResolver = new OptionsResolver();
$stepParamsResolver->setRequired([
self::PARAM_FILE_NAME,
... | php | protected function copyFile(array &$stepActionParams, array &$endpointOptions, array &$context)
{
$rootPath = $this->getRootPath($endpointOptions, $stepActionParams);
$stepParamsResolver = new OptionsResolver();
$stepParamsResolver->setRequired([
self::PARAM_FILE_NAME,
... | [
"protected",
"function",
"copyFile",
"(",
"array",
"&",
"$",
"stepActionParams",
",",
"array",
"&",
"$",
"endpointOptions",
",",
"array",
"&",
"$",
"context",
")",
"{",
"$",
"rootPath",
"=",
"$",
"this",
"->",
"getRootPath",
"(",
"$",
"endpointOptions",
",... | Copy a file for this producer.
Required Params:
- CsvConfigurableProducer::PARAM_NEW_FILE_PATH
Optional Params:
- CsvConfigurableProducer::PARAM_FILE_NAME
@param array $stepActionParams
@param array $endpointOptions
@param array $context | [
"Copy",
"a",
"file",
"for",
"this",
"producer",
"."
] | 5f0bf8ff86337a51f6d208bd38df39017643b905 | https://github.com/smartboxgroup/integration-framework-bundle/blob/5f0bf8ff86337a51f6d208bd38df39017643b905/Components/FileService/Csv/CsvConfigurableStepsProvider.php#L424-L442 |
28,765 | smartboxgroup/integration-framework-bundle | Components/FileService/Csv/CsvConfigurableStepsProvider.php | CsvConfigurableStepsProvider.createFile | protected function createFile(array &$stepActionParams, array &$endpointOptions, array &$context)
{
$fullPath = $this->getFullPath($endpointOptions, $stepActionParams);
$fileHandle = fopen($fullPath, 'w');
fclose($fileHandle);
} | php | protected function createFile(array &$stepActionParams, array &$endpointOptions, array &$context)
{
$fullPath = $this->getFullPath($endpointOptions, $stepActionParams);
$fileHandle = fopen($fullPath, 'w');
fclose($fileHandle);
} | [
"protected",
"function",
"createFile",
"(",
"array",
"&",
"$",
"stepActionParams",
",",
"array",
"&",
"$",
"endpointOptions",
",",
"array",
"&",
"$",
"context",
")",
"{",
"$",
"fullPath",
"=",
"$",
"this",
"->",
"getFullPath",
"(",
"$",
"endpointOptions",
... | Create a new blank file.
Required Params:
- CsvConfigurableProducer::PARAM_NEW_FILE_PATH
Optional Params:
- CsvConfigurableProducer::PARAM_FILE_NAME
@param array $stepActionParams
@param array $endpointOptions
@param array $context | [
"Create",
"a",
"new",
"blank",
"file",
"."
] | 5f0bf8ff86337a51f6d208bd38df39017643b905 | https://github.com/smartboxgroup/integration-framework-bundle/blob/5f0bf8ff86337a51f6d208bd38df39017643b905/Components/FileService/Csv/CsvConfigurableStepsProvider.php#L456-L462 |
28,766 | smartboxgroup/integration-framework-bundle | Components/FileService/Csv/CsvConfigurableStepsProvider.php | CsvConfigurableStepsProvider.getFilePath | protected function getFilePath(array $endpointOptions, $stepActionParams)
{
if (array_key_exists(self::PARAM_FILE_NAME, $stepActionParams)) {
return $stepActionParams[self::PARAM_FILE_NAME];
} else {
return $endpointOptions[CsvConfigurableProtocol::OPTION_PATH];
}
... | php | protected function getFilePath(array $endpointOptions, $stepActionParams)
{
if (array_key_exists(self::PARAM_FILE_NAME, $stepActionParams)) {
return $stepActionParams[self::PARAM_FILE_NAME];
} else {
return $endpointOptions[CsvConfigurableProtocol::OPTION_PATH];
}
... | [
"protected",
"function",
"getFilePath",
"(",
"array",
"$",
"endpointOptions",
",",
"$",
"stepActionParams",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"self",
"::",
"PARAM_FILE_NAME",
",",
"$",
"stepActionParams",
")",
")",
"{",
"return",
"$",
"stepActionPara... | Resolve the file path from the configuration
use the configured default path if none is set.
@param array $endpointOptions
@param array $stepActionParams
@return string The file path to the file as in the configuration | [
"Resolve",
"the",
"file",
"path",
"from",
"the",
"configuration",
"use",
"the",
"configured",
"default",
"path",
"if",
"none",
"is",
"set",
"."
] | 5f0bf8ff86337a51f6d208bd38df39017643b905 | https://github.com/smartboxgroup/integration-framework-bundle/blob/5f0bf8ff86337a51f6d208bd38df39017643b905/Components/FileService/Csv/CsvConfigurableStepsProvider.php#L485-L492 |
28,767 | smartboxgroup/integration-framework-bundle | Components/FileService/Csv/CsvConfigurableStepsProvider.php | CsvConfigurableStepsProvider.getFullPath | protected function getFullPath(array $endpointOptions, $stepActionParams)
{
return $this->getRootPath($endpointOptions).DIRECTORY_SEPARATOR.$this->getFilePath($endpointOptions, $stepActionParams);
} | php | protected function getFullPath(array $endpointOptions, $stepActionParams)
{
return $this->getRootPath($endpointOptions).DIRECTORY_SEPARATOR.$this->getFilePath($endpointOptions, $stepActionParams);
} | [
"protected",
"function",
"getFullPath",
"(",
"array",
"$",
"endpointOptions",
",",
"$",
"stepActionParams",
")",
"{",
"return",
"$",
"this",
"->",
"getRootPath",
"(",
"$",
"endpointOptions",
")",
".",
"DIRECTORY_SEPARATOR",
".",
"$",
"this",
"->",
"getFilePath",... | resolve the full path to the file in the configuration.
@param array $endpointOptions
@param array $stepActionParams
@return string A full path to the file from the configuration | [
"resolve",
"the",
"full",
"path",
"to",
"the",
"file",
"in",
"the",
"configuration",
"."
] | 5f0bf8ff86337a51f6d208bd38df39017643b905 | https://github.com/smartboxgroup/integration-framework-bundle/blob/5f0bf8ff86337a51f6d208bd38df39017643b905/Components/FileService/Csv/CsvConfigurableStepsProvider.php#L502-L505 |
28,768 | netgen/site-bundle | bundle/EventListener/NoViewTemplateEventListener.php | NoViewTemplateEventListener.getController | public function getController(FilterControllerEvent $event): void
{
if (!$this->enabled || $event->getRequestType() !== Kernel::MASTER_REQUEST) {
return;
}
$request = $event->getRequest();
$view = $request->attributes->get('view');
if (!$view instanceof View || ... | php | public function getController(FilterControllerEvent $event): void
{
if (!$this->enabled || $event->getRequestType() !== Kernel::MASTER_REQUEST) {
return;
}
$request = $event->getRequest();
$view = $request->attributes->get('view');
if (!$view instanceof View || ... | [
"public",
"function",
"getController",
"(",
"FilterControllerEvent",
"$",
"event",
")",
":",
"void",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"enabled",
"||",
"$",
"event",
"->",
"getRequestType",
"(",
")",
"!==",
"Kernel",
"::",
"MASTER_REQUEST",
")",
"{",... | Redirects to the frontpage for any full view that does not have a template configured. | [
"Redirects",
"to",
"the",
"frontpage",
"for",
"any",
"full",
"view",
"that",
"does",
"not",
"have",
"a",
"template",
"configured",
"."
] | 4198c8412ffdb6692b80d35e05c8ba331365b746 | https://github.com/netgen/site-bundle/blob/4198c8412ffdb6692b80d35e05c8ba331365b746/bundle/EventListener/NoViewTemplateEventListener.php#L56-L83 |
28,769 | spiral/router | src/UriHandler.php | UriHandler.match | public function match(UriInterface $uri, array $defaults): ?array
{
if (!$this->isCompiled()) {
$this->compile();
}
$matches = [];
if (!preg_match($this->compiled, $this->fetchTarget($uri), $matches)) {
return null;
}
$matches = array_interse... | php | public function match(UriInterface $uri, array $defaults): ?array
{
if (!$this->isCompiled()) {
$this->compile();
}
$matches = [];
if (!preg_match($this->compiled, $this->fetchTarget($uri), $matches)) {
return null;
}
$matches = array_interse... | [
"public",
"function",
"match",
"(",
"UriInterface",
"$",
"uri",
",",
"array",
"$",
"defaults",
")",
":",
"?",
"array",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isCompiled",
"(",
")",
")",
"{",
"$",
"this",
"->",
"compile",
"(",
")",
";",
"}",
"$"... | Match given url against compiled template and return matches array or null if pattern does
not match.
@param UriInterface $uri
@param array $defaults
@return array|null | [
"Match",
"given",
"url",
"against",
"compiled",
"template",
"and",
"return",
"matches",
"array",
"or",
"null",
"if",
"pattern",
"does",
"not",
"match",
"."
] | 35721d06231d5650402eb93ac7f3ade00cd1b640 | https://github.com/spiral/router/blob/35721d06231d5650402eb93ac7f3ade00cd1b640/src/UriHandler.php#L116-L130 |
28,770 | spiral/router | src/UriHandler.php | UriHandler.uri | public function uri($parameters = [], array $defaults = []): UriInterface
{
if (!$this->isCompiled()) {
$this->compile();
}
$parameters = array_merge(
$this->options,
$defaults,
$this->fetchOptions($parameters, $query)
);
fore... | php | public function uri($parameters = [], array $defaults = []): UriInterface
{
if (!$this->isCompiled()) {
$this->compile();
}
$parameters = array_merge(
$this->options,
$defaults,
$this->fetchOptions($parameters, $query)
);
fore... | [
"public",
"function",
"uri",
"(",
"$",
"parameters",
"=",
"[",
"]",
",",
"array",
"$",
"defaults",
"=",
"[",
"]",
")",
":",
"UriInterface",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isCompiled",
"(",
")",
")",
"{",
"$",
"this",
"->",
"compile",
"(... | Generate Uri for a given parameters and default values.
@param array|\Traversable $parameters
@param array $defaults
@return UriInterface | [
"Generate",
"Uri",
"for",
"a",
"given",
"parameters",
"and",
"default",
"values",
"."
] | 35721d06231d5650402eb93ac7f3ade00cd1b640 | https://github.com/spiral/router/blob/35721d06231d5650402eb93ac7f3ade00cd1b640/src/UriHandler.php#L139-L164 |
28,771 | spiral/router | src/UriHandler.php | UriHandler.fetchOptions | private function fetchOptions($parameters, &$query): array
{
$allowed = array_keys($this->options);
$result = [];
foreach ($parameters as $key => $parameter) {
if (is_numeric($key) && isset($allowed[$key])) {
// this segment fetched keys from given parameters eit... | php | private function fetchOptions($parameters, &$query): array
{
$allowed = array_keys($this->options);
$result = [];
foreach ($parameters as $key => $parameter) {
if (is_numeric($key) && isset($allowed[$key])) {
// this segment fetched keys from given parameters eit... | [
"private",
"function",
"fetchOptions",
"(",
"$",
"parameters",
",",
"&",
"$",
"query",
")",
":",
"array",
"{",
"$",
"allowed",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"options",
")",
";",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"... | Fetch uri segments and query parameters.
@param \Traversable|array $parameters
@param array|null $query Query parameters.
@return array | [
"Fetch",
"uri",
"segments",
"and",
"query",
"parameters",
"."
] | 35721d06231d5650402eb93ac7f3ade00cd1b640 | https://github.com/spiral/router/blob/35721d06231d5650402eb93ac7f3ade00cd1b640/src/UriHandler.php#L173-L198 |
28,772 | spiral/router | src/UriHandler.php | UriHandler.fetchTarget | private function fetchTarget(UriInterface $uri): string
{
$path = $uri->getPath();
if (empty($path) || $path[0] !== '/') {
$path = '/' . $path;
}
if ($this->matchHost) {
$uri = $uri->getHost() . $path;
} else {
$uri = substr($path, strlen... | php | private function fetchTarget(UriInterface $uri): string
{
$path = $uri->getPath();
if (empty($path) || $path[0] !== '/') {
$path = '/' . $path;
}
if ($this->matchHost) {
$uri = $uri->getHost() . $path;
} else {
$uri = substr($path, strlen... | [
"private",
"function",
"fetchTarget",
"(",
"UriInterface",
"$",
"uri",
")",
":",
"string",
"{",
"$",
"path",
"=",
"$",
"uri",
"->",
"getPath",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"path",
")",
"||",
"$",
"path",
"[",
"0",
"]",
"!==",
"'/'... | Part of uri path which is being matched.
@param UriInterface $uri
@return string | [
"Part",
"of",
"uri",
"path",
"which",
"is",
"being",
"matched",
"."
] | 35721d06231d5650402eb93ac7f3ade00cd1b640 | https://github.com/spiral/router/blob/35721d06231d5650402eb93ac7f3ade00cd1b640/src/UriHandler.php#L206-L221 |
28,773 | spiral/router | src/UriHandler.php | UriHandler.compile | private function compile()
{
$options = $replaces = [];
$pattern = rtrim(ltrim($this->pattern, ':/'), '/');
// correct [/ first occurrence]
if (strpos($pattern, '[/') === 0) {
$pattern = '[' . substr($pattern, 2);
}
if (preg_match_all('/<(\w+):?(.*?)?>/'... | php | private function compile()
{
$options = $replaces = [];
$pattern = rtrim(ltrim($this->pattern, ':/'), '/');
// correct [/ first occurrence]
if (strpos($pattern, '[/') === 0) {
$pattern = '[' . substr($pattern, 2);
}
if (preg_match_all('/<(\w+):?(.*?)?>/'... | [
"private",
"function",
"compile",
"(",
")",
"{",
"$",
"options",
"=",
"$",
"replaces",
"=",
"[",
"]",
";",
"$",
"pattern",
"=",
"rtrim",
"(",
"ltrim",
"(",
"$",
"this",
"->",
"pattern",
",",
"':/'",
")",
",",
"'/'",
")",
";",
"// correct [/ first occ... | Compile route matcher into regexp. | [
"Compile",
"route",
"matcher",
"into",
"regexp",
"."
] | 35721d06231d5650402eb93ac7f3ade00cd1b640 | https://github.com/spiral/router/blob/35721d06231d5650402eb93ac7f3ade00cd1b640/src/UriHandler.php#L226-L267 |
28,774 | spiral/router | src/UriHandler.php | UriHandler.interpolate | private function interpolate(string $string, array $values): string
{
$replaces = [];
foreach ($values as $key => $value) {
$value = (is_array($value) || $value instanceof \Closure) ? '' : $value;
$replaces["<{$key}>"] = is_object($value) ? (string)$value : $value;
}
... | php | private function interpolate(string $string, array $values): string
{
$replaces = [];
foreach ($values as $key => $value) {
$value = (is_array($value) || $value instanceof \Closure) ? '' : $value;
$replaces["<{$key}>"] = is_object($value) ? (string)$value : $value;
}
... | [
"private",
"function",
"interpolate",
"(",
"string",
"$",
"string",
",",
"array",
"$",
"values",
")",
":",
"string",
"{",
"$",
"replaces",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"values",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"valu... | Interpolate string with given values.
@param string $string
@param array $values
@return string | [
"Interpolate",
"string",
"with",
"given",
"values",
"."
] | 35721d06231d5650402eb93ac7f3ade00cd1b640 | https://github.com/spiral/router/blob/35721d06231d5650402eb93ac7f3ade00cd1b640/src/UriHandler.php#L276-L285 |
28,775 | spiral/router | src/UriHandler.php | UriHandler.prepareSegment | private function prepareSegment(string $name, string $segment): string
{
if (!empty($segment)) {
return $this->filterSegment($segment);
}
if (!isset($this->constrains[$name])) {
return self::DEFAULT_SEGMENT;
}
if (is_array($this->constrains[$name])) ... | php | private function prepareSegment(string $name, string $segment): string
{
if (!empty($segment)) {
return $this->filterSegment($segment);
}
if (!isset($this->constrains[$name])) {
return self::DEFAULT_SEGMENT;
}
if (is_array($this->constrains[$name])) ... | [
"private",
"function",
"prepareSegment",
"(",
"string",
"$",
"name",
",",
"string",
"$",
"segment",
")",
":",
"string",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"segment",
")",
")",
"{",
"return",
"$",
"this",
"->",
"filterSegment",
"(",
"$",
"segment",... | Prepares segment pattern with given constrains.
@param string $name
@param string $segment
@return string | [
"Prepares",
"segment",
"pattern",
"with",
"given",
"constrains",
"."
] | 35721d06231d5650402eb93ac7f3ade00cd1b640 | https://github.com/spiral/router/blob/35721d06231d5650402eb93ac7f3ade00cd1b640/src/UriHandler.php#L294-L311 |
28,776 | adminarchitect/options | src/Terranet/Options/Drivers/EloquentOptionsDriver.php | EloquentOptionsDriver.find | public function find($name, $default = null)
{
return ($options = $this->fetchAll()->lists('value', 'key')) && $options->has($name)
? $options->get($name)
: $default;
} | php | public function find($name, $default = null)
{
return ($options = $this->fetchAll()->lists('value', 'key')) && $options->has($name)
? $options->get($name)
: $default;
} | [
"public",
"function",
"find",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"return",
"(",
"$",
"options",
"=",
"$",
"this",
"->",
"fetchAll",
"(",
")",
"->",
"lists",
"(",
"'value'",
",",
"'key'",
")",
")",
"&&",
"$",
"options",
... | Find an option by name.
@param $name
@param $default
@return mixed | [
"Find",
"an",
"option",
"by",
"name",
"."
] | b3b43dc3bfc34710143c8e34a79603e925f07fd2 | https://github.com/adminarchitect/options/blob/b3b43dc3bfc34710143c8e34a79603e925f07fd2/src/Terranet/Options/Drivers/EloquentOptionsDriver.php#L34-L39 |
28,777 | adminarchitect/options | src/Terranet/Options/Drivers/EloquentOptionsDriver.php | EloquentOptionsDriver.create | public function create($key, $value, $group = Manager::DEFAULT_GROUP)
{
return $this->createModel()->create([
'key' => $key,
'value' => $value,
'group' => $group,
]);
} | php | public function create($key, $value, $group = Manager::DEFAULT_GROUP)
{
return $this->createModel()->create([
'key' => $key,
'value' => $value,
'group' => $group,
]);
} | [
"public",
"function",
"create",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"group",
"=",
"Manager",
"::",
"DEFAULT_GROUP",
")",
"{",
"return",
"$",
"this",
"->",
"createModel",
"(",
")",
"->",
"create",
"(",
"[",
"'key'",
"=>",
"$",
"key",
",",
... | Create new option.
@param string $key
@param string $value
@param string $group
@return \Illuminate\Database\Eloquent\Model|$this | [
"Create",
"new",
"option",
"."
] | b3b43dc3bfc34710143c8e34a79603e925f07fd2 | https://github.com/adminarchitect/options/blob/b3b43dc3bfc34710143c8e34a79603e925f07fd2/src/Terranet/Options/Drivers/EloquentOptionsDriver.php#L103-L110 |
28,778 | netgen/site-bundle | bundle/EventListener/User/PostRegisterEventListener.php | PostRegisterEventListener.onUserRegistered | public function onUserRegistered(PostRegisterEvent $event): void
{
$user = $event->getUser();
if ($user->enabled) {
$this->mailHelper
->sendMail(
[$user->email => $this->getUserName($user)],
'ngsite.user.welcome.subject',
... | php | public function onUserRegistered(PostRegisterEvent $event): void
{
$user = $event->getUser();
if ($user->enabled) {
$this->mailHelper
->sendMail(
[$user->email => $this->getUserName($user)],
'ngsite.user.welcome.subject',
... | [
"public",
"function",
"onUserRegistered",
"(",
"PostRegisterEvent",
"$",
"event",
")",
":",
"void",
"{",
"$",
"user",
"=",
"$",
"event",
"->",
"getUser",
"(",
")",
";",
"if",
"(",
"$",
"user",
"->",
"enabled",
")",
"{",
"$",
"this",
"->",
"mailHelper",... | Listens to the event triggered after the user has been registered.
The event contains information about registered user. | [
"Listens",
"to",
"the",
"event",
"triggered",
"after",
"the",
"user",
"has",
"been",
"registered",
".",
"The",
"event",
"contains",
"information",
"about",
"registered",
"user",
"."
] | 4198c8412ffdb6692b80d35e05c8ba331365b746 | https://github.com/netgen/site-bundle/blob/4198c8412ffdb6692b80d35e05c8ba331365b746/bundle/EventListener/User/PostRegisterEventListener.php#L30-L89 |
28,779 | netgen/site-bundle | bundle/Routing/SiteLocationUrlAliasRouter.php | SiteLocationUrlAliasRouter.generate | public function generate($name, $parameters = [], $referenceType = self::ABSOLUTE_PATH): string
{
if (!$name instanceof Location) {
throw new RouteNotFoundException('Could not match route');
}
return $this->generator->generate(
$name->innerLocation,
$para... | php | public function generate($name, $parameters = [], $referenceType = self::ABSOLUTE_PATH): string
{
if (!$name instanceof Location) {
throw new RouteNotFoundException('Could not match route');
}
return $this->generator->generate(
$name->innerLocation,
$para... | [
"public",
"function",
"generate",
"(",
"$",
"name",
",",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"referenceType",
"=",
"self",
"::",
"ABSOLUTE_PATH",
")",
":",
"string",
"{",
"if",
"(",
"!",
"$",
"name",
"instanceof",
"Location",
")",
"{",
"throw",... | Generates a URL for Site API Location object, from the given parameters.
@param mixed $name
@param mixed $parameters
@param mixed $referenceType | [
"Generates",
"a",
"URL",
"for",
"Site",
"API",
"Location",
"object",
"from",
"the",
"given",
"parameters",
"."
] | 4198c8412ffdb6692b80d35e05c8ba331365b746 | https://github.com/netgen/site-bundle/blob/4198c8412ffdb6692b80d35e05c8ba331365b746/bundle/Routing/SiteLocationUrlAliasRouter.php#L50-L61 |
28,780 | spiral/core | src/Container.php | Container.hasInjector | public function hasInjector(\ReflectionClass $reflection): bool
{
if (isset($this->injectors[$reflection->getName()])) {
return true;
}
//Auto injection!
return $reflection->isSubclassOf(InjectableInterface::class);
} | php | public function hasInjector(\ReflectionClass $reflection): bool
{
if (isset($this->injectors[$reflection->getName()])) {
return true;
}
//Auto injection!
return $reflection->isSubclassOf(InjectableInterface::class);
} | [
"public",
"function",
"hasInjector",
"(",
"\\",
"ReflectionClass",
"$",
"reflection",
")",
":",
"bool",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"injectors",
"[",
"$",
"reflection",
"->",
"getName",
"(",
")",
"]",
")",
")",
"{",
"return",
"true... | Check if given class has associated injector.
@param \ReflectionClass $reflection
@return bool | [
"Check",
"if",
"given",
"class",
"has",
"associated",
"injector",
"."
] | 02580dff7f1fcbc5e74caa1f78ea84c0e4c0d92e | https://github.com/spiral/core/blob/02580dff7f1fcbc5e74caa1f78ea84c0e4c0d92e/src/Container.php#L338-L346 |
28,781 | spiral/core | src/Container.php | Container.registerInstance | protected function registerInstance($instance, array $parameters)
{
//Declarative singletons (only when class received via direct get)
if (empty($parameters) && $instance instanceof SingletonInterface) {
$alias = get_class($instance);
if (!isset($this->bindings[$alias])) {
... | php | protected function registerInstance($instance, array $parameters)
{
//Declarative singletons (only when class received via direct get)
if (empty($parameters) && $instance instanceof SingletonInterface) {
$alias = get_class($instance);
if (!isset($this->bindings[$alias])) {
... | [
"protected",
"function",
"registerInstance",
"(",
"$",
"instance",
",",
"array",
"$",
"parameters",
")",
"{",
"//Declarative singletons (only when class received via direct get)",
"if",
"(",
"empty",
"(",
"$",
"parameters",
")",
"&&",
"$",
"instance",
"instanceof",
"S... | Register instance in container, might perform methods like auto-singletons, log populations
and etc. Can be extended.
@param object $instance Created object.
@param array $parameters Parameters which been passed with created instance.
@return object | [
"Register",
"instance",
"in",
"container",
"might",
"perform",
"methods",
"like",
"auto",
"-",
"singletons",
"log",
"populations",
"and",
"etc",
".",
"Can",
"be",
"extended",
"."
] | 02580dff7f1fcbc5e74caa1f78ea84c0e4c0d92e | https://github.com/spiral/core/blob/02580dff7f1fcbc5e74caa1f78ea84c0e4c0d92e/src/Container.php#L436-L450 |
28,782 | spiral/core | src/Container.php | Container.getInjector | private function getInjector(\ReflectionClass $reflection): InjectorInterface
{
if (isset($this->injectors[$reflection->getName()])) {
//Stated directly
$injector = $this->get($this->injectors[$reflection->getName()]);
} else {
//Auto-injection!
$injec... | php | private function getInjector(\ReflectionClass $reflection): InjectorInterface
{
if (isset($this->injectors[$reflection->getName()])) {
//Stated directly
$injector = $this->get($this->injectors[$reflection->getName()]);
} else {
//Auto-injection!
$injec... | [
"private",
"function",
"getInjector",
"(",
"\\",
"ReflectionClass",
"$",
"reflection",
")",
":",
"InjectorInterface",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"injectors",
"[",
"$",
"reflection",
"->",
"getName",
"(",
")",
"]",
")",
")",
"{",
"//... | Get injector associated with given class.
@param \ReflectionClass $reflection
@return InjectorInterface | [
"Get",
"injector",
"associated",
"with",
"given",
"class",
"."
] | 02580dff7f1fcbc5e74caa1f78ea84c0e4c0d92e | https://github.com/spiral/core/blob/02580dff7f1fcbc5e74caa1f78ea84c0e4c0d92e/src/Container.php#L570-L589 |
28,783 | spiral/core | src/Container.php | Container.assertType | private function assertType(
\ReflectionParameter $parameter,
\ReflectionFunctionAbstract $context,
$value
) {
if (is_null($value)) {
if (
!$parameter->isOptional()
&& !($parameter->isDefaultValueAvailable() && $parameter->getDefaultValue()... | php | private function assertType(
\ReflectionParameter $parameter,
\ReflectionFunctionAbstract $context,
$value
) {
if (is_null($value)) {
if (
!$parameter->isOptional()
&& !($parameter->isDefaultValueAvailable() && $parameter->getDefaultValue()... | [
"private",
"function",
"assertType",
"(",
"\\",
"ReflectionParameter",
"$",
"parameter",
",",
"\\",
"ReflectionFunctionAbstract",
"$",
"context",
",",
"$",
"value",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"value",
")",
")",
"{",
"if",
"(",
"!",
"$",
"p... | Assert that given value are matched parameter type.
@param \ReflectionParameter $parameter
@param \ReflectionFunctionAbstract $context
@param mixed $value
@throws ArgumentException | [
"Assert",
"that",
"given",
"value",
"are",
"matched",
"parameter",
"type",
"."
] | 02580dff7f1fcbc5e74caa1f78ea84c0e4c0d92e | https://github.com/spiral/core/blob/02580dff7f1fcbc5e74caa1f78ea84c0e4c0d92e/src/Container.php#L600-L629 |
28,784 | netgen/site-bundle | bundle/EventListener/SetCsrfEnabledEventListener.php | SetCsrfEnabledEventListener.onKernelRequest | public function onKernelRequest(GetResponseEvent $event): void
{
$event->getRequest()->attributes->set(
'csrf_enabled',
$this->csrfTokenManager instanceof CsrfTokenManager
);
} | php | public function onKernelRequest(GetResponseEvent $event): void
{
$event->getRequest()->attributes->set(
'csrf_enabled',
$this->csrfTokenManager instanceof CsrfTokenManager
);
} | [
"public",
"function",
"onKernelRequest",
"(",
"GetResponseEvent",
"$",
"event",
")",
":",
"void",
"{",
"$",
"event",
"->",
"getRequest",
"(",
")",
"->",
"attributes",
"->",
"set",
"(",
"'csrf_enabled'",
",",
"$",
"this",
"->",
"csrfTokenManager",
"instanceof",... | Sets the variable into request indicating if CSRF protection is enabled or not. | [
"Sets",
"the",
"variable",
"into",
"request",
"indicating",
"if",
"CSRF",
"protection",
"is",
"enabled",
"or",
"not",
"."
] | 4198c8412ffdb6692b80d35e05c8ba331365b746 | https://github.com/netgen/site-bundle/blob/4198c8412ffdb6692b80d35e05c8ba331365b746/bundle/EventListener/SetCsrfEnabledEventListener.php#L37-L43 |
28,785 | netgen/site-bundle | bundle/Helper/PathHelper.php | PathHelper.getPath | public function getPath($locationId, array $options = []): array
{
$optionsResolver = new OptionsResolver();
$this->configureOptions($optionsResolver);
$options = $optionsResolver->resolve($options);
$excludedContentTypes = [];
if (
!$options['use_all_content_typ... | php | public function getPath($locationId, array $options = []): array
{
$optionsResolver = new OptionsResolver();
$this->configureOptions($optionsResolver);
$options = $optionsResolver->resolve($options);
$excludedContentTypes = [];
if (
!$options['use_all_content_typ... | [
"public",
"function",
"getPath",
"(",
"$",
"locationId",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"array",
"{",
"$",
"optionsResolver",
"=",
"new",
"OptionsResolver",
"(",
")",
";",
"$",
"this",
"->",
"configureOptions",
"(",
"$",
"optionsR... | Returns the path array for provided location ID.
@param int|string $locationId | [
"Returns",
"the",
"path",
"array",
"for",
"provided",
"location",
"ID",
"."
] | 4198c8412ffdb6692b80d35e05c8ba331365b746 | https://github.com/netgen/site-bundle/blob/4198c8412ffdb6692b80d35e05c8ba331365b746/bundle/Helper/PathHelper.php#L46-L106 |
28,786 | netgen/site-bundle | bundle/ContextProvider/UserContextProvider.php | UserContextProvider.updateUserContext | public function updateUserContext(UserContext $context): void
{
$context->addParameter(
'userId',
$this->repository->getPermissionResolver()->getCurrentUserReference()->getUserId()
);
} | php | public function updateUserContext(UserContext $context): void
{
$context->addParameter(
'userId',
$this->repository->getPermissionResolver()->getCurrentUserReference()->getUserId()
);
} | [
"public",
"function",
"updateUserContext",
"(",
"UserContext",
"$",
"context",
")",
":",
"void",
"{",
"$",
"context",
"->",
"addParameter",
"(",
"'userId'",
",",
"$",
"this",
"->",
"repository",
"->",
"getPermissionResolver",
"(",
")",
"->",
"getCurrentUserRefer... | Adds the current user ID to the user context. Allows varying the caches
per user, without taking into the account session for example. | [
"Adds",
"the",
"current",
"user",
"ID",
"to",
"the",
"user",
"context",
".",
"Allows",
"varying",
"the",
"caches",
"per",
"user",
"without",
"taking",
"into",
"the",
"account",
"session",
"for",
"example",
"."
] | 4198c8412ffdb6692b80d35e05c8ba331365b746 | https://github.com/netgen/site-bundle/blob/4198c8412ffdb6692b80d35e05c8ba331365b746/bundle/ContextProvider/UserContextProvider.php#L27-L33 |
28,787 | netgen/site-bundle | bundle/Command/SymlinkCommand.php | SymlinkCommand.verifyAndSymlinkFile | protected function verifyAndSymlinkFile(string $source, string $destination, OutputInterface $output): void
{
if (!$this->fileSystem->exists(dirname($destination))) {
$this->fileSystem->mkdir(dirname($destination), 0755);
}
if ($this->fileSystem->exists($destination) && !is_file... | php | protected function verifyAndSymlinkFile(string $source, string $destination, OutputInterface $output): void
{
if (!$this->fileSystem->exists(dirname($destination))) {
$this->fileSystem->mkdir(dirname($destination), 0755);
}
if ($this->fileSystem->exists($destination) && !is_file... | [
"protected",
"function",
"verifyAndSymlinkFile",
"(",
"string",
"$",
"source",
",",
"string",
"$",
"destination",
",",
"OutputInterface",
"$",
"output",
")",
":",
"void",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"fileSystem",
"->",
"exists",
"(",
"dirname",
... | Verify that source file can be symlinked to destination and do symlinking if it can. | [
"Verify",
"that",
"source",
"file",
"can",
"be",
"symlinked",
"to",
"destination",
"and",
"do",
"symlinking",
"if",
"it",
"can",
"."
] | 4198c8412ffdb6692b80d35e05c8ba331365b746 | https://github.com/netgen/site-bundle/blob/4198c8412ffdb6692b80d35e05c8ba331365b746/bundle/Command/SymlinkCommand.php#L34-L77 |
28,788 | netgen/site-bundle | bundle/Command/SymlinkCommand.php | SymlinkCommand.verifyAndSymlinkDirectory | protected function verifyAndSymlinkDirectory(string $source, string $destination, OutputInterface $output): void
{
if ($this->fileSystem->exists($destination) && !is_link($destination)) {
$output->writeln('<comment>' . basename($destination) . '</comment> already exists in <comment>' . dirname($... | php | protected function verifyAndSymlinkDirectory(string $source, string $destination, OutputInterface $output): void
{
if ($this->fileSystem->exists($destination) && !is_link($destination)) {
$output->writeln('<comment>' . basename($destination) . '</comment> already exists in <comment>' . dirname($... | [
"protected",
"function",
"verifyAndSymlinkDirectory",
"(",
"string",
"$",
"source",
",",
"string",
"$",
"destination",
",",
"OutputInterface",
"$",
"output",
")",
":",
"void",
"{",
"if",
"(",
"$",
"this",
"->",
"fileSystem",
"->",
"exists",
"(",
"$",
"destin... | Verify that source directory can be symlinked to destination and do symlinking if it can. | [
"Verify",
"that",
"source",
"directory",
"can",
"be",
"symlinked",
"to",
"destination",
"and",
"do",
"symlinking",
"if",
"it",
"can",
"."
] | 4198c8412ffdb6692b80d35e05c8ba331365b746 | https://github.com/netgen/site-bundle/blob/4198c8412ffdb6692b80d35e05c8ba331365b746/bundle/Command/SymlinkCommand.php#L82-L107 |
28,789 | Prezent/prezent-crud-bundle | src/Templating/TemplateGuesser.php | TemplateGuesser.guessTemplateNames | public function guessTemplateNames($controller, Request $request)
{
if (is_object($controller) && method_exists($controller, '__invoke')) {
$controller = [$controller, '__invoke'];
} elseif (!is_array($controller)) {
throw new \InvalidArgumentException(sprintf('First argument... | php | public function guessTemplateNames($controller, Request $request)
{
if (is_object($controller) && method_exists($controller, '__invoke')) {
$controller = [$controller, '__invoke'];
} elseif (!is_array($controller)) {
throw new \InvalidArgumentException(sprintf('First argument... | [
"public",
"function",
"guessTemplateNames",
"(",
"$",
"controller",
",",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"controller",
")",
"&&",
"method_exists",
"(",
"$",
"controller",
",",
"'__invoke'",
")",
")",
"{",
"$",
"contro... | Guess multiple possible template names based on the controller
@param callable $controller An array storing the controller object and action method
@param Request $request A Request instance
@param string $engine
@return string[] Array of template references
@throws \InvalidArgumentException | [
"Guess",
"multiple",
"possible",
"template",
"names",
"based",
"on",
"the",
"controller"
] | bb8bcf92cecc2acae08b8a672876b4972175ca24 | https://github.com/Prezent/prezent-crud-bundle/blob/bb8bcf92cecc2acae08b8a672876b4972175ca24/src/Templating/TemplateGuesser.php#L54-L82 |
28,790 | netgen/site-bundle | bundle/EventListener/UserEventListener.php | UserEventListener.getUserName | protected function getUserName(User $user): string
{
$contentInfo = $this->repository->sudo(
function (Repository $repository) use ($user): ContentInfo {
return $this->loadService->loadContent($user->id)->contentInfo;
}
);
return $contentInfo->name;
... | php | protected function getUserName(User $user): string
{
$contentInfo = $this->repository->sudo(
function (Repository $repository) use ($user): ContentInfo {
return $this->loadService->loadContent($user->id)->contentInfo;
}
);
return $contentInfo->name;
... | [
"protected",
"function",
"getUserName",
"(",
"User",
"$",
"user",
")",
":",
"string",
"{",
"$",
"contentInfo",
"=",
"$",
"this",
"->",
"repository",
"->",
"sudo",
"(",
"function",
"(",
"Repository",
"$",
"repository",
")",
"use",
"(",
"$",
"user",
")",
... | Returns the translated user name. | [
"Returns",
"the",
"translated",
"user",
"name",
"."
] | 4198c8412ffdb6692b80d35e05c8ba331365b746 | https://github.com/netgen/site-bundle/blob/4198c8412ffdb6692b80d35e05c8ba331365b746/bundle/EventListener/UserEventListener.php#L67-L76 |
28,791 | spiral/router | src/Router.php | Router.matchRoute | protected function matchRoute(ServerRequestInterface $request): ?RouteInterface
{
foreach ($this->routes as $route) {
// Matched route will return new route instance with matched parameters
$matched = $route->match($request);
if (!empty($matched)) {
retur... | php | protected function matchRoute(ServerRequestInterface $request): ?RouteInterface
{
foreach ($this->routes as $route) {
// Matched route will return new route instance with matched parameters
$matched = $route->match($request);
if (!empty($matched)) {
retur... | [
"protected",
"function",
"matchRoute",
"(",
"ServerRequestInterface",
"$",
"request",
")",
":",
"?",
"RouteInterface",
"{",
"foreach",
"(",
"$",
"this",
"->",
"routes",
"as",
"$",
"route",
")",
"{",
"// Matched route will return new route instance with matched parameter... | Find route matched for given request.
@param ServerRequestInterface $request
@return null|RouteInterface | [
"Find",
"route",
"matched",
"for",
"given",
"request",
"."
] | 35721d06231d5650402eb93ac7f3ade00cd1b640 | https://github.com/spiral/router/blob/35721d06231d5650402eb93ac7f3ade00cd1b640/src/Router.php#L142-L159 |
28,792 | spiral/router | src/Router.php | Router.configure | protected function configure(RouteInterface $route): RouteInterface
{
if ($route instanceof ContainerizedInterface && !$route->hasContainer()) {
// isolating route in a given container
$route = $route->withContainer($this->container);
}
return $route->withPrefix($thi... | php | protected function configure(RouteInterface $route): RouteInterface
{
if ($route instanceof ContainerizedInterface && !$route->hasContainer()) {
// isolating route in a given container
$route = $route->withContainer($this->container);
}
return $route->withPrefix($thi... | [
"protected",
"function",
"configure",
"(",
"RouteInterface",
"$",
"route",
")",
":",
"RouteInterface",
"{",
"if",
"(",
"$",
"route",
"instanceof",
"ContainerizedInterface",
"&&",
"!",
"$",
"route",
"->",
"hasContainer",
"(",
")",
")",
"{",
"// isolating route in... | Configure route with needed dependencies.
@param RouteInterface $route
@return RouteInterface | [
"Configure",
"route",
"with",
"needed",
"dependencies",
"."
] | 35721d06231d5650402eb93ac7f3ade00cd1b640 | https://github.com/spiral/router/blob/35721d06231d5650402eb93ac7f3ade00cd1b640/src/Router.php#L168-L176 |
28,793 | spiral/router | src/CoreHandler.php | CoreHandler.withVerbActions | public function withVerbActions(bool $verbActions): CoreHandler
{
$handler = clone $this;
$handler->verbActions = $verbActions;
return $handler;
} | php | public function withVerbActions(bool $verbActions): CoreHandler
{
$handler = clone $this;
$handler->verbActions = $verbActions;
return $handler;
} | [
"public",
"function",
"withVerbActions",
"(",
"bool",
"$",
"verbActions",
")",
":",
"CoreHandler",
"{",
"$",
"handler",
"=",
"clone",
"$",
"this",
";",
"$",
"handler",
"->",
"verbActions",
"=",
"$",
"verbActions",
";",
"return",
"$",
"handler",
";",
"}"
] | Disable or enable HTTP prefix for actions.
@param bool $verbActions
@return CoreHandler | [
"Disable",
"or",
"enable",
"HTTP",
"prefix",
"for",
"actions",
"."
] | 35721d06231d5650402eb93ac7f3ade00cd1b640 | https://github.com/spiral/router/blob/35721d06231d5650402eb93ac7f3ade00cd1b640/src/CoreHandler.php#L79-L85 |
28,794 | spiral/router | src/CoreHandler.php | CoreHandler.wrapResponse | private function wrapResponse(Response $response, $result = null, string $output = ''): Response
{
if ($result instanceof Response) {
if (!empty($output) && $result->getBody()->isWritable()) {
$result->getBody()->write($output);
}
return $result;
... | php | private function wrapResponse(Response $response, $result = null, string $output = ''): Response
{
if ($result instanceof Response) {
if (!empty($output) && $result->getBody()->isWritable()) {
$result->getBody()->write($output);
}
return $result;
... | [
"private",
"function",
"wrapResponse",
"(",
"Response",
"$",
"response",
",",
"$",
"result",
"=",
"null",
",",
"string",
"$",
"output",
"=",
"''",
")",
":",
"Response",
"{",
"if",
"(",
"$",
"result",
"instanceof",
"Response",
")",
"{",
"if",
"(",
"!",
... | Convert endpoint result into valid response.
@param Response $response Initial pipeline response.
@param mixed $result Generated endpoint output.
@param string $output Buffer output.
@return Response | [
"Convert",
"endpoint",
"result",
"into",
"valid",
"response",
"."
] | 35721d06231d5650402eb93ac7f3ade00cd1b640 | https://github.com/spiral/router/blob/35721d06231d5650402eb93ac7f3ade00cd1b640/src/CoreHandler.php#L149-L169 |
28,795 | spiral/router | src/CoreHandler.php | CoreHandler.mapException | private function mapException(ControllerException $exception): ClientException
{
switch ($exception->getCode()) {
case ControllerException::BAD_ACTION:
//no break
case ControllerException::NOT_FOUND:
return new NotFoundException($exception->getMessage(... | php | private function mapException(ControllerException $exception): ClientException
{
switch ($exception->getCode()) {
case ControllerException::BAD_ACTION:
//no break
case ControllerException::NOT_FOUND:
return new NotFoundException($exception->getMessage(... | [
"private",
"function",
"mapException",
"(",
"ControllerException",
"$",
"exception",
")",
":",
"ClientException",
"{",
"switch",
"(",
"$",
"exception",
"->",
"getCode",
"(",
")",
")",
"{",
"case",
"ControllerException",
"::",
"BAD_ACTION",
":",
"//no break",
"ca... | Converts core specific ControllerException into HTTP ClientException.
@param ControllerException $exception
@return ClientException | [
"Converts",
"core",
"specific",
"ControllerException",
"into",
"HTTP",
"ClientException",
"."
] | 35721d06231d5650402eb93ac7f3ade00cd1b640 | https://github.com/spiral/router/blob/35721d06231d5650402eb93ac7f3ade00cd1b640/src/CoreHandler.php#L177-L189 |
28,796 | Atnic/laravel-generator | app/Database/Eloquent/Concerns/HasRelationships.php | HasRelationships.belongsToOne | public function belongsToOne($related, $table = null, $foreignPivotKey = null, $relatedPivotKey = null,
$parentKey = null, $relatedKey = null, $relation = null)
{
// If no relationship name was passed, we will pull backtraces to get the
// name of the calling functi... | php | public function belongsToOne($related, $table = null, $foreignPivotKey = null, $relatedPivotKey = null,
$parentKey = null, $relatedKey = null, $relation = null)
{
// If no relationship name was passed, we will pull backtraces to get the
// name of the calling functi... | [
"public",
"function",
"belongsToOne",
"(",
"$",
"related",
",",
"$",
"table",
"=",
"null",
",",
"$",
"foreignPivotKey",
"=",
"null",
",",
"$",
"relatedPivotKey",
"=",
"null",
",",
"$",
"parentKey",
"=",
"null",
",",
"$",
"relatedKey",
"=",
"null",
",",
... | Define a one-to-one via pivot relationship.
@param string $related
@param string $table
@param string $foreignPivotKey
@param string $relatedPivotKey
@param string $parentKey
@param string $relatedKey
@param string $relation
@return \Atnic\LaravelGenerator\Database\Eloquent\Relations\BelongsToOne | [
"Define",
"a",
"one",
"-",
"to",
"-",
"one",
"via",
"pivot",
"relationship",
"."
] | 7bf53837a61af566b389255784dbbf1789020018 | https://github.com/Atnic/laravel-generator/blob/7bf53837a61af566b389255784dbbf1789020018/app/Database/Eloquent/Concerns/HasRelationships.php#L88-L119 |
28,797 | alaxos/cakephp3-libs | src/Lib/ShellTool.php | ShellTool.color | public static function color($text, $color)
{
if (isset(ShellTool::$colors[$color])) {
return ShellTool::$colors[$color]['start'] . $text . ShellTool::$colors[$color]['close'];
} else {
return $text;
}
} | php | public static function color($text, $color)
{
if (isset(ShellTool::$colors[$color])) {
return ShellTool::$colors[$color]['start'] . $text . ShellTool::$colors[$color]['close'];
} else {
return $text;
}
} | [
"public",
"static",
"function",
"color",
"(",
"$",
"text",
",",
"$",
"color",
")",
"{",
"if",
"(",
"isset",
"(",
"ShellTool",
"::",
"$",
"colors",
"[",
"$",
"color",
"]",
")",
")",
"{",
"return",
"ShellTool",
"::",
"$",
"colors",
"[",
"$",
"color",... | Return the given text formatted in the given color
@param string $text
@param string $color
@return string | [
"Return",
"the",
"given",
"text",
"formatted",
"in",
"the",
"given",
"color"
] | 685e9f17a3fbe3550c59a03a65c4d75df763e804 | https://github.com/alaxos/cakephp3-libs/blob/685e9f17a3fbe3550c59a03a65c4d75df763e804/src/Lib/ShellTool.php#L17-L24 |
28,798 | nilportugues/php-api-transformer | src/Transformer/Helpers/RecursiveDeleteHelper.php | RecursiveDeleteHelper.deleteProperties | public static function deleteProperties(array &$mappings, array &$array, string $typeKey)
{
if (\array_key_exists(Serializer::CLASS_IDENTIFIER_KEY, $array)) {
$newArray = [];
self::deleteMatchedClassProperties($mappings, $array, $typeKey, $newArray);
if (!empty($newArra... | php | public static function deleteProperties(array &$mappings, array &$array, string $typeKey)
{
if (\array_key_exists(Serializer::CLASS_IDENTIFIER_KEY, $array)) {
$newArray = [];
self::deleteMatchedClassProperties($mappings, $array, $typeKey, $newArray);
if (!empty($newArra... | [
"public",
"static",
"function",
"deleteProperties",
"(",
"array",
"&",
"$",
"mappings",
",",
"array",
"&",
"$",
"array",
",",
"string",
"$",
"typeKey",
")",
"{",
"if",
"(",
"\\",
"array_key_exists",
"(",
"Serializer",
"::",
"CLASS_IDENTIFIER_KEY",
",",
"$",
... | Removes a sets if keys for a given class using recursion.
@param \NilPortugues\Api\Mapping\Mapping[] $mappings
@param array $array Array with data
@param string $typeKey Scope to do the replacement. | [
"Removes",
"a",
"sets",
"if",
"keys",
"for",
"a",
"given",
"class",
"using",
"recursion",
"."
] | a9f20fbe1580d98e3d462a0ebe13fb7595cbd683 | https://github.com/nilportugues/php-api-transformer/blob/a9f20fbe1580d98e3d462a0ebe13fb7595cbd683/src/Transformer/Helpers/RecursiveDeleteHelper.php#L79-L90 |
28,799 | cedx/coveralls.php | lib/GitCommit.php | GitCommit.fromJson | static function fromJson(object $map): self {
return (new static(isset($map->id) && is_string($map->id) ? $map->id : '', isset($map->message) && is_string($map->message) ? $map->message : ''))
->setAuthorEmail(isset($map->author_email) && is_string($map->author_email) ? $map->author_email : '')
->setAut... | php | static function fromJson(object $map): self {
return (new static(isset($map->id) && is_string($map->id) ? $map->id : '', isset($map->message) && is_string($map->message) ? $map->message : ''))
->setAuthorEmail(isset($map->author_email) && is_string($map->author_email) ? $map->author_email : '')
->setAut... | [
"static",
"function",
"fromJson",
"(",
"object",
"$",
"map",
")",
":",
"self",
"{",
"return",
"(",
"new",
"static",
"(",
"isset",
"(",
"$",
"map",
"->",
"id",
")",
"&&",
"is_string",
"(",
"$",
"map",
"->",
"id",
")",
"?",
"$",
"map",
"->",
"id",
... | Creates a new Git commit from the specified JSON map.
@param object $map A JSON map representing a Git commit.
@return static The instance corresponding to the specified JSON map. | [
"Creates",
"a",
"new",
"Git",
"commit",
"from",
"the",
"specified",
"JSON",
"map",
"."
] | c196de0f92e06d5143ba90ebab18c8e384316cc0 | https://github.com/cedx/coveralls.php/blob/c196de0f92e06d5143ba90ebab18c8e384316cc0/lib/GitCommit.php#L40-L46 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.