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 |
|---|---|---|---|---|---|---|---|---|---|---|
austinkregel/Warden | src/Warden/Http/Controllers/ModelController.php | ModelController.getNewModel | protected function getNewModel($model_name, FormModel $form)
{
/*
* We need to grab the model from the config and select one entry for
* that model from within the database.
*/
$model = $this->findModel($model_name);
/*
* Here we generate the form to upda... | php | protected function getNewModel($model_name, FormModel $form)
{
/*
* We need to grab the model from the config and select one entry for
* that model from within the database.
*/
$model = $this->findModel($model_name);
/*
* Here we generate the form to upda... | [
"protected",
"function",
"getNewModel",
"(",
"$",
"model_name",
",",
"FormModel",
"$",
"form",
")",
"{",
"/*\n * We need to grab the model from the config and select one entry for\n * that model from within the database.\n */",
"$",
"model",
"=",
"$",
"this"... | @param string $model_name A key in the warden.models configuration
@param FormModel $form An injected model
@return mixed | [
"@param",
"string",
"$model_name",
"A",
"key",
"in",
"the",
"warden",
".",
"models",
"configuration",
"@param",
"FormModel",
"$form",
"An",
"injected",
"model"
] | train | https://github.com/austinkregel/Warden/blob/6f5a98bd79a488f0f300f4851061ac6f7d19f8a3/src/Warden/Http/Controllers/ModelController.php#L105-L128 |
austinkregel/Warden | src/Warden/Http/Controllers/ModelController.php | ModelController.deleteModel | protected function deleteModel($model_name, $id)
{
/*
* Retrieve the desired model
*/
$response = $this->delete('warden::api.delete-model', [$model_name, $id]);
Session::flash('message', 'Hooray! It worked! The model was deleted!');
return redirect(route('warden::... | php | protected function deleteModel($model_name, $id)
{
/*
* Retrieve the desired model
*/
$response = $this->delete('warden::api.delete-model', [$model_name, $id]);
Session::flash('message', 'Hooray! It worked! The model was deleted!');
return redirect(route('warden::... | [
"protected",
"function",
"deleteModel",
"(",
"$",
"model_name",
",",
"$",
"id",
")",
"{",
"/*\n * Retrieve the desired model\n */",
"$",
"response",
"=",
"$",
"this",
"->",
"delete",
"(",
"'warden::api.delete-model'",
",",
"[",
"$",
"model_name",
","... | @depreciated Please use ajax to delete the element.
@param string $model_name A key in the warden.models configuration
@param int $id The id of the model
@return Route | [
"@depreciated",
"Please",
"use",
"ajax",
"to",
"delete",
"the",
"element",
"."
] | train | https://github.com/austinkregel/Warden/blob/6f5a98bd79a488f0f300f4851061ac6f7d19f8a3/src/Warden/Http/Controllers/ModelController.php#L138-L148 |
austinkregel/Warden | src/Warden/Http/Controllers/ModelController.php | ModelController.createModel | protected function createModel($model_name)
{
$this->post('warden::api.create-model', [$model_name]);
return redirect(route('warden::model', [$model_name, $model->id]));
} | php | protected function createModel($model_name)
{
$this->post('warden::api.create-model', [$model_name]);
return redirect(route('warden::model', [$model_name, $model->id]));
} | [
"protected",
"function",
"createModel",
"(",
"$",
"model_name",
")",
"{",
"$",
"this",
"->",
"post",
"(",
"'warden::api.create-model'",
",",
"[",
"$",
"model_name",
"]",
")",
";",
"return",
"redirect",
"(",
"route",
"(",
"'warden::model'",
",",
"[",
"$",
"... | @param string $model_name A key in the warden.models configuration
@return Route | [
"@param",
"string",
"$model_name",
"A",
"key",
"in",
"the",
"warden",
".",
"models",
"configuration"
] | train | https://github.com/austinkregel/Warden/blob/6f5a98bd79a488f0f300f4851061ac6f7d19f8a3/src/Warden/Http/Controllers/ModelController.php#L155-L160 |
austinkregel/Warden | src/Warden/Http/Controllers/ModelController.php | ModelController.sortInputAndApply | private function sortInputAndApply(Model &$model, $update = false)
{
// Loop through all input
if ($update) {
foreach (Input::all() as $key => $value) {
// Check to see if there is any available value for the desired model.
if (!empty($model->$key)) {
... | php | private function sortInputAndApply(Model &$model, $update = false)
{
// Loop through all input
if ($update) {
foreach (Input::all() as $key => $value) {
// Check to see if there is any available value for the desired model.
if (!empty($model->$key)) {
... | [
"private",
"function",
"sortInputAndApply",
"(",
"Model",
"&",
"$",
"model",
",",
"$",
"update",
"=",
"false",
")",
"{",
"// Loop through all input",
"if",
"(",
"$",
"update",
")",
"{",
"foreach",
"(",
"Input",
"::",
"all",
"(",
")",
"as",
"$",
"key",
... | @param Model $model This should be an eloquent based thing...
@return Model A newed up model | [
"@param",
"Model",
"$model",
"This",
"should",
"be",
"an",
"eloquent",
"based",
"thing",
"..."
] | train | https://github.com/austinkregel/Warden/blob/6f5a98bd79a488f0f300f4851061ac6f7d19f8a3/src/Warden/Http/Controllers/ModelController.php#L167-L205 |
austinkregel/Warden | src/Warden/Http/Controllers/ModelController.php | ModelController.manageInput | private function manageInput($input_type, $input)
{
switch (true) {
case stripos($input_type, 'password') !== false:
// Encrypt the password fields
// The password field will not be shortend due to poor naming of
// Other potential naming conflicts... | php | private function manageInput($input_type, $input)
{
switch (true) {
case stripos($input_type, 'password') !== false:
// Encrypt the password fields
// The password field will not be shortend due to poor naming of
// Other potential naming conflicts... | [
"private",
"function",
"manageInput",
"(",
"$",
"input_type",
",",
"$",
"input",
")",
"{",
"switch",
"(",
"true",
")",
"{",
"case",
"stripos",
"(",
"$",
"input_type",
",",
"'password'",
")",
"!==",
"false",
":",
"// Encrypt the password fields",
"// The passwo... | @param $input_type
@param $input
@return string | [
"@param",
"$input_type",
"@param",
"$input"
] | train | https://github.com/austinkregel/Warden/blob/6f5a98bd79a488f0f300f4851061ac6f7d19f8a3/src/Warden/Http/Controllers/ModelController.php#L213-L226 |
mihai-stancu/serializer | Serializer/Normalizer/RecursiveNormalizer.php | RecursiveNormalizer.instantiateObject | protected function instantiateObject(array &$data, $class, array &$context, \ReflectionClass $reflectionClass, $allowedAttributes)
{
if (
isset($context['object_to_populate']) &&
is_object($context['object_to_populate']) &&
$class === get_class($context['object_to_populat... | php | protected function instantiateObject(array &$data, $class, array &$context, \ReflectionClass $reflectionClass, $allowedAttributes)
{
if (
isset($context['object_to_populate']) &&
is_object($context['object_to_populate']) &&
$class === get_class($context['object_to_populat... | [
"protected",
"function",
"instantiateObject",
"(",
"array",
"&",
"$",
"data",
",",
"$",
"class",
",",
"array",
"&",
"$",
"context",
",",
"\\",
"ReflectionClass",
"$",
"reflectionClass",
",",
"$",
"allowedAttributes",
")",
"{",
"if",
"(",
"isset",
"(",
"$",... | @param array $data
@param string $class
@param array $context
@param \ReflectionClass $reflectionClass
@param array|bool $allowedAttributes
@throws RuntimeException
@return object | [
"@param",
"array",
"$data",
"@param",
"string",
"$class",
"@param",
"array",
"$context",
"@param",
"\\",
"ReflectionClass",
"$reflectionClass",
"@param",
"array|bool",
"$allowedAttributes"
] | train | https://github.com/mihai-stancu/serializer/blob/4d96f942a3c44d5b5652868be726af656bf1baad/Serializer/Normalizer/RecursiveNormalizer.php#L53-L120 |
mihai-stancu/serializer | Serializer/Normalizer/RecursiveNormalizer.php | RecursiveNormalizer.denormalizeProperty | protected function denormalizeProperty($data, $class, $name, $format = null, array $context = array())
{
if (!$this->propertyInfoExtractor) {
return $data;
}
/** @var Type[] $types */
$types = (array) $this->propertyInfoExtractor->getTypes($class, $name);
$_class... | php | protected function denormalizeProperty($data, $class, $name, $format = null, array $context = array())
{
if (!$this->propertyInfoExtractor) {
return $data;
}
/** @var Type[] $types */
$types = (array) $this->propertyInfoExtractor->getTypes($class, $name);
$_class... | [
"protected",
"function",
"denormalizeProperty",
"(",
"$",
"data",
",",
"$",
"class",
",",
"$",
"name",
",",
"$",
"format",
"=",
"null",
",",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"propertyInfoEx... | @param mixed $data
@param string $class
@param string $name
@param string $format
@param array $context
@throws RuntimeException
@return mixed|object | [
"@param",
"mixed",
"$data",
"@param",
"string",
"$class",
"@param",
"string",
"$name",
"@param",
"string",
"$format",
"@param",
"array",
"$context"
] | train | https://github.com/mihai-stancu/serializer/blob/4d96f942a3c44d5b5652868be726af656bf1baad/Serializer/Normalizer/RecursiveNormalizer.php#L133-L165 |
mihai-stancu/serializer | Serializer/Normalizer/RecursiveNormalizer.php | RecursiveNormalizer.denormalize | public function denormalize($data, $class, $format = null, array $context = array())
{
$allowedAttributes = $this->getAllowedAttributes($class, $context, true);
$normalizedData = $this->prepareForDenormalization($data);
$reflectionClass = new \ReflectionClass($class);
$subcontext = ... | php | public function denormalize($data, $class, $format = null, array $context = array())
{
$allowedAttributes = $this->getAllowedAttributes($class, $context, true);
$normalizedData = $this->prepareForDenormalization($data);
$reflectionClass = new \ReflectionClass($class);
$subcontext = ... | [
"public",
"function",
"denormalize",
"(",
"$",
"data",
",",
"$",
"class",
",",
"$",
"format",
"=",
"null",
",",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"$",
"allowedAttributes",
"=",
"$",
"this",
"->",
"getAllowedAttributes",
"(",
"$... | @param mixed $data
@param string $class
@param null $format
@param array $context
@return object | [
"@param",
"mixed",
"$data",
"@param",
"string",
"$class",
"@param",
"null",
"$format",
"@param",
"array",
"$context"
] | train | https://github.com/mihai-stancu/serializer/blob/4d96f942a3c44d5b5652868be726af656bf1baad/Serializer/Normalizer/RecursiveNormalizer.php#L175-L209 |
ClanCats/Core | src/classes/CCAsset.php | CCAsset.macro_og | protected static function macro_og( $tags, $content = null )
{
if ( !is_array( $tags ) )
{
$tags = array( $tags => $content );
}
$buffer = "";
foreach( $tags as $key => $content )
{
$buffer .= '<meta property="og:'.$key.'" content="'.$content.'" />';
}
return $buffer;
} | php | protected static function macro_og( $tags, $content = null )
{
if ( !is_array( $tags ) )
{
$tags = array( $tags => $content );
}
$buffer = "";
foreach( $tags as $key => $content )
{
$buffer .= '<meta property="og:'.$key.'" content="'.$content.'" />';
}
return $buffer;
} | [
"protected",
"static",
"function",
"macro_og",
"(",
"$",
"tags",
",",
"$",
"content",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"tags",
")",
")",
"{",
"$",
"tags",
"=",
"array",
"(",
"$",
"tags",
"=>",
"$",
"content",
")",
";",... | OG Macro - Generates open grapth tags
// <meta property="og:type" content="video" />
CCAsset::og( 'type', 'video' );
// <meta property="og:type" content="video" />
// <meta property="og:res" content="1080p" />
CCAsset::og( array( 'type' => 'video', 'res' => '1080p' ));
@param array|string $tags
@param string $c... | [
"OG",
"Macro",
"-",
"Generates",
"open",
"grapth",
"tags"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCAsset.php#L109-L124 |
ClanCats/Core | src/classes/CCAsset.php | CCAsset.uri | public static function uri( $uri, $name = null )
{
// when the uri conains a protocol we just return
// the given uri.
if ( strpos( $uri, '://' ) === false )
{
// If the path is relative and not absolute
// we prefix the holder path.
if ( substr( $uri, 0, 1 ) != '/' )
{
$uri = CCUrl::to( s... | php | public static function uri( $uri, $name = null )
{
// when the uri conains a protocol we just return
// the given uri.
if ( strpos( $uri, '://' ) === false )
{
// If the path is relative and not absolute
// we prefix the holder path.
if ( substr( $uri, 0, 1 ) != '/' )
{
$uri = CCUrl::to( s... | [
"public",
"static",
"function",
"uri",
"(",
"$",
"uri",
",",
"$",
"name",
"=",
"null",
")",
"{",
"// when the uri conains a protocol we just return ",
"// the given uri.",
"if",
"(",
"strpos",
"(",
"$",
"uri",
",",
"'://'",
")",
"===",
"false",
")",
"{",
"//... | Get the uri to an asset
// /assets/images/something.jpg
CCAsset::uri( 'images/something.jpg' );
// /assets/MyTheme/images/something.jpg
CCAsset::uri( 'images/logo.png', 'theme' );
// will not modify the given url
CCAsset::uri( 'http://example.com/images/logo.jpg' );
@param string $uri
@param string $name
@return ... | [
"Get",
"the",
"uri",
"to",
"an",
"asset"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCAsset.php#L188-L209 |
ClanCats/Core | src/classes/CCAsset.php | CCAsset.holder | public static function holder( $name = null )
{
if ( !isset( $name ) )
{
$name = static::$_default;
}
if ( !isset( static::$instances[$name] ) )
{
static::$instances[$name] = new CCAsset_Holder();
}
return static::$instances[$name];
} | php | public static function holder( $name = null )
{
if ( !isset( $name ) )
{
$name = static::$_default;
}
if ( !isset( static::$instances[$name] ) )
{
static::$instances[$name] = new CCAsset_Holder();
}
return static::$instances[$name];
} | [
"public",
"static",
"function",
"holder",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"name",
")",
")",
"{",
"$",
"name",
"=",
"static",
"::",
"$",
"_default",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"static",
":... | Get an asset holder instance.
$holder = CCAsset::holder();
$holder = CCAsset::holder( 'footer' );
@param string $name
@return CCAsset | [
"Get",
"an",
"asset",
"holder",
"instance",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCAsset.php#L220-L233 |
ClanCats/Core | src/classes/CCAsset.php | CCAsset.code | public static function code( $type, $name = null )
{
$buffer = "";
foreach( static::holder( $name )->get( $type ) as $item )
{
$buffer .= call_user_func( array( '\\CCAsset', $type ), $item, $name );
}
return $buffer;
} | php | public static function code( $type, $name = null )
{
$buffer = "";
foreach( static::holder( $name )->get( $type ) as $item )
{
$buffer .= call_user_func( array( '\\CCAsset', $type ), $item, $name );
}
return $buffer;
} | [
"public",
"static",
"function",
"code",
"(",
"$",
"type",
",",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"buffer",
"=",
"\"\"",
";",
"foreach",
"(",
"static",
"::",
"holder",
"(",
"$",
"name",
")",
"->",
"get",
"(",
"$",
"type",
")",
"as",
"$",
... | Get all assets of a specific type in a holder and run them
trough the maching macros.
CCAsset::code( 'css' );
CCAsset::code( 'js', 'footer' );
@param string $type
@param string $name | [
"Get",
"all",
"assets",
"of",
"a",
"specific",
"type",
"in",
"a",
"holder",
"and",
"run",
"them",
"trough",
"the",
"maching",
"macros",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCAsset.php#L245-L255 |
arsengoian/viper-framework | src/Viper/Daemon/QueueRouter.php | QueueRouter.add | public function add(Task $task) : void
{
$this->index++;
Util::put($this -> storage().$this->index.'.queue', serialize($task));
$this -> updateIterator();
Util::put($this -> storage().'_index', $this -> index);
} | php | public function add(Task $task) : void
{
$this->index++;
Util::put($this -> storage().$this->index.'.queue', serialize($task));
$this -> updateIterator();
Util::put($this -> storage().'_index', $this -> index);
} | [
"public",
"function",
"add",
"(",
"Task",
"$",
"task",
")",
":",
"void",
"{",
"$",
"this",
"->",
"index",
"++",
";",
"Util",
"::",
"put",
"(",
"$",
"this",
"->",
"storage",
"(",
")",
".",
"$",
"this",
"->",
"index",
".",
"'.queue'",
",",
"seriali... | Add new task to queue top
@param Task $task | [
"Add",
"new",
"task",
"to",
"queue",
"top"
] | train | https://github.com/arsengoian/viper-framework/blob/22796c5cc219cae3ca0b4af370a347ba2acab0f2/src/Viper/Daemon/QueueRouter.php#L52-L58 |
arsengoian/viper-framework | src/Viper/Daemon/QueueRouter.php | QueueRouter.pop | public function pop(int $num) : Collection
{
$ret = new Collection();
foreach ($this -> iterator as $item) {
if (!$num--)
return $ret;
$ret[] = unserialize(file_get_contents($item));
unlink($item);
}
$this -> updateIterator();
... | php | public function pop(int $num) : Collection
{
$ret = new Collection();
foreach ($this -> iterator as $item) {
if (!$num--)
return $ret;
$ret[] = unserialize(file_get_contents($item));
unlink($item);
}
$this -> updateIterator();
... | [
"public",
"function",
"pop",
"(",
"int",
"$",
"num",
")",
":",
"Collection",
"{",
"$",
"ret",
"=",
"new",
"Collection",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"iterator",
"as",
"$",
"item",
")",
"{",
"if",
"(",
"!",
"$",
"num",
"--",
... | Get the oldest items from the queue
@param int $num the number of items to pop
@return Collection
TODO fix situation when crash is immediately after pop; | [
"Get",
"the",
"oldest",
"items",
"from",
"the",
"queue"
] | train | https://github.com/arsengoian/viper-framework/blob/22796c5cc219cae3ca0b4af370a347ba2acab0f2/src/Viper/Daemon/QueueRouter.php#L66-L77 |
PortaText/php-sdk | src/PortaText/Command/Api/Templates.php | Templates.getEndpoint | protected function getEndpoint($method)
{
$endpoint = "templates";
$templateId = $this->getArgument("id");
if (!is_null($templateId)) {
$endpoint .= "/$templateId";
$this->delArgument("id");
}
return $endpoint;
} | php | protected function getEndpoint($method)
{
$endpoint = "templates";
$templateId = $this->getArgument("id");
if (!is_null($templateId)) {
$endpoint .= "/$templateId";
$this->delArgument("id");
}
return $endpoint;
} | [
"protected",
"function",
"getEndpoint",
"(",
"$",
"method",
")",
"{",
"$",
"endpoint",
"=",
"\"templates\"",
";",
"$",
"templateId",
"=",
"$",
"this",
"->",
"getArgument",
"(",
"\"id\"",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"templateId",
")",
... | Returns a string with the endpoint for the given command.
@param string $method Method for this command.
@return string | [
"Returns",
"a",
"string",
"with",
"the",
"endpoint",
"for",
"the",
"given",
"command",
"."
] | train | https://github.com/PortaText/php-sdk/blob/dbe04ef043db5b251953f9de57aa4d0f1785dfcc/src/PortaText/Command/Api/Templates.php#L75-L84 |
claroline/ForumBundle | Event/Log/CreateMessageEvent.php | CreateMessageEvent.getNotificationDetails | public function getNotificationDetails()
{
$details = $this->details;
$details['forum']['name'] = $this->message->getSubject()->getCategory()->getForum()->getResourceNode()->getName();
return $details;
} | php | public function getNotificationDetails()
{
$details = $this->details;
$details['forum']['name'] = $this->message->getSubject()->getCategory()->getForum()->getResourceNode()->getName();
return $details;
} | [
"public",
"function",
"getNotificationDetails",
"(",
")",
"{",
"$",
"details",
"=",
"$",
"this",
"->",
"details",
";",
"$",
"details",
"[",
"'forum'",
"]",
"[",
"'name'",
"]",
"=",
"$",
"this",
"->",
"message",
"->",
"getSubject",
"(",
")",
"->",
"getC... | Get details
@return array | [
"Get",
"details"
] | train | https://github.com/claroline/ForumBundle/blob/bd85dfd870cacee541ea94fec8e59744bf90eaf4/Event/Log/CreateMessageEvent.php#L114-L120 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppPeer.php | BaseRemoteAppPeer.getFieldNames | public static function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, RemoteAppPeer::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, ... | php | public static function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, RemoteAppPeer::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, ... | [
"public",
"static",
"function",
"getFieldNames",
"(",
"$",
"type",
"=",
"BasePeer",
"::",
"TYPE_PHPNAME",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"type",
",",
"RemoteAppPeer",
"::",
"$",
"fieldNames",
")",
")",
"{",
"throw",
"new",
"PropelE... | Returns an array of field names.
@param string $type The type of fieldnames to return:
One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
@return array A list of field names
@throws PropelException - i... | [
"Returns",
"an",
"array",
"of",
"field",
"names",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppPeer.php#L212-L219 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppPeer.php | BaseRemoteAppPeer.getValueSet | public static function getValueSet($colname)
{
$valueSets = RemoteAppPeer::getValueSets();
if (!isset($valueSets[$colname])) {
throw new PropelException(sprintf('Column "%s" has no ValueSet.', $colname));
}
return $valueSets[$colname];
} | php | public static function getValueSet($colname)
{
$valueSets = RemoteAppPeer::getValueSets();
if (!isset($valueSets[$colname])) {
throw new PropelException(sprintf('Column "%s" has no ValueSet.', $colname));
}
return $valueSets[$colname];
} | [
"public",
"static",
"function",
"getValueSet",
"(",
"$",
"colname",
")",
"{",
"$",
"valueSets",
"=",
"RemoteAppPeer",
"::",
"getValueSets",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"valueSets",
"[",
"$",
"colname",
"]",
")",
")",
"{",
"throw",... | Gets the list of values for an ENUM column
@param string $colname The ENUM column name.
@return array list of possible values for the column | [
"Gets",
"the",
"list",
"of",
"values",
"for",
"an",
"ENUM",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppPeer.php#L237-L246 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppPeer.php | BaseRemoteAppPeer.getSqlValueForEnum | public static function getSqlValueForEnum($colname, $enumVal)
{
$values = RemoteAppPeer::getValueSet($colname);
if (!in_array($enumVal, $values)) {
throw new PropelException(sprintf('Value "%s" is not accepted in this enumerated column', $colname));
}
return array_search... | php | public static function getSqlValueForEnum($colname, $enumVal)
{
$values = RemoteAppPeer::getValueSet($colname);
if (!in_array($enumVal, $values)) {
throw new PropelException(sprintf('Value "%s" is not accepted in this enumerated column', $colname));
}
return array_search... | [
"public",
"static",
"function",
"getSqlValueForEnum",
"(",
"$",
"colname",
",",
"$",
"enumVal",
")",
"{",
"$",
"values",
"=",
"RemoteAppPeer",
"::",
"getValueSet",
"(",
"$",
"colname",
")",
";",
"if",
"(",
"!",
"in_array",
"(",
"$",
"enumVal",
",",
"$",
... | Gets the SQL value for the ENUM column value
@param string $colname ENUM column name.
@param string $enumVal ENUM value.
@return int SQL value | [
"Gets",
"the",
"SQL",
"value",
"for",
"the",
"ENUM",
"column",
"value"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppPeer.php#L256-L264 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppPeer.php | BaseRemoteAppPeer.addSelectColumns | public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(RemoteAppPeer::ID);
$criteria->addSelectColumn(RemoteAppPeer::TYPE);
$criteria->addSelectColumn(RemoteAppPeer::NAME);
$criteria->addS... | php | public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(RemoteAppPeer::ID);
$criteria->addSelectColumn(RemoteAppPeer::TYPE);
$criteria->addSelectColumn(RemoteAppPeer::NAME);
$criteria->addS... | [
"public",
"static",
"function",
"addSelectColumns",
"(",
"Criteria",
"$",
"criteria",
",",
"$",
"alias",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"alias",
")",
"{",
"$",
"criteria",
"->",
"addSelectColumn",
"(",
"RemoteAppPeer",
"::",
"ID",
... | Add all the columns needed to create a new object.
Note: any columns that were marked with lazyLoad="true" in the
XML schema will not be added to the select list and only loaded
on demand.
@param Criteria $criteria object containing the columns to add.
@param string $alias optional table alias
@throws ... | [
"Add",
"all",
"the",
"columns",
"needed",
"to",
"create",
"a",
"new",
"object",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppPeer.php#L295-L350 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppPeer.php | BaseRemoteAppPeer.getInstanceFromPool | public static function getInstanceFromPool($key)
{
if (Propel::isInstancePoolingEnabled()) {
if (isset(RemoteAppPeer::$instances[$key])) {
return RemoteAppPeer::$instances[$key];
}
}
return null; // just to be explicit
} | php | public static function getInstanceFromPool($key)
{
if (Propel::isInstancePoolingEnabled()) {
if (isset(RemoteAppPeer::$instances[$key])) {
return RemoteAppPeer::$instances[$key];
}
}
return null; // just to be explicit
} | [
"public",
"static",
"function",
"getInstanceFromPool",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"Propel",
"::",
"isInstancePoolingEnabled",
"(",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"RemoteAppPeer",
"::",
"$",
"instances",
"[",
"$",
"key",
"]",
")",
")",... | Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
For tables with a single-column primary key, that simple pkey value will be returned. For tables with
a multi-column primary key, a serialize()d version of the primary key will be returne... | [
"Retrieves",
"a",
"string",
"version",
"of",
"the",
"primary",
"key",
"from",
"the",
"DB",
"resultset",
"row",
"that",
"can",
"be",
"used",
"to",
"uniquely",
"identify",
"a",
"row",
"in",
"this",
"table",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppPeer.php#L521-L530 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppPeer.php | BaseRemoteAppPeer.clearInstancePool | public static function clearInstancePool($and_clear_all_references = false)
{
if ($and_clear_all_references) {
foreach (RemoteAppPeer::$instances as $instance) {
$instance->clearAllReferences(true);
}
}
RemoteAppPeer::$instances = array();
} | php | public static function clearInstancePool($and_clear_all_references = false)
{
if ($and_clear_all_references) {
foreach (RemoteAppPeer::$instances as $instance) {
$instance->clearAllReferences(true);
}
}
RemoteAppPeer::$instances = array();
} | [
"public",
"static",
"function",
"clearInstancePool",
"(",
"$",
"and_clear_all_references",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"and_clear_all_references",
")",
"{",
"foreach",
"(",
"RemoteAppPeer",
"::",
"$",
"instances",
"as",
"$",
"instance",
")",
"{",
"... | Clear the instance pool.
@return void | [
"Clear",
"the",
"instance",
"pool",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppPeer.php#L537-L545 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppPeer.php | BaseRemoteAppPeer.buildTableMap | public static function buildTableMap()
{
$dbMap = Propel::getDatabaseMap(BaseRemoteAppPeer::DATABASE_NAME);
if (!$dbMap->hasTable(BaseRemoteAppPeer::TABLE_NAME)) {
$dbMap->addTableObject(new \Slashworks\AppBundle\Model\map\RemoteAppTableMap());
}
} | php | public static function buildTableMap()
{
$dbMap = Propel::getDatabaseMap(BaseRemoteAppPeer::DATABASE_NAME);
if (!$dbMap->hasTable(BaseRemoteAppPeer::TABLE_NAME)) {
$dbMap->addTableObject(new \Slashworks\AppBundle\Model\map\RemoteAppTableMap());
}
} | [
"public",
"static",
"function",
"buildTableMap",
"(",
")",
"{",
"$",
"dbMap",
"=",
"Propel",
"::",
"getDatabaseMap",
"(",
"BaseRemoteAppPeer",
"::",
"DATABASE_NAME",
")",
";",
"if",
"(",
"!",
"$",
"dbMap",
"->",
"hasTable",
"(",
"BaseRemoteAppPeer",
"::",
"T... | Add a TableMap instance to the database for this peer class. | [
"Add",
"a",
"TableMap",
"instance",
"to",
"the",
"database",
"for",
"this",
"peer",
"class",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppPeer.php#L908-L914 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppPeer.php | BaseRemoteAppPeer.doOnDeleteCascade | protected static function doOnDeleteCascade(Criteria $criteria, PropelPDO $con)
{
// initialize var to track total num of affected rows
$affectedRows = 0;
// first find the objects that are implicated by the $criteria
$objects = RemoteAppPeer::doSelect($criteria, $con);
fore... | php | protected static function doOnDeleteCascade(Criteria $criteria, PropelPDO $con)
{
// initialize var to track total num of affected rows
$affectedRows = 0;
// first find the objects that are implicated by the $criteria
$objects = RemoteAppPeer::doSelect($criteria, $con);
fore... | [
"protected",
"static",
"function",
"doOnDeleteCascade",
"(",
"Criteria",
"$",
"criteria",
",",
"PropelPDO",
"$",
"con",
")",
"{",
"// initialize var to track total num of affected rows",
"$",
"affectedRows",
"=",
"0",
";",
"// first find the objects that are implicated by the... | This is a method for emulating ON DELETE CASCADE for DBs that don't support this
feature (like MySQL or SQLite).
This method is not very speedy because it must perform a query first to get
the implicated records and then perform the deletes by calling those Peer classes.
This method should be used within a transactio... | [
"This",
"is",
"a",
"method",
"for",
"emulating",
"ON",
"DELETE",
"CASCADE",
"for",
"DBs",
"that",
"don",
"t",
"support",
"this",
"feature",
"(",
"like",
"MySQL",
"or",
"SQLite",
")",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppPeer.php#L1121-L1145 |
fyuze/framework | src/Fyuze/Http/Message/Upload.php | Upload.getStream | public function getStream()
{
if ($this->moved === true) {
throw new \RuntimeException('File has already been moved to disk.');
}
if ($this->stream instanceof StreamInterface) {
return $this->stream;
}
return $this->stream = new Stream($this->stream)... | php | public function getStream()
{
if ($this->moved === true) {
throw new \RuntimeException('File has already been moved to disk.');
}
if ($this->stream instanceof StreamInterface) {
return $this->stream;
}
return $this->stream = new Stream($this->stream)... | [
"public",
"function",
"getStream",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"moved",
"===",
"true",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'File has already been moved to disk.'",
")",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"stream"... | {@inheritdoc}
@return StreamInterface Stream representation of the uploaded file.
@throws \RuntimeException in cases when no stream is available or can be
created. | [
"{",
"@inheritdoc",
"}"
] | train | https://github.com/fyuze/framework/blob/89b3984f7225e24bfcdafb090ee197275b3222c9/src/Fyuze/Http/Message/Upload.php#L79-L90 |
fyuze/framework | src/Fyuze/Http/Message/Upload.php | Upload.moveTo | public function moveTo($targetPath)
{
if ($this->moved === true) {
throw new RuntimeException('This file has already been moved.');
}
if (is_writable($targetPath) === false) {
throw new InvalidArgumentException(
'Unable to write to target path'
... | php | public function moveTo($targetPath)
{
if ($this->moved === true) {
throw new RuntimeException('This file has already been moved.');
}
if (is_writable($targetPath) === false) {
throw new InvalidArgumentException(
'Unable to write to target path'
... | [
"public",
"function",
"moveTo",
"(",
"$",
"targetPath",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"moved",
"===",
"true",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"'This file has already been moved.'",
")",
";",
"}",
"if",
"(",
"is_writable",
"(",
... | {@inheritdoc}
@see http://php.net/is_uploaded_file
@see http://php.net/move_uploaded_file
@param string $targetPath Path to which to move the uploaded file.
@throws \InvalidArgumentException if the $path specified is invalid.
@throws \RuntimeException on any error during the move operation, or on
the second or subsequ... | [
"{",
"@inheritdoc",
"}"
] | train | https://github.com/fyuze/framework/blob/89b3984f7225e24bfcdafb090ee197275b3222c9/src/Fyuze/Http/Message/Upload.php#L102-L129 |
freyo/flysystem-qcloud-cos-v3 | src/Adapter.php | Adapter.rename | public function rename($path, $newpath)
{
return (bool)$this->normalizeResponse(
Cosapi::move($this->getBucket(), $path, $newpath, 1)
);
} | php | public function rename($path, $newpath)
{
return (bool)$this->normalizeResponse(
Cosapi::move($this->getBucket(), $path, $newpath, 1)
);
} | [
"public",
"function",
"rename",
"(",
"$",
"path",
",",
"$",
"newpath",
")",
"{",
"return",
"(",
"bool",
")",
"$",
"this",
"->",
"normalizeResponse",
"(",
"Cosapi",
"::",
"move",
"(",
"$",
"this",
"->",
"getBucket",
"(",
")",
",",
"$",
"path",
",",
... | @param string $path
@param string $newpath
@return bool | [
"@param",
"string",
"$path",
"@param",
"string",
"$newpath"
] | train | https://github.com/freyo/flysystem-qcloud-cos-v3/blob/6bddbc22396aa1228942ec4c0ce46935d415f3b4/src/Adapter.php#L171-L176 |
freyo/flysystem-qcloud-cos-v3 | src/Adapter.php | Adapter.copy | public function copy($path, $newpath)
{
$resource = $this->read($path);
return isset($resource['contents'])
? (bool)$this->update($newpath, $resource['contents'], new Config()) : false;
} | php | public function copy($path, $newpath)
{
$resource = $this->read($path);
return isset($resource['contents'])
? (bool)$this->update($newpath, $resource['contents'], new Config()) : false;
} | [
"public",
"function",
"copy",
"(",
"$",
"path",
",",
"$",
"newpath",
")",
"{",
"$",
"resource",
"=",
"$",
"this",
"->",
"read",
"(",
"$",
"path",
")",
";",
"return",
"isset",
"(",
"$",
"resource",
"[",
"'contents'",
"]",
")",
"?",
"(",
"bool",
")... | @param string $path
@param string $newpath
@return bool | [
"@param",
"string",
"$path",
"@param",
"string",
"$newpath"
] | train | https://github.com/freyo/flysystem-qcloud-cos-v3/blob/6bddbc22396aa1228942ec4c0ce46935d415f3b4/src/Adapter.php#L184-L190 |
freyo/flysystem-qcloud-cos-v3 | src/Adapter.php | Adapter.delete | public function delete($path)
{
return (bool)$this->normalizeResponse(
Cosapi::delFile($this->getBucket(), $path)
);
} | php | public function delete($path)
{
return (bool)$this->normalizeResponse(
Cosapi::delFile($this->getBucket(), $path)
);
} | [
"public",
"function",
"delete",
"(",
"$",
"path",
")",
"{",
"return",
"(",
"bool",
")",
"$",
"this",
"->",
"normalizeResponse",
"(",
"Cosapi",
"::",
"delFile",
"(",
"$",
"this",
"->",
"getBucket",
"(",
")",
",",
"$",
"path",
")",
")",
";",
"}"
] | @param string $path
@return bool | [
"@param",
"string",
"$path"
] | train | https://github.com/freyo/flysystem-qcloud-cos-v3/blob/6bddbc22396aa1228942ec4c0ce46935d415f3b4/src/Adapter.php#L197-L202 |
freyo/flysystem-qcloud-cos-v3 | src/Adapter.php | Adapter.deleteDir | public function deleteDir($dirname)
{
return (bool)$this->normalizeResponse(
Cosapi::delFolder($this->getBucket(), $dirname)
);
} | php | public function deleteDir($dirname)
{
return (bool)$this->normalizeResponse(
Cosapi::delFolder($this->getBucket(), $dirname)
);
} | [
"public",
"function",
"deleteDir",
"(",
"$",
"dirname",
")",
"{",
"return",
"(",
"bool",
")",
"$",
"this",
"->",
"normalizeResponse",
"(",
"Cosapi",
"::",
"delFolder",
"(",
"$",
"this",
"->",
"getBucket",
"(",
")",
",",
"$",
"dirname",
")",
")",
";",
... | @param string $dirname
@return bool | [
"@param",
"string",
"$dirname"
] | train | https://github.com/freyo/flysystem-qcloud-cos-v3/blob/6bddbc22396aa1228942ec4c0ce46935d415f3b4/src/Adapter.php#L209-L214 |
freyo/flysystem-qcloud-cos-v3 | src/Adapter.php | Adapter.listContents | public function listContents($directory = '', $recursive = false)
{
return $this->normalizeResponse(
Cosapi::listFolder($this->getBucket(), $directory)
);
} | php | public function listContents($directory = '', $recursive = false)
{
return $this->normalizeResponse(
Cosapi::listFolder($this->getBucket(), $directory)
);
} | [
"public",
"function",
"listContents",
"(",
"$",
"directory",
"=",
"''",
",",
"$",
"recursive",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"normalizeResponse",
"(",
"Cosapi",
"::",
"listFolder",
"(",
"$",
"this",
"->",
"getBucket",
"(",
")",
","... | @param string $directory
@param bool $recursive
@return bool | [
"@param",
"string",
"$directory",
"@param",
"bool",
"$recursive"
] | train | https://github.com/freyo/flysystem-qcloud-cos-v3/blob/6bddbc22396aa1228942ec4c0ce46935d415f3b4/src/Adapter.php#L289-L294 |
windwork/wf-mailer | lib/Helper.php | Helper.emailEncode | public static function emailEncode($emails, $encode = 'utf-8')
{
$emails = str_replace(['"', "\r", "\n", "\t"], '', $emails);
$emailArr = explode(',', $emails);
foreach ($emailArr as $k => $mail) {
$mail = trim($mail);
if (preg_match('/^(.+?)<(.... | php | public static function emailEncode($emails, $encode = 'utf-8')
{
$emails = str_replace(['"', "\r", "\n", "\t"], '', $emails);
$emailArr = explode(',', $emails);
foreach ($emailArr as $k => $mail) {
$mail = trim($mail);
if (preg_match('/^(.+?)<(.... | [
"public",
"static",
"function",
"emailEncode",
"(",
"$",
"emails",
",",
"$",
"encode",
"=",
"'utf-8'",
")",
"{",
"$",
"emails",
"=",
"str_replace",
"(",
"[",
"'\"'",
",",
"\"\\r\"",
",",
"\"\\n\"",
",",
"\"\\t\"",
"]",
",",
"''",
",",
"$",
"emails",
... | 邮箱(收件人、发件人、抄送、密送)编码
@param string $emails 格式:昵称<you@domain.com>,孟春<cmpan@qq.com> 多个账号用半角逗号隔开 | [
"邮箱(收件人、发件人、抄送、密送)编码"
] | train | https://github.com/windwork/wf-mailer/blob/71fbdb3bcb5bdc0a53fa8b4433c446828e205d22/lib/Helper.php#L25-L41 |
jpcercal/resource-query-language | src/Processor/DoctrineOrmProcessor.php | DoctrineOrmProcessor.setWhereOperationMode | protected function setWhereOperationMode($whereOperationMode)
{
if (!in_array($whereOperationMode, [self::WHERE_OPERATION_MODE_AND, self::WHERE_OPERATION_MODE_OR])) {
throw new ProcessorException(sprintf(
'The where operation mode "%s" is not allowed or not exists.',
... | php | protected function setWhereOperationMode($whereOperationMode)
{
if (!in_array($whereOperationMode, [self::WHERE_OPERATION_MODE_AND, self::WHERE_OPERATION_MODE_OR])) {
throw new ProcessorException(sprintf(
'The where operation mode "%s" is not allowed or not exists.',
... | [
"protected",
"function",
"setWhereOperationMode",
"(",
"$",
"whereOperationMode",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"whereOperationMode",
",",
"[",
"self",
"::",
"WHERE_OPERATION_MODE_AND",
",",
"self",
"::",
"WHERE_OPERATION_MODE_OR",
"]",
")",
")",... | @param string $whereOperationMode
@return DoctrineOrmProcessor
@throws ProcessorException | [
"@param",
"string",
"$whereOperationMode"
] | train | https://github.com/jpcercal/resource-query-language/blob/2a1520198c717a8199cd8d3d85ca2557e24cb7f5/src/Processor/DoctrineOrmProcessor.php#L62-L74 |
jpcercal/resource-query-language | src/Processor/DoctrineOrmProcessor.php | DoctrineOrmProcessor.getParamKeyByExpr | protected function getParamKeyByExpr(ExprInterface $expr)
{
return str_replace('.', '', $expr->getField()) . ucfirst($expr->getExpression()) . uniqid();
} | php | protected function getParamKeyByExpr(ExprInterface $expr)
{
return str_replace('.', '', $expr->getField()) . ucfirst($expr->getExpression()) . uniqid();
} | [
"protected",
"function",
"getParamKeyByExpr",
"(",
"ExprInterface",
"$",
"expr",
")",
"{",
"return",
"str_replace",
"(",
"'.'",
",",
"''",
",",
"$",
"expr",
"->",
"getField",
"(",
")",
")",
".",
"ucfirst",
"(",
"$",
"expr",
"->",
"getExpression",
"(",
")... | Get the parameter key that is used by doctrine to put the query parameter identifier.
@param ExprInterface $expr
@return string | [
"Get",
"the",
"parameter",
"key",
"that",
"is",
"used",
"by",
"doctrine",
"to",
"put",
"the",
"query",
"parameter",
"identifier",
"."
] | train | https://github.com/jpcercal/resource-query-language/blob/2a1520198c717a8199cd8d3d85ca2557e24cb7f5/src/Processor/DoctrineOrmProcessor.php#L113-L116 |
steeffeen/FancyManiaLinks | FML/Script/Features/Preload.php | Preload.addImageUrl | public function addImageUrl($imageUrl)
{
if (!in_array($imageUrl, $this->imageUrls)) {
array_push($this->imageUrls, $imageUrl);
}
return $this;
} | php | public function addImageUrl($imageUrl)
{
if (!in_array($imageUrl, $this->imageUrls)) {
array_push($this->imageUrls, $imageUrl);
}
return $this;
} | [
"public",
"function",
"addImageUrl",
"(",
"$",
"imageUrl",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"imageUrl",
",",
"$",
"this",
"->",
"imageUrls",
")",
")",
"{",
"array_push",
"(",
"$",
"this",
"->",
"imageUrls",
",",
"$",
"imageUrl",
")",
"... | Add an Image Url to preload
@api
@param string $imageUrl Image Url
@return static | [
"Add",
"an",
"Image",
"Url",
"to",
"preload"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Preload.php#L55-L61 |
steeffeen/FancyManiaLinks | FML/Script/Features/Preload.php | Preload.getScriptText | protected function getScriptText()
{
$scriptText = "";
foreach ($this->imageUrls as $imageUrl) {
$escapedImageUrl = Builder::escapeText($imageUrl);
$scriptText .= "
PreloadImage({$escapedImageUrl});";
}
return $scriptText;
} | php | protected function getScriptText()
{
$scriptText = "";
foreach ($this->imageUrls as $imageUrl) {
$escapedImageUrl = Builder::escapeText($imageUrl);
$scriptText .= "
PreloadImage({$escapedImageUrl});";
}
return $scriptText;
} | [
"protected",
"function",
"getScriptText",
"(",
")",
"{",
"$",
"scriptText",
"=",
"\"\"",
";",
"foreach",
"(",
"$",
"this",
"->",
"imageUrls",
"as",
"$",
"imageUrl",
")",
"{",
"$",
"escapedImageUrl",
"=",
"Builder",
"::",
"escapeText",
"(",
"$",
"imageUrl",... | Get the script text
@return string | [
"Get",
"the",
"script",
"text"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Preload.php#L102-L111 |
TypistTech/wp-kses-view | src/View.php | View.toHtml | public function toHtml($context = null): string
{
return wp_kses(
$this->unsafeRender($context),
$this->allowedHtml
);
} | php | public function toHtml($context = null): string
{
return wp_kses(
$this->unsafeRender($context),
$this->allowedHtml
);
} | [
"public",
"function",
"toHtml",
"(",
"$",
"context",
"=",
"null",
")",
":",
"string",
"{",
"return",
"wp_kses",
"(",
"$",
"this",
"->",
"unsafeRender",
"(",
"$",
"context",
")",
",",
"$",
"this",
"->",
"allowedHtml",
")",
";",
"}"
] | Convert the view to safe HTML.
@param mixed $context Optional. Context object for which to render the view.
@return string | [
"Convert",
"the",
"view",
"to",
"safe",
"HTML",
"."
] | train | https://github.com/TypistTech/wp-kses-view/blob/6a5e5a34b81c6387d1c5356c9e42166daec9225f/src/View.php#L80-L86 |
Sedona-Solutions/sedona-sbo | src/Sedona/SBOGeneratorBundle/Command/GenerateDoctrineCrudCommand.php | GenerateDoctrineCrudCommand.generateDatatable | protected function generateDatatable($bundle, $entity, $metadata, $forceOverwrite)
{
try {
$this->getDatatableGenerator($bundle)->generate($bundle, $entity, $metadata[0], $forceOverwrite);
} catch (\RuntimeException $e) {
// form already exists
}
} | php | protected function generateDatatable($bundle, $entity, $metadata, $forceOverwrite)
{
try {
$this->getDatatableGenerator($bundle)->generate($bundle, $entity, $metadata[0], $forceOverwrite);
} catch (\RuntimeException $e) {
// form already exists
}
} | [
"protected",
"function",
"generateDatatable",
"(",
"$",
"bundle",
",",
"$",
"entity",
",",
"$",
"metadata",
",",
"$",
"forceOverwrite",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"getDatatableGenerator",
"(",
"$",
"bundle",
")",
"->",
"generate",
"(",
"$",
... | Tries to generate forms if they don't exist yet and if we need write operations on entities. | [
"Tries",
"to",
"generate",
"forms",
"if",
"they",
"don",
"t",
"exist",
"yet",
"and",
"if",
"we",
"need",
"write",
"operations",
"on",
"entities",
"."
] | train | https://github.com/Sedona-Solutions/sedona-sbo/blob/8548be4170d191cb1a3e263577aaaab49f04d5ce/src/Sedona/SBOGeneratorBundle/Command/GenerateDoctrineCrudCommand.php#L230-L237 |
Sedona-Solutions/sedona-sbo | src/Sedona/SBOGeneratorBundle/Command/GenerateDoctrineCrudCommand.php | GenerateDoctrineCrudCommand.generateTranslations | protected function generateTranslations($bundle, $entity, $metadata, $forceOverwrite)
{
try {
$this->getTranslationsGenerator($bundle)->generate($bundle, $entity, $metadata[0], $forceOverwrite);
} catch (\RuntimeException $e) {
// form already exists
}
} | php | protected function generateTranslations($bundle, $entity, $metadata, $forceOverwrite)
{
try {
$this->getTranslationsGenerator($bundle)->generate($bundle, $entity, $metadata[0], $forceOverwrite);
} catch (\RuntimeException $e) {
// form already exists
}
} | [
"protected",
"function",
"generateTranslations",
"(",
"$",
"bundle",
",",
"$",
"entity",
",",
"$",
"metadata",
",",
"$",
"forceOverwrite",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"getTranslationsGenerator",
"(",
"$",
"bundle",
")",
"->",
"generate",
"(",
... | Tries to generate translations if they don't exist yet and if we need write operations on entities. | [
"Tries",
"to",
"generate",
"translations",
"if",
"they",
"don",
"t",
"exist",
"yet",
"and",
"if",
"we",
"need",
"write",
"operations",
"on",
"entities",
"."
] | train | https://github.com/Sedona-Solutions/sedona-sbo/blob/8548be4170d191cb1a3e263577aaaab49f04d5ce/src/Sedona/SBOGeneratorBundle/Command/GenerateDoctrineCrudCommand.php#L242-L249 |
ruvents/ruwork-upload-bundle | Source/Handler/UploadedFileHandler.php | UploadedFileHandler.write | public function write($source, string $target): void
{
$source->move(\dirname($target), basename($target));
} | php | public function write($source, string $target): void
{
$source->move(\dirname($target), basename($target));
} | [
"public",
"function",
"write",
"(",
"$",
"source",
",",
"string",
"$",
"target",
")",
":",
"void",
"{",
"$",
"source",
"->",
"move",
"(",
"\\",
"dirname",
"(",
"$",
"target",
")",
",",
"basename",
"(",
"$",
"target",
")",
")",
";",
"}"
] | {@inheritdoc}
@param UploadedFile $source | [
"{",
"@inheritdoc",
"}"
] | train | https://github.com/ruvents/ruwork-upload-bundle/blob/8ad09cc2dce6ab389105c440d791346696da43af/Source/Handler/UploadedFileHandler.php#L26-L29 |
ruvents/ruwork-upload-bundle | Source/Handler/UploadedFileHandler.php | UploadedFileHandler.getAttributes | public function getAttributes($source): array
{
return [
self::CLIENT_MIME_TYPE => $source->getClientMimeType(),
self::CLIENT_NAME => $source->getClientOriginalName(),
self::TMP_PATH => $source->getPathname(),
];
} | php | public function getAttributes($source): array
{
return [
self::CLIENT_MIME_TYPE => $source->getClientMimeType(),
self::CLIENT_NAME => $source->getClientOriginalName(),
self::TMP_PATH => $source->getPathname(),
];
} | [
"public",
"function",
"getAttributes",
"(",
"$",
"source",
")",
":",
"array",
"{",
"return",
"[",
"self",
"::",
"CLIENT_MIME_TYPE",
"=>",
"$",
"source",
"->",
"getClientMimeType",
"(",
")",
",",
"self",
"::",
"CLIENT_NAME",
"=>",
"$",
"source",
"->",
"getC... | {@inheritdoc}
@param UploadedFile $source | [
"{",
"@inheritdoc",
"}"
] | train | https://github.com/ruvents/ruwork-upload-bundle/blob/8ad09cc2dce6ab389105c440d791346696da43af/Source/Handler/UploadedFileHandler.php#L36-L43 |
webforge-labs/psc-cms | lib/Psc/Code/Generate/ClassBuilder.php | ClassBuilder.createMethod | public function createMethod($name, $params = array(), $body = NULL, $modifiers = 256) {
$method = $this->class->createMethod($name, $params, $body, $modifiers);
$method->setClassBuilder($this);
return $method;
} | php | public function createMethod($name, $params = array(), $body = NULL, $modifiers = 256) {
$method = $this->class->createMethod($name, $params, $body, $modifiers);
$method->setClassBuilder($this);
return $method;
} | [
"public",
"function",
"createMethod",
"(",
"$",
"name",
",",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"body",
"=",
"NULL",
",",
"$",
"modifiers",
"=",
"256",
")",
"{",
"$",
"method",
"=",
"$",
"this",
"->",
"class",
"->",
"createMethod",
"(... | Erstellt eine neue Methode
@return GMethod | [
"Erstellt",
"eine",
"neue",
"Methode"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Code/Generate/ClassBuilder.php#L109-L113 |
webforge-labs/psc-cms | lib/Psc/Code/Generate/ClassBuilder.php | ClassBuilder.generateSetter | public function generateSetter(ClassBuilderProperty $property, $setter = NULL, $flags = 0) {
$setter = $setter ?: $property->getSetterName();
// wenn die klasse die Methode wirklich selbst hat, überschreiben wir diesen nicht
if ($this->class->hasOwnMethod($setter)) {
return $this;
}
... | php | public function generateSetter(ClassBuilderProperty $property, $setter = NULL, $flags = 0) {
$setter = $setter ?: $property->getSetterName();
// wenn die klasse die Methode wirklich selbst hat, überschreiben wir diesen nicht
if ($this->class->hasOwnMethod($setter)) {
return $this;
}
... | [
"public",
"function",
"generateSetter",
"(",
"ClassBuilderProperty",
"$",
"property",
",",
"$",
"setter",
"=",
"NULL",
",",
"$",
"flags",
"=",
"0",
")",
"{",
"$",
"setter",
"=",
"$",
"setter",
"?",
":",
"$",
"property",
"->",
"getSetterName",
"(",
")",
... | @param string der volle Name des Setters
@param $flags wenn dies z.B: INHERIT ist wird immer eine eigene Methode für den Setter erstellt (auch wenn es die Methode schon in der Hierarchy gibt) | [
"@param",
"string",
"der",
"volle",
"Name",
"des",
"Setters"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Code/Generate/ClassBuilder.php#L217-L271 |
webforge-labs/psc-cms | lib/Psc/Code/Generate/ClassBuilder.php | ClassBuilder.setParentClass | public function setParentClass(GClass $gClass) {
$this->class->setParentClass($gClass);
if ($gClass->exists()) {
try {
// damit die gclass vernünftig initialisiert wird
$this->class->elevateParent();
} catch (\Psc\Code\Generate\ReflectionException $e) {
throw new \Ps... | php | public function setParentClass(GClass $gClass) {
$this->class->setParentClass($gClass);
if ($gClass->exists()) {
try {
// damit die gclass vernünftig initialisiert wird
$this->class->elevateParent();
} catch (\Psc\Code\Generate\ReflectionException $e) {
throw new \Ps... | [
"public",
"function",
"setParentClass",
"(",
"GClass",
"$",
"gClass",
")",
"{",
"$",
"this",
"->",
"class",
"->",
"setParentClass",
"(",
"$",
"gClass",
")",
";",
"if",
"(",
"$",
"gClass",
"->",
"exists",
"(",
")",
")",
"{",
"try",
"{",
"// damit die gc... | Elevated die ParentClass um properties der Hierarchy laden zu können | [
"Elevated",
"die",
"ParentClass",
"um",
"properties",
"der",
"Hierarchy",
"laden",
"zu",
"können"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Code/Generate/ClassBuilder.php#L421-L439 |
terion-name/package-installer | src/Terion/PackageInstaller/PackageProcessCommand.php | PackageProcessCommand.fire | public function fire()
{
$packageName = $this->argument('packageName');
$version = $this->argument('version');
$version = unserialize(base64_decode($version));
$this->postProcess($packageName, $version);
} | php | public function fire()
{
$packageName = $this->argument('packageName');
$version = $this->argument('version');
$version = unserialize(base64_decode($version));
$this->postProcess($packageName, $version);
} | [
"public",
"function",
"fire",
"(",
")",
"{",
"$",
"packageName",
"=",
"$",
"this",
"->",
"argument",
"(",
"'packageName'",
")",
";",
"$",
"version",
"=",
"$",
"this",
"->",
"argument",
"(",
"'version'",
")",
";",
"$",
"version",
"=",
"unserialize",
"("... | Execute the console command.
@return void | [
"Execute",
"the",
"console",
"command",
"."
] | train | https://github.com/terion-name/package-installer/blob/a1f53085b0b5dbbcc308476f61188103051bd201/src/Terion/PackageInstaller/PackageProcessCommand.php#L67-L73 |
terion-name/package-installer | src/Terion/PackageInstaller/PackageProcessCommand.php | PackageProcessCommand.postProcess | protected function postProcess($packageName, Version $version)
{
$this->comment('Processing package...');
$specials = $this->resolver->specials($packageName, $version);
if ($specials === false) {
$this->info("No Service Providers and Facades found. Assuming that package is not ... | php | protected function postProcess($packageName, Version $version)
{
$this->comment('Processing package...');
$specials = $this->resolver->specials($packageName, $version);
if ($specials === false) {
$this->info("No Service Providers and Facades found. Assuming that package is not ... | [
"protected",
"function",
"postProcess",
"(",
"$",
"packageName",
",",
"Version",
"$",
"version",
")",
"{",
"$",
"this",
"->",
"comment",
"(",
"'Processing package...'",
")",
";",
"$",
"specials",
"=",
"$",
"this",
"->",
"resolver",
"->",
"specials",
"(",
"... | Process package after install
e.g. search and register ServiceProviders and Facades.
@param $packageName
@param Version $version | [
"Process",
"package",
"after",
"install",
"e",
".",
"g",
".",
"search",
"and",
"register",
"ServiceProviders",
"and",
"Facades",
"."
] | train | https://github.com/terion-name/package-installer/blob/a1f53085b0b5dbbcc308476f61188103051bd201/src/Terion/PackageInstaller/PackageProcessCommand.php#L82-L125 |
bdunogier/iftttbundle | IFTTT/RequestParser.php | RequestParser.getRequest | public function getRequest( array $requestPostData )
{
$requestProperties = array(
'username' => $requestPostData[1],
'password' => $requestPostData[2],
'title' => $requestPostData[3]['title'],
'description' => $requestPostData[3]['description'],
... | php | public function getRequest( array $requestPostData )
{
$requestProperties = array(
'username' => $requestPostData[1],
'password' => $requestPostData[2],
'title' => $requestPostData[3]['title'],
'description' => $requestPostData[3]['description'],
... | [
"public",
"function",
"getRequest",
"(",
"array",
"$",
"requestPostData",
")",
"{",
"$",
"requestProperties",
"=",
"array",
"(",
"'username'",
"=>",
"$",
"requestPostData",
"[",
"1",
"]",
",",
"'password'",
"=>",
"$",
"requestPostData",
"[",
"2",
"]",
",",
... | Creates an IFTTT Request from XML RPC post data
@param array $requestPostData
@return \BD\Bundle\IFTTTBundle\IFTTT\Request | [
"Creates",
"an",
"IFTTT",
"Request",
"from",
"XML",
"RPC",
"post",
"data"
] | train | https://github.com/bdunogier/iftttbundle/blob/b3232a9f49cc6cc8bfc86e92eaf961d8c59021fa/IFTTT/RequestParser.php#L21-L33 |
webforge-labs/psc-cms | lib/Psc/Code/ExceptionBuilder.php | ExceptionBuilder.end | public function end() {
$c = $this->fqn;
$this->exception = new $c($this->msg, $this->code, $this->previous);
foreach ($this->vars as $var => $value) {
$this->exception->$var = $value;
}
return $this->exception;
} | php | public function end() {
$c = $this->fqn;
$this->exception = new $c($this->msg, $this->code, $this->previous);
foreach ($this->vars as $var => $value) {
$this->exception->$var = $value;
}
return $this->exception;
} | [
"public",
"function",
"end",
"(",
")",
"{",
"$",
"c",
"=",
"$",
"this",
"->",
"fqn",
";",
"$",
"this",
"->",
"exception",
"=",
"new",
"$",
"c",
"(",
"$",
"this",
"->",
"msg",
",",
"$",
"this",
"->",
"code",
",",
"$",
"this",
"->",
"previous",
... | Gibt die fertige Exception zurück
Nachdem end() aufgerufen wurde, haben die anderen Funktionen keinen Effekt mehr. Der Builder ist dann nutzlos
@return Exception | [
"Gibt",
"die",
"fertige",
"Exception",
"zurück"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Code/ExceptionBuilder.php#L34-L42 |
steeffeen/FancyManiaLinks | FML/Form/Parameters.php | Parameters.getValue | public static function getValue($name)
{
if (array_key_exists($name, $_GET)) {
return $_GET[$name];
}
if (array_key_exists($name, $_POST)) {
return $_POST[$name];
}
return null;
} | php | public static function getValue($name)
{
if (array_key_exists($name, $_GET)) {
return $_GET[$name];
}
if (array_key_exists($name, $_POST)) {
return $_POST[$name];
}
return null;
} | [
"public",
"static",
"function",
"getValue",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"_GET",
")",
")",
"{",
"return",
"$",
"_GET",
"[",
"$",
"name",
"]",
";",
"}",
"if",
"(",
"array_key_exists",
"(",
"$... | Get the submitted form value
@param string $name Value name
@return string | [
"Get",
"the",
"submitted",
"form",
"value"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Form/Parameters.php#L21-L30 |
webforge-labs/psc-cms | lib/Psc/FE/Errors.php | Errors.hasErrors | public function hasErrors() {
foreach ($this->jsonArray as $error) {
if ($error['type'] != self::OK)
return TRUE;
}
return FALSE;
} | php | public function hasErrors() {
foreach ($this->jsonArray as $error) {
if ($error['type'] != self::OK)
return TRUE;
}
return FALSE;
} | [
"public",
"function",
"hasErrors",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"jsonArray",
"as",
"$",
"error",
")",
"{",
"if",
"(",
"$",
"error",
"[",
"'type'",
"]",
"!=",
"self",
"::",
"OK",
")",
"return",
"TRUE",
";",
"}",
"return",
"FALSE... | Gibt nur dann Errors zurück, wenn diese ungleich self::OK sind
@return bool | [
"Gibt",
"nur",
"dann",
"Errors",
"zurück",
"wenn",
"diese",
"ungleich",
"self",
"::",
"OK",
"sind"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/FE/Errors.php#L69-L75 |
webforge-labs/psc-cms | lib/Psc/FE/Errors.php | Errors.addEx | public function addEx(\Psc\Exception $e) {
if (isset($e->errorMessage)) {
$msg = $e->errorMessage;
} else {
$msg = $e->getMessage();
}
if (isset($e->errorStatus)) {
$errorStatus = $e->errorStatus;
} else {
$errorStatus = self::ERROR;
}
$devInfo = NULL;
i... | php | public function addEx(\Psc\Exception $e) {
if (isset($e->errorMessage)) {
$msg = $e->errorMessage;
} else {
$msg = $e->getMessage();
}
if (isset($e->errorStatus)) {
$errorStatus = $e->errorStatus;
} else {
$errorStatus = self::ERROR;
}
$devInfo = NULL;
i... | [
"public",
"function",
"addEx",
"(",
"\\",
"Psc",
"\\",
"Exception",
"$",
"e",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"e",
"->",
"errorMessage",
")",
")",
"{",
"$",
"msg",
"=",
"$",
"e",
"->",
"errorMessage",
";",
"}",
"else",
"{",
"$",
"msg",
... | Fügt eine schöne Exception als Fehler hinzu | [
"Fügt",
"eine",
"schöne",
"Exception",
"als",
"Fehler",
"hinzu"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/FE/Errors.php#L108-L127 |
webforge-labs/psc-cms | lib/Psc/FE/Errors.php | Errors.html | public function html() {
$html = NULL;
if (count($this->jsonArray) > 0) {
$content = json_encode($this->jsonArray,
JSON_HEX_TAG|JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_AMP
);
$html = HTML::tag('div',$content,array('id'=>$this->getJsonId()))->setStyle('display','none');
}
r... | php | public function html() {
$html = NULL;
if (count($this->jsonArray) > 0) {
$content = json_encode($this->jsonArray,
JSON_HEX_TAG|JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_AMP
);
$html = HTML::tag('div',$content,array('id'=>$this->getJsonId()))->setStyle('display','none');
}
r... | [
"public",
"function",
"html",
"(",
")",
"{",
"$",
"html",
"=",
"NULL",
";",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"jsonArray",
")",
">",
"0",
")",
"{",
"$",
"content",
"=",
"json_encode",
"(",
"$",
"this",
"->",
"jsonArray",
",",
"JSON_HEX_TA... | Gibt Informationen für die Fehler die angezeigt werden sollen, für das JavaScript zurück
@return HTMLTag|NULL | [
"Gibt",
"Informationen",
"für",
"die",
"Fehler",
"die",
"angezeigt",
"werden",
"sollen",
"für",
"das",
"JavaScript",
"zurück"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/FE/Errors.php#L160-L171 |
inpsyde/inpsyde-filter | src/WordPress/SpecialChars.php | SpecialChars.filter | public function filter( $value ) {
if ( ! is_string( $value ) || empty( $value ) ) {
do_action( 'inpsyde.filter.error', 'The given value is not string or empty.', [ 'method' => __METHOD__, 'value' => $value ] );
return $value;
}
$quote_style = $this->options[ 'quote_style' ];
$charset = (string... | php | public function filter( $value ) {
if ( ! is_string( $value ) || empty( $value ) ) {
do_action( 'inpsyde.filter.error', 'The given value is not string or empty.', [ 'method' => __METHOD__, 'value' => $value ] );
return $value;
}
$quote_style = $this->options[ 'quote_style' ];
$charset = (string... | [
"public",
"function",
"filter",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"value",
")",
"||",
"empty",
"(",
"$",
"value",
")",
")",
"{",
"do_action",
"(",
"'inpsyde.filter.error'",
",",
"'The given value is not string or empty.'",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/inpsyde/inpsyde-filter/blob/777a6208ea4dfbeed89e6d0712a35dc25eab498b/src/WordPress/SpecialChars.php#L26-L39 |
prolic/Concurrent-PHP-Utils | src/ConcurrentPhpUtils/TimeUnit.php | TimeUnit.toNanos | public function toNanos($d)
{
$v = $this->getValue();
return $this->x($d, $this->{'c'.$v}/$this->c0, PHP_INT_MAX/($this->{'c'.$v}/$this->c0));
} | php | public function toNanos($d)
{
$v = $this->getValue();
return $this->x($d, $this->{'c'.$v}/$this->c0, PHP_INT_MAX/($this->{'c'.$v}/$this->c0));
} | [
"public",
"function",
"toNanos",
"(",
"$",
"d",
")",
"{",
"$",
"v",
"=",
"$",
"this",
"->",
"getValue",
"(",
")",
";",
"return",
"$",
"this",
"->",
"x",
"(",
"$",
"d",
",",
"$",
"this",
"->",
"{",
"'c'",
".",
"$",
"v",
"}",
"/",
"$",
"this"... | Convert to nanos
@param int $d
@return int | [
"Convert",
"to",
"nanos"
] | train | https://github.com/prolic/Concurrent-PHP-Utils/blob/771b55b3ef79d9a7443c4f6d95373f41b9f34c4a/src/ConcurrentPhpUtils/TimeUnit.php#L52-L56 |
prolic/Concurrent-PHP-Utils | src/ConcurrentPhpUtils/TimeUnit.php | TimeUnit.toMicros | public function toMicros($d)
{
$v = $this->getValue();
if ($v < self::MICROSECONDS) {
return $d/($this->c1/$this->c0);
} else {
return $this->x($d, $this->{'c'.$v}/$this->c1, PHP_INT_MAX/($this->{'c'.$v})/$this->c1);
}
} | php | public function toMicros($d)
{
$v = $this->getValue();
if ($v < self::MICROSECONDS) {
return $d/($this->c1/$this->c0);
} else {
return $this->x($d, $this->{'c'.$v}/$this->c1, PHP_INT_MAX/($this->{'c'.$v})/$this->c1);
}
} | [
"public",
"function",
"toMicros",
"(",
"$",
"d",
")",
"{",
"$",
"v",
"=",
"$",
"this",
"->",
"getValue",
"(",
")",
";",
"if",
"(",
"$",
"v",
"<",
"self",
"::",
"MICROSECONDS",
")",
"{",
"return",
"$",
"d",
"/",
"(",
"$",
"this",
"->",
"c1",
"... | Convert to micros
@param int $d
@return float|int | [
"Convert",
"to",
"micros"
] | train | https://github.com/prolic/Concurrent-PHP-Utils/blob/771b55b3ef79d9a7443c4f6d95373f41b9f34c4a/src/ConcurrentPhpUtils/TimeUnit.php#L64-L72 |
prolic/Concurrent-PHP-Utils | src/ConcurrentPhpUtils/TimeUnit.php | TimeUnit.toMillis | public function toMillis($d)
{
$v = $this->getValue();
if ($v < self::MILLISECONDS) {
return $d/($this->c2/$this->{'c'.$v});
} else {
return $this->x($d, $this->{'c'.$v}/$this->c2, PHP_INT_MAX/($this->{'c'.$v}/$this->c2));
}
} | php | public function toMillis($d)
{
$v = $this->getValue();
if ($v < self::MILLISECONDS) {
return $d/($this->c2/$this->{'c'.$v});
} else {
return $this->x($d, $this->{'c'.$v}/$this->c2, PHP_INT_MAX/($this->{'c'.$v}/$this->c2));
}
} | [
"public",
"function",
"toMillis",
"(",
"$",
"d",
")",
"{",
"$",
"v",
"=",
"$",
"this",
"->",
"getValue",
"(",
")",
";",
"if",
"(",
"$",
"v",
"<",
"self",
"::",
"MILLISECONDS",
")",
"{",
"return",
"$",
"d",
"/",
"(",
"$",
"this",
"->",
"c2",
"... | Convert to millies
@param int $d
@return float|int | [
"Convert",
"to",
"millies"
] | train | https://github.com/prolic/Concurrent-PHP-Utils/blob/771b55b3ef79d9a7443c4f6d95373f41b9f34c4a/src/ConcurrentPhpUtils/TimeUnit.php#L80-L88 |
prolic/Concurrent-PHP-Utils | src/ConcurrentPhpUtils/TimeUnit.php | TimeUnit.toSeconds | public function toSeconds($d)
{
$v = $this->getValue();
if ($v < self::SECONDS) {
return $d/($this->c3/$this->{'c'.$v});
} else {
return $this->x($d, $this->{'c'.$v}/$this->c3, PHP_INT_MAX/($this->{'c'.$v}/$this->c3));
}
} | php | public function toSeconds($d)
{
$v = $this->getValue();
if ($v < self::SECONDS) {
return $d/($this->c3/$this->{'c'.$v});
} else {
return $this->x($d, $this->{'c'.$v}/$this->c3, PHP_INT_MAX/($this->{'c'.$v}/$this->c3));
}
} | [
"public",
"function",
"toSeconds",
"(",
"$",
"d",
")",
"{",
"$",
"v",
"=",
"$",
"this",
"->",
"getValue",
"(",
")",
";",
"if",
"(",
"$",
"v",
"<",
"self",
"::",
"SECONDS",
")",
"{",
"return",
"$",
"d",
"/",
"(",
"$",
"this",
"->",
"c3",
"/",
... | Convert to seconds
@param int $d
@return float|int | [
"Convert",
"to",
"seconds"
] | train | https://github.com/prolic/Concurrent-PHP-Utils/blob/771b55b3ef79d9a7443c4f6d95373f41b9f34c4a/src/ConcurrentPhpUtils/TimeUnit.php#L96-L104 |
prolic/Concurrent-PHP-Utils | src/ConcurrentPhpUtils/TimeUnit.php | TimeUnit.toMinutes | public function toMinutes($d)
{
$v = $this->getValue();
if ($v < self::MINUTES) {
return $d/($this->c4/$this->{'c'.$v});
} else {
return $this->x($d, $this->{'c'.$v}/$this->c4, PHP_INT_MAX/($this->{'c'.$v}/$this->c4));
}
} | php | public function toMinutes($d)
{
$v = $this->getValue();
if ($v < self::MINUTES) {
return $d/($this->c4/$this->{'c'.$v});
} else {
return $this->x($d, $this->{'c'.$v}/$this->c4, PHP_INT_MAX/($this->{'c'.$v}/$this->c4));
}
} | [
"public",
"function",
"toMinutes",
"(",
"$",
"d",
")",
"{",
"$",
"v",
"=",
"$",
"this",
"->",
"getValue",
"(",
")",
";",
"if",
"(",
"$",
"v",
"<",
"self",
"::",
"MINUTES",
")",
"{",
"return",
"$",
"d",
"/",
"(",
"$",
"this",
"->",
"c4",
"/",
... | Convert to minutes
@param int $d
@return float|int | [
"Convert",
"to",
"minutes"
] | train | https://github.com/prolic/Concurrent-PHP-Utils/blob/771b55b3ef79d9a7443c4f6d95373f41b9f34c4a/src/ConcurrentPhpUtils/TimeUnit.php#L112-L120 |
prolic/Concurrent-PHP-Utils | src/ConcurrentPhpUtils/TimeUnit.php | TimeUnit.toHours | public function toHours($d)
{
$v = $this->getValue();
if ($v < self::HOURS) {
return $d/($this->c5/$this->{'c'.$v});
} else {
return $this->x($d, $this->{'c'.$v}/$this->c5, PHP_INT_MAX/($this->{'c'.$v}/$this->c5));
}
} | php | public function toHours($d)
{
$v = $this->getValue();
if ($v < self::HOURS) {
return $d/($this->c5/$this->{'c'.$v});
} else {
return $this->x($d, $this->{'c'.$v}/$this->c5, PHP_INT_MAX/($this->{'c'.$v}/$this->c5));
}
} | [
"public",
"function",
"toHours",
"(",
"$",
"d",
")",
"{",
"$",
"v",
"=",
"$",
"this",
"->",
"getValue",
"(",
")",
";",
"if",
"(",
"$",
"v",
"<",
"self",
"::",
"HOURS",
")",
"{",
"return",
"$",
"d",
"/",
"(",
"$",
"this",
"->",
"c5",
"/",
"$... | Convert to hours
@param int $d
@return float|int | [
"Convert",
"to",
"hours"
] | train | https://github.com/prolic/Concurrent-PHP-Utils/blob/771b55b3ef79d9a7443c4f6d95373f41b9f34c4a/src/ConcurrentPhpUtils/TimeUnit.php#L128-L136 |
prolic/Concurrent-PHP-Utils | src/ConcurrentPhpUtils/TimeUnit.php | TimeUnit.toDays | public function toDays($d)
{
$v = $this->getValue();
return $d/($this->c6/$this->{'c'.$v});
} | php | public function toDays($d)
{
$v = $this->getValue();
return $d/($this->c6/$this->{'c'.$v});
} | [
"public",
"function",
"toDays",
"(",
"$",
"d",
")",
"{",
"$",
"v",
"=",
"$",
"this",
"->",
"getValue",
"(",
")",
";",
"return",
"$",
"d",
"/",
"(",
"$",
"this",
"->",
"c6",
"/",
"$",
"this",
"->",
"{",
"'c'",
".",
"$",
"v",
"}",
")",
";",
... | Convert to days
@param int $d
@return float | [
"Convert",
"to",
"days"
] | train | https://github.com/prolic/Concurrent-PHP-Utils/blob/771b55b3ef79d9a7443c4f6d95373f41b9f34c4a/src/ConcurrentPhpUtils/TimeUnit.php#L144-L148 |
prolic/Concurrent-PHP-Utils | src/ConcurrentPhpUtils/TimeUnit.php | TimeUnit.convert | public function convert($sourceDuration, TimeUnit $sourceUnit)
{
switch ($this->getValue()) {
case self::NANOSECONDS:
return $sourceUnit->toNanos($sourceDuration);
case self::MICROSECONDS:
return $sourceUnit->toMicros($sourceDuration);
case... | php | public function convert($sourceDuration, TimeUnit $sourceUnit)
{
switch ($this->getValue()) {
case self::NANOSECONDS:
return $sourceUnit->toNanos($sourceDuration);
case self::MICROSECONDS:
return $sourceUnit->toMicros($sourceDuration);
case... | [
"public",
"function",
"convert",
"(",
"$",
"sourceDuration",
",",
"TimeUnit",
"$",
"sourceUnit",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"getValue",
"(",
")",
")",
"{",
"case",
"self",
"::",
"NANOSECONDS",
":",
"return",
"$",
"sourceUnit",
"->",
"toN... | Convert the given time duration in the given unit to this
unit. Conversions from finer to coarser granularities
truncate, so lose precision. For example converting
999 milliseconds to seconds results in
0. Conversions from coarser to finer granularities
with arguments that would numerically overflow saturate to
"-PHP_... | [
"Convert",
"the",
"given",
"time",
"duration",
"in",
"the",
"given",
"unit",
"to",
"this",
"unit",
".",
"Conversions",
"from",
"finer",
"to",
"coarser",
"granularities",
"truncate",
"so",
"lose",
"precision",
".",
"For",
"example",
"converting",
"999",
"millis... | train | https://github.com/prolic/Concurrent-PHP-Utils/blob/771b55b3ef79d9a7443c4f6d95373f41b9f34c4a/src/ConcurrentPhpUtils/TimeUnit.php#L167-L185 |
prolic/Concurrent-PHP-Utils | src/ConcurrentPhpUtils/TimeUnit.php | TimeUnit.x | private function x($d, $m, $over)
{
if ($d > $over) {
return PHP_INT_MAX;
}
if ($d < -$over) {
return -PHP_INT_MAX -1;
}
return $d * $m;
} | php | private function x($d, $m, $over)
{
if ($d > $over) {
return PHP_INT_MAX;
}
if ($d < -$over) {
return -PHP_INT_MAX -1;
}
return $d * $m;
} | [
"private",
"function",
"x",
"(",
"$",
"d",
",",
"$",
"m",
",",
"$",
"over",
")",
"{",
"if",
"(",
"$",
"d",
">",
"$",
"over",
")",
"{",
"return",
"PHP_INT_MAX",
";",
"}",
"if",
"(",
"$",
"d",
"<",
"-",
"$",
"over",
")",
"{",
"return",
"-",
... | Scale d by m, checking for overflow.
This has a short name to make code more readable.
@param int $d
@param int $m
@param int $over
@return int | [
"Scale",
"d",
"by",
"m",
"checking",
"for",
"overflow",
".",
"This",
"has",
"a",
"short",
"name",
"to",
"make",
"code",
"more",
"readable",
"."
] | train | https://github.com/prolic/Concurrent-PHP-Utils/blob/771b55b3ef79d9a7443c4f6d95373f41b9f34c4a/src/ConcurrentPhpUtils/TimeUnit.php#L196-L205 |
webtorque7/link-field | code/WTLink.php | WTLink.Link | public function Link()
{
$link = '';
switch ($this->type) {
case 'Internal' :
if ($this->internal && ($page = SiteTree::get()->byID($this->internal))) {
$link = $page->Link();
}
break;
case 'External' :
... | php | public function Link()
{
$link = '';
switch ($this->type) {
case 'Internal' :
if ($this->internal && ($page = SiteTree::get()->byID($this->internal))) {
$link = $page->Link();
}
break;
case 'External' :
... | [
"public",
"function",
"Link",
"(",
")",
"{",
"$",
"link",
"=",
"''",
";",
"switch",
"(",
"$",
"this",
"->",
"type",
")",
"{",
"case",
"'Internal'",
":",
"if",
"(",
"$",
"this",
"->",
"internal",
"&&",
"(",
"$",
"page",
"=",
"SiteTree",
"::",
"get... | Determines the link by the type and what is set
@return mixed|string | [
"Determines",
"the",
"link",
"by",
"the",
"type",
"and",
"what",
"is",
"set"
] | train | https://github.com/webtorque7/link-field/blob/b846644e1d35676419e71f3127cfc8f150aff081/code/WTLink.php#L389-L430 |
webtorque7/link-field | code/WTLink.php | WTLink.Tag | public function Tag($text = null)
{
$link = $this->Link();
if ($link) {
$target = !empty($this->targetBlank) ? 'target="_blank"' : '';
return $text ? "<a href=\"{$link}\" {$target}>" . Convert::raw2xml(
$text
) . '</a>' : "<a href=\"{$lin... | php | public function Tag($text = null)
{
$link = $this->Link();
if ($link) {
$target = !empty($this->targetBlank) ? 'target="_blank"' : '';
return $text ? "<a href=\"{$link}\" {$target}>" . Convert::raw2xml(
$text
) . '</a>' : "<a href=\"{$lin... | [
"public",
"function",
"Tag",
"(",
"$",
"text",
"=",
"null",
")",
"{",
"$",
"link",
"=",
"$",
"this",
"->",
"Link",
"(",
")",
";",
"if",
"(",
"$",
"link",
")",
"{",
"$",
"target",
"=",
"!",
"empty",
"(",
"$",
"this",
"->",
"targetBlank",
")",
... | Creates the anchor tag, if $text is it is put inside the anchor tag, otherwise it only returns
the opening of the ancor tag
@param string|null $text
@return string | [
"Creates",
"the",
"anchor",
"tag",
"if",
"$text",
"is",
"it",
"is",
"put",
"inside",
"the",
"anchor",
"tag",
"otherwise",
"it",
"only",
"returns",
"the",
"opening",
"of",
"the",
"ancor",
"tag"
] | train | https://github.com/webtorque7/link-field/blob/b846644e1d35676419e71f3127cfc8f150aff081/code/WTLink.php#L439-L452 |
webtorque7/link-field | code/WTLink.php | WTLink.getDO | public function getDO()
{
if (!empty($this->dataObject)) {
list($className, $ID) = explode('-', $this->dataObject);
return DataList::create($className)->byID($ID);
}
return null;
} | php | public function getDO()
{
if (!empty($this->dataObject)) {
list($className, $ID) = explode('-', $this->dataObject);
return DataList::create($className)->byID($ID);
}
return null;
} | [
"public",
"function",
"getDO",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"dataObject",
")",
")",
"{",
"list",
"(",
"$",
"className",
",",
"$",
"ID",
")",
"=",
"explode",
"(",
"'-'",
",",
"$",
"this",
"->",
"dataObject",
")",... | Get the DataObject instance
@return DataObject|null | [
"Get",
"the",
"DataObject",
"instance"
] | train | https://github.com/webtorque7/link-field/blob/b846644e1d35676419e71f3127cfc8f150aff081/code/WTLink.php#L459-L468 |
CakeCMS/Core | src/Toolbar/ToolbarItemLink.php | ToolbarItemLink.fetchItem | public function fetchItem()
{
list ($source, $title, $url, $options) = func_get_args();
$url = Router::url($url);
return $this->_view->Html->link($title, $url, $options);
} | php | public function fetchItem()
{
list ($source, $title, $url, $options) = func_get_args();
$url = Router::url($url);
return $this->_view->Html->link($title, $url, $options);
} | [
"public",
"function",
"fetchItem",
"(",
")",
"{",
"list",
"(",
"$",
"source",
",",
"$",
"title",
",",
"$",
"url",
",",
"$",
"options",
")",
"=",
"func_get_args",
"(",
")",
";",
"$",
"url",
"=",
"Router",
"::",
"url",
"(",
"$",
"url",
")",
";",
... | Fetch button id.
@return string
@SuppressWarnings("unused") | [
"Fetch",
"button",
"id",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Toolbar/ToolbarItemLink.php#L34-L40 |
sparwelt/imgix-lib | src/Components/ImgixUrlGenerator.php | ImgixUrlGenerator.generateUrl | public function generateUrl($originalUrl, array $filterParams = [])
{
if (empty($originalUrl)) {
throw new ResolutionException('Empty url');
}
$cdn = $this->cdnSelector->getCdnForImage($originalUrl);
$queryParams = $cdn->isGenerateFilterParams() ? array_merge($cdn->getD... | php | public function generateUrl($originalUrl, array $filterParams = [])
{
if (empty($originalUrl)) {
throw new ResolutionException('Empty url');
}
$cdn = $this->cdnSelector->getCdnForImage($originalUrl);
$queryParams = $cdn->isGenerateFilterParams() ? array_merge($cdn->getD... | [
"public",
"function",
"generateUrl",
"(",
"$",
"originalUrl",
",",
"array",
"$",
"filterParams",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"originalUrl",
")",
")",
"{",
"throw",
"new",
"ResolutionException",
"(",
"'Empty url'",
")",
";",
"}"... | @param string $originalUrl
@param array $filterParams
@return string
@throws \Sparwelt\ImgixLib\Exception\ResolutionException
@throws \Sparwelt\ImgixLib\Exception\ConfigurationException
@throws \InvalidArgumentException | [
"@param",
"string",
"$originalUrl",
"@param",
"array",
"$filterParams"
] | train | https://github.com/sparwelt/imgix-lib/blob/330e1db2bed71bc283e5a2da6246528f240939ec/src/Components/ImgixUrlGenerator.php#L46-L86 |
sparwelt/imgix-lib | src/Components/ImgixUrlGenerator.php | ImgixUrlGenerator.translateShardStrategy | private function translateShardStrategy($shardStrategy)
{
switch ($shardStrategy) {
case 'crc':
return ShardStrategy::CRC;
case 'cycle':
return ShardStrategy::CYCLE;
default:
throw new ConfigurationException(
... | php | private function translateShardStrategy($shardStrategy)
{
switch ($shardStrategy) {
case 'crc':
return ShardStrategy::CRC;
case 'cycle':
return ShardStrategy::CYCLE;
default:
throw new ConfigurationException(
... | [
"private",
"function",
"translateShardStrategy",
"(",
"$",
"shardStrategy",
")",
"{",
"switch",
"(",
"$",
"shardStrategy",
")",
"{",
"case",
"'crc'",
":",
"return",
"ShardStrategy",
"::",
"CRC",
";",
"case",
"'cycle'",
":",
"return",
"ShardStrategy",
"::",
"CY... | @param string $shardStrategy
@return int
@throws \Sparwelt\ImgixLib\Exception\ConfigurationException | [
"@param",
"string",
"$shardStrategy"
] | train | https://github.com/sparwelt/imgix-lib/blob/330e1db2bed71bc283e5a2da6246528f240939ec/src/Components/ImgixUrlGenerator.php#L95-L107 |
transfer-framework/ezplatform | src/Transfer/EzPlatform/Repository/Values/ContentObject.php | ContentObject.setParentLocations | public function setParentLocations(array $parentLocations)
{
$this->properties['parent_locations'] = [];
foreach ($parentLocations as $location) {
$this->addParentLocation($location);
}
} | php | public function setParentLocations(array $parentLocations)
{
$this->properties['parent_locations'] = [];
foreach ($parentLocations as $location) {
$this->addParentLocation($location);
}
} | [
"public",
"function",
"setParentLocations",
"(",
"array",
"$",
"parentLocations",
")",
"{",
"$",
"this",
"->",
"properties",
"[",
"'parent_locations'",
"]",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"parentLocations",
"as",
"$",
"location",
")",
"{",
"$",
"... | Values in array must be of type Location, LocationObject or int.
@param array $parentLocations | [
"Values",
"in",
"array",
"must",
"be",
"of",
"type",
"Location",
"LocationObject",
"or",
"int",
"."
] | train | https://github.com/transfer-framework/ezplatform/blob/1b2d87caa1a6b79fd8fc78109c26a2d1d6359c2f/src/Transfer/EzPlatform/Repository/Values/ContentObject.php#L81-L87 |
transfer-framework/ezplatform | src/Transfer/EzPlatform/Repository/Values/ContentObject.php | ContentObject.addParentLocation | public function addParentLocation($parentLocation)
{
$locationObject = $this->convertToLocationObject($parentLocation);
if (!isset($locationObject->data['parent_location_id']) || (int) $locationObject->data['parent_location_id'] < 1) {
throw new InvalidDataStructureException('Parent loc... | php | public function addParentLocation($parentLocation)
{
$locationObject = $this->convertToLocationObject($parentLocation);
if (!isset($locationObject->data['parent_location_id']) || (int) $locationObject->data['parent_location_id'] < 1) {
throw new InvalidDataStructureException('Parent loc... | [
"public",
"function",
"addParentLocation",
"(",
"$",
"parentLocation",
")",
"{",
"$",
"locationObject",
"=",
"$",
"this",
"->",
"convertToLocationObject",
"(",
"$",
"parentLocation",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"locationObject",
"->",
"data",
... | Convert parameters to LocationCreateStruct and stores it on the ContentObject.
@param Location|LocationObject|int $parentLocation
@throws InvalidDataStructureException | [
"Convert",
"parameters",
"to",
"LocationCreateStruct",
"and",
"stores",
"it",
"on",
"the",
"ContentObject",
"."
] | train | https://github.com/transfer-framework/ezplatform/blob/1b2d87caa1a6b79fd8fc78109c26a2d1d6359c2f/src/Transfer/EzPlatform/Repository/Values/ContentObject.php#L96-L111 |
transfer-framework/ezplatform | src/Transfer/EzPlatform/Repository/Values/ContentObject.php | ContentObject.convertToLocationObject | private function convertToLocationObject($parentLocation)
{
$locationObject = new LocationObject(array());
switch (true) {
case $parentLocation instanceof Location:
$locationObject->getMapper()->locationToObject($parentLocation);
break;
case i... | php | private function convertToLocationObject($parentLocation)
{
$locationObject = new LocationObject(array());
switch (true) {
case $parentLocation instanceof Location:
$locationObject->getMapper()->locationToObject($parentLocation);
break;
case i... | [
"private",
"function",
"convertToLocationObject",
"(",
"$",
"parentLocation",
")",
"{",
"$",
"locationObject",
"=",
"new",
"LocationObject",
"(",
"array",
"(",
")",
")",
";",
"switch",
"(",
"true",
")",
"{",
"case",
"$",
"parentLocation",
"instanceof",
"Locati... | @param int|Location|LocationObject $parentLocation
@return LocationObject | [
"@param",
"int|Location|LocationObject",
"$parentLocation"
] | train | https://github.com/transfer-framework/ezplatform/blob/1b2d87caa1a6b79fd8fc78109c26a2d1d6359c2f/src/Transfer/EzPlatform/Repository/Values/ContentObject.php#L118-L135 |
zircote/AMQP | library/AMQP/Wire/GenericContent.php | GenericContent.load_properties | public function load_properties($rawBytes)
{
$reader = new Reader($rawBytes);
$flagBits = false;
// Read 16-bit shorts until we get one with a low bit set to zero
$flags = array();
while (true) {
$flagBits = $reader->readShort();
$flags[] = $flagBits;
... | php | public function load_properties($rawBytes)
{
$reader = new Reader($rawBytes);
$flagBits = false;
// Read 16-bit shorts until we get one with a low bit set to zero
$flags = array();
while (true) {
$flagBits = $reader->readShort();
$flags[] = $flagBits;
... | [
"public",
"function",
"load_properties",
"(",
"$",
"rawBytes",
")",
"{",
"$",
"reader",
"=",
"new",
"Reader",
"(",
"$",
"rawBytes",
")",
";",
"$",
"flagBits",
"=",
"false",
";",
"// Read 16-bit shorts until we get one with a low bit set to zero",
"$",
"flags",
"="... | Given the raw bytes containing the property-flags and
property-list from a content-frame-header, parse and insert
into a dictionary stored in this object as an attribute named
'properties'. | [
"Given",
"the",
"raw",
"bytes",
"containing",
"the",
"property",
"-",
"flags",
"and",
"property",
"-",
"list",
"from",
"a",
"content",
"-",
"frame",
"-",
"header",
"parse",
"and",
"insert",
"into",
"a",
"dictionary",
"stored",
"in",
"this",
"object",
"as",... | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Wire/GenericContent.php#L88-L120 |
zircote/AMQP | library/AMQP/Wire/GenericContent.php | GenericContent.serializeProperties | public function serializeProperties()
{
$shift = 15;
$flagBits = 0;
$flags = array();
$rawBytes = new Writer();
foreach ($this->propertyTypes as $key => $proptype) {
if (isset($this->properties[$key])) {
$value = $this->properties[$key];
... | php | public function serializeProperties()
{
$shift = 15;
$flagBits = 0;
$flags = array();
$rawBytes = new Writer();
foreach ($this->propertyTypes as $key => $proptype) {
if (isset($this->properties[$key])) {
$value = $this->properties[$key];
... | [
"public",
"function",
"serializeProperties",
"(",
")",
"{",
"$",
"shift",
"=",
"15",
";",
"$",
"flagBits",
"=",
"0",
";",
"$",
"flags",
"=",
"array",
"(",
")",
";",
"$",
"rawBytes",
"=",
"new",
"Writer",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
... | serialize the 'properties' attribute (a dictionary) into the
raw bytes making up a set of property flags and a property
list, suitable for putting into a content frame header. | [
"serialize",
"the",
"properties",
"attribute",
"(",
"a",
"dictionary",
")",
"into",
"the",
"raw",
"bytes",
"making",
"up",
"a",
"set",
"of",
"property",
"flags",
"and",
"a",
"property",
"list",
"suitable",
"for",
"putting",
"into",
"a",
"content",
"frame",
... | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Wire/GenericContent.php#L140-L180 |
steeffeen/FancyManiaLinks | FML/CustomUI.php | CustomUI.renderStandalone | public function renderStandalone()
{
$domDocument = new \DOMDocument("1.0", "utf-8");
$domDocument->xmlStandalone = true;
$domElement = $this->render($domDocument);
$domDocument->appendChild($domElement);
return $domDocument;
} | php | public function renderStandalone()
{
$domDocument = new \DOMDocument("1.0", "utf-8");
$domDocument->xmlStandalone = true;
$domElement = $this->render($domDocument);
$domDocument->appendChild($domElement);
return $domDocument;
} | [
"public",
"function",
"renderStandalone",
"(",
")",
"{",
"$",
"domDocument",
"=",
"new",
"\\",
"DOMDocument",
"(",
"\"1.0\"",
",",
"\"utf-8\"",
")",
";",
"$",
"domDocument",
"->",
"xmlStandalone",
"=",
"true",
";",
"$",
"domElement",
"=",
"$",
"this",
"->"... | Render the Custom UI standalone
@return \DOMDocument | [
"Render",
"the",
"Custom",
"UI",
"standalone"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/CustomUI.php#L263-L272 |
steeffeen/FancyManiaLinks | FML/CustomUI.php | CustomUI.render | public function render(\DOMDocument $domDocument)
{
$domElement = $domDocument->createElement("custom_ui");
$settings = $this->getSettings();
foreach ($settings as $setting => $value) {
if ($value === null) {
continue;
}
$settingDomElemen... | php | public function render(\DOMDocument $domDocument)
{
$domElement = $domDocument->createElement("custom_ui");
$settings = $this->getSettings();
foreach ($settings as $setting => $value) {
if ($value === null) {
continue;
}
$settingDomElemen... | [
"public",
"function",
"render",
"(",
"\\",
"DOMDocument",
"$",
"domDocument",
")",
"{",
"$",
"domElement",
"=",
"$",
"domDocument",
"->",
"createElement",
"(",
"\"custom_ui\"",
")",
";",
"$",
"settings",
"=",
"$",
"this",
"->",
"getSettings",
"(",
")",
";"... | Render the Custom UI
@param \DOMDocument $domDocument DOMDocument for which the Custom UI should be rendered
@return \DOMElement | [
"Render",
"the",
"Custom",
"UI"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/CustomUI.php#L280-L296 |
steeffeen/FancyManiaLinks | FML/CustomUI.php | CustomUI.getSettings | protected function getSettings()
{
return array(
"global" => $this->globalVisible,
"challenge_info" => $this->challengeInfoVisible,
"chat" => $this->chatVisible,
"checkpoint_list" => $this->checkpointListVisible,
"net_infos" => $this->netInfosVisib... | php | protected function getSettings()
{
return array(
"global" => $this->globalVisible,
"challenge_info" => $this->challengeInfoVisible,
"chat" => $this->chatVisible,
"checkpoint_list" => $this->checkpointListVisible,
"net_infos" => $this->netInfosVisib... | [
"protected",
"function",
"getSettings",
"(",
")",
"{",
"return",
"array",
"(",
"\"global\"",
"=>",
"$",
"this",
"->",
"globalVisible",
",",
"\"challenge_info\"",
"=>",
"$",
"this",
"->",
"challengeInfoVisible",
",",
"\"chat\"",
"=>",
"$",
"this",
"->",
"chatVi... | Get associative array of all Custom UI settings
@return array | [
"Get",
"associative",
"array",
"of",
"all",
"Custom",
"UI",
"settings"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/CustomUI.php#L314-L326 |
zodream/thirdparty | src/Pay/WeChat.php | WeChat.getUrl | public function getUrl($path) {
if (strpos($path, '://') !== false) {
return $path;
}
$url = 'https://api.mch.weixin.qq.com/';
if ($this->get('debug_mode') === true) {
$url .= 'sandboxnew/';
}
return $url. trim($path, '/');
} | php | public function getUrl($path) {
if (strpos($path, '://') !== false) {
return $path;
}
$url = 'https://api.mch.weixin.qq.com/';
if ($this->get('debug_mode') === true) {
$url .= 'sandboxnew/';
}
return $url. trim($path, '/');
} | [
"public",
"function",
"getUrl",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"path",
",",
"'://'",
")",
"!==",
"false",
")",
"{",
"return",
"$",
"path",
";",
"}",
"$",
"url",
"=",
"'https://api.mch.weixin.qq.com/'",
";",
"if",
"(",
"$",... | 生成完整的网址
@param $path
@return string | [
"生成完整的网址"
] | train | https://github.com/zodream/thirdparty/blob/b9d39087913850f1c5c7c9165105fec22a128f8f/src/Pay/WeChat.php#L42-L51 |
zodream/thirdparty | src/Pay/WeChat.php | WeChat.order | public function order(array $args = array()) {
$args = $this->getOrder()->parameters($this->merge($args))->text();
if ($args['return_code'] != 'SUCCESS') {
throw new Exception($args['return_msg']);
}
if ($args['result_code'] != 'SUCCESS') {
throw new Exception($ar... | php | public function order(array $args = array()) {
$args = $this->getOrder()->parameters($this->merge($args))->text();
if ($args['return_code'] != 'SUCCESS') {
throw new Exception($args['return_msg']);
}
if ($args['result_code'] != 'SUCCESS') {
throw new Exception($ar... | [
"public",
"function",
"order",
"(",
"array",
"$",
"args",
"=",
"array",
"(",
")",
")",
"{",
"$",
"args",
"=",
"$",
"this",
"->",
"getOrder",
"(",
")",
"->",
"parameters",
"(",
"$",
"this",
"->",
"merge",
"(",
"$",
"args",
")",
")",
"->",
"text",
... | 生成预支付订单
[
'nonce_str' => '',
'body' => '',
'out_trade_no' => ',
'total_fee' => 1,
'spbill_create_ip' => '',
'time_start' => date('Ymdis')
]
@param array $args
@return array|bool|mixed|object
@throws \Exception | [
"生成预支付订单",
"[",
"nonce_str",
"=",
">",
"body",
"=",
">",
"out_trade_no",
"=",
">",
"total_fee",
"=",
">",
"1",
"spbill_create_ip",
"=",
">",
"time_start",
"=",
">",
"date",
"(",
"Ymdis",
")",
"]"
] | train | https://github.com/zodream/thirdparty/blob/b9d39087913850f1c5c7c9165105fec22a128f8f/src/Pay/WeChat.php#L499-L512 |
zodream/thirdparty | src/Pay/WeChat.php | WeChat.queryOrder | public function queryOrder(array $args = array()) {
$args = $this->getQuery()->parameters($this->merge($args))->text();
if ($args['return_code'] != 'SUCCESS') {
throw new Exception($args['return_msg']);
}
if (!$this->verify($args)) {
throw new Exception('数据验签失败!')... | php | public function queryOrder(array $args = array()) {
$args = $this->getQuery()->parameters($this->merge($args))->text();
if ($args['return_code'] != 'SUCCESS') {
throw new Exception($args['return_msg']);
}
if (!$this->verify($args)) {
throw new Exception('数据验签失败!')... | [
"public",
"function",
"queryOrder",
"(",
"array",
"$",
"args",
"=",
"array",
"(",
")",
")",
"{",
"$",
"args",
"=",
"$",
"this",
"->",
"getQuery",
"(",
")",
"->",
"parameters",
"(",
"$",
"this",
"->",
"merge",
"(",
"$",
"args",
")",
")",
"->",
"te... | 查询订单
EXAMPLE:
[
'out_trade_no' =>
]
@param array $args
@return array|bool|mixed|object
@throws \Exception | [
"查询订单",
"EXAMPLE",
":",
"[",
"out_trade_no",
"=",
">",
"]"
] | train | https://github.com/zodream/thirdparty/blob/b9d39087913850f1c5c7c9165105fec22a128f8f/src/Pay/WeChat.php#L524-L533 |
zodream/thirdparty | src/Pay/WeChat.php | WeChat.closeOrder | public function closeOrder(array $args = array()) {
$args = $this->getClose()->parameters($this->merge($args))->text();
if ($args['return_code'] != 'SUCCESS') {
throw new Exception($args['return_msg']);
}
if (!$this->verify($args)) {
throw new Exception('数据验签失败!')... | php | public function closeOrder(array $args = array()) {
$args = $this->getClose()->parameters($this->merge($args))->text();
if ($args['return_code'] != 'SUCCESS') {
throw new Exception($args['return_msg']);
}
if (!$this->verify($args)) {
throw new Exception('数据验签失败!')... | [
"public",
"function",
"closeOrder",
"(",
"array",
"$",
"args",
"=",
"array",
"(",
")",
")",
"{",
"$",
"args",
"=",
"$",
"this",
"->",
"getClose",
"(",
")",
"->",
"parameters",
"(",
"$",
"this",
"->",
"merge",
"(",
"$",
"args",
")",
")",
"->",
"te... | 关闭订单
@param array $args
@return array|bool|mixed|object
@throws \ErrorException
@throws \Exception | [
"关闭订单"
] | train | https://github.com/zodream/thirdparty/blob/b9d39087913850f1c5c7c9165105fec22a128f8f/src/Pay/WeChat.php#L542-L551 |
zodream/thirdparty | src/Pay/WeChat.php | WeChat.appPay | public function appPay(array $args = array()) {
if (!isset($args['timestamp'])) {
$args['timestamp'] = time();
}
return $this->set($args)->getAppPay();
} | php | public function appPay(array $args = array()) {
if (!isset($args['timestamp'])) {
$args['timestamp'] = time();
}
return $this->set($args)->getAppPay();
} | [
"public",
"function",
"appPay",
"(",
"array",
"$",
"args",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"args",
"[",
"'timestamp'",
"]",
")",
")",
"{",
"$",
"args",
"[",
"'timestamp'",
"]",
"=",
"time",
"(",
")",
";",
"}... | APP支付参数 异步回调必须输出 appCallbackReturn()
@param array $args
@return string
@throws Exception | [
"APP支付参数",
"异步回调必须输出",
"appCallbackReturn",
"()"
] | train | https://github.com/zodream/thirdparty/blob/b9d39087913850f1c5c7c9165105fec22a128f8f/src/Pay/WeChat.php#L560-L565 |
zodream/thirdparty | src/Pay/WeChat.php | WeChat.downloadBill | public function downloadBill($file, array $args = array()) {
return $this->getBill()->parameters($this->merge($args))->save($file);
} | php | public function downloadBill($file, array $args = array()) {
return $this->getBill()->parameters($this->merge($args))->save($file);
} | [
"public",
"function",
"downloadBill",
"(",
"$",
"file",
",",
"array",
"$",
"args",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getBill",
"(",
")",
"->",
"parameters",
"(",
"$",
"this",
"->",
"merge",
"(",
"$",
"args",
")",
")",
... | 下载对账单
@param string|File $file
@param array $args
@return int
@throws \Exception | [
"下载对账单"
] | train | https://github.com/zodream/thirdparty/blob/b9d39087913850f1c5c7c9165105fec22a128f8f/src/Pay/WeChat.php#L582-L584 |
zodream/thirdparty | src/Pay/WeChat.php | WeChat.queryRefund | public function queryRefund(array $args = array()) {
$args = $this->getQueryRefund()->parameters($this->merge($args))->text();
if ($args['return_code'] != 'SUCCESS') {
throw new Exception($args['return_msg']);
}
if (!$this->verify($args)) {
throw new Exception('数据... | php | public function queryRefund(array $args = array()) {
$args = $this->getQueryRefund()->parameters($this->merge($args))->text();
if ($args['return_code'] != 'SUCCESS') {
throw new Exception($args['return_msg']);
}
if (!$this->verify($args)) {
throw new Exception('数据... | [
"public",
"function",
"queryRefund",
"(",
"array",
"$",
"args",
"=",
"array",
"(",
")",
")",
"{",
"$",
"args",
"=",
"$",
"this",
"->",
"getQueryRefund",
"(",
")",
"->",
"parameters",
"(",
"$",
"this",
"->",
"merge",
"(",
"$",
"args",
")",
")",
"->"... | 查询退款
@param array $args
@return array|bool|mixed|object
@throws \ErrorException
@throws \Exception | [
"查询退款"
] | train | https://github.com/zodream/thirdparty/blob/b9d39087913850f1c5c7c9165105fec22a128f8f/src/Pay/WeChat.php#L593-L602 |
zodream/thirdparty | src/Pay/WeChat.php | WeChat.refundOrder | public function refundOrder(array $args = array()) {
//第二种方式,两个文件合成一个.pem文件
$args = $this->setCert($this->getRefund())
->parameters($this->merge($args))->text();
if ($args['return_code'] != 'SUCCESS') {
throw new Exception($args['return_msg']);
}
if ($args... | php | public function refundOrder(array $args = array()) {
//第二种方式,两个文件合成一个.pem文件
$args = $this->setCert($this->getRefund())
->parameters($this->merge($args))->text();
if ($args['return_code'] != 'SUCCESS') {
throw new Exception($args['return_msg']);
}
if ($args... | [
"public",
"function",
"refundOrder",
"(",
"array",
"$",
"args",
"=",
"array",
"(",
")",
")",
"{",
"//第二种方式,两个文件合成一个.pem文件",
"$",
"args",
"=",
"$",
"this",
"->",
"setCert",
"(",
"$",
"this",
"->",
"getRefund",
"(",
")",
")",
"->",
"parameters",
"(",
"$"... | 退款
@param array $args
@return array|bool|mixed|object
@throws \Exception | [
"退款"
] | train | https://github.com/zodream/thirdparty/blob/b9d39087913850f1c5c7c9165105fec22a128f8f/src/Pay/WeChat.php#L610-L624 |
zodream/thirdparty | src/Pay/WeChat.php | WeChat.setCert | public function setCert(Http $http) {
//两个文件合成一个.pem文件
if (!empty($this->privateKeyFile)) {
return $http->setOption(CURLOPT_SSLCERT, (string)$this->privateKeyFile);
}
//cert 与 key 分别属于两个.pem文件
return $http->setOption([
CURLOPT_SSLCERTTYPE => 'PEM',
... | php | public function setCert(Http $http) {
//两个文件合成一个.pem文件
if (!empty($this->privateKeyFile)) {
return $http->setOption(CURLOPT_SSLCERT, (string)$this->privateKeyFile);
}
//cert 与 key 分别属于两个.pem文件
return $http->setOption([
CURLOPT_SSLCERTTYPE => 'PEM',
... | [
"public",
"function",
"setCert",
"(",
"Http",
"$",
"http",
")",
"{",
"//两个文件合成一个.pem文件",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"privateKeyFile",
")",
")",
"{",
"return",
"$",
"http",
"->",
"setOption",
"(",
"CURLOPT_SSLCERT",
",",
"(",
"string... | 添加证书
@param Http $http
@return Http | [
"添加证书"
] | train | https://github.com/zodream/thirdparty/blob/b9d39087913850f1c5c7c9165105fec22a128f8f/src/Pay/WeChat.php#L631-L645 |
zodream/thirdparty | src/Pay/WeChat.php | WeChat.sign | public function sign($args) {
if (empty($this->key)) {
throw new Exception('KEY IS NEED');
}
ksort($args);
reset($args);
$arg = '';
foreach ($args as $key => $item) {
if (Http::isEmpty($item) ||
in_array($key, $this->ignoreKeys)) {
... | php | public function sign($args) {
if (empty($this->key)) {
throw new Exception('KEY IS NEED');
}
ksort($args);
reset($args);
$arg = '';
foreach ($args as $key => $item) {
if (Http::isEmpty($item) ||
in_array($key, $this->ignoreKeys)) {
... | [
"public",
"function",
"sign",
"(",
"$",
"args",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"key",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'KEY IS NEED'",
")",
";",
"}",
"ksort",
"(",
"$",
"args",
")",
";",
"reset",
"(",
"$",
... | 生成签名
@param array $args
@return string
@throws Exception | [
"生成签名"
] | train | https://github.com/zodream/thirdparty/blob/b9d39087913850f1c5c7c9165105fec22a128f8f/src/Pay/WeChat.php#L653-L672 |
zodream/thirdparty | src/Pay/WeChat.php | WeChat.verify | public function verify(array $args, $sign = null) {
if (is_null($sign)) {
$sign = $args[$this->signKey];
}
return $this->sign($args) === $sign;
} | php | public function verify(array $args, $sign = null) {
if (is_null($sign)) {
$sign = $args[$this->signKey];
}
return $this->sign($args) === $sign;
} | [
"public",
"function",
"verify",
"(",
"array",
"$",
"args",
",",
"$",
"sign",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"sign",
")",
")",
"{",
"$",
"sign",
"=",
"$",
"args",
"[",
"$",
"this",
"->",
"signKey",
"]",
";",
"}",
"return"... | 验证
@param array $args
@param $sign
@return bool
@throws Exception | [
"验证"
] | train | https://github.com/zodream/thirdparty/blob/b9d39087913850f1c5c7c9165105fec22a128f8f/src/Pay/WeChat.php#L681-L686 |
zodream/thirdparty | src/Pay/WeChat.php | WeChat.callback | public function callback() {
$xml = app('request')->input();
if (empty($xml)) {
throw new Exception(
__('xml error')
);
}
/**
* 禁止引用外部xml实体
*/
$disableLibxmlEntityLoader = libxml_disable_entity_loader(true);
$args ... | php | public function callback() {
$xml = app('request')->input();
if (empty($xml)) {
throw new Exception(
__('xml error')
);
}
/**
* 禁止引用外部xml实体
*/
$disableLibxmlEntityLoader = libxml_disable_entity_loader(true);
$args ... | [
"public",
"function",
"callback",
"(",
")",
"{",
"$",
"xml",
"=",
"app",
"(",
"'request'",
")",
"->",
"input",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"xml",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"__",
"(",
"'xml error'",
")",
")"... | 交易完成回调
@return mixed
@throws Exception | [
"交易完成回调"
] | train | https://github.com/zodream/thirdparty/blob/b9d39087913850f1c5c7c9165105fec22a128f8f/src/Pay/WeChat.php#L693-L722 |
zodream/thirdparty | src/Pay/WeChat.php | WeChat.qrPay | public function qrPay(array $args = array()) {
$url = $this->getPayQr()->parameters($this->merge($args))->getUrl();
return (new QrCode())->create((string)$url);
} | php | public function qrPay(array $args = array()) {
$url = $this->getPayQr()->parameters($this->merge($args))->getUrl();
return (new QrCode())->create((string)$url);
} | [
"public",
"function",
"qrPay",
"(",
"array",
"$",
"args",
"=",
"array",
"(",
")",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"getPayQr",
"(",
")",
"->",
"parameters",
"(",
"$",
"this",
"->",
"merge",
"(",
"$",
"args",
")",
")",
"->",
"getUrl",... | 微信二维码支付
@param array $args
@return Image
@throws Exception | [
"微信二维码支付"
] | train | https://github.com/zodream/thirdparty/blob/b9d39087913850f1c5c7c9165105fec22a128f8f/src/Pay/WeChat.php#L730-L733 |
zodream/thirdparty | src/Pay/WeChat.php | WeChat.orderQr | public function orderQr(array $args = array()) {
$data = $this->order($args);
if ($data === false) {
return false;
}
if (array_key_exists('code_url', $data)) {
return (new QrCode())->create($data['code_url']);
}
throw new Exception('unkown');
... | php | public function orderQr(array $args = array()) {
$data = $this->order($args);
if ($data === false) {
return false;
}
if (array_key_exists('code_url', $data)) {
return (new QrCode())->create($data['code_url']);
}
throw new Exception('unkown');
... | [
"public",
"function",
"orderQr",
"(",
"array",
"$",
"args",
"=",
"array",
"(",
")",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"order",
"(",
"$",
"args",
")",
";",
"if",
"(",
"$",
"data",
"===",
"false",
")",
"{",
"return",
"false",
";",
"}... | 商户后台系统先调用微信支付的统一下单接口,微信后台系统返回链接参数code_url,商户后台系统将code_url值生成二维码图片
@param array $args
@return bool|Image
@throws \Exception | [
"商户后台系统先调用微信支付的统一下单接口,微信后台系统返回链接参数code_url,商户后台系统将code_url值生成二维码图片"
] | train | https://github.com/zodream/thirdparty/blob/b9d39087913850f1c5c7c9165105fec22a128f8f/src/Pay/WeChat.php#L758-L768 |
zodream/thirdparty | src/Pay/WeChat.php | WeChat.h5Pay | public function h5Pay(array $args = [], $redirect_url = null) {
$args['trade_type'] = 'MWEB';
$data = $this->order($args);
if ($data === false) {
return false;
}
if (array_key_exists('mweb_url', $data)) {
return $data['mweb_url'].'&redirect_url='.urlencode... | php | public function h5Pay(array $args = [], $redirect_url = null) {
$args['trade_type'] = 'MWEB';
$data = $this->order($args);
if ($data === false) {
return false;
}
if (array_key_exists('mweb_url', $data)) {
return $data['mweb_url'].'&redirect_url='.urlencode... | [
"public",
"function",
"h5Pay",
"(",
"array",
"$",
"args",
"=",
"[",
"]",
",",
"$",
"redirect_url",
"=",
"null",
")",
"{",
"$",
"args",
"[",
"'trade_type'",
"]",
"=",
"'MWEB'",
";",
"$",
"data",
"=",
"$",
"this",
"->",
"order",
"(",
"$",
"args",
"... | h5下单获取支付链接,并加上回调地址
@param array $args
@param string|Uri $redirect_url
@return string
@throws \Exception | [
"h5下单获取支付链接,并加上回调地址"
] | train | https://github.com/zodream/thirdparty/blob/b9d39087913850f1c5c7c9165105fec22a128f8f/src/Pay/WeChat.php#L777-L787 |
zodream/thirdparty | src/Pay/WeChat.php | WeChat.jsPay | public function jsPay(array $args = array()) {
$args['appId'] = $this->get('appid'); //防止微信返回appid
$args['nonceStr'] = Str::random(32);
$args['timeStamp'] = time();
$data = $this->set($args)->getJsApi();
$data['package'] = 'prepay_id='.$data['package']['prepay_id'];
$data... | php | public function jsPay(array $args = array()) {
$args['appId'] = $this->get('appid'); //防止微信返回appid
$args['nonceStr'] = Str::random(32);
$args['timeStamp'] = time();
$data = $this->set($args)->getJsApi();
$data['package'] = 'prepay_id='.$data['package']['prepay_id'];
$data... | [
"public",
"function",
"jsPay",
"(",
"array",
"$",
"args",
"=",
"array",
"(",
")",
")",
"{",
"$",
"args",
"[",
"'appId'",
"]",
"=",
"$",
"this",
"->",
"get",
"(",
"'appid'",
")",
";",
"//防止微信返回appid",
"$",
"args",
"[",
"'nonceStr'",
"]",
"=",
"Str",... | 公众号支付 在微信浏览器里面打开H5网页中执行JS调起支付。接口输入输出数据格式为JSON。
https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_7&index=6
@param array $args
@return array
@throws Exception | [
"公众号支付",
"在微信浏览器里面打开H5网页中执行JS调起支付。接口输入输出数据格式为JSON。",
"https",
":",
"//",
"pay",
".",
"weixin",
".",
"qq",
".",
"com",
"/",
"wiki",
"/",
"doc",
"/",
"api",
"/",
"jsapi",
".",
"php?chapter",
"=",
"7_7&index",
"=",
"6"
] | train | https://github.com/zodream/thirdparty/blob/b9d39087913850f1c5c7c9165105fec22a128f8f/src/Pay/WeChat.php#L796-L804 |
zodream/thirdparty | src/Pay/WeChat.php | WeChat.declareOrder | public function declareOrder(array $args = array()) {
$args = $this->getDeclareOrder()->parameters($this->merge($args))->text();
if ($args['return_code'] != 'SUCCESS') {
throw new Exception($args['return_msg']);
}
if (!$this->verify($args)) {
throw new Exception(
... | php | public function declareOrder(array $args = array()) {
$args = $this->getDeclareOrder()->parameters($this->merge($args))->text();
if ($args['return_code'] != 'SUCCESS') {
throw new Exception($args['return_msg']);
}
if (!$this->verify($args)) {
throw new Exception(
... | [
"public",
"function",
"declareOrder",
"(",
"array",
"$",
"args",
"=",
"array",
"(",
")",
")",
"{",
"$",
"args",
"=",
"$",
"this",
"->",
"getDeclareOrder",
"(",
")",
"->",
"parameters",
"(",
"$",
"this",
"->",
"merge",
"(",
"$",
"args",
")",
")",
"-... | 报关
@param array $args
@return array|mixed
@throws Exception | [
"报关"
] | train | https://github.com/zodream/thirdparty/blob/b9d39087913850f1c5c7c9165105fec22a128f8f/src/Pay/WeChat.php#L812-L824 |
zodream/thirdparty | src/Pay/WeChat.php | WeChat.transfer | public function transfer(array $args) {
$data = $this->getTransfer()->parameters($this->merge($args))->text();
if (empty($data)) {
return false;
}
if ($data['return_code'] != 'SUCCESS') {
throw new Exception($data['return_msg']);
}
if ($data['resul... | php | public function transfer(array $args) {
$data = $this->getTransfer()->parameters($this->merge($args))->text();
if (empty($data)) {
return false;
}
if ($data['return_code'] != 'SUCCESS') {
throw new Exception($data['return_msg']);
}
if ($data['resul... | [
"public",
"function",
"transfer",
"(",
"array",
"$",
"args",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"getTransfer",
"(",
")",
"->",
"parameters",
"(",
"$",
"this",
"->",
"merge",
"(",
"$",
"args",
")",
")",
"->",
"text",
"(",
")",
";",
"if... | 转账给个人
@param array $args
@return bool|array
@throws Exception | [
"转账给个人"
] | train | https://github.com/zodream/thirdparty/blob/b9d39087913850f1c5c7c9165105fec22a128f8f/src/Pay/WeChat.php#L832-L844 |
zodream/thirdparty | src/Pay/WeChat.php | WeChat.refund | public function refund(array $args) {
$data = $this->getRefund()->parameters($this->merge($args))->text();
if (empty($data)) {
return false;
}
if ($data['return_code'] != 'SUCCESS') {
throw new Exception($data['return_msg']);
}
if ($data['result_co... | php | public function refund(array $args) {
$data = $this->getRefund()->parameters($this->merge($args))->text();
if (empty($data)) {
return false;
}
if ($data['return_code'] != 'SUCCESS') {
throw new Exception($data['return_msg']);
}
if ($data['result_co... | [
"public",
"function",
"refund",
"(",
"array",
"$",
"args",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"getRefund",
"(",
")",
"->",
"parameters",
"(",
"$",
"this",
"->",
"merge",
"(",
"$",
"args",
")",
")",
"->",
"text",
"(",
")",
";",
"if",
... | 退款
@param array $args
@return bool|mixed|null
@throws Exception | [
"退款"
] | train | https://github.com/zodream/thirdparty/blob/b9d39087913850f1c5c7c9165105fec22a128f8f/src/Pay/WeChat.php#L852-L864 |
accgit/single-web | src/Single/Latte.php | Latte.createLatteEngine | private function createLatteEngine()
{
$latte = new LatteEngine\Engine;
$latte->setTempDirectory($this->temp);
// Form macro.
$latte->onCompile[] = function($latte) {
Bridges\FormsLatte\FormMacros::install($latte->getCompiler());
};
return $latte;
} | php | private function createLatteEngine()
{
$latte = new LatteEngine\Engine;
$latte->setTempDirectory($this->temp);
// Form macro.
$latte->onCompile[] = function($latte) {
Bridges\FormsLatte\FormMacros::install($latte->getCompiler());
};
return $latte;
} | [
"private",
"function",
"createLatteEngine",
"(",
")",
"{",
"$",
"latte",
"=",
"new",
"LatteEngine",
"\\",
"Engine",
";",
"$",
"latte",
"->",
"setTempDirectory",
"(",
"$",
"this",
"->",
"temp",
")",
";",
"// Form macro.\r",
"$",
"latte",
"->",
"onCompile",
... | Latte engine settings.
@return LatteEngine\Engine | [
"Latte",
"engine",
"settings",
"."
] | train | https://github.com/accgit/single-web/blob/5d0dce3313df9e22ab60749bcf01f1753de8c143/src/Single/Latte.php#L41-L51 |
accgit/single-web | src/Single/Latte.php | Latte.getBasePath | private function getBasePath()
{
$pathInfo = new Http\RequestFactory;
$basePath = rtrim($pathInfo->createHttpRequest()->url->basePath, '/');
return $basePath;
} | php | private function getBasePath()
{
$pathInfo = new Http\RequestFactory;
$basePath = rtrim($pathInfo->createHttpRequest()->url->basePath, '/');
return $basePath;
} | [
"private",
"function",
"getBasePath",
"(",
")",
"{",
"$",
"pathInfo",
"=",
"new",
"Http",
"\\",
"RequestFactory",
";",
"$",
"basePath",
"=",
"rtrim",
"(",
"$",
"pathInfo",
"->",
"createHttpRequest",
"(",
")",
"->",
"url",
"->",
"basePath",
",",
"'/'",
")... | Path to root.
@return string | [
"Path",
"to",
"root",
"."
] | train | https://github.com/accgit/single-web/blob/5d0dce3313df9e22ab60749bcf01f1753de8c143/src/Single/Latte.php#L57-L62 |
accgit/single-web | src/Single/Latte.php | Latte.render | public function render($name, array $params = [])
{
$latte = $this->createLatteEngine();
$basePath = ['basePath' => $this->getBasePath()] ;
$latte->render($name, $params + $basePath);
return $latte;
} | php | public function render($name, array $params = [])
{
$latte = $this->createLatteEngine();
$basePath = ['basePath' => $this->getBasePath()] ;
$latte->render($name, $params + $basePath);
return $latte;
} | [
"public",
"function",
"render",
"(",
"$",
"name",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"latte",
"=",
"$",
"this",
"->",
"createLatteEngine",
"(",
")",
";",
"$",
"basePath",
"=",
"[",
"'basePath'",
"=>",
"$",
"this",
"->",
"get... | Create a template and insert parameters.
@param string $name
@return self | [
"Create",
"a",
"template",
"and",
"insert",
"parameters",
"."
] | train | https://github.com/accgit/single-web/blob/5d0dce3313df9e22ab60749bcf01f1753de8c143/src/Single/Latte.php#L69-L75 |
yuncms/framework | src/caching/YacCache.php | YacCache.setValue | protected function setValue($key, $value, $duration)
{
return $this->yac->set($key, $value, $duration);
} | php | protected function setValue($key, $value, $duration)
{
return $this->yac->set($key, $value, $duration);
} | [
"protected",
"function",
"setValue",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"duration",
")",
"{",
"return",
"$",
"this",
"->",
"yac",
"->",
"set",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"duration",
")",
";",
"}"
] | Stores a value identified by a key in cache.
This is the implementation of the method declared in the parent class.
@param string $key the key identifying the value to be cached
@param mixed $value the value to be cached. Most often it's a string. If you have disabled [[serializer]],
it could be something else.
@param... | [
"Stores",
"a",
"value",
"identified",
"by",
"a",
"key",
"in",
"cache",
".",
"This",
"is",
"the",
"implementation",
"of",
"the",
"method",
"declared",
"in",
"the",
"parent",
"class",
"."
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/caching/YacCache.php#L89-L92 |
yuncms/framework | src/caching/YacCache.php | YacCache.addValue | protected function addValue($key, $value, $duration)
{
return $this->yac->set($key, $value, $duration);
} | php | protected function addValue($key, $value, $duration)
{
return $this->yac->set($key, $value, $duration);
} | [
"protected",
"function",
"addValue",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"duration",
")",
"{",
"return",
"$",
"this",
"->",
"yac",
"->",
"set",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"duration",
")",
";",
"}"
] | Stores a value identified by a key into cache if the cache does not contain this key.
This is the implementation of the method declared in the parent class.
@param string $key the key identifying the value to be cached
@param mixed $value the value to be cached. Most often it's a string. If you have disabled [[seriali... | [
"Stores",
"a",
"value",
"identified",
"by",
"a",
"key",
"into",
"cache",
"if",
"the",
"cache",
"does",
"not",
"contain",
"this",
"key",
".",
"This",
"is",
"the",
"implementation",
"of",
"the",
"method",
"declared",
"in",
"the",
"parent",
"class",
"."
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/caching/YacCache.php#L113-L116 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.