repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
fetus-hina/docomo-dialogue | src/UserInformation.php | UserInformation.setBirthdateY | public function setBirthdateY($value)
{
if ($value === null) {
$this->parameters['birthdateY'] = null;
} else {
$datetime = new \DateTime('now');
$max = (int)$datetime->format('Y');
validators\Number::validate($value, 1, $max, 'Invalid birthdateY');
... | php | public function setBirthdateY($value)
{
if ($value === null) {
$this->parameters['birthdateY'] = null;
} else {
$datetime = new \DateTime('now');
$max = (int)$datetime->format('Y');
validators\Number::validate($value, 1, $max, 'Invalid birthdateY');
... | [
"public",
"function",
"setBirthdateY",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"parameters",
"[",
"'birthdateY'",
"]",
"=",
"null",
";",
"}",
"else",
"{",
"$",
"datetime",
"=",
"new",
"\\",
... | ユーザの生年月日(年)を設定する
@param int $value ユーザの生年月日(年)
@return self
@throws DomainError | [
"ユーザの生年月日",
"(",
"年",
")",
"を設定する"
] | train | https://github.com/fetus-hina/docomo-dialogue/blob/cf985fdc93c09f93181081038eccd1d2dbb3f08c/src/UserInformation.php#L377-L388 |
fetus-hina/docomo-dialogue | src/UserInformation.php | UserInformation.setBirthdateM | public function setBirthdateM($value)
{
if ($value === null) {
$this->parameters['birthdateM'] = null;
} else {
validators\Number::validate($value, 1, 12, 'Invalid birthdateM');
$this->parameters['birthdateM'] = min(12, max(1, (int)$value));
}
retu... | php | public function setBirthdateM($value)
{
if ($value === null) {
$this->parameters['birthdateM'] = null;
} else {
validators\Number::validate($value, 1, 12, 'Invalid birthdateM');
$this->parameters['birthdateM'] = min(12, max(1, (int)$value));
}
retu... | [
"public",
"function",
"setBirthdateM",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"parameters",
"[",
"'birthdateM'",
"]",
"=",
"null",
";",
"}",
"else",
"{",
"validators",
"\\",
"Number",
"::",
"... | ユーザの生年月日(月)を設定する
@param int $value ユーザの生年月日(月)
@return self
@throws DomainError | [
"ユーザの生年月日",
"(",
"月",
")",
"を設定する"
] | train | https://github.com/fetus-hina/docomo-dialogue/blob/cf985fdc93c09f93181081038eccd1d2dbb3f08c/src/UserInformation.php#L397-L406 |
fetus-hina/docomo-dialogue | src/UserInformation.php | UserInformation.setAge | public function setAge($value)
{
if ($value === null) {
$this->parameters['age'] = null;
} else {
validators\Number::validate($value, 0, null, 'Invalid age');
$this->parameters['age'] = max(0, (int)$value);
}
return $this;
} | php | public function setAge($value)
{
if ($value === null) {
$this->parameters['age'] = null;
} else {
validators\Number::validate($value, 0, null, 'Invalid age');
$this->parameters['age'] = max(0, (int)$value);
}
return $this;
} | [
"public",
"function",
"setAge",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"parameters",
"[",
"'age'",
"]",
"=",
"null",
";",
"}",
"else",
"{",
"validators",
"\\",
"Number",
"::",
"validate",
"... | ユーザの年齢を設定する
@param int $value ユーザの年齢
@return self
@throws DomainError | [
"ユーザの年齢を設定する"
] | train | https://github.com/fetus-hina/docomo-dialogue/blob/cf985fdc93c09f93181081038eccd1d2dbb3f08c/src/UserInformation.php#L433-L442 |
fetus-hina/docomo-dialogue | src/UserInformation.php | UserInformation.setConstellations | public function setConstellations($value)
{
if ($value !== null && !in_array($value, [
self::CONSTELLATION_ARIES,
self::CONSTELLATION_TAURUS,
self::CONSTELLATION_GEMINI,
self::CONSTELLATION_CANCER,
self::CONSTELLATION_LEO,
... | php | public function setConstellations($value)
{
if ($value !== null && !in_array($value, [
self::CONSTELLATION_ARIES,
self::CONSTELLATION_TAURUS,
self::CONSTELLATION_GEMINI,
self::CONSTELLATION_CANCER,
self::CONSTELLATION_LEO,
... | [
"public",
"function",
"setConstellations",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"!==",
"null",
"&&",
"!",
"in_array",
"(",
"$",
"value",
",",
"[",
"self",
"::",
"CONSTELLATION_ARIES",
",",
"self",
"::",
"CONSTELLATION_TAURUS",
",",
"self",... | ユーザの星座を設定する
@param string $value ユーザの星座 CONSTELLATION_*
@return self
@throws DomainError | [
"ユーザの星座を設定する"
] | train | https://github.com/fetus-hina/docomo-dialogue/blob/cf985fdc93c09f93181081038eccd1d2dbb3f08c/src/UserInformation.php#L451-L472 |
fetus-hina/docomo-dialogue | src/UserInformation.php | UserInformation.setPlace | public function setPlace($value)
{
if ($value !== null &&
!in_array($value, self::$validPlaces, true)) {
throw new DomainError('Invalid place');
}
$this->parameters['place'] = $value;
return $this;
} | php | public function setPlace($value)
{
if ($value !== null &&
!in_array($value, self::$validPlaces, true)) {
throw new DomainError('Invalid place');
}
$this->parameters['place'] = $value;
return $this;
} | [
"public",
"function",
"setPlace",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"!==",
"null",
"&&",
"!",
"in_array",
"(",
"$",
"value",
",",
"self",
"::",
"$",
"validPlaces",
",",
"true",
")",
")",
"{",
"throw",
"new",
"DomainError",
"(",
... | ユーザの場所を設定する
@param string $value ユーザの場所 one of $validPlaces
@return self
@throws DomainError | [
"ユーザの場所を設定する"
] | train | https://github.com/fetus-hina/docomo-dialogue/blob/cf985fdc93c09f93181081038eccd1d2dbb3f08c/src/UserInformation.php#L481-L489 |
fetus-hina/docomo-dialogue | src/UserInformation.php | UserInformation.makeParameter | public function makeParameter()
{
$ret = [];
foreach ($this->parameters as $k => $v) {
if ($v !== null) {
$ret[$k] = $v;
}
}
return $ret;
} | php | public function makeParameter()
{
$ret = [];
foreach ($this->parameters as $k => $v) {
if ($v !== null) {
$ret[$k] = $v;
}
}
return $ret;
} | [
"public",
"function",
"makeParameter",
"(",
")",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"parameters",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"v",
"!==",
"null",
")",
"{",
"$",
"ret",
"[",
"$... | 送信用のパラメータ配列を作成して取得する
@return array | [
"送信用のパラメータ配列を作成して取得する"
] | train | https://github.com/fetus-hina/docomo-dialogue/blob/cf985fdc93c09f93181081038eccd1d2dbb3f08c/src/UserInformation.php#L496-L505 |
assely/fielder | src/Field/Radios.php | Radios.assets | public function assets(AssetFactory $asset)
{
$asset->add('fielder-radios-styles', [
'path' => FIELDER_URI.'public/css/radios.css',
])->area('admin');
$asset->add('fielder-radios', [
'path' => FIELDER_URI.'public/js/radios.js',
'dependences' => ['fielder'... | php | public function assets(AssetFactory $asset)
{
$asset->add('fielder-radios-styles', [
'path' => FIELDER_URI.'public/css/radios.css',
])->area('admin');
$asset->add('fielder-radios', [
'path' => FIELDER_URI.'public/js/radios.js',
'dependences' => ['fielder'... | [
"public",
"function",
"assets",
"(",
"AssetFactory",
"$",
"asset",
")",
"{",
"$",
"asset",
"->",
"add",
"(",
"'fielder-radios-styles'",
",",
"[",
"'path'",
"=>",
"FIELDER_URI",
".",
"'public/css/radios.css'",
",",
"]",
")",
"->",
"area",
"(",
"'admin'",
")",... | Add field assets.
@param \Assely\Asset\AssetFactory $asset
@return void | [
"Add",
"field",
"assets",
"."
] | train | https://github.com/assely/fielder/blob/c702ef2426522d1a0a9ca9945547513a7788fcdc/src/Field/Radios.php#L51-L61 |
PandaPlatform/framework | src/Panda/Localization/Processors/AbstractProcessor.php | AbstractProcessor.get | public function get($key, $locale, $package = 'default', $default = null)
{
// Check key
if (empty($key)) {
return $default;
}
// Normalize group and load translations
$package = ($package ?: 'default');
try {
$this->loadTranslations($locale,... | php | public function get($key, $locale, $package = 'default', $default = null)
{
// Check key
if (empty($key)) {
return $default;
}
// Normalize group and load translations
$package = ($package ?: 'default');
try {
$this->loadTranslations($locale,... | [
"public",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"locale",
",",
"$",
"package",
"=",
"'default'",
",",
"$",
"default",
"=",
"null",
")",
"{",
"// Check key",
"if",
"(",
"empty",
"(",
"$",
"key",
")",
")",
"{",
"return",
"$",
"default",
";",
... | Get a translation value.
If the default value is null and no translation is found, it throws Exception.
@param string $key
@param string $locale
@param string $package
@param mixed $default
@return mixed | [
"Get",
"a",
"translation",
"value",
".",
"If",
"the",
"default",
"value",
"is",
"null",
"and",
"no",
"translation",
"is",
"found",
"it",
"throws",
"Exception",
"."
] | train | https://github.com/PandaPlatform/framework/blob/a78cf051b379896b5a4d5df620988e37a0e632f5/src/Panda/Localization/Processors/AbstractProcessor.php#L82-L104 |
dekalee/cdn77 | src/Cdn77/Query/ResourceLogQuery.php | ResourceLogQuery.execute | public function execute($resource = null)
{
$this->populateCDNResources();
foreach ($this->cdnResources as $cdnResource) {
if (false !== strpos($cdnResource['cname'], $resource)) {
$url = sprintf($this->url . '?login=%s&passwd=%s&cdn_id=%d&period=4&http_status[]=cached&h... | php | public function execute($resource = null)
{
$this->populateCDNResources();
foreach ($this->cdnResources as $cdnResource) {
if (false !== strpos($cdnResource['cname'], $resource)) {
$url = sprintf($this->url . '?login=%s&passwd=%s&cdn_id=%d&period=4&http_status[]=cached&h... | [
"public",
"function",
"execute",
"(",
"$",
"resource",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"populateCDNResources",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"cdnResources",
"as",
"$",
"cdnResource",
")",
"{",
"if",
"(",
"false",
"!==",
"s... | @param string|null $resource
@return array | [
"@param",
"string|null",
"$resource"
] | train | https://github.com/dekalee/cdn77/blob/71d1771e047cf2fbd273018f6f35d44b87c53b24/src/Cdn77/Query/ResourceLogQuery.php#L17-L38 |
ageras-com/laravel-onesky | src/ServiceProvider.php | ServiceProvider.loadConfiguration | protected function loadConfiguration()
{
$configPath = __DIR__ . '/../config/onesky.php';
$this->publishes([
$configPath => config_path('onesky.php'),
], 'config');
$this->mergeConfigFrom($configPath, 'onesky');
} | php | protected function loadConfiguration()
{
$configPath = __DIR__ . '/../config/onesky.php';
$this->publishes([
$configPath => config_path('onesky.php'),
], 'config');
$this->mergeConfigFrom($configPath, 'onesky');
} | [
"protected",
"function",
"loadConfiguration",
"(",
")",
"{",
"$",
"configPath",
"=",
"__DIR__",
".",
"'/../config/onesky.php'",
";",
"$",
"this",
"->",
"publishes",
"(",
"[",
"$",
"configPath",
"=>",
"config_path",
"(",
"'onesky.php'",
")",
",",
"]",
",",
"'... | Load the configuration files and allow them to be published.
@return void | [
"Load",
"the",
"configuration",
"files",
"and",
"allow",
"them",
"to",
"be",
"published",
"."
] | train | https://github.com/ageras-com/laravel-onesky/blob/ec7cda129684559e465978db3fef51b52e4ead20/src/ServiceProvider.php#L60-L69 |
astronati/php-fantasy-football-quotations-parser | src/Map/Row/Normalizer/Field/RowFieldNormalizerFactory.php | RowFieldNormalizerFactory.create | public static function create($field): RowFieldNormalizerInterface
{
switch ($field) {
case Quotation::ACTIVE:
return new ActiveNormalizer();
case Quotation::ASSISTS_MAGIC_POINTS:
return new AssistsMagicPointsNormalizer();
case Quotation::A... | php | public static function create($field): RowFieldNormalizerInterface
{
switch ($field) {
case Quotation::ACTIVE:
return new ActiveNormalizer();
case Quotation::ASSISTS_MAGIC_POINTS:
return new AssistsMagicPointsNormalizer();
case Quotation::A... | [
"public",
"static",
"function",
"create",
"(",
"$",
"field",
")",
":",
"RowFieldNormalizerInterface",
"{",
"switch",
"(",
"$",
"field",
")",
"{",
"case",
"Quotation",
"::",
"ACTIVE",
":",
"return",
"new",
"ActiveNormalizer",
"(",
")",
";",
"case",
"Quotation... | Returns an implementation of RowFieldNormalizerInterface
@param string $field
@return RowFieldNormalizerInterface
@throws NotFoundFieldException | [
"Returns",
"an",
"implementation",
"of",
"RowFieldNormalizerInterface"
] | train | https://github.com/astronati/php-fantasy-football-quotations-parser/blob/1214f313c325ac7e9fc4d5218b85b3d7234f7bf3/src/Map/Row/Normalizer/Field/RowFieldNormalizerFactory.php#L41-L91 |
serverdensity/sd-php-wrapper | lib/serverdensity/Api/Metrics.php | Metrics.available | public function available($id, $start, $end){
$param = array(
'start' => date("Y-m-d\TH:i:s\Z", $start),
'end' => date("Y-m-d\TH:i:s\Z", $end)
);
return $this->get('metrics/definitions/'.urlencode($id), $param);
} | php | public function available($id, $start, $end){
$param = array(
'start' => date("Y-m-d\TH:i:s\Z", $start),
'end' => date("Y-m-d\TH:i:s\Z", $end)
);
return $this->get('metrics/definitions/'.urlencode($id), $param);
} | [
"public",
"function",
"available",
"(",
"$",
"id",
",",
"$",
"start",
",",
"$",
"end",
")",
"{",
"$",
"param",
"=",
"array",
"(",
"'start'",
"=>",
"date",
"(",
"\"Y-m-d\\TH:i:s\\Z\"",
",",
"$",
"start",
")",
",",
"'end'",
"=>",
"date",
"(",
"\"Y-m-d\... | Get available metrics
@link https://developer.serverdensity.com/docs/available-metrics
@param string $id the subjectID to get available metrics
@param timestamp $start the start of the period.
@param timestamp $end the end of the period
@return an array that is all available metrics. | [
"Get",
"available",
"metrics"
] | train | https://github.com/serverdensity/sd-php-wrapper/blob/9c742a9ee61e32a9bc4ed17b5fe0eca1f4c3015e/lib/serverdensity/Api/Metrics.php#L17-L24 |
serverdensity/sd-php-wrapper | lib/serverdensity/Api/Metrics.php | Metrics.metrics | public function metrics($id, $filter, $start, $end){
$param = array(
'start' => date("Y-m-d\TH:i:s\Z", $start),
'end' => date("Y-m-d\TH:i:s\Z", $end),
'filter' => $filter
);
$param = $this->makeJsonReady($param);
return $this->get('metrics/graphs/'.u... | php | public function metrics($id, $filter, $start, $end){
$param = array(
'start' => date("Y-m-d\TH:i:s\Z", $start),
'end' => date("Y-m-d\TH:i:s\Z", $end),
'filter' => $filter
);
$param = $this->makeJsonReady($param);
return $this->get('metrics/graphs/'.u... | [
"public",
"function",
"metrics",
"(",
"$",
"id",
",",
"$",
"filter",
",",
"$",
"start",
",",
"$",
"end",
")",
"{",
"$",
"param",
"=",
"array",
"(",
"'start'",
"=>",
"date",
"(",
"\"Y-m-d\\TH:i:s\\Z\"",
",",
"$",
"start",
")",
",",
"'end'",
"=>",
"d... | Get actual metrics
@link https://developer.serverdensity.com/docs/get-metrics
@param string $id the subjectID to get available metrics
@param array $filter an array of what you want to filter
@param timestamp $start the start of the period.
@param timestamp $end the end of the per... | [
"Get",
"actual",
"metrics"
] | train | https://github.com/serverdensity/sd-php-wrapper/blob/9c742a9ee61e32a9bc4ed17b5fe0eca1f4c3015e/lib/serverdensity/Api/Metrics.php#L36-L46 |
serverdensity/sd-php-wrapper | lib/serverdensity/Api/Metrics.php | Metrics.dynamicMetrics | public function dynamicMetrics($filter, $start, $end, $inventoryFilter=Null){
$urlencoded = '';
$query = array();
if (isset($inventoryFilter)){
$query['inventoryFilter'] = $inventoryFilter;
}
if (!empty($query)){
$urlencoded = '?' . http_build_query($query... | php | public function dynamicMetrics($filter, $start, $end, $inventoryFilter=Null){
$urlencoded = '';
$query = array();
if (isset($inventoryFilter)){
$query['inventoryFilter'] = $inventoryFilter;
}
if (!empty($query)){
$urlencoded = '?' . http_build_query($query... | [
"public",
"function",
"dynamicMetrics",
"(",
"$",
"filter",
",",
"$",
"start",
",",
"$",
"end",
",",
"$",
"inventoryFilter",
"=",
"Null",
")",
"{",
"$",
"urlencoded",
"=",
"''",
";",
"$",
"query",
"=",
"array",
"(",
")",
";",
"if",
"(",
"isset",
"(... | Get dynamic metrics
@link https://developer.serverdensity.com/docs/dynamic-metrics
@param array $filter an array of what you want to filter
@param timestamp $start the start of the period.
@param timestamp $end the end of the period
@param string $inventoryFilter the filter to use to ... | [
"Get",
"dynamic",
"metrics"
] | train | https://github.com/serverdensity/sd-php-wrapper/blob/9c742a9ee61e32a9bc4ed17b5fe0eca1f4c3015e/lib/serverdensity/Api/Metrics.php#L59-L78 |
Im0rtality/Underscore | src/Underscore.php | Underscore.executePayload | protected function executePayload($payload, $args)
{
array_unshift($args, $this->wrapped);
if ($payload instanceof Mutator) {
/** @var $payload callable */
$this->wrapped = call_user_func_array($payload, $args);
return $this;
} else {
return ... | php | protected function executePayload($payload, $args)
{
array_unshift($args, $this->wrapped);
if ($payload instanceof Mutator) {
/** @var $payload callable */
$this->wrapped = call_user_func_array($payload, $args);
return $this;
} else {
return ... | [
"protected",
"function",
"executePayload",
"(",
"$",
"payload",
",",
"$",
"args",
")",
"{",
"array_unshift",
"(",
"$",
"args",
",",
"$",
"this",
"->",
"wrapped",
")",
";",
"if",
"(",
"$",
"payload",
"instanceof",
"Mutator",
")",
"{",
"/** @var $payload cal... | Payload is either Mutator or Accessor. Both are supposed to be callable.
@param callable $payload
@param array $args
@return $this|mixed | [
"Payload",
"is",
"either",
"Mutator",
"or",
"Accessor",
".",
"Both",
"are",
"supposed",
"to",
"be",
"callable",
"."
] | train | https://github.com/Im0rtality/Underscore/blob/2deb95cfd340761d00ecd0f033e67ce600f2b535/src/Underscore.php#L145-L157 |
activecollab/user | src/UserInterface/UserIsImplementation.php | UserIsImplementation.is | public function is($object)
{
if ($object instanceof UserInterface) {
return $this->getId() && $this->getId() === $object->getId();
}
return false;
} | php | public function is($object)
{
if ($object instanceof UserInterface) {
return $this->getId() && $this->getId() === $object->getId();
}
return false;
} | [
"public",
"function",
"is",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"$",
"object",
"instanceof",
"UserInterface",
")",
"{",
"return",
"$",
"this",
"->",
"getId",
"(",
")",
"&&",
"$",
"this",
"->",
"getId",
"(",
")",
"===",
"$",
"object",
"->",
"ge... | {@inheritdoc} | [
"{"
] | train | https://github.com/activecollab/user/blob/f54b858eb9016fbca32090e624eccb0354e93d8f/src/UserInterface/UserIsImplementation.php#L21-L28 |
TFHInc/ci-realredis | src/Traits/SupportRedis.php | SupportRedis.getElseSet | public function getElseSet(string $key, int $ttl, callable $callable)
{
if ($this->exists($key)) {
return $this->get($key);
}
try {
$callable_data = call_user_func($callable);
} catch( Exception $e ) {
// throw exception
}
$this->... | php | public function getElseSet(string $key, int $ttl, callable $callable)
{
if ($this->exists($key)) {
return $this->get($key);
}
try {
$callable_data = call_user_func($callable);
} catch( Exception $e ) {
// throw exception
}
$this->... | [
"public",
"function",
"getElseSet",
"(",
"string",
"$",
"key",
",",
"int",
"$",
"ttl",
",",
"callable",
"$",
"callable",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"exists",
"(",
"$",
"key",
")",
")",
"{",
"return",
"$",
"this",
"->",
"get",
"(",
"$... | Get the cache key. If it does not exist, execute the callable and set the cache key.
@param string $key
@param int $ttl
@param callable $callable
@return mixed | [
"Get",
"the",
"cache",
"key",
".",
"If",
"it",
"does",
"not",
"exist",
"execute",
"the",
"callable",
"and",
"set",
"the",
"cache",
"key",
"."
] | train | https://github.com/TFHInc/ci-realredis/blob/23b11fb65445a0e3704084788677fe229cf255e6/src/Traits/SupportRedis.php#L22-L38 |
assely/fielder | src/Field/Colorpicker.php | Colorpicker.assets | public function assets(AssetFactory $asset)
{
$asset->load('jquery', [
'type' => 'script',
])->area('admin');
$asset->load('wp-color-picker', [
'type' => 'style',
])->area('admin');
$asset->add('fielder-colorpicker-styles', [
'path' => FI... | php | public function assets(AssetFactory $asset)
{
$asset->load('jquery', [
'type' => 'script',
])->area('admin');
$asset->load('wp-color-picker', [
'type' => 'style',
])->area('admin');
$asset->add('fielder-colorpicker-styles', [
'path' => FI... | [
"public",
"function",
"assets",
"(",
"AssetFactory",
"$",
"asset",
")",
"{",
"$",
"asset",
"->",
"load",
"(",
"'jquery'",
",",
"[",
"'type'",
"=>",
"'script'",
",",
"]",
")",
"->",
"area",
"(",
"'admin'",
")",
";",
"$",
"asset",
"->",
"load",
"(",
... | Add field assets.
@param \Assely\Asset\AssetFactory $asset
@return void | [
"Add",
"field",
"assets",
"."
] | train | https://github.com/assely/fielder/blob/c702ef2426522d1a0a9ca9945547513a7788fcdc/src/Field/Colorpicker.php#L52-L70 |
serverdensity/sd-php-wrapper | lib/serverdensity/HttpClient/HttpClient.php | HttpClient.request | public function request($path, $body = null, $httpMethod = 'GET', array $headers = array(), array $options = array())
{
if(!empty($body)){
$options = array_merge($options, ['body' => $body]);
}
if(!empty($headers)){
$options = array_merge($options, ['headers' => $hea... | php | public function request($path, $body = null, $httpMethod = 'GET', array $headers = array(), array $options = array())
{
if(!empty($body)){
$options = array_merge($options, ['body' => $body]);
}
if(!empty($headers)){
$options = array_merge($options, ['headers' => $hea... | [
"public",
"function",
"request",
"(",
"$",
"path",
",",
"$",
"body",
"=",
"null",
",",
"$",
"httpMethod",
"=",
"'GET'",
",",
"array",
"$",
"headers",
"=",
"array",
"(",
")",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(... | {@inheritDoc} | [
"{"
] | train | https://github.com/serverdensity/sd-php-wrapper/blob/9c742a9ee61e32a9bc4ed17b5fe0eca1f4c3015e/lib/serverdensity/HttpClient/HttpClient.php#L147-L166 |
serverdensity/sd-php-wrapper | lib/serverdensity/HttpClient/HttpClient.php | HttpClient.authenticate | public function authenticate($token, $method)
{
$this->client->getEmitter()->on(
'before', function (BeforeEvent $event) use ($token, $method){
$auth = new AuthListener($token, $method);
$auth->onRequestBeforeSend($event);
});
} | php | public function authenticate($token, $method)
{
$this->client->getEmitter()->on(
'before', function (BeforeEvent $event) use ($token, $method){
$auth = new AuthListener($token, $method);
$auth->onRequestBeforeSend($event);
});
} | [
"public",
"function",
"authenticate",
"(",
"$",
"token",
",",
"$",
"method",
")",
"{",
"$",
"this",
"->",
"client",
"->",
"getEmitter",
"(",
")",
"->",
"on",
"(",
"'before'",
",",
"function",
"(",
"BeforeEvent",
"$",
"event",
")",
"use",
"(",
"$",
"t... | {@inheritDoc} | [
"{"
] | train | https://github.com/serverdensity/sd-php-wrapper/blob/9c742a9ee61e32a9bc4ed17b5fe0eca1f4c3015e/lib/serverdensity/HttpClient/HttpClient.php#L171-L178 |
ipunkt/social-auth | src/Ipunkt/SocialAuth/Repositories/EloquentUserRepository.php | EloquentUserRepository.findByAuth | public function findByAuth($provider, $identifier) {
$user = null;
$login = $this->repository->findByAuth($provider, $identifier);
if($login !== null)
$user = $login->getUser();
return $user;
} | php | public function findByAuth($provider, $identifier) {
$user = null;
$login = $this->repository->findByAuth($provider, $identifier);
if($login !== null)
$user = $login->getUser();
return $user;
} | [
"public",
"function",
"findByAuth",
"(",
"$",
"provider",
",",
"$",
"identifier",
")",
"{",
"$",
"user",
"=",
"null",
";",
"$",
"login",
"=",
"$",
"this",
"->",
"repository",
"->",
"findByAuth",
"(",
"$",
"provider",
",",
"$",
"identifier",
")",
";",
... | Attempt to find a UserInterface by given login credentials
returns the UserInterface or null on error
@param array $credentials
@return null|User | [
"Attempt",
"to",
"find",
"a",
"UserInterface",
"by",
"given",
"login",
"credentials",
"returns",
"the",
"UserInterface",
"or",
"null",
"on",
"error"
] | train | https://github.com/ipunkt/social-auth/blob/28723a8e449612789a2cd7d21137996c48b62229/src/Ipunkt/SocialAuth/Repositories/EloquentUserRepository.php#L54-L63 |
wpup/digster | src/class-digster.php | Digster.instance | public static function instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new self;
self::$instance->boot();
self::$instance->setup_actions();
}
return self::$instance;
} | php | public static function instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new self;
self::$instance->boot();
self::$instance->setup_actions();
}
return self::$instance;
} | [
"public",
"static",
"function",
"instance",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"instance",
")",
")",
"{",
"self",
"::",
"$",
"instance",
"=",
"new",
"self",
";",
"self",
"::",
"$",
"instance",
"->",
"boot",
"(",
")",
... | Get Plugin boilerplate loader instance.
@return object | [
"Get",
"Plugin",
"boilerplate",
"loader",
"instance",
"."
] | train | https://github.com/wpup/digster/blob/9ef9626ce82673af698bc0976d6c38a532e4a6d9/src/class-digster.php#L28-L36 |
wpup/digster | src/class-digster.php | Digster.config | public static function config( $key, $value = null ) {
return self::factory()->engine()->config( $key, $value );
} | php | public static function config( $key, $value = null ) {
return self::factory()->engine()->config( $key, $value );
} | [
"public",
"static",
"function",
"config",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"null",
")",
"{",
"return",
"self",
"::",
"factory",
"(",
")",
"->",
"engine",
"(",
")",
"->",
"config",
"(",
"$",
"key",
",",
"$",
"value",
")",
";",
"}"
] | Get or set configuration value.
@param array|string $key
@param mixed $value
@return mixed | [
"Get",
"or",
"set",
"configuration",
"value",
"."
] | train | https://github.com/wpup/digster/blob/9ef9626ce82673af698bc0976d6c38a532e4a6d9/src/class-digster.php#L65-L67 |
wpup/digster | src/class-digster.php | Digster.load_extensions | public function load_extensions() {
$extensions = [
new \Frozzare\Digster\Extensions\Filter_Extensions(),
new \Frozzare\Digster\Extensions\Function_Extensions(),
new \Frozzare\Digster\Extensions\Global_Extensions(),
new \Frozzare\Digster\Extensions\I18n_Extensions()
];
/**
* Modify extensions or a... | php | public function load_extensions() {
$extensions = [
new \Frozzare\Digster\Extensions\Filter_Extensions(),
new \Frozzare\Digster\Extensions\Function_Extensions(),
new \Frozzare\Digster\Extensions\Global_Extensions(),
new \Frozzare\Digster\Extensions\I18n_Extensions()
];
/**
* Modify extensions or a... | [
"public",
"function",
"load_extensions",
"(",
")",
"{",
"$",
"extensions",
"=",
"[",
"new",
"\\",
"Frozzare",
"\\",
"Digster",
"\\",
"Extensions",
"\\",
"Filter_Extensions",
"(",
")",
",",
"new",
"\\",
"Frozzare",
"\\",
"Digster",
"\\",
"Extensions",
"\\",
... | Load Digster extensions. | [
"Load",
"Digster",
"extensions",
"."
] | train | https://github.com/wpup/digster/blob/9ef9626ce82673af698bc0976d6c38a532e4a6d9/src/class-digster.php#L93-L110 |
wpup/digster | src/class-digster.php | Digster.view | public static function view( $view = null, array $data = [] ) {
if ( func_num_args() === 0 ) {
return self::factory();
}
return self::factory()->make( $view, $data );
} | php | public static function view( $view = null, array $data = [] ) {
if ( func_num_args() === 0 ) {
return self::factory();
}
return self::factory()->make( $view, $data );
} | [
"public",
"static",
"function",
"view",
"(",
"$",
"view",
"=",
"null",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
"===",
"0",
")",
"{",
"return",
"self",
"::",
"factory",
"(",
")",
";",
"}",
"return"... | Get the view class.
@param string $view
@param array $data
@return string | [
"Get",
"the",
"view",
"class",
"."
] | train | https://github.com/wpup/digster/blob/9ef9626ce82673af698bc0976d6c38a532e4a6d9/src/class-digster.php#L158-L164 |
euro-ix/ixf-client-php | lib/IXF/ApiResource.php | ApiResource.resolveClass | public static function resolveClass( $resource, $id = null )
{
$class = 'IXF\\' . $resource;
if( class_exists($class) )
return new $class( $id );
return new IXF\ApiResource( $id );
} | php | public static function resolveClass( $resource, $id = null )
{
$class = 'IXF\\' . $resource;
if( class_exists($class) )
return new $class( $id );
return new IXF\ApiResource( $id );
} | [
"public",
"static",
"function",
"resolveClass",
"(",
"$",
"resource",
",",
"$",
"id",
"=",
"null",
")",
"{",
"$",
"class",
"=",
"'IXF\\\\'",
".",
"$",
"resource",
";",
"if",
"(",
"class_exists",
"(",
"$",
"class",
")",
")",
"return",
"new",
"$",
"cla... | If a class exists for the given resource return an instance
of it, else return an instance of the generic ApiResouce class.
@param string $resource The resource - e.g. ''IXP''
@param int $id ID of the object - use for initialisation
@return ApiResouce Or the more specific child class | [
"If",
"a",
"class",
"exists",
"for",
"the",
"given",
"resource",
"return",
"an",
"instance",
"of",
"it",
"else",
"return",
"an",
"instance",
"of",
"the",
"generic",
"ApiResouce",
"class",
"."
] | train | https://github.com/euro-ix/ixf-client-php/blob/dd39f5c17dc2d3795fcacf5d06793ca28886f3c1/lib/IXF/ApiResource.php#L15-L22 |
euro-ix/ixf-client-php | lib/IXF/ApiResource.php | ApiResource.retrieve | public static function retrieve( $resource, $id )
{
$instance = self::resolveClass( $resource, $id );
$instance->refresh( $resource );
return $instance;
} | php | public static function retrieve( $resource, $id )
{
$instance = self::resolveClass( $resource, $id );
$instance->refresh( $resource );
return $instance;
} | [
"public",
"static",
"function",
"retrieve",
"(",
"$",
"resource",
",",
"$",
"id",
")",
"{",
"$",
"instance",
"=",
"self",
"::",
"resolveClass",
"(",
"$",
"resource",
",",
"$",
"id",
")",
";",
"$",
"instance",
"->",
"refresh",
"(",
"$",
"resource",
")... | Retrieve an object by ID
@param string $resource The resource - e.g. ''IXP''
@param int $id ID of the object
@return ApiResouce
@throws Error\NotFound If the requested object does not exist | [
"Retrieve",
"an",
"object",
"by",
"ID"
] | train | https://github.com/euro-ix/ixf-client-php/blob/dd39f5c17dc2d3795fcacf5d06793ca28886f3c1/lib/IXF/ApiResource.php#L48-L53 |
euro-ix/ixf-client-php | lib/IXF/ApiResource.php | ApiResource.refresh | public function refresh( $resource )
{
$url = $url = '/' . $resource . '/' . $this->id;
$requestor = new ApiRequestor();
$response = $requestor->request(
'get',
$url,
$this->_retrieveOptions
);
$this->refreshFrom($response[0]);
re... | php | public function refresh( $resource )
{
$url = $url = '/' . $resource . '/' . $this->id;
$requestor = new ApiRequestor();
$response = $requestor->request(
'get',
$url,
$this->_retrieveOptions
);
$this->refreshFrom($response[0]);
re... | [
"public",
"function",
"refresh",
"(",
"$",
"resource",
")",
"{",
"$",
"url",
"=",
"$",
"url",
"=",
"'/'",
".",
"$",
"resource",
".",
"'/'",
".",
"$",
"this",
"->",
"id",
";",
"$",
"requestor",
"=",
"new",
"ApiRequestor",
"(",
")",
";",
"$",
"resp... | Refresh the current object from the API service
@param string $resource The resource - e.g. ''IXP''
@return ApiResource The refreshed resource.
@throws Error An appropriate error object | [
"Refresh",
"the",
"current",
"object",
"from",
"the",
"API",
"service"
] | train | https://github.com/euro-ix/ixf-client-php/blob/dd39f5c17dc2d3795fcacf5d06793ca28886f3c1/lib/IXF/ApiResource.php#L63-L76 |
euro-ix/ixf-client-php | lib/IXF/ApiResource.php | ApiResource.all | public static function all( $resource, $params=null )
{
self::_validateCall('all', $params);
$requestor = new ApiRequestor();
$url = '/' . $resource;
$response = $requestor->request('get', $url, $params);
return Util::convertToIxfObject($response);
} | php | public static function all( $resource, $params=null )
{
self::_validateCall('all', $params);
$requestor = new ApiRequestor();
$url = '/' . $resource;
$response = $requestor->request('get', $url, $params);
return Util::convertToIxfObject($response);
} | [
"public",
"static",
"function",
"all",
"(",
"$",
"resource",
",",
"$",
"params",
"=",
"null",
")",
"{",
"self",
"::",
"_validateCall",
"(",
"'all'",
",",
"$",
"params",
")",
";",
"$",
"requestor",
"=",
"new",
"ApiRequestor",
"(",
")",
";",
"$",
"url"... | Get all objects of a given resource
Allowed params:
* ''limit'' => integer, limit the number of objects
* ''skip'' => integer, skip the first n objects
@param string $resource The resource - e.g. ''IXP''
@param array|null $params
@return ApiResource[] An array of resource objects.
@throws Error An appropriate error o... | [
"Get",
"all",
"objects",
"of",
"a",
"given",
"resource"
] | train | https://github.com/euro-ix/ixf-client-php/blob/dd39f5c17dc2d3795fcacf5d06793ca28886f3c1/lib/IXF/ApiResource.php#L91-L98 |
euro-ix/ixf-client-php | lib/IXF/ApiResource.php | ApiResource.create | public static function create( $resource, $params=null )
{
self::_validateCall('create', $params);
$requestor = new ApiRequestor();
$url = '/' . $resource;
return $requestor->request( 'post', $url, $params );
} | php | public static function create( $resource, $params=null )
{
self::_validateCall('create', $params);
$requestor = new ApiRequestor();
$url = '/' . $resource;
return $requestor->request( 'post', $url, $params );
} | [
"public",
"static",
"function",
"create",
"(",
"$",
"resource",
",",
"$",
"params",
"=",
"null",
")",
"{",
"self",
"::",
"_validateCall",
"(",
"'create'",
",",
"$",
"params",
")",
";",
"$",
"requestor",
"=",
"new",
"ApiRequestor",
"(",
")",
";",
"$",
... | Create an object from a given array of key/value pairs
@param string $resource The resource - e.g. ''IXP''
@param array|null $params
@return int The created object ID
@throws Error An appropriate error object | [
"Create",
"an",
"object",
"from",
"a",
"given",
"array",
"of",
"key",
"/",
"value",
"pairs"
] | train | https://github.com/euro-ix/ixf-client-php/blob/dd39f5c17dc2d3795fcacf5d06793ca28886f3c1/lib/IXF/ApiResource.php#L111-L117 |
euro-ix/ixf-client-php | lib/IXF/ApiResource.php | ApiResource.save | public function save()
{
$requestor = new ApiRequestor();
$params = $this->serializeParameters();
self::_validateCall( 'save', $params );
unset( $params['id'] );
if( count( $params ) > 0 )
{
$url = '/' . $this->getType() . '/' . $this->id;
ret... | php | public function save()
{
$requestor = new ApiRequestor();
$params = $this->serializeParameters();
self::_validateCall( 'save', $params );
unset( $params['id'] );
if( count( $params ) > 0 )
{
$url = '/' . $this->getType() . '/' . $this->id;
ret... | [
"public",
"function",
"save",
"(",
")",
"{",
"$",
"requestor",
"=",
"new",
"ApiRequestor",
"(",
")",
";",
"$",
"params",
"=",
"$",
"this",
"->",
"serializeParameters",
"(",
")",
";",
"self",
"::",
"_validateCall",
"(",
"'save'",
",",
"$",
"params",
")"... | Save an object
@return bool True when successful
@throws Error An appropriate error object | [
"Save",
"an",
"object"
] | train | https://github.com/euro-ix/ixf-client-php/blob/dd39f5c17dc2d3795fcacf5d06793ca28886f3c1/lib/IXF/ApiResource.php#L125-L139 |
euro-ix/ixf-client-php | lib/IXF/ApiResource.php | ApiResource.delete | public function delete($params=null)
{
self::_validateCall('delete');
$requestor = new ApiRequestor();
$url = '/' . $this->getType() . '/' . $this->id;
return $requestor->request('delete', $url, $params);
} | php | public function delete($params=null)
{
self::_validateCall('delete');
$requestor = new ApiRequestor();
$url = '/' . $this->getType() . '/' . $this->id;
return $requestor->request('delete', $url, $params);
} | [
"public",
"function",
"delete",
"(",
"$",
"params",
"=",
"null",
")",
"{",
"self",
"::",
"_validateCall",
"(",
"'delete'",
")",
";",
"$",
"requestor",
"=",
"new",
"ApiRequestor",
"(",
")",
";",
"$",
"url",
"=",
"'/'",
".",
"$",
"this",
"->",
"getType... | Delete an object
@return bool True when successful
@throws Error An appropriate error object | [
"Delete",
"an",
"object"
] | train | https://github.com/euro-ix/ixf-client-php/blob/dd39f5c17dc2d3795fcacf5d06793ca28886f3c1/lib/IXF/ApiResource.php#L149-L155 |
PandaPlatform/framework | src/Panda/Support/Configuration/Handlers/StorageConfiguration.php | StorageConfiguration.getStorageBaseDirectory | public function getStorageBaseDirectory($basePath = null)
{
// Get base storage path configuration
$storage = $this->get('storage');
// Check if storage is relative to the application path or not
$relative = $storage['path_is_relative'] ?: true;
return ($relative ? $basePat... | php | public function getStorageBaseDirectory($basePath = null)
{
// Get base storage path configuration
$storage = $this->get('storage');
// Check if storage is relative to the application path or not
$relative = $storage['path_is_relative'] ?: true;
return ($relative ? $basePat... | [
"public",
"function",
"getStorageBaseDirectory",
"(",
"$",
"basePath",
"=",
"null",
")",
"{",
"// Get base storage path configuration",
"$",
"storage",
"=",
"$",
"this",
"->",
"get",
"(",
"'storage'",
")",
";",
"// Check if storage is relative to the application path or n... | @param string $basePath
@return string | [
"@param",
"string",
"$basePath"
] | train | https://github.com/PandaPlatform/framework/blob/a78cf051b379896b5a4d5df620988e37a0e632f5/src/Panda/Support/Configuration/Handlers/StorageConfiguration.php#L27-L36 |
todstoychev/icr | src/Manipulator/ResizeCrop.php | ResizeCrop.manipulate | public function manipulate(AbstractImage $image, $width, $height)
{
$box = $this->calculateResize($image, $width, $height);
$image = $image->resize($box);
$point = $this->createCropPoint($image, $width, $height);
$this->box->setWidth($width)
->setHeight($height);
... | php | public function manipulate(AbstractImage $image, $width, $height)
{
$box = $this->calculateResize($image, $width, $height);
$image = $image->resize($box);
$point = $this->createCropPoint($image, $width, $height);
$this->box->setWidth($width)
->setHeight($height);
... | [
"public",
"function",
"manipulate",
"(",
"AbstractImage",
"$",
"image",
",",
"$",
"width",
",",
"$",
"height",
")",
"{",
"$",
"box",
"=",
"$",
"this",
"->",
"calculateResize",
"(",
"$",
"image",
",",
"$",
"width",
",",
"$",
"height",
")",
";",
"$",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/todstoychev/icr/blob/0214c7bc76e44488e98758d55deb707b72e24000/src/Manipulator/ResizeCrop.php#L18-L28 |
crysalead/net | src/Mime/Address.php | Address.toString | public function toString()
{
$email = '<' . Mime::encodeEmail($this->email()) . '>';
$name = $this->name();
return $name ? Mime::encodeValue($name) . ' ' . $email : $email;
} | php | public function toString()
{
$email = '<' . Mime::encodeEmail($this->email()) . '>';
$name = $this->name();
return $name ? Mime::encodeValue($name) . ' ' . $email : $email;
} | [
"public",
"function",
"toString",
"(",
")",
"{",
"$",
"email",
"=",
"'<'",
".",
"Mime",
"::",
"encodeEmail",
"(",
"$",
"this",
"->",
"email",
"(",
")",
")",
".",
"'>'",
";",
"$",
"name",
"=",
"$",
"this",
"->",
"name",
"(",
")",
";",
"return",
... | Return the encoded representation of the address
@return string | [
"Return",
"the",
"encoded",
"representation",
"of",
"the",
"address"
] | train | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Mime/Address.php#L89-L94 |
activecollab/bootstrap | src/ResultEncoder/ResultEncoder.php | ResultEncoder.onNoEncoderApplied | protected function onNoEncoderApplied($action_result, ServerRequestInterface $request, ResponseInterface $response)
{
if ($action_result instanceof UserSessionResponseInterface) {
return $this->encodeUserSessionResponse($action_result, $request, $response);
} elseif ($action_result insta... | php | protected function onNoEncoderApplied($action_result, ServerRequestInterface $request, ResponseInterface $response)
{
if ($action_result instanceof UserSessionResponseInterface) {
return $this->encodeUserSessionResponse($action_result, $request, $response);
} elseif ($action_result insta... | [
"protected",
"function",
"onNoEncoderApplied",
"(",
"$",
"action_result",
",",
"ServerRequestInterface",
"$",
"request",
",",
"ResponseInterface",
"$",
"response",
")",
"{",
"if",
"(",
"$",
"action_result",
"instanceof",
"UserSessionResponseInterface",
")",
"{",
"retu... | {@inheritdoc} | [
"{"
] | train | https://github.com/activecollab/bootstrap/blob/92eea19b2b2b329035f20e855a78f36e74084ccf/src/ResultEncoder/ResultEncoder.php#L75-L92 |
activecollab/bootstrap | src/ResultEncoder/ResultEncoder.php | ResultEncoder.encodeCollection | private function encodeCollection(CollectionInterface $action_result, ResponseInterface $response)
{
$response = $response->write(json_encode($action_result))->withStatus(200);
if ($action_result->canBeEtagged()) {
if ($action_result->getApplicationIdentifier() != $this->app_identifier)... | php | private function encodeCollection(CollectionInterface $action_result, ResponseInterface $response)
{
$response = $response->write(json_encode($action_result))->withStatus(200);
if ($action_result->canBeEtagged()) {
if ($action_result->getApplicationIdentifier() != $this->app_identifier)... | [
"private",
"function",
"encodeCollection",
"(",
"CollectionInterface",
"$",
"action_result",
",",
"ResponseInterface",
"$",
"response",
")",
"{",
"$",
"response",
"=",
"$",
"response",
"->",
"write",
"(",
"json_encode",
"(",
"$",
"action_result",
")",
")",
"->",... | Encode DataObject collection.
@param CollectionInterface $action_result
@param ResponseInterface $response
@return ResponseInterface | [
"Encode",
"DataObject",
"collection",
"."
] | train | https://github.com/activecollab/bootstrap/blob/92eea19b2b2b329035f20e855a78f36e74084ccf/src/ResultEncoder/ResultEncoder.php#L101-L125 |
activecollab/bootstrap | src/ResultEncoder/ResultEncoder.php | ResultEncoder.encodeSingle | private function encodeSingle(ObjectInterface $action_result, ResponseInterface $response)
{
$result = ['single' => $action_result];
foreach ($action_result->jsonSerializeDetails() as $k => $v) {
if ($k == 'single') {
throw new LogicException("JSON serialize details can'... | php | private function encodeSingle(ObjectInterface $action_result, ResponseInterface $response)
{
$result = ['single' => $action_result];
foreach ($action_result->jsonSerializeDetails() as $k => $v) {
if ($k == 'single') {
throw new LogicException("JSON serialize details can'... | [
"private",
"function",
"encodeSingle",
"(",
"ObjectInterface",
"$",
"action_result",
",",
"ResponseInterface",
"$",
"response",
")",
"{",
"$",
"result",
"=",
"[",
"'single'",
"=>",
"$",
"action_result",
"]",
";",
"foreach",
"(",
"$",
"action_result",
"->",
"js... | Encode individual DataObject object.
@param ObjectInterface $action_result
@param ResponseInterface $response
@return ResponseInterface | [
"Encode",
"individual",
"DataObject",
"object",
"."
] | train | https://github.com/activecollab/bootstrap/blob/92eea19b2b2b329035f20e855a78f36e74084ccf/src/ResultEncoder/ResultEncoder.php#L134-L153 |
activecollab/bootstrap | src/ResultEncoder/ResultEncoder.php | ResultEncoder.encodeJsonSerializable | protected function encodeJsonSerializable(JsonSerializable $action_result, ResponseInterface $response, $status = 200)
{
return $response->write(json_encode($action_result))->withStatus($status);
} | php | protected function encodeJsonSerializable(JsonSerializable $action_result, ResponseInterface $response, $status = 200)
{
return $response->write(json_encode($action_result))->withStatus($status);
} | [
"protected",
"function",
"encodeJsonSerializable",
"(",
"JsonSerializable",
"$",
"action_result",
",",
"ResponseInterface",
"$",
"response",
",",
"$",
"status",
"=",
"200",
")",
"{",
"return",
"$",
"response",
"->",
"write",
"(",
"json_encode",
"(",
"$",
"action... | Encode JsonSerializable instance response, with status 200.
@param JsonSerializable $action_result
@param ResponseInterface $response
@param int $status
@return ResponseInterface | [
"Encode",
"JsonSerializable",
"instance",
"response",
"with",
"status",
"200",
"."
] | train | https://github.com/activecollab/bootstrap/blob/92eea19b2b2b329035f20e855a78f36e74084ccf/src/ResultEncoder/ResultEncoder.php#L163-L166 |
activecollab/bootstrap | src/ResultEncoder/ResultEncoder.php | ResultEncoder.encodeUserSessionResponse | private function encodeUserSessionResponse(UserSessionResponseInterface $action_result, ServerRequestInterface $request, ResponseInterface $response)
{
if ($action_result->getAuthenticatedWith() instanceof SessionInterface) {
$response = $this->getCookiesProvider()->set($request, $response, $th... | php | private function encodeUserSessionResponse(UserSessionResponseInterface $action_result, ServerRequestInterface $request, ResponseInterface $response)
{
if ($action_result->getAuthenticatedWith() instanceof SessionInterface) {
$response = $this->getCookiesProvider()->set($request, $response, $th... | [
"private",
"function",
"encodeUserSessionResponse",
"(",
"UserSessionResponseInterface",
"$",
"action_result",
",",
"ServerRequestInterface",
"$",
"request",
",",
"ResponseInterface",
"$",
"response",
")",
"{",
"if",
"(",
"$",
"action_result",
"->",
"getAuthenticatedWith"... | Encode user session action results and return properly populated response.
@param UserSessionResponseInterface $action_result
@param ServerRequestInterface $request
@param ResponseInterface $response
@return ResponseInterface | [
"Encode",
"user",
"session",
"action",
"results",
"and",
"return",
"properly",
"populated",
"response",
"."
] | train | https://github.com/activecollab/bootstrap/blob/92eea19b2b2b329035f20e855a78f36e74084ccf/src/ResultEncoder/ResultEncoder.php#L176-L186 |
activecollab/bootstrap | src/ResultEncoder/ResultEncoder.php | ResultEncoder.encodeUserSessionTerminatedResponse | private function encodeUserSessionTerminatedResponse(UserSessionTerminateResponseInterface $action_result, ServerRequestInterface $request, ResponseInterface $response)
{
$response = $this->getCookiesProvider()->remove($request, $response, $this->getUserSessionIdCookieName())[1];
return $this->enco... | php | private function encodeUserSessionTerminatedResponse(UserSessionTerminateResponseInterface $action_result, ServerRequestInterface $request, ResponseInterface $response)
{
$response = $this->getCookiesProvider()->remove($request, $response, $this->getUserSessionIdCookieName())[1];
return $this->enco... | [
"private",
"function",
"encodeUserSessionTerminatedResponse",
"(",
"UserSessionTerminateResponseInterface",
"$",
"action_result",
",",
"ServerRequestInterface",
"$",
"request",
",",
"ResponseInterface",
"$",
"response",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
... | Encode user session terminated action results and return properly populated response.
@param UserSessionTerminateResponseInterface $action_result
@param ServerRequestInterface $request
@param ResponseInterface $response
@return ResponseInterface | [
"Encode",
"user",
"session",
"terminated",
"action",
"results",
"and",
"return",
"properly",
"populated",
"response",
"."
] | train | https://github.com/activecollab/bootstrap/blob/92eea19b2b2b329035f20e855a78f36e74084ccf/src/ResultEncoder/ResultEncoder.php#L196-L201 |
o2system/parser | src/String/Abstracts/AbstractAdapter.php | AbstractAdapter.loadString | public function loadString($string)
{
$this->string = htmlspecialchars_decode($string);
return (bool)empty($this->string);
} | php | public function loadString($string)
{
$this->string = htmlspecialchars_decode($string);
return (bool)empty($this->string);
} | [
"public",
"function",
"loadString",
"(",
"$",
"string",
")",
"{",
"$",
"this",
"->",
"string",
"=",
"htmlspecialchars_decode",
"(",
"$",
"string",
")",
";",
"return",
"(",
"bool",
")",
"empty",
"(",
"$",
"this",
"->",
"string",
")",
";",
"}"
] | AbstractAdapter::loadString
@param string $string
@return bool | [
"AbstractAdapter",
"::",
"loadString"
] | train | https://github.com/o2system/parser/blob/1b85fe676ea043a500842e61731ab4d38e5323e4/src/String/Abstracts/AbstractAdapter.php#L173-L178 |
bantenprov/tanara | app/Http/Controllers/Settings/PasswordController.php | PasswordController.update | public function update(Request $request)
{
$this->validate($request, [
'password' => 'required|confirmed|min:6',
]);
$request->user()->update([
'password' => bcrypt($request->password),
]);
} | php | public function update(Request $request)
{
$this->validate($request, [
'password' => 'required|confirmed|min:6',
]);
$request->user()->update([
'password' => bcrypt($request->password),
]);
} | [
"public",
"function",
"update",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"validate",
"(",
"$",
"request",
",",
"[",
"'password'",
"=>",
"'required|confirmed|min:6'",
",",
"]",
")",
";",
"$",
"request",
"->",
"user",
"(",
")",
"->",
... | Update the user's password.
@param \Illuminate\Http\Request $request
@return \Illuminate\Http\Response | [
"Update",
"the",
"user",
"s",
"password",
"."
] | train | https://github.com/bantenprov/tanara/blob/e70b027cbbc59bb57a31fa3c7347e7eae87671c3/app/Http/Controllers/Settings/PasswordController.php#L16-L25 |
KejawenLab/PetrukUsername | Util/DateGenerator.php | DateGenerator.generate | public static function generate(\DateTimeInterface $date): array
{
$list = array();
$list[] = $date->format('ym');
$list[] = $date->format('yd');
$list[] = $date->format('my');
$list[] = $date->format('md');
$list[] = $date->format('dy');
$list[] = $date->form... | php | public static function generate(\DateTimeInterface $date): array
{
$list = array();
$list[] = $date->format('ym');
$list[] = $date->format('yd');
$list[] = $date->format('my');
$list[] = $date->format('md');
$list[] = $date->format('dy');
$list[] = $date->form... | [
"public",
"static",
"function",
"generate",
"(",
"\\",
"DateTimeInterface",
"$",
"date",
")",
":",
"array",
"{",
"$",
"list",
"=",
"array",
"(",
")",
";",
"$",
"list",
"[",
"]",
"=",
"$",
"date",
"->",
"format",
"(",
"'ym'",
")",
";",
"$",
"list",
... | @param \DateTimeInterface $date
@return array | [
"@param",
"\\",
"DateTimeInterface",
"$date"
] | train | https://github.com/KejawenLab/PetrukUsername/blob/a602cf9976415c94c2346a22b5df87fd53069b99/Util/DateGenerator.php#L15-L26 |
sifophp/sifo-common-instance | controllers/scripts/loadAvgAutoswitch.php | ScriptsLoadAvgAutoswitchController._getFileContent | private function _getFileContent()
{
if ( !isset( $this->_index_file_content ) )
{
if ( !( $this->_index_file_content = file_get_contents( $this->_root_page_path ) ) )
{
trigger_error( "Root file not found. Please, validate the path.", E_USER_ERROR );
}
}
return $this->_index_file_content;
} | php | private function _getFileContent()
{
if ( !isset( $this->_index_file_content ) )
{
if ( !( $this->_index_file_content = file_get_contents( $this->_root_page_path ) ) )
{
trigger_error( "Root file not found. Please, validate the path.", E_USER_ERROR );
}
}
return $this->_index_file_content;
} | [
"private",
"function",
"_getFileContent",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_index_file_content",
")",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"this",
"->",
"_index_file_content",
"=",
"file_get_contents",
"(",
"$",
"this",
"->... | Return the platform index file content.
@return boolean | [
"Return",
"the",
"platform",
"index",
"file",
"content",
"."
] | train | https://github.com/sifophp/sifo-common-instance/blob/52d54ea3e565bd2bccd77e0b0a6a99b5cae3aff5/controllers/scripts/loadAvgAutoswitch.php#L43-L54 |
sifophp/sifo-common-instance | controllers/scripts/loadAvgAutoswitch.php | ScriptsLoadAvgAutoswitchController._getEnablingCode | private function _getEnablingCode()
{
// Finishing with comment slashes for comment the php open label:
return self::PHP_OPEN_TAG. PHP_EOL . self::ENABLED_LABEL . PHP_EOL . str_replace( '%replacement_path%', $this->_alternative_page_path, self::REDIRECT_CODE ) . PHP_EOL ."//";
} | php | private function _getEnablingCode()
{
// Finishing with comment slashes for comment the php open label:
return self::PHP_OPEN_TAG. PHP_EOL . self::ENABLED_LABEL . PHP_EOL . str_replace( '%replacement_path%', $this->_alternative_page_path, self::REDIRECT_CODE ) . PHP_EOL ."//";
} | [
"private",
"function",
"_getEnablingCode",
"(",
")",
"{",
"// Finishing with comment slashes for comment the php open label:",
"return",
"self",
"::",
"PHP_OPEN_TAG",
".",
"PHP_EOL",
".",
"self",
"::",
"ENABLED_LABEL",
".",
"PHP_EOL",
".",
"str_replace",
"(",
"'%replaceme... | Generate the required code to enable/disable the replacement.
@return string | [
"Generate",
"the",
"required",
"code",
"to",
"enable",
"/",
"disable",
"the",
"replacement",
"."
] | train | https://github.com/sifophp/sifo-common-instance/blob/52d54ea3e565bd2bccd77e0b0a6a99b5cae3aff5/controllers/scripts/loadAvgAutoswitch.php#L61-L65 |
sifophp/sifo-common-instance | controllers/scripts/loadAvgAutoswitch.php | ScriptsLoadAvgAutoswitchController._enablePage | private function _enablePage()
{
if ( $this->test )
{
return true;
}
$enabled_source = $this->_getEnablingCode(). $this->_getFileContent();
return file_put_contents( $this->_root_page_path, $enabled_source );
} | php | private function _enablePage()
{
if ( $this->test )
{
return true;
}
$enabled_source = $this->_getEnablingCode(). $this->_getFileContent();
return file_put_contents( $this->_root_page_path, $enabled_source );
} | [
"private",
"function",
"_enablePage",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"test",
")",
"{",
"return",
"true",
";",
"}",
"$",
"enabled_source",
"=",
"$",
"this",
"->",
"_getEnablingCode",
"(",
")",
".",
"$",
"this",
"->",
"_getFileContent",
"("... | Enable the replacement page.
@return boolean False when error. | [
"Enable",
"the",
"replacement",
"page",
"."
] | train | https://github.com/sifophp/sifo-common-instance/blob/52d54ea3e565bd2bccd77e0b0a6a99b5cae3aff5/controllers/scripts/loadAvgAutoswitch.php#L100-L109 |
sifophp/sifo-common-instance | controllers/scripts/loadAvgAutoswitch.php | ScriptsLoadAvgAutoswitchController._disablePage | private function _disablePage()
{
if ( $this->test )
{
return true;
}
$disabled_source = str_replace( $this->_getEnablingCode(), '', $this->_getFileContent() );
return file_put_contents( $this->_root_page_path, $disabled_source );;
} | php | private function _disablePage()
{
if ( $this->test )
{
return true;
}
$disabled_source = str_replace( $this->_getEnablingCode(), '', $this->_getFileContent() );
return file_put_contents( $this->_root_page_path, $disabled_source );;
} | [
"private",
"function",
"_disablePage",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"test",
")",
"{",
"return",
"true",
";",
"}",
"$",
"disabled_source",
"=",
"str_replace",
"(",
"$",
"this",
"->",
"_getEnablingCode",
"(",
")",
",",
"''",
",",
"$",
"... | Disable the replacement page. Normal page is enabled.
@return boolean False when error. | [
"Disable",
"the",
"replacement",
"page",
".",
"Normal",
"page",
"is",
"enabled",
"."
] | train | https://github.com/sifophp/sifo-common-instance/blob/52d54ea3e565bd2bccd77e0b0a6a99b5cae3aff5/controllers/scripts/loadAvgAutoswitch.php#L117-L127 |
sifophp/sifo-common-instance | controllers/scripts/loadAvgAutoswitch.php | ScriptsLoadAvgAutoswitchController.init | public function init()
{
$this->help_str = 'This script enable/disable a replacement main page when the current system current load average surpass a defined value. '.PHP_EOL;
$this->help_str = 'Very usefult for show load exced pages or change the service only for premium users. '.PHP_EOL;
$this->help_str .= 'U... | php | public function init()
{
$this->help_str = 'This script enable/disable a replacement main page when the current system current load average surpass a defined value. '.PHP_EOL;
$this->help_str = 'Very usefult for show load exced pages or change the service only for premium users. '.PHP_EOL;
$this->help_str .= 'U... | [
"public",
"function",
"init",
"(",
")",
"{",
"$",
"this",
"->",
"help_str",
"=",
"'This script enable/disable a replacement main page when the current system current load average surpass a defined value. '",
".",
"PHP_EOL",
";",
"$",
"this",
"->",
"help_str",
"=",
"'Very usef... | ABSTRACTED METHODES: | [
"ABSTRACTED",
"METHODES",
":"
] | train | https://github.com/sifophp/sifo-common-instance/blob/52d54ea3e565bd2bccd77e0b0a6a99b5cae3aff5/controllers/scripts/loadAvgAutoswitch.php#L131-L141 |
FWidm/dwd-hourly-crawler | src/fwidm/dwdHourlyCrawler/DWDLib.php | DWDLib.getAllStations | public function getAllStations(DWDHourlyParameters $hourlyParameters,bool $active=false){
$services = $this->createServices($hourlyParameters);
$crawler = new DWDHourlyCrawler($services);
return $crawler->getAllStations($active);
} | php | public function getAllStations(DWDHourlyParameters $hourlyParameters,bool $active=false){
$services = $this->createServices($hourlyParameters);
$crawler = new DWDHourlyCrawler($services);
return $crawler->getAllStations($active);
} | [
"public",
"function",
"getAllStations",
"(",
"DWDHourlyParameters",
"$",
"hourlyParameters",
",",
"bool",
"$",
"active",
"=",
"false",
")",
"{",
"$",
"services",
"=",
"$",
"this",
"->",
"createServices",
"(",
"$",
"hourlyParameters",
")",
";",
"$",
"crawler",
... | Retrieve all stations for the parameters
@param DWDHourlyParameters $hourlyParameters
@param bool $active get active stations
@return array | [
"Retrieve",
"all",
"stations",
"for",
"the",
"parameters"
] | train | https://github.com/FWidm/dwd-hourly-crawler/blob/36dec7d84a85af599e9d4fb6a3bcc302378ce4a8/src/fwidm/dwdHourlyCrawler/DWDLib.php#L43-L47 |
FWidm/dwd-hourly-crawler | src/fwidm/dwdHourlyCrawler/DWDLib.php | DWDLib.getHourlyInInterval | public function getHourlyInInterval(DWDHourlyParameters $hourlyParameters, DateTime $dateTime, $latitude, $longitude, $timeLimitMinutes = 30): array
{
$coordinatesRequest = new Coordinate($latitude, $longitude);
if (!empty($hourlyParameters) && $hourlyParameters->getVariableCount() > 0) {
... | php | public function getHourlyInInterval(DWDHourlyParameters $hourlyParameters, DateTime $dateTime, $latitude, $longitude, $timeLimitMinutes = 30): array
{
$coordinatesRequest = new Coordinate($latitude, $longitude);
if (!empty($hourlyParameters) && $hourlyParameters->getVariableCount() > 0) {
... | [
"public",
"function",
"getHourlyInInterval",
"(",
"DWDHourlyParameters",
"$",
"hourlyParameters",
",",
"DateTime",
"$",
"dateTime",
",",
"$",
"latitude",
",",
"$",
"longitude",
",",
"$",
"timeLimitMinutes",
"=",
"30",
")",
":",
"array",
"{",
"$",
"coordinatesReq... | Retrieve values for the parameters in a time frame between detetime +- timeLimitMinutes (default: 30) for the specific location.
@param DWDHourlyParameters $hourlyParameters
@param DateTime $dateTime
@param $latitude
@param $longitude
@param int $timeLimitMinutes - optional parameter that limit
@return array - returns ... | [
"Retrieve",
"values",
"for",
"the",
"parameters",
"in",
"a",
"time",
"frame",
"between",
"detetime",
"+",
"-",
"timeLimitMinutes",
"(",
"default",
":",
"30",
")",
"for",
"the",
"specific",
"location",
"."
] | train | https://github.com/FWidm/dwd-hourly-crawler/blob/36dec7d84a85af599e9d4fb6a3bcc302378ce4a8/src/fwidm/dwdHourlyCrawler/DWDLib.php#L59-L71 |
FWidm/dwd-hourly-crawler | src/fwidm/dwdHourlyCrawler/DWDLib.php | DWDLib.getHourlyDataInDay | public function getHourlyDataInDay(DWDHourlyParameters $hourlyParameters, DateTime $day, $latitude, $longitude)
{
$coordinatesRequest = new Coordinate($latitude, $longitude);
if (!empty($hourlyParameters) && $hourlyParameters->getVariableCount() > 0) {
$services = $this->createServices(... | php | public function getHourlyDataInDay(DWDHourlyParameters $hourlyParameters, DateTime $day, $latitude, $longitude)
{
$coordinatesRequest = new Coordinate($latitude, $longitude);
if (!empty($hourlyParameters) && $hourlyParameters->getVariableCount() > 0) {
$services = $this->createServices(... | [
"public",
"function",
"getHourlyDataInDay",
"(",
"DWDHourlyParameters",
"$",
"hourlyParameters",
",",
"DateTime",
"$",
"day",
",",
"$",
"latitude",
",",
"$",
"longitude",
")",
"{",
"$",
"coordinatesRequest",
"=",
"new",
"Coordinate",
"(",
"$",
"latitude",
",",
... | Retrieve values for the parameters in a time frame between detetime +- timeLimitMinutes (default: 30) for the specific location.
@param DWDHourlyParameters $hourlyParameters
@param DateTime $dateTime
@param $latitude
@param $longitude
@return array - returns an array that contains measurements ('values') and the statio... | [
"Retrieve",
"values",
"for",
"the",
"parameters",
"in",
"a",
"time",
"frame",
"between",
"detetime",
"+",
"-",
"timeLimitMinutes",
"(",
"default",
":",
"30",
")",
"for",
"the",
"specific",
"location",
"."
] | train | https://github.com/FWidm/dwd-hourly-crawler/blob/36dec7d84a85af599e9d4fb6a3bcc302378ce4a8/src/fwidm/dwdHourlyCrawler/DWDLib.php#L83-L94 |
FWidm/dwd-hourly-crawler | src/fwidm/dwdHourlyCrawler/DWDLib.php | DWDLib.createServices | private function createServices(DWDHourlyParameters $variables): array
{
$conf = DWDConfiguration::getHourlyConfiguration()->parameters;
$controllers = array();
if (!empty($variables->getVariables())) {
foreach ($variables->getVariables() as $var) {
switch ($var)... | php | private function createServices(DWDHourlyParameters $variables): array
{
$conf = DWDConfiguration::getHourlyConfiguration()->parameters;
$controllers = array();
if (!empty($variables->getVariables())) {
foreach ($variables->getVariables() as $var) {
switch ($var)... | [
"private",
"function",
"createServices",
"(",
"DWDHourlyParameters",
"$",
"variables",
")",
":",
"array",
"{",
"$",
"conf",
"=",
"DWDConfiguration",
"::",
"getHourlyConfiguration",
"(",
")",
"->",
"parameters",
";",
"$",
"controllers",
"=",
"array",
"(",
")",
... | Create a new instance of the appropriate controller.
@param DWDHourlyParameters $variables
@return AbstractHourlyService
@throws Error
@internal param $var | [
"Create",
"a",
"new",
"instance",
"of",
"the",
"appropriate",
"controller",
"."
] | train | https://github.com/FWidm/dwd-hourly-crawler/blob/36dec7d84a85af599e9d4fb6a3bcc302378ce4a8/src/fwidm/dwdHourlyCrawler/DWDLib.php#L102-L140 |
terdia/legato-framework | src/App.php | App.bootMiddleWares | protected function bootMiddleWares()
{
if (isset($this->middleWares['boot']) && count($this->middleWares['boot'])) {
foreach ($this->middleWares['boot'] as $middleware => $handler) {
$this->container->call([$this->container->make($middleware), $handler]);
}
... | php | protected function bootMiddleWares()
{
if (isset($this->middleWares['boot']) && count($this->middleWares['boot'])) {
foreach ($this->middleWares['boot'] as $middleware => $handler) {
$this->container->call([$this->container->make($middleware), $handler]);
}
... | [
"protected",
"function",
"bootMiddleWares",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"middleWares",
"[",
"'boot'",
"]",
")",
"&&",
"count",
"(",
"$",
"this",
"->",
"middleWares",
"[",
"'boot'",
"]",
")",
")",
"{",
"foreach",
"(",
"$... | Resolve application boot middleware. | [
"Resolve",
"application",
"boot",
"middleware",
"."
] | train | https://github.com/terdia/legato-framework/blob/44057c1c3c6f3e9643e9fade51bd417860fafda8/src/App.php#L59-L75 |
terdia/legato-framework | src/App.php | App.resolveDependencies | protected function resolveDependencies(array $dependencies)
{
foreach ($dependencies as $dependency => $type) {
call_user_func_array([$this, $type], [$dependency]);
}
} | php | protected function resolveDependencies(array $dependencies)
{
foreach ($dependencies as $dependency => $type) {
call_user_func_array([$this, $type], [$dependency]);
}
} | [
"protected",
"function",
"resolveDependencies",
"(",
"array",
"$",
"dependencies",
")",
"{",
"foreach",
"(",
"$",
"dependencies",
"as",
"$",
"dependency",
"=>",
"$",
"type",
")",
"{",
"call_user_func_array",
"(",
"[",
"$",
"this",
",",
"$",
"type",
"]",
",... | Application dependency binding to container.
@param array $dependencies | [
"Application",
"dependency",
"binding",
"to",
"container",
"."
] | train | https://github.com/terdia/legato-framework/blob/44057c1c3c6f3e9643e9fade51bd417860fafda8/src/App.php#L82-L87 |
terdia/legato-framework | src/App.php | App.execute | public function execute($callback, array $parameters = [], $defaultMethod = null)
{
return $this->container->call($callback, $parameters, $defaultMethod);
} | php | public function execute($callback, array $parameters = [], $defaultMethod = null)
{
return $this->container->call($callback, $parameters, $defaultMethod);
} | [
"public",
"function",
"execute",
"(",
"$",
"callback",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"defaultMethod",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"container",
"->",
"call",
"(",
"$",
"callback",
",",
"$",
"parameters... | Call and inject its dependencies for the given class / method or closure.
@param callable|string $callback
@param array $parameters (optional)
@param string|null $defaultMethod (optional)
@return mixed | [
"Call",
"and",
"inject",
"its",
"dependencies",
"for",
"the",
"given",
"class",
"/",
"method",
"or",
"closure",
"."
] | train | https://github.com/terdia/legato-framework/blob/44057c1c3c6f3e9643e9fade51bd417860fafda8/src/App.php#L181-L184 |
keboola/php-csvmap | src/Keboola/CsvMap/Mapper.php | Mapper.expandShorthandDefinitions | private function expandShorthandDefinitions()
{
foreach ($this->mapping as $key => $settings) {
if (is_string($key) && is_string($settings)) {
$this->mapping[$key] = [
'type' => 'column',
'mapping' => [
'destination'... | php | private function expandShorthandDefinitions()
{
foreach ($this->mapping as $key => $settings) {
if (is_string($key) && is_string($settings)) {
$this->mapping[$key] = [
'type' => 'column',
'mapping' => [
'destination'... | [
"private",
"function",
"expandShorthandDefinitions",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"mapping",
"as",
"$",
"key",
"=>",
"$",
"settings",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"key",
")",
"&&",
"is_string",
"(",
"$",
"settings",
... | Expands shorthand definitions to theirs full definition | [
"Expands",
"shorthand",
"definitions",
"to",
"theirs",
"full",
"definition"
] | train | https://github.com/keboola/php-csvmap/blob/17ff005e2f00535c48bc71d44629cf8fbf78380e/src/Keboola/CsvMap/Mapper.php#L56-L68 |
keboola/php-csvmap | src/Keboola/CsvMap/Mapper.php | Mapper.getCsvFiles | public function getCsvFiles()
{
$childResults = [];
foreach ($this->parsers as $type => $parser) {
$childResults += $parser->getCsvFiles();
}
$results = array_merge(
[
$this->type => $this->result
],
$childResults
... | php | public function getCsvFiles()
{
$childResults = [];
foreach ($this->parsers as $type => $parser) {
$childResults += $parser->getCsvFiles();
}
$results = array_merge(
[
$this->type => $this->result
],
$childResults
... | [
"public",
"function",
"getCsvFiles",
"(",
")",
"{",
"$",
"childResults",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"parsers",
"as",
"$",
"type",
"=>",
"$",
"parser",
")",
"{",
"$",
"childResults",
"+=",
"$",
"parser",
"->",
"getCsvFiles",
... | Return own result and all children
@return Table[] | [
"Return",
"own",
"result",
"and",
"all",
"children"
] | train | https://github.com/keboola/php-csvmap/blob/17ff005e2f00535c48bc71d44629cf8fbf78380e/src/Keboola/CsvMap/Mapper.php#L300-L315 |
nyeholt/silverstripe-simplewiki | thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier/Length.php | HTMLPurifier_Length.isValid | public function isValid() {
if ($this->isValid === null) $this->isValid = $this->validate();
return $this->isValid;
} | php | public function isValid() {
if ($this->isValid === null) $this->isValid = $this->validate();
return $this->isValid;
} | [
"public",
"function",
"isValid",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isValid",
"===",
"null",
")",
"$",
"this",
"->",
"isValid",
"=",
"$",
"this",
"->",
"validate",
"(",
")",
";",
"return",
"$",
"this",
"->",
"isValid",
";",
"}"
] | Returns true if this length unit is valid. | [
"Returns",
"true",
"if",
"this",
"length",
"unit",
"is",
"valid",
"."
] | train | https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier/Length.php#L93-L96 |
nyeholt/silverstripe-simplewiki | thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier/Length.php | HTMLPurifier_Length.compareTo | public function compareTo($l) {
if ($l === false) return false;
if ($l->unit !== $this->unit) {
$converter = new HTMLPurifier_UnitConverter();
$l = $converter->convert($l, $this->unit);
if ($l === false) return false;
}
return $this->n - $l->n;
} | php | public function compareTo($l) {
if ($l === false) return false;
if ($l->unit !== $this->unit) {
$converter = new HTMLPurifier_UnitConverter();
$l = $converter->convert($l, $this->unit);
if ($l === false) return false;
}
return $this->n - $l->n;
} | [
"public",
"function",
"compareTo",
"(",
"$",
"l",
")",
"{",
"if",
"(",
"$",
"l",
"===",
"false",
")",
"return",
"false",
";",
"if",
"(",
"$",
"l",
"->",
"unit",
"!==",
"$",
"this",
"->",
"unit",
")",
"{",
"$",
"converter",
"=",
"new",
"HTMLPurifi... | Compares two lengths, and returns 1 if greater, -1 if less and 0 if equal.
@warning If both values are too large or small, this calculation will
not work properly | [
"Compares",
"two",
"lengths",
"and",
"returns",
"1",
"if",
"greater",
"-",
"1",
"if",
"less",
"and",
"0",
"if",
"equal",
"."
] | train | https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier/Length.php#L103-L111 |
ronan-gloo/jade-php | src/Jade/Jade.php | Jade.stream | public function stream($input)
{
if (false === static::$isWrapperRegistered)
{
static::$isWrapperRegistered = true;
stream_wrapper_register($this->options['stream'], 'Jade\Stream\Template');
}
return $this->options['stream'].'://data;'.$this->compile($input);... | php | public function stream($input)
{
if (false === static::$isWrapperRegistered)
{
static::$isWrapperRegistered = true;
stream_wrapper_register($this->options['stream'], 'Jade\Stream\Template');
}
return $this->options['stream'].'://data;'.$this->compile($input);... | [
"public",
"function",
"stream",
"(",
"$",
"input",
")",
"{",
"if",
"(",
"false",
"===",
"static",
"::",
"$",
"isWrapperRegistered",
")",
"{",
"static",
"::",
"$",
"isWrapperRegistered",
"=",
"true",
";",
"stream_wrapper_register",
"(",
"$",
"this",
"->",
"... | Create a stream wrapper to allow
the possibility to add $scope variables
@param $input
@return string | [
"Create",
"a",
"stream",
"wrapper",
"to",
"allow",
"the",
"possibility",
"to",
"add",
"$scope",
"variables"
] | train | https://github.com/ronan-gloo/jade-php/blob/77230d2eef2f0d4f045292a5906162f0c0499421/src/Jade/Jade.php#L106-L115 |
ptlis/conneg | src/Preference/Matched/MatchedPreferenceSort.php | MatchedPreferenceSort.sortAscending | public function sortAscending(array $prefList)
{
$comparator = new MatchedPreferenceComparator();
usort(
$prefList,
function (MatchedPreferenceInterface $lValue, MatchedPreferenceInterface $rValue) use ($comparator) {
return -1 * $comparator->compare($lValue,... | php | public function sortAscending(array $prefList)
{
$comparator = new MatchedPreferenceComparator();
usort(
$prefList,
function (MatchedPreferenceInterface $lValue, MatchedPreferenceInterface $rValue) use ($comparator) {
return -1 * $comparator->compare($lValue,... | [
"public",
"function",
"sortAscending",
"(",
"array",
"$",
"prefList",
")",
"{",
"$",
"comparator",
"=",
"new",
"MatchedPreferenceComparator",
"(",
")",
";",
"usort",
"(",
"$",
"prefList",
",",
"function",
"(",
"MatchedPreferenceInterface",
"$",
"lValue",
",",
... | Sort the array of MatchedPreference instances in ascending order.
@param MatchedPreferenceInterface[] $prefList
@return MatchedPreferenceInterface[] | [
"Sort",
"the",
"array",
"of",
"MatchedPreference",
"instances",
"in",
"ascending",
"order",
"."
] | train | https://github.com/ptlis/conneg/blob/04afb568f368ecdd81c13277006c4be041ccb58b/src/Preference/Matched/MatchedPreferenceSort.php#L23-L35 |
csun-metalab/laravel-directory-authentication | src/Authentication/Factories/HandlerLDAPFactory.php | HandlerLDAPFactory.fromDefaults | public static function fromDefaults() {
$handler = new HandlerLDAP(
config('ldap.host'),
config('ldap.basedn'),
config('ldap.dn'),
config('ldap.password'),
config('ldap.search_user_id'),
config('ldap.search_username'),
config('ldap.search_user_mail'),
config('ldap.search_user_mail_array')
);... | php | public static function fromDefaults() {
$handler = new HandlerLDAP(
config('ldap.host'),
config('ldap.basedn'),
config('ldap.dn'),
config('ldap.password'),
config('ldap.search_user_id'),
config('ldap.search_username'),
config('ldap.search_user_mail'),
config('ldap.search_user_mail_array')
);... | [
"public",
"static",
"function",
"fromDefaults",
"(",
")",
"{",
"$",
"handler",
"=",
"new",
"HandlerLDAP",
"(",
"config",
"(",
"'ldap.host'",
")",
",",
"config",
"(",
"'ldap.basedn'",
")",
",",
"config",
"(",
"'ldap.dn'",
")",
",",
"config",
"(",
"'ldap.pas... | Returns a HandlerLDAP instance based on the default configuration.
@return HandlerLDAP | [
"Returns",
"a",
"HandlerLDAP",
"instance",
"based",
"on",
"the",
"default",
"configuration",
"."
] | train | https://github.com/csun-metalab/laravel-directory-authentication/blob/b8d4fa64dd646566e508cdf838d6a3d03b1d53ea/src/Authentication/Factories/HandlerLDAPFactory.php#L17-L43 |
sifophp/sifo-common-instance | controllers/i18n/actions.php | I18nActionsController.addMessage | protected function addMessage( $instance )
{
$message = \Sifo\FilterPost::getInstance()->getString( 'msgid' );
$translator_model = new I18nTranslatorModel();
// Check if this message exists in the instances parents.
// Get selected instance inheritance.
$instance_domains = $this->getConfig( 'domains',... | php | protected function addMessage( $instance )
{
$message = \Sifo\FilterPost::getInstance()->getString( 'msgid' );
$translator_model = new I18nTranslatorModel();
// Check if this message exists in the instances parents.
// Get selected instance inheritance.
$instance_domains = $this->getConfig( 'domains',... | [
"protected",
"function",
"addMessage",
"(",
"$",
"instance",
")",
"{",
"$",
"message",
"=",
"\\",
"Sifo",
"\\",
"FilterPost",
"::",
"getInstance",
"(",
")",
"->",
"getString",
"(",
"'msgid'",
")",
";",
"$",
"translator_model",
"=",
"new",
"I18nTranslatorMode... | Add message.
@return mixed | [
"Add",
"message",
"."
] | train | https://github.com/sifophp/sifo-common-instance/blob/52d54ea3e565bd2bccd77e0b0a6a99b5cae3aff5/controllers/i18n/actions.php#L39-L64 |
sifophp/sifo-common-instance | controllers/i18n/actions.php | I18nActionsController.customizeTranslation | protected function customizeTranslation()
{
$message = \Sifo\FilterPost::getInstance()->getString( 'msgid' );
$id_message = null;
if ( is_numeric( $message ) )
{
$id_message = $message;
}
$instance = $this->getParsedParam( 'instance' );
$translator_model = new I18nTranslatorModel();
$id_messa... | php | protected function customizeTranslation()
{
$message = \Sifo\FilterPost::getInstance()->getString( 'msgid' );
$id_message = null;
if ( is_numeric( $message ) )
{
$id_message = $message;
}
$instance = $this->getParsedParam( 'instance' );
$translator_model = new I18nTranslatorModel();
$id_messa... | [
"protected",
"function",
"customizeTranslation",
"(",
")",
"{",
"$",
"message",
"=",
"\\",
"Sifo",
"\\",
"FilterPost",
"::",
"getInstance",
"(",
")",
"->",
"getString",
"(",
"'msgid'",
")",
";",
"$",
"id_message",
"=",
"null",
";",
"if",
"(",
"is_numeric",... | Customize translation.
@return mixed | [
"Customize",
"translation",
"."
] | train | https://github.com/sifophp/sifo-common-instance/blob/52d54ea3e565bd2bccd77e0b0a6a99b5cae3aff5/controllers/i18n/actions.php#L70-L94 |
itrnka/ha-framework | src/ha/Access/HTTP/Error/Handler/HTTPErrorHandlerDefault.php | HTTPErrorHandlerDefault.handleError | public function handleError(HTTPInputRequest $request, HTTPOutputResponse $response, \Throwable $e) : void
{
if ($e instanceof HTTPError) {
$e->generateErrorResponse();
}
#$error = (new HTTPServerError([], $e->getMessage()))->generateErrorResponse();
throw $e;
} | php | public function handleError(HTTPInputRequest $request, HTTPOutputResponse $response, \Throwable $e) : void
{
if ($e instanceof HTTPError) {
$e->generateErrorResponse();
}
#$error = (new HTTPServerError([], $e->getMessage()))->generateErrorResponse();
throw $e;
} | [
"public",
"function",
"handleError",
"(",
"HTTPInputRequest",
"$",
"request",
",",
"HTTPOutputResponse",
"$",
"response",
",",
"\\",
"Throwable",
"$",
"e",
")",
":",
"void",
"{",
"if",
"(",
"$",
"e",
"instanceof",
"HTTPError",
")",
"{",
"$",
"e",
"->",
"... | Handle HTTP error or other \Throwable instance throwed under HTTP access.
@param HTTPInputRequest $request
@param HTTPOutputResponse $response
@param \Throwable $e
@throws \Throwable
@internal param \Throwable $error | [
"Handle",
"HTTP",
"error",
"or",
"other",
"\\",
"Throwable",
"instance",
"throwed",
"under",
"HTTP",
"access",
"."
] | train | https://github.com/itrnka/ha-framework/blob/a72b09c28f8e966c37f98a0004e4fbbce80df42c/src/ha/Access/HTTP/Error/Handler/HTTPErrorHandlerDefault.php#L23-L30 |
dphn/ScContent | src/ScContent/Controller/Back/ThemeController.php | ThemeController.indexAction | public function indexAction()
{
$view = new ViewModel();
$service = $this->getThemeService();
$view->registeredThemes = $service->getRegisteredThemes();
$view->options = $this->getModuleOptions();
$flashMessenger = $this->flashMessenger();
if ($flashMessenger->hasMess... | php | public function indexAction()
{
$view = new ViewModel();
$service = $this->getThemeService();
$view->registeredThemes = $service->getRegisteredThemes();
$view->options = $this->getModuleOptions();
$flashMessenger = $this->flashMessenger();
if ($flashMessenger->hasMess... | [
"public",
"function",
"indexAction",
"(",
")",
"{",
"$",
"view",
"=",
"new",
"ViewModel",
"(",
")",
";",
"$",
"service",
"=",
"$",
"this",
"->",
"getThemeService",
"(",
")",
";",
"$",
"view",
"->",
"registeredThemes",
"=",
"$",
"service",
"->",
"getReg... | Show list of themes.
@return \Zend\View\Model\ViewModel | [
"Show",
"list",
"of",
"themes",
"."
] | train | https://github.com/dphn/ScContent/blob/9dd5732490c45fd788b96cedf7b3c7adfacb30d2/src/ScContent/Controller/Back/ThemeController.php#L38-L49 |
dphn/ScContent | src/ScContent/Controller/Back/ThemeController.php | ThemeController.enableAction | public function enableAction()
{
$themeName = $this->params()->fromRoute('theme');
if (! $themeName) {
$this->flashMessenger()->addMessage(
$this->scTranslate('Theme was not specified.')
);
return $this->redirect()
->toRoute('sc-adm... | php | public function enableAction()
{
$themeName = $this->params()->fromRoute('theme');
if (! $themeName) {
$this->flashMessenger()->addMessage(
$this->scTranslate('Theme was not specified.')
);
return $this->redirect()
->toRoute('sc-adm... | [
"public",
"function",
"enableAction",
"(",
")",
"{",
"$",
"themeName",
"=",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromRoute",
"(",
"'theme'",
")",
";",
"if",
"(",
"!",
"$",
"themeName",
")",
"{",
"$",
"this",
"->",
"flashMessenger",
"(",
")",... | Enable theme.
@return \Zend\Stdlib\ResponseInterface | [
"Enable",
"theme",
"."
] | train | https://github.com/dphn/ScContent/blob/9dd5732490c45fd788b96cedf7b3c7adfacb30d2/src/ScContent/Controller/Back/ThemeController.php#L56-L75 |
dphn/ScContent | src/ScContent/Controller/Back/ThemeController.php | ThemeController.disableAction | public function disableAction()
{
$themeName = $this->params()->fromRoute('theme');
if (! $themeName) {
$this->flashMessenger()->addMessage(
$this->scTranslate('Theme was not specified.')
);
return $this->redirect()
->toRoute('sc-ad... | php | public function disableAction()
{
$themeName = $this->params()->fromRoute('theme');
if (! $themeName) {
$this->flashMessenger()->addMessage(
$this->scTranslate('Theme was not specified.')
);
return $this->redirect()
->toRoute('sc-ad... | [
"public",
"function",
"disableAction",
"(",
")",
"{",
"$",
"themeName",
"=",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromRoute",
"(",
"'theme'",
")",
";",
"if",
"(",
"!",
"$",
"themeName",
")",
"{",
"$",
"this",
"->",
"flashMessenger",
"(",
")"... | Disable theme.
@return \Zend\Stdlib\ResponseInterface | [
"Disable",
"theme",
"."
] | train | https://github.com/dphn/ScContent/blob/9dd5732490c45fd788b96cedf7b3c7adfacb30d2/src/ScContent/Controller/Back/ThemeController.php#L82-L101 |
dphn/ScContent | src/ScContent/Controller/Back/ThemeController.php | ThemeController.defaultAction | public function defaultAction()
{
$themeName = $this->params()->fromRoute('theme');
if (! $themeName) {
$this->flashMessenger()->addMessage(
$this->scTranslate('Theme was not specified.')
);
return $this->redirect()
->toRoute('sc-ad... | php | public function defaultAction()
{
$themeName = $this->params()->fromRoute('theme');
if (! $themeName) {
$this->flashMessenger()->addMessage(
$this->scTranslate('Theme was not specified.')
);
return $this->redirect()
->toRoute('sc-ad... | [
"public",
"function",
"defaultAction",
"(",
")",
"{",
"$",
"themeName",
"=",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromRoute",
"(",
"'theme'",
")",
";",
"if",
"(",
"!",
"$",
"themeName",
")",
"{",
"$",
"this",
"->",
"flashMessenger",
"(",
")"... | Set the default theme.
@return \Zend\Stdlib\ResponseInterface | [
"Set",
"the",
"default",
"theme",
"."
] | train | https://github.com/dphn/ScContent/blob/9dd5732490c45fd788b96cedf7b3c7adfacb30d2/src/ScContent/Controller/Back/ThemeController.php#L108-L127 |
rfdy/imagemagick | CLI/Operation/Processor.php | Processor.getOutputFileWithFormat | protected function getOutputFileWithFormat($temp_output_filename) {
if ($this->output_format) {
return $this->output_format . ':' . escapeshellarg($temp_output_filename);
}
return escapeshellarg($temp_output_filename);
} | php | protected function getOutputFileWithFormat($temp_output_filename) {
if ($this->output_format) {
return $this->output_format . ':' . escapeshellarg($temp_output_filename);
}
return escapeshellarg($temp_output_filename);
} | [
"protected",
"function",
"getOutputFileWithFormat",
"(",
"$",
"temp_output_filename",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"output_format",
")",
"{",
"return",
"$",
"this",
"->",
"output_format",
".",
"':'",
".",
"escapeshellarg",
"(",
"$",
"temp_output_filen... | @param $temp_output_filename
@return string | [
"@param",
"$temp_output_filename"
] | train | https://github.com/rfdy/imagemagick/blob/dd1e52fbd66093828dd013e64c53dc7d68f1bc91/CLI/Operation/Processor.php#L219-L225 |
ixocreate/type-package | src/Entity/CollectionType.php | CollectionType.getSchema | private function getSchema(): ?SchemaInterface
{
if (!empty($this->schema)) {
return $this->schema;
}
if (!empty($this->options['schema'])) {
//TODO check instance of
$this->schema = $this->options['schema'];
return $this->schema;
}
... | php | private function getSchema(): ?SchemaInterface
{
if (!empty($this->schema)) {
return $this->schema;
}
if (!empty($this->options['schema'])) {
//TODO check instance of
$this->schema = $this->options['schema'];
return $this->schema;
}
... | [
"private",
"function",
"getSchema",
"(",
")",
":",
"?",
"SchemaInterface",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"schema",
")",
")",
"{",
"return",
"$",
"this",
"->",
"schema",
";",
"}",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
... | Doesn't work when the object is unserialized!
@throws \Exception
@return SchemaInterface|null | [
"Doesn",
"t",
"work",
"when",
"the",
"object",
"is",
"unserialized!"
] | train | https://github.com/ixocreate/type-package/blob/20399dc055a2bea0da26311aef8c68bf2eaf5c1e/src/Entity/CollectionType.php#L57-L95 |
samjarrett/DoctrineSluggableBundle | src/SamJ/DoctrineSluggableBundle/Listener/SluggableListener.php | SluggableListener.generateUniqueSlug | public function generateUniqueSlug(SluggableInterface $entity, EntityRepository $repository)
{
// Find a slug
$eliminated = array(); // Our prior eliminated slugs
$foundSlug = false;
do {
// Obtain our slug
$slug = $this->slugger->getSlug($entity->getSlugFields(), $eliminated);
// See if it is in our... | php | public function generateUniqueSlug(SluggableInterface $entity, EntityRepository $repository)
{
// Find a slug
$eliminated = array(); // Our prior eliminated slugs
$foundSlug = false;
do {
// Obtain our slug
$slug = $this->slugger->getSlug($entity->getSlugFields(), $eliminated);
// See if it is in our... | [
"public",
"function",
"generateUniqueSlug",
"(",
"SluggableInterface",
"$",
"entity",
",",
"EntityRepository",
"$",
"repository",
")",
"{",
"// Find a slug",
"$",
"eliminated",
"=",
"array",
"(",
")",
";",
"// Our prior eliminated slugs",
"$",
"foundSlug",
"=",
"fal... | @param \SamJ\DoctrineSluggableBundle\SluggableInterface $entity
@param \Doctrine\ORM\EntityRepository $repository
@return void
@TODO: Remove the dependency on the field 'slug' on the entity (not in interface)
@TODO: Discuss whether the slug should auto-update if it is an 'update' (behaviour?) | [
"@param",
"\\",
"SamJ",
"\\",
"DoctrineSluggableBundle",
"\\",
"SluggableInterface",
"$entity",
"@param",
"\\",
"Doctrine",
"\\",
"ORM",
"\\",
"EntityRepository",
"$repository",
"@return",
"void"
] | train | https://github.com/samjarrett/DoctrineSluggableBundle/blob/e01bb68cbc4339a379efe36e8294205fd3a48a5c/src/SamJ/DoctrineSluggableBundle/Listener/SluggableListener.php#L58-L81 |
yosmanyga/validation | src/Yosmanyga/Validation/Resource/Normalizer/XmlFile/ArrayNormalizer.php | ArrayNormalizer.normalize | public function normalize($data, Resource $resource)
{
if (isset($data['value']['option'])) {
$data['value'] = $this->xmlKit->extractContent($data['value']['option']);
}
if (isset($data['value']['map'])) {
$data['value']['map'] = $this->normalizer->normalize(
... | php | public function normalize($data, Resource $resource)
{
if (isset($data['value']['option'])) {
$data['value'] = $this->xmlKit->extractContent($data['value']['option']);
}
if (isset($data['value']['map'])) {
$data['value']['map'] = $this->normalizer->normalize(
... | [
"public",
"function",
"normalize",
"(",
"$",
"data",
",",
"Resource",
"$",
"resource",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"'value'",
"]",
"[",
"'option'",
"]",
")",
")",
"{",
"$",
"data",
"[",
"'value'",
"]",
"=",
"$",
"this",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/yosmanyga/validation/blob/dded99a6e24b79f808250791ba1db632fd44c5c4/src/Yosmanyga/Validation/Resource/Normalizer/XmlFile/ArrayNormalizer.php#L42-L61 |
PandaPlatform/framework | src/Panda/Foundation/Bootstrap/BootstrapRegistry.php | BootstrapRegistry.setItems | public function setItems(array $bootLoaders)
{
// Set items in container
$items = ArrayHelper::set(parent::getItems(), self::CONTAINER, $bootLoaders, false);
// Set registry back
parent::setItems($items);
} | php | public function setItems(array $bootLoaders)
{
// Set items in container
$items = ArrayHelper::set(parent::getItems(), self::CONTAINER, $bootLoaders, false);
// Set registry back
parent::setItems($items);
} | [
"public",
"function",
"setItems",
"(",
"array",
"$",
"bootLoaders",
")",
"{",
"// Set items in container",
"$",
"items",
"=",
"ArrayHelper",
"::",
"set",
"(",
"parent",
"::",
"getItems",
"(",
")",
",",
"self",
"::",
"CONTAINER",
",",
"$",
"bootLoaders",
",",... | {@inheritdoc} | [
"{"
] | train | https://github.com/PandaPlatform/framework/blob/a78cf051b379896b5a4d5df620988e37a0e632f5/src/Panda/Foundation/Bootstrap/BootstrapRegistry.php#L36-L43 |
hfcorriez/php-childprocess | lib/Pagon/ChildProcess.php | ChildProcess.self | public static function self(array $option = array())
{
if (!self::$self) {
self::$self = new self($option);
}
return self::$self;
} | php | public static function self(array $option = array())
{
if (!self::$self) {
self::$self = new self($option);
}
return self::$self;
} | [
"public",
"static",
"function",
"self",
"(",
"array",
"$",
"option",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"self",
")",
"{",
"self",
"::",
"$",
"self",
"=",
"new",
"self",
"(",
"$",
"option",
")",
";",
"}",
"retur... | Instance for current process | [
"Instance",
"for",
"current",
"process"
] | train | https://github.com/hfcorriez/php-childprocess/blob/92481a85783cf2a24fef1760930f1252bb83fa5d/lib/Pagon/ChildProcess.php#L76-L82 |
hfcorriez/php-childprocess | lib/Pagon/ChildProcess.php | ChildProcess.parallel | public function parallel($closure, $options = array(), $start = true)
{
// Check auto_start
if (is_bool($options)) {
$start = $options;
$options = array();
}
// Check if process set
if ($closure instanceof Process) {
$child = $closure;
... | php | public function parallel($closure, $options = array(), $start = true)
{
// Check auto_start
if (is_bool($options)) {
$start = $options;
$options = array();
}
// Check if process set
if ($closure instanceof Process) {
$child = $closure;
... | [
"public",
"function",
"parallel",
"(",
"$",
"closure",
",",
"$",
"options",
"=",
"array",
"(",
")",
",",
"$",
"start",
"=",
"true",
")",
"{",
"// Check auto_start",
"if",
"(",
"is_bool",
"(",
"$",
"options",
")",
")",
"{",
"$",
"start",
"=",
"$",
"... | Run the closure in parallel space
@param callable|Process $closure
@param array|\Closure $options
@param bool $start
@throws \RuntimeException
@return Process | [
"Run",
"the",
"closure",
"in",
"parallel",
"space"
] | train | https://github.com/hfcorriez/php-childprocess/blob/92481a85783cf2a24fef1760930f1252bb83fa5d/lib/Pagon/ChildProcess.php#L109-L170 |
hfcorriez/php-childprocess | lib/Pagon/ChildProcess.php | ChildProcess.fork | public function fork($file, $options = array(), $start = true)
{
return $this->parallel(function ($process) use ($file) {
if (is_string($file) && is_file($file)) {
include($file);
} else {
throw new \RuntimeException('Bad file');
}
... | php | public function fork($file, $options = array(), $start = true)
{
return $this->parallel(function ($process) use ($file) {
if (is_string($file) && is_file($file)) {
include($file);
} else {
throw new \RuntimeException('Bad file');
}
... | [
"public",
"function",
"fork",
"(",
"$",
"file",
",",
"$",
"options",
"=",
"array",
"(",
")",
",",
"$",
"start",
"=",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"parallel",
"(",
"function",
"(",
"$",
"process",
")",
"use",
"(",
"$",
"file",
")... | Attempt to fork a child process from the parent to run a job in.
@param string $file
@param array|\Closure $options
@param bool $start
@return Process | [
"Attempt",
"to",
"fork",
"a",
"child",
"process",
"from",
"the",
"parent",
"to",
"run",
"a",
"job",
"in",
"."
] | train | https://github.com/hfcorriez/php-childprocess/blob/92481a85783cf2a24fef1760930f1252bb83fa5d/lib/Pagon/ChildProcess.php#L180-L189 |
hfcorriez/php-childprocess | lib/Pagon/ChildProcess.php | ChildProcess.spawn | public function spawn($cmd, $options = array(), $start = true)
{
// Generate guid
$guid = uniqid();
// Get create directory
$dir = !empty($options['dir']) ? $options['dir'] : sys_get_temp_dir();
// Events name
$types = array('stdin', 'stdout', 'stderr');
// Fi... | php | public function spawn($cmd, $options = array(), $start = true)
{
// Generate guid
$guid = uniqid();
// Get create directory
$dir = !empty($options['dir']) ? $options['dir'] : sys_get_temp_dir();
// Events name
$types = array('stdin', 'stdout', 'stderr');
// Fi... | [
"public",
"function",
"spawn",
"(",
"$",
"cmd",
",",
"$",
"options",
"=",
"array",
"(",
")",
",",
"$",
"start",
"=",
"true",
")",
"{",
"// Generate guid",
"$",
"guid",
"=",
"uniqid",
"(",
")",
";",
"// Get create directory",
"$",
"dir",
"=",
"!",
"em... | Spawn the command
@param string $cmd
@param array|\Closure $options
@param bool $start
@return Process | [
"Spawn",
"the",
"command"
] | train | https://github.com/hfcorriez/php-childprocess/blob/92481a85783cf2a24fef1760930f1252bb83fa5d/lib/Pagon/ChildProcess.php#L199-L281 |
hfcorriez/php-childprocess | lib/Pagon/ChildProcess.php | ChildProcess.wait | public function wait()
{
foreach ($this->prepared_children as $child) {
$child->run();
}
while ($this->children) {
usleep(100000);
}
} | php | public function wait()
{
foreach ($this->prepared_children as $child) {
$child->run();
}
while ($this->children) {
usleep(100000);
}
} | [
"public",
"function",
"wait",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"prepared_children",
"as",
"$",
"child",
")",
"{",
"$",
"child",
"->",
"run",
"(",
")",
";",
"}",
"while",
"(",
"$",
"this",
"->",
"children",
")",
"{",
"usleep",
"(",
... | Join | [
"Join"
] | train | https://github.com/hfcorriez/php-childprocess/blob/92481a85783cf2a24fef1760930f1252bb83fa5d/lib/Pagon/ChildProcess.php#L286-L295 |
hfcorriez/php-childprocess | lib/Pagon/ChildProcess.php | ChildProcess.daemonize | public function daemonize()
{
$pid = pcntl_fork();
if ($pid === -1) {
throw new \RuntimeException('Unable to fork child process.');
} else if ($pid) {
exit;
}
// Make sub process as session leader
posix_setsid();
if ($pid === -1) {
... | php | public function daemonize()
{
$pid = pcntl_fork();
if ($pid === -1) {
throw new \RuntimeException('Unable to fork child process.');
} else if ($pid) {
exit;
}
// Make sub process as session leader
posix_setsid();
if ($pid === -1) {
... | [
"public",
"function",
"daemonize",
"(",
")",
"{",
"$",
"pid",
"=",
"pcntl_fork",
"(",
")",
";",
"if",
"(",
"$",
"pid",
"===",
"-",
"1",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Unable to fork child process.'",
")",
";",
"}",
"else",
"... | Make the process daemonize
@return ChildProcess
@throws \RuntimeException | [
"Make",
"the",
"process",
"daemonize"
] | train | https://github.com/hfcorriez/php-childprocess/blob/92481a85783cf2a24fef1760930f1252bb83fa5d/lib/Pagon/ChildProcess.php#L303-L333 |
hfcorriez/php-childprocess | lib/Pagon/ChildProcess.php | ChildProcess.listen | public function listen()
{
if (!$this->queue) {
$this->queue = msg_get_queue($this->pid);
$this->emit('listen');
}
return $this;
} | php | public function listen()
{
if (!$this->queue) {
$this->queue = msg_get_queue($this->pid);
$this->emit('listen');
}
return $this;
} | [
"public",
"function",
"listen",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"queue",
")",
"{",
"$",
"this",
"->",
"queue",
"=",
"msg_get_queue",
"(",
"$",
"this",
"->",
"pid",
")",
";",
"$",
"this",
"->",
"emit",
"(",
"'listen'",
")",
";",
... | Register message listener | [
"Register",
"message",
"listener"
] | train | https://github.com/hfcorriez/php-childprocess/blob/92481a85783cf2a24fef1760930f1252bb83fa5d/lib/Pagon/ChildProcess.php#L358-L365 |
hfcorriez/php-childprocess | lib/Pagon/ChildProcess.php | ChildProcess.clear | public function clear($process)
{
if ($process instanceof Process) {
if (($index = array_search($process, $this->children)) !== false) {
$this->children[$index]->__destruct();
unset($this->children[$index]);
}
} elseif (is_numeric($process)) {
... | php | public function clear($process)
{
if ($process instanceof Process) {
if (($index = array_search($process, $this->children)) !== false) {
$this->children[$index]->__destruct();
unset($this->children[$index]);
}
} elseif (is_numeric($process)) {
... | [
"public",
"function",
"clear",
"(",
"$",
"process",
")",
"{",
"if",
"(",
"$",
"process",
"instanceof",
"Process",
")",
"{",
"if",
"(",
"(",
"$",
"index",
"=",
"array_search",
"(",
"$",
"process",
",",
"$",
"this",
"->",
"children",
")",
")",
"!==",
... | Clear children
@param Process|int $process
@throws \InvalidArgumentException | [
"Clear",
"children"
] | train | https://github.com/hfcorriez/php-childprocess/blob/92481a85783cf2a24fef1760930f1252bb83fa5d/lib/Pagon/ChildProcess.php#L373-L388 |
hfcorriez/php-childprocess | lib/Pagon/ChildProcess.php | ChildProcess.childInitialize | protected function childInitialize(array $options = array())
{
$this->prepared = false;
$this->removeAllListeners();
$this->master = false;
$pid = posix_getpid();
$this->ppid = $this->pid;
$this->pid = $pid;
$this->queue = null;
$this->process = new Pr... | php | protected function childInitialize(array $options = array())
{
$this->prepared = false;
$this->removeAllListeners();
$this->master = false;
$pid = posix_getpid();
$this->ppid = $this->pid;
$this->pid = $pid;
$this->queue = null;
$this->process = new Pr... | [
"protected",
"function",
"childInitialize",
"(",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"prepared",
"=",
"false",
";",
"$",
"this",
"->",
"removeAllListeners",
"(",
")",
";",
"$",
"this",
"->",
"master",
"=",
"fal... | Init child process
@param array $options | [
"Init",
"child",
"process"
] | train | https://github.com/hfcorriez/php-childprocess/blob/92481a85783cf2a24fef1760930f1252bb83fa5d/lib/Pagon/ChildProcess.php#L395-L411 |
hfcorriez/php-childprocess | lib/Pagon/ChildProcess.php | ChildProcess.childProcessOptions | protected function childProcessOptions($options)
{
// Process options
if ($options['cwd']) {
chdir($options['cwd']);
}
// User to be change
if ($options['user']) {
$this->childChangeUser($options['user']);
}
// Env set
if ($op... | php | protected function childProcessOptions($options)
{
// Process options
if ($options['cwd']) {
chdir($options['cwd']);
}
// User to be change
if ($options['user']) {
$this->childChangeUser($options['user']);
}
// Env set
if ($op... | [
"protected",
"function",
"childProcessOptions",
"(",
"$",
"options",
")",
"{",
"// Process options",
"if",
"(",
"$",
"options",
"[",
"'cwd'",
"]",
")",
"{",
"chdir",
"(",
"$",
"options",
"[",
"'cwd'",
"]",
")",
";",
"}",
"// User to be change",
"if",
"(",
... | Process options in child
@param $options | [
"Process",
"options",
"in",
"child"
] | train | https://github.com/hfcorriez/php-childprocess/blob/92481a85783cf2a24fef1760930f1252bb83fa5d/lib/Pagon/ChildProcess.php#L418-L444 |
hfcorriez/php-childprocess | lib/Pagon/ChildProcess.php | ChildProcess.tryChangeUser | protected function tryChangeUser($user)
{
$changed_user = false;
// Check user can be changed?
if ($user && posix_getuid() > 0) {
// Not root
throw new \RuntimeException('Only root can change user to spawn the process');
}
// Check user if exists?
... | php | protected function tryChangeUser($user)
{
$changed_user = false;
// Check user can be changed?
if ($user && posix_getuid() > 0) {
// Not root
throw new \RuntimeException('Only root can change user to spawn the process');
}
// Check user if exists?
... | [
"protected",
"function",
"tryChangeUser",
"(",
"$",
"user",
")",
"{",
"$",
"changed_user",
"=",
"false",
";",
"// Check user can be changed?",
"if",
"(",
"$",
"user",
"&&",
"posix_getuid",
"(",
")",
">",
"0",
")",
"{",
"// Not root",
"throw",
"new",
"\\",
... | Try to change user
@param string $user
@return array|bool
@throws \RuntimeException | [
"Try",
"to",
"change",
"user"
] | train | https://github.com/hfcorriez/php-childprocess/blob/92481a85783cf2a24fef1760930f1252bb83fa5d/lib/Pagon/ChildProcess.php#L453-L468 |
hfcorriez/php-childprocess | lib/Pagon/ChildProcess.php | ChildProcess.childSetTimeout | protected function childSetTimeout($timeout)
{
$start_time = time();
$self = $this;
$this->on('tick', function () use ($timeout, $start_time, $self) {
if ($start_time + $timeout < time()) $self->shutdown(1);
});
} | php | protected function childSetTimeout($timeout)
{
$start_time = time();
$self = $this;
$this->on('tick', function () use ($timeout, $start_time, $self) {
if ($start_time + $timeout < time()) $self->shutdown(1);
});
} | [
"protected",
"function",
"childSetTimeout",
"(",
"$",
"timeout",
")",
"{",
"$",
"start_time",
"=",
"time",
"(",
")",
";",
"$",
"self",
"=",
"$",
"this",
";",
"$",
"this",
"->",
"on",
"(",
"'tick'",
",",
"function",
"(",
")",
"use",
"(",
"$",
"timeo... | Try to set timeout
@param int $timeout | [
"Try",
"to",
"set",
"timeout"
] | train | https://github.com/hfcorriez/php-childprocess/blob/92481a85783cf2a24fef1760930f1252bb83fa5d/lib/Pagon/ChildProcess.php#L475-L482 |
hfcorriez/php-childprocess | lib/Pagon/ChildProcess.php | ChildProcess.childChangeUser | protected function childChangeUser($user)
{
if (is_array($user) || ($user = $this->tryChangeUser($user))) {
posix_setgid($user['gid']);
posix_setuid($user['uid']);
}
} | php | protected function childChangeUser($user)
{
if (is_array($user) || ($user = $this->tryChangeUser($user))) {
posix_setgid($user['gid']);
posix_setuid($user['uid']);
}
} | [
"protected",
"function",
"childChangeUser",
"(",
"$",
"user",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"user",
")",
"||",
"(",
"$",
"user",
"=",
"$",
"this",
"->",
"tryChangeUser",
"(",
"$",
"user",
")",
")",
")",
"{",
"posix_setgid",
"(",
"$",
"... | Process change user
@param string $user | [
"Process",
"change",
"user"
] | train | https://github.com/hfcorriez/php-childprocess/blob/92481a85783cf2a24fef1760930f1252bb83fa5d/lib/Pagon/ChildProcess.php#L514-L520 |
hfcorriez/php-childprocess | lib/Pagon/ChildProcess.php | ChildProcess.registerSigHandlers | protected function registerSigHandlers()
{
pcntl_signal(SIGTERM, array($this, 'signalHandler'));
pcntl_signal(SIGINT, array($this, 'signalHandler'));;
pcntl_signal(SIGUSR1, array($this, 'signalHandler'));
pcntl_signal(SIGUSR2, array($this, 'signalHandler'));
//pcntl_signal(SI... | php | protected function registerSigHandlers()
{
pcntl_signal(SIGTERM, array($this, 'signalHandler'));
pcntl_signal(SIGINT, array($this, 'signalHandler'));;
pcntl_signal(SIGUSR1, array($this, 'signalHandler'));
pcntl_signal(SIGUSR2, array($this, 'signalHandler'));
//pcntl_signal(SI... | [
"protected",
"function",
"registerSigHandlers",
"(",
")",
"{",
"pcntl_signal",
"(",
"SIGTERM",
",",
"array",
"(",
"$",
"this",
",",
"'signalHandler'",
")",
")",
";",
"pcntl_signal",
"(",
"SIGINT",
",",
"array",
"(",
"$",
"this",
",",
"'signalHandler'",
")",
... | Register signal handlers that a worker should respond to. | [
"Register",
"signal",
"handlers",
"that",
"a",
"worker",
"should",
"respond",
"to",
"."
] | train | https://github.com/hfcorriez/php-childprocess/blob/92481a85783cf2a24fef1760930f1252bb83fa5d/lib/Pagon/ChildProcess.php#L538-L548 |
hfcorriez/php-childprocess | lib/Pagon/ChildProcess.php | ChildProcess.signalHandler | public function signalHandler($signal)
{
$this->emit('signal', $signal);
$this->emit($signal);
// Default signal process
if ($this->options['catch_signal']) {
$this->signalHandlerDefault($signal);
}
} | php | public function signalHandler($signal)
{
$this->emit('signal', $signal);
$this->emit($signal);
// Default signal process
if ($this->options['catch_signal']) {
$this->signalHandlerDefault($signal);
}
} | [
"public",
"function",
"signalHandler",
"(",
"$",
"signal",
")",
"{",
"$",
"this",
"->",
"emit",
"(",
"'signal'",
",",
"$",
"signal",
")",
";",
"$",
"this",
"->",
"emit",
"(",
"$",
"signal",
")",
";",
"// Default signal process",
"if",
"(",
"$",
"this",... | Control signals
@param int $signal | [
"Control",
"signals"
] | train | https://github.com/hfcorriez/php-childprocess/blob/92481a85783cf2a24fef1760930f1252bb83fa5d/lib/Pagon/ChildProcess.php#L555-L564 |
hfcorriez/php-childprocess | lib/Pagon/ChildProcess.php | ChildProcess.signalHandlerDefault | protected function signalHandlerDefault($signal)
{
switch ($signal) {
case SIGTERM:
case SIGINT:
// Check children
while ($this->children) {
foreach ($this->children as $child) {
$ok = $child->kill(SIGINT);
... | php | protected function signalHandlerDefault($signal)
{
switch ($signal) {
case SIGTERM:
case SIGINT:
// Check children
while ($this->children) {
foreach ($this->children as $child) {
$ok = $child->kill(SIGINT);
... | [
"protected",
"function",
"signalHandlerDefault",
"(",
"$",
"signal",
")",
"{",
"switch",
"(",
"$",
"signal",
")",
"{",
"case",
"SIGTERM",
":",
"case",
"SIGINT",
":",
"// Check children",
"while",
"(",
"$",
"this",
"->",
"children",
")",
"{",
"foreach",
"("... | Default signal handler
@param int $signal | [
"Default",
"signal",
"handler"
] | train | https://github.com/hfcorriez/php-childprocess/blob/92481a85783cf2a24fef1760930f1252bb83fa5d/lib/Pagon/ChildProcess.php#L571-L596 |
hfcorriez/php-childprocess | lib/Pagon/ChildProcess.php | ChildProcess.shutdown | public function shutdown($status = 0, $info = null)
{
if (!$this->process->isExit()) {
$this->process->status = $status;
$this->emit('exit', $status, $info);
$this->process->emit('exit', $status, $info);
}
} | php | public function shutdown($status = 0, $info = null)
{
if (!$this->process->isExit()) {
$this->process->status = $status;
$this->emit('exit', $status, $info);
$this->process->emit('exit', $status, $info);
}
} | [
"public",
"function",
"shutdown",
"(",
"$",
"status",
"=",
"0",
",",
"$",
"info",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"process",
"->",
"isExit",
"(",
")",
")",
"{",
"$",
"this",
"->",
"process",
"->",
"status",
"=",
"$",
"... | Shutdown with status
@param int $status
@param mixed $info | [
"Shutdown",
"with",
"status"
] | train | https://github.com/hfcorriez/php-childprocess/blob/92481a85783cf2a24fef1760930f1252bb83fa5d/lib/Pagon/ChildProcess.php#L604-L611 |
hfcorriez/php-childprocess | lib/Pagon/ChildProcess.php | ChildProcess.registerShutdownHandlers | protected function registerShutdownHandlers()
{
$self = $this;
register_shutdown_function(function () use ($self) {
if (($error = error_get_last()) && in_array($error['type'], array(E_PARSE, E_ERROR, E_USER_ERROR))) {
$self->shutdown(1, $error);
} else {
... | php | protected function registerShutdownHandlers()
{
$self = $this;
register_shutdown_function(function () use ($self) {
if (($error = error_get_last()) && in_array($error['type'], array(E_PARSE, E_ERROR, E_USER_ERROR))) {
$self->shutdown(1, $error);
} else {
... | [
"protected",
"function",
"registerShutdownHandlers",
"(",
")",
"{",
"$",
"self",
"=",
"$",
"this",
";",
"register_shutdown_function",
"(",
"function",
"(",
")",
"use",
"(",
"$",
"self",
")",
"{",
"if",
"(",
"(",
"$",
"error",
"=",
"error_get_last",
"(",
... | Shutdown handlers | [
"Shutdown",
"handlers"
] | train | https://github.com/hfcorriez/php-childprocess/blob/92481a85783cf2a24fef1760930f1252bb83fa5d/lib/Pagon/ChildProcess.php#L616-L633 |
hfcorriez/php-childprocess | lib/Pagon/ChildProcess.php | ChildProcess.registerTickHandlers | protected function registerTickHandlers()
{
$self = $this;
register_tick_function(function () use ($self) {
if (!$self->prepared) {
return;
}
if ($self->master) {
while ($pid = pcntl_wait($status, WNOHANG)) {
if... | php | protected function registerTickHandlers()
{
$self = $this;
register_tick_function(function () use ($self) {
if (!$self->prepared) {
return;
}
if ($self->master) {
while ($pid = pcntl_wait($status, WNOHANG)) {
if... | [
"protected",
"function",
"registerTickHandlers",
"(",
")",
"{",
"$",
"self",
"=",
"$",
"this",
";",
"register_tick_function",
"(",
"function",
"(",
")",
"use",
"(",
"$",
"self",
")",
"{",
"if",
"(",
"!",
"$",
"self",
"->",
"prepared",
")",
"{",
"return... | Register tick handlers | [
"Register",
"tick",
"handlers"
] | train | https://github.com/hfcorriez/php-childprocess/blob/92481a85783cf2a24fef1760930f1252bb83fa5d/lib/Pagon/ChildProcess.php#L638-L686 |
mimmi20/Wurfl | src/Storage/Factory.php | Factory.create | public static function create(array $configuration)
{
$currentConfiguration = is_array($configuration) ? array_merge(self::$defaultConfiguration, $configuration)
: self::$defaultConfiguration;
$class = self::className($currentConfiguration);
$adapter = new $class($currentConfig... | php | public static function create(array $configuration)
{
$currentConfiguration = is_array($configuration) ? array_merge(self::$defaultConfiguration, $configuration)
: self::$defaultConfiguration;
$class = self::className($currentConfiguration);
$adapter = new $class($currentConfig... | [
"public",
"static",
"function",
"create",
"(",
"array",
"$",
"configuration",
")",
"{",
"$",
"currentConfiguration",
"=",
"is_array",
"(",
"$",
"configuration",
")",
"?",
"array_merge",
"(",
"self",
"::",
"$",
"defaultConfiguration",
",",
"$",
"configuration",
... | Create a configuration based on the default configuration with the differences from $configuration
@param array $configuration
@return \Wurfl\Storage\Storage Storage object, initialized with the given $configuration | [
"Create",
"a",
"configuration",
"based",
"on",
"the",
"default",
"configuration",
"with",
"the",
"differences",
"from",
"$configuration"
] | train | https://github.com/mimmi20/Wurfl/blob/443ed0d73a0b9a21ebd0d6ddf1e32669b9de44ec/src/Storage/Factory.php#L43-L53 |
mimmi20/Wurfl | src/Storage/Factory.php | Factory.className | private static function className($configuration)
{
$provider = (empty($configuration[Config::PROVIDER]) ? 'null' : $configuration[Config::PROVIDER]);
if ('null' === $provider) {
$provider = 'NullStorage';
}
return '\\WurflCache\\Adapter\\' . ucfirst($provider);
} | php | private static function className($configuration)
{
$provider = (empty($configuration[Config::PROVIDER]) ? 'null' : $configuration[Config::PROVIDER]);
if ('null' === $provider) {
$provider = 'NullStorage';
}
return '\\WurflCache\\Adapter\\' . ucfirst($provider);
} | [
"private",
"static",
"function",
"className",
"(",
"$",
"configuration",
")",
"{",
"$",
"provider",
"=",
"(",
"empty",
"(",
"$",
"configuration",
"[",
"Config",
"::",
"PROVIDER",
"]",
")",
"?",
"'null'",
":",
"$",
"configuration",
"[",
"Config",
"::",
"P... | Return the Storage Provider Class name from the given $configuration by using its 'provider' element
@param array $configuration
@return string WurflCache Storage Provider class name | [
"Return",
"the",
"Storage",
"Provider",
"Class",
"name",
"from",
"the",
"given",
"$configuration",
"by",
"using",
"its",
"provider",
"element"
] | train | https://github.com/mimmi20/Wurfl/blob/443ed0d73a0b9a21ebd0d6ddf1e32669b9de44ec/src/Storage/Factory.php#L62-L71 |
FWidm/dwd-hourly-crawler | src/fwidm/dwdHourlyCrawler/DWDUtil.php | DWDUtil.getFileNameFromPath | public static function getFileNameFromPath(string $path)
{
$split = explode('/', $path);
$name = (string)end($split);
return $name;
} | php | public static function getFileNameFromPath(string $path)
{
$split = explode('/', $path);
$name = (string)end($split);
return $name;
} | [
"public",
"static",
"function",
"getFileNameFromPath",
"(",
"string",
"$",
"path",
")",
"{",
"$",
"split",
"=",
"explode",
"(",
"'/'",
",",
"$",
"path",
")",
";",
"$",
"name",
"=",
"(",
"string",
")",
"end",
"(",
"$",
"split",
")",
";",
"return",
"... | Splits (FTP) Paths with forward slashes to get the file name.
@param string $path
@return string | [
"Splits",
"(",
"FTP",
")",
"Paths",
"with",
"forward",
"slashes",
"to",
"get",
"the",
"file",
"name",
"."
] | train | https://github.com/FWidm/dwd-hourly-crawler/blob/36dec7d84a85af599e9d4fb6a3bcc302378ce4a8/src/fwidm/dwdHourlyCrawler/DWDUtil.php#L40-L46 |
FWidm/dwd-hourly-crawler | src/fwidm/dwdHourlyCrawler/DWDUtil.php | DWDUtil.getDataFromZip | static function getDataFromZip($zipFile, $extractionPrefix)
{
$zip = new ZipArchive;
self::log(self::class, "zip=" . $zipFile);
if ($zip->open($zipFile)) {
for ($i = 0; $i < $zip->numFiles; $i++) {
$stat = $zip->statIndex($i);
// print_r(basename($stat[... | php | static function getDataFromZip($zipFile, $extractionPrefix)
{
$zip = new ZipArchive;
self::log(self::class, "zip=" . $zipFile);
if ($zip->open($zipFile)) {
for ($i = 0; $i < $zip->numFiles; $i++) {
$stat = $zip->statIndex($i);
// print_r(basename($stat[... | [
"static",
"function",
"getDataFromZip",
"(",
"$",
"zipFile",
",",
"$",
"extractionPrefix",
")",
"{",
"$",
"zip",
"=",
"new",
"ZipArchive",
";",
"self",
"::",
"log",
"(",
"self",
"::",
"class",
",",
"\"zip=\"",
".",
"$",
"zipFile",
")",
";",
"if",
"(",
... | Extract the single file we need to use to get the data.
@param $zipFile - zip file we want to exctract from
@param $extractionPrefix - part of the file's prefix we want to match
@return null|string | [
"Extract",
"the",
"single",
"file",
"we",
"need",
"to",
"use",
"to",
"get",
"the",
"data",
"."
] | train | https://github.com/FWidm/dwd-hourly-crawler/blob/36dec7d84a85af599e9d4fb6a3bcc302378ce4a8/src/fwidm/dwdHourlyCrawler/DWDUtil.php#L55-L76 |
FWidm/dwd-hourly-crawler | src/fwidm/dwdHourlyCrawler/DWDUtil.php | DWDUtil.calculateDistanceToStation | public static function calculateDistanceToStation(Coordinate $coordinate, DWDStation $station, $unit = "m")
{
$coordinateStation = new Coordinate($station->getLatitude(), $station->getLongitude()); // Mauna Kea Summit
$calculator = new Vincenty();
$distance_meters = $calculator->getDistance... | php | public static function calculateDistanceToStation(Coordinate $coordinate, DWDStation $station, $unit = "m")
{
$coordinateStation = new Coordinate($station->getLatitude(), $station->getLongitude()); // Mauna Kea Summit
$calculator = new Vincenty();
$distance_meters = $calculator->getDistance... | [
"public",
"static",
"function",
"calculateDistanceToStation",
"(",
"Coordinate",
"$",
"coordinate",
",",
"DWDStation",
"$",
"station",
",",
"$",
"unit",
"=",
"\"m\"",
")",
"{",
"$",
"coordinateStation",
"=",
"new",
"Coordinate",
"(",
"$",
"station",
"->",
"get... | Calculates the distance from coordinate to station in either meters (default) or km
@param Coordinate $coordinate
@param DWDStation $station
@param string $unit - default is "m" for meters, can be set to "km" for km.
@return float - distance in meters or km | [
"Calculates",
"the",
"distance",
"from",
"coordinate",
"to",
"station",
"in",
"either",
"meters",
"(",
"default",
")",
"or",
"km"
] | train | https://github.com/FWidm/dwd-hourly-crawler/blob/36dec7d84a85af599e9d4fb6a3bcc302378ce4a8/src/fwidm/dwdHourlyCrawler/DWDUtil.php#L124-L134 |
rokde/laravel-bootstrap-formbuilder | src/BootstrapFormBuilder.php | BootstrapFormBuilder.openGroup | public function openGroup($name, $label = null, $options = [])
{
$options = $this->appendClassToOptions('form-group', $options);
// Append the name of the group to the groupStack.
$this->groupStack[] = $name;
if ($this->hasErrors($name)) {
// If the form element with the ... | php | public function openGroup($name, $label = null, $options = [])
{
$options = $this->appendClassToOptions('form-group', $options);
// Append the name of the group to the groupStack.
$this->groupStack[] = $name;
if ($this->hasErrors($name)) {
// If the form element with the ... | [
"public",
"function",
"openGroup",
"(",
"$",
"name",
",",
"$",
"label",
"=",
"null",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"appendClassToOptions",
"(",
"'form-group'",
",",
"$",
"options",
")",
";",
"//... | Open a new form group.
@param string $name
@param mixed $label
@param array $options
@return string | [
"Open",
"a",
"new",
"form",
"group",
"."
] | train | https://github.com/rokde/laravel-bootstrap-formbuilder/blob/f3ce43ad3d74b045176e24a03e9deffb71c17cd6/src/BootstrapFormBuilder.php#L30-L45 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.