id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
233,800 | skrz/meta | gen-src/Google/Protobuf/Meta/ServiceOptionsMeta.php | ServiceOptionsMeta.reset | public static function reset($object)
{
if (!($object instanceof ServiceOptions)) {
throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\ServiceOptions.');
}
$object->deprecated = NULL;
$object->uninterpretedOption = NULL;
} | php | public static function reset($object)
{
if (!($object instanceof ServiceOptions)) {
throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\ServiceOptions.');
}
$object->deprecated = NULL;
$object->uninterpretedOption = NULL;
} | [
"public",
"static",
"function",
"reset",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"object",
"instanceof",
"ServiceOptions",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'You have to pass object of class Google\\Protobuf\\Serv... | Resets properties of \Google\Protobuf\ServiceOptions to default values
@param ServiceOptions $object
@throws \InvalidArgumentException
@return void | [
"Resets",
"properties",
"of",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"ServiceOptions",
"to",
"default",
"values"
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Meta/ServiceOptionsMeta.php#L95-L102 |
233,801 | skrz/meta | gen-src/Google/Protobuf/Meta/ServiceOptionsMeta.php | ServiceOptionsMeta.hash | public static function hash($object, $algoOrCtx = 'md5', $raw = FALSE)
{
if (is_string($algoOrCtx)) {
$ctx = hash_init($algoOrCtx);
} else {
$ctx = $algoOrCtx;
}
if (isset($object->deprecated)) {
hash_update($ctx, 'deprecated');
hash_update($ctx, (string)$object->deprecated);
}
if (isset($obj... | php | public static function hash($object, $algoOrCtx = 'md5', $raw = FALSE)
{
if (is_string($algoOrCtx)) {
$ctx = hash_init($algoOrCtx);
} else {
$ctx = $algoOrCtx;
}
if (isset($object->deprecated)) {
hash_update($ctx, 'deprecated');
hash_update($ctx, (string)$object->deprecated);
}
if (isset($obj... | [
"public",
"static",
"function",
"hash",
"(",
"$",
"object",
",",
"$",
"algoOrCtx",
"=",
"'md5'",
",",
"$",
"raw",
"=",
"FALSE",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"algoOrCtx",
")",
")",
"{",
"$",
"ctx",
"=",
"hash_init",
"(",
"$",
"algoOrC... | Computes hash of \Google\Protobuf\ServiceOptions
@param object $object
@param string|resource $algoOrCtx
@param bool $raw
@return string|void | [
"Computes",
"hash",
"of",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"ServiceOptions"
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Meta/ServiceOptionsMeta.php#L114-L139 |
233,802 | budde377/Part | lib/controller/json/JSONFunctionImpl.php | JSONFunctionImpl.getArg | public function getArg($num)
{
return isset($this->args[$num]) ? $this->args[$num] : null;
} | php | public function getArg($num)
{
return isset($this->args[$num]) ? $this->args[$num] : null;
} | [
"public",
"function",
"getArg",
"(",
"$",
"num",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"args",
"[",
"$",
"num",
"]",
")",
"?",
"$",
"this",
"->",
"args",
"[",
"$",
"num",
"]",
":",
"null",
";",
"}"
] | Will return argument at index given
@param $num
@return mixed | [
"Will",
"return",
"argument",
"at",
"index",
"given"
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/controller/json/JSONFunctionImpl.php#L58-L61 |
233,803 | budde377/Part | lib/util/file/DumpFileImpl.php | DumpFileImpl.writeSerialized | public function writeSerialized($var)
{
$data = (($c = $this->getUnSerializedContent()) == ""?[]:$c);
$data[] = $var;
$this->delete();
$this->write(serialize($data));
} | php | public function writeSerialized($var)
{
$data = (($c = $this->getUnSerializedContent()) == ""?[]:$c);
$data[] = $var;
$this->delete();
$this->write(serialize($data));
} | [
"public",
"function",
"writeSerialized",
"(",
"$",
"var",
")",
"{",
"$",
"data",
"=",
"(",
"(",
"$",
"c",
"=",
"$",
"this",
"->",
"getUnSerializedContent",
"(",
")",
")",
"==",
"\"\"",
"?",
"[",
"]",
":",
"$",
"c",
")",
";",
"$",
"data",
"[",
"... | Dumps a variable to the dumpfile using serialize.
@param mixed $var
@return void | [
"Dumps",
"a",
"variable",
"to",
"the",
"dumpfile",
"using",
"serialize",
"."
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/util/file/DumpFileImpl.php#L18-L25 |
233,804 | budde377/Part | lib/controller/ajax/ServerImpl.php | ServerImpl.registerHandler | public function registerHandler(TypeHandler $type)
{
$zeroLength = true;
foreach ($type->listTypes() as $t) {
$zeroLength = false;
$this->handlers[$t][] = $type;
$type->setUp($this, $t);
}
if ($zeroLength) {
$type->setUp($this, null);
... | php | public function registerHandler(TypeHandler $type)
{
$zeroLength = true;
foreach ($type->listTypes() as $t) {
$zeroLength = false;
$this->handlers[$t][] = $type;
$type->setUp($this, $t);
}
if ($zeroLength) {
$type->setUp($this, null);
... | [
"public",
"function",
"registerHandler",
"(",
"TypeHandler",
"$",
"type",
")",
"{",
"$",
"zeroLength",
"=",
"true",
";",
"foreach",
"(",
"$",
"type",
"->",
"listTypes",
"(",
")",
"as",
"$",
"t",
")",
"{",
"$",
"zeroLength",
"=",
"false",
";",
"$",
"t... | Registers a AJAX type.
@param TypeHandler $type
@return void | [
"Registers",
"a",
"AJAX",
"type",
"."
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/controller/ajax/ServerImpl.php#L54-L66 |
233,805 | budde377/Part | lib/controller/ajax/ServerImpl.php | ServerImpl.registerHandlersFromConfig | public function registerHandlersFromConfig()
{
$config = $this->container->getConfigInstance();
foreach ($config->getAJAXTypeHandlers() as $handlerArray) {
if (isset($handlerArray['path'])) {
$path = $handlerArray['path'];
if (!file_exists($path)) {
... | php | public function registerHandlersFromConfig()
{
$config = $this->container->getConfigInstance();
foreach ($config->getAJAXTypeHandlers() as $handlerArray) {
if (isset($handlerArray['path'])) {
$path = $handlerArray['path'];
if (!file_exists($path)) {
... | [
"public",
"function",
"registerHandlersFromConfig",
"(",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"container",
"->",
"getConfigInstance",
"(",
")",
";",
"foreach",
"(",
"$",
"config",
"->",
"getAJAXTypeHandlers",
"(",
")",
"as",
"$",
"handlerArray",
... | Registers the handlers from config.
@throws ClassNotDefinedException
@throws FileNotFoundException
@throws ClassNotInstanceOfException
@return void | [
"Registers",
"the",
"handlers",
"from",
"config",
"."
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/controller/ajax/ServerImpl.php#L75-L107 |
233,806 | MW-Peachy/Peachy | Plugins/IRC.php | IRC.parseRC | public static function parseRC( $msg ) {
if( preg_match( '/^\[\[((Talk|User|Wikipedia|Image|MediaWiki|Template|Help|Category|Portal|Special)(( |_)talk)?:)?([^\x5d]*)\]\] (\S*) (http:\/\/en\.wikipedia\.org\/w\/index\.php\?(oldid|diff)=(\d*)&(rcid|oldid)=(\d*).*|http:\/\/en\.wikipedia\.org\/wiki\/\S+)? \* ([^*]*) \* (\... | php | public static function parseRC( $msg ) {
if( preg_match( '/^\[\[((Talk|User|Wikipedia|Image|MediaWiki|Template|Help|Category|Portal|Special)(( |_)talk)?:)?([^\x5d]*)\]\] (\S*) (http:\/\/en\.wikipedia\.org\/w\/index\.php\?(oldid|diff)=(\d*)&(rcid|oldid)=(\d*).*|http:\/\/en\.wikipedia\.org\/wiki\/\S+)? \* ([^*]*) \* (\... | [
"public",
"static",
"function",
"parseRC",
"(",
"$",
"msg",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/^\\[\\[((Talk|User|Wikipedia|Image|MediaWiki|Template|Help|Category|Portal|Special)(( |_)talk)?:)?([^\\x5d]*)\\]\\] (\\S*) (http:\\/\\/en\\.wikipedia\\.org\\/w\\/index\\.php\\?(oldid|diff... | Parses the title, user, etc from a MediaWiki RC feed
@link http://www.mediawiki.org/wiki/Manual:IRC_RC_Bot
@param string $msg Message from feed
@return array Parsed line
@static | [
"Parses",
"the",
"title",
"user",
"etc",
"from",
"a",
"MediaWiki",
"RC",
"feed"
] | 2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c | https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Plugins/IRC.php#L232-L283 |
233,807 | matrozov/yii2-couchbase | src/Connection.php | Connection.getBucket | public function getBucket($bucketName = null, $password = null)
{
if ($bucketName === null) {
$bucketName = $this->defaultBucket;
}
if (!array_key_exists($bucketName, $this->_buckets)) {
$this->_buckets[$bucketName] = $this->selectBucket($bucketName, $password);
... | php | public function getBucket($bucketName = null, $password = null)
{
if ($bucketName === null) {
$bucketName = $this->defaultBucket;
}
if (!array_key_exists($bucketName, $this->_buckets)) {
$this->_buckets[$bucketName] = $this->selectBucket($bucketName, $password);
... | [
"public",
"function",
"getBucket",
"(",
"$",
"bucketName",
"=",
"null",
",",
"$",
"password",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"bucketName",
"===",
"null",
")",
"{",
"$",
"bucketName",
"=",
"$",
"this",
"->",
"defaultBucket",
";",
"}",
"if",
"(... | Returns the Couchbase bucket with the given name.
@param string $bucketName bucket name. If string considered as the name of the bucket
inside the default database. If array - first element considered as the name of the database,
second - as name of bucket inside that database
@param string $password bucket password... | [
"Returns",
"the",
"Couchbase",
"bucket",
"with",
"the",
"given",
"name",
"."
] | 07c2e9d18cb90f873c0d88dcacf6bb532e9d648c | https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/Connection.php#L131-L142 |
233,808 | matrozov/yii2-couchbase | src/Connection.php | Connection.selectBucket | protected function selectBucket($name, $password = '')
{
$this->open();
try {
$bucket = $this->cluster->openBucket($name, $password);
}
catch (\Exception $e) {
throw new Exception($e->getMessage(), (int)$e->getCode(), $e);
}
return Yii::creat... | php | protected function selectBucket($name, $password = '')
{
$this->open();
try {
$bucket = $this->cluster->openBucket($name, $password);
}
catch (\Exception $e) {
throw new Exception($e->getMessage(), (int)$e->getCode(), $e);
}
return Yii::creat... | [
"protected",
"function",
"selectBucket",
"(",
"$",
"name",
",",
"$",
"password",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"open",
"(",
")",
";",
"try",
"{",
"$",
"bucket",
"=",
"$",
"this",
"->",
"cluster",
"->",
"openBucket",
"(",
"$",
"name",
",",... | Selects bucket with given name and password.
@param string $name bucket name.
@param string $password bucket password.
@return Bucket|null bucket instance.
@throws Exception
@throws InvalidConfigException | [
"Selects",
"bucket",
"with",
"given",
"name",
"and",
"password",
"."
] | 07c2e9d18cb90f873c0d88dcacf6bb532e9d648c | https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/Connection.php#L154-L171 |
233,809 | matrozov/yii2-couchbase | src/Connection.php | Connection.open | public function open()
{
if ($this->cluster !== null) {
return;
}
if (empty($this->dsn)) {
throw new InvalidConfigException($this->className() . '::dsn cannot be empty.');
}
$token = 'Opening Couchbase connection: ' . $this->dsn;
try {
... | php | public function open()
{
if ($this->cluster !== null) {
return;
}
if (empty($this->dsn)) {
throw new InvalidConfigException($this->className() . '::dsn cannot be empty.');
}
$token = 'Opening Couchbase connection: ' . $this->dsn;
try {
... | [
"public",
"function",
"open",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"cluster",
"!==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"dsn",
")",
")",
"{",
"throw",
"new",
"InvalidConfigException",
"(",
"$",... | Establishes a Couchbase connection.
It does nothing if a Couchbase connection has already been established.
@throws Exception if connection fails
@throws InvalidConfigException | [
"Establishes",
"a",
"Couchbase",
"connection",
".",
"It",
"does",
"nothing",
"if",
"a",
"Couchbase",
"connection",
"has",
"already",
"been",
"established",
"."
] | 07c2e9d18cb90f873c0d88dcacf6bb532e9d648c | https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/Connection.php#L208-L235 |
233,810 | matrozov/yii2-couchbase | src/Connection.php | Connection.openManager | public function openManager()
{
if ($this->manager !== null) {
return;
}
if ($this->cluster === null) {
$this->open();
}
if (empty($this->userName) || empty($this->password)) {
throw new InvalidConfigException($this->className() . '::user... | php | public function openManager()
{
if ($this->manager !== null) {
return;
}
if ($this->cluster === null) {
$this->open();
}
if (empty($this->userName) || empty($this->password)) {
throw new InvalidConfigException($this->className() . '::user... | [
"public",
"function",
"openManager",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"manager",
"!==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"cluster",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"open",
"(",
")",
";",
... | Open a CouchbaseManager.
It does nothing if a CouchbaseManager has already been opened.
@throws Exception if open fails
@throws InvalidConfigException | [
"Open",
"a",
"CouchbaseManager",
".",
"It",
"does",
"nothing",
"if",
"a",
"CouchbaseManager",
"has",
"already",
"been",
"opened",
"."
] | 07c2e9d18cb90f873c0d88dcacf6bb532e9d648c | https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/Connection.php#L243-L272 |
233,811 | matrozov/yii2-couchbase | src/Connection.php | Connection.createBucket | public function createBucket($bucketName, array $options = [])
{
$this->openManager();
$this->manager->createBucket($bucketName, $options);
// ToDo: https://github.com/matrozov/yii2-couchbase/issues/1
sleep(5);
} | php | public function createBucket($bucketName, array $options = [])
{
$this->openManager();
$this->manager->createBucket($bucketName, $options);
// ToDo: https://github.com/matrozov/yii2-couchbase/issues/1
sleep(5);
} | [
"public",
"function",
"createBucket",
"(",
"$",
"bucketName",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"openManager",
"(",
")",
";",
"$",
"this",
"->",
"manager",
"->",
"createBucket",
"(",
"$",
"bucketName",
",",
"$",
... | Creates new bucket in database associated with this command.s
@param string $bucketName bucket name
@param array $options bucket options in format: "name" => "value"
@throws Exception
@throws InvalidConfigException | [
"Creates",
"new",
"bucket",
"in",
"database",
"associated",
"with",
"this",
"command",
".",
"s"
] | 07c2e9d18cb90f873c0d88dcacf6bb532e9d648c | https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/Connection.php#L391-L399 |
233,812 | wardrobecms/core-archived | src/Wardrobe/Core/Controllers/LoginController.php | LoginController.store | public function store()
{
$email = mb_strtolower(Input::get('email'));
$password = Input::get('password');
if ($this->users->login($email, $password, Input::get('remember') == 'yes'))
{
return Redirect::route('wardrobe.admin.index');
}
return Redirect::back()
->withInput()
->with('login_errors'... | php | public function store()
{
$email = mb_strtolower(Input::get('email'));
$password = Input::get('password');
if ($this->users->login($email, $password, Input::get('remember') == 'yes'))
{
return Redirect::route('wardrobe.admin.index');
}
return Redirect::back()
->withInput()
->with('login_errors'... | [
"public",
"function",
"store",
"(",
")",
"{",
"$",
"email",
"=",
"mb_strtolower",
"(",
"Input",
"::",
"get",
"(",
"'email'",
")",
")",
";",
"$",
"password",
"=",
"Input",
"::",
"get",
"(",
"'password'",
")",
";",
"if",
"(",
"$",
"this",
"->",
"user... | Handle a user login attempt. | [
"Handle",
"a",
"user",
"login",
"attempt",
"."
] | 5c0836ea2e6885a428c852dc392073f2a2541c71 | https://github.com/wardrobecms/core-archived/blob/5c0836ea2e6885a428c852dc392073f2a2541c71/src/Wardrobe/Core/Controllers/LoginController.php#L41-L55 |
233,813 | wardrobecms/core-archived | src/Wardrobe/Core/Controllers/LoginController.php | LoginController.remindSend | public function remindSend()
{
$credentials = array('email' => Input::get('email'));
return Password::remind($credentials, function($message, $user)
{
$message->subject('Reset your password');
});
} | php | public function remindSend()
{
$credentials = array('email' => Input::get('email'));
return Password::remind($credentials, function($message, $user)
{
$message->subject('Reset your password');
});
} | [
"public",
"function",
"remindSend",
"(",
")",
"{",
"$",
"credentials",
"=",
"array",
"(",
"'email'",
"=>",
"Input",
"::",
"get",
"(",
"'email'",
")",
")",
";",
"return",
"Password",
"::",
"remind",
"(",
"$",
"credentials",
",",
"function",
"(",
"$",
"m... | Send an email to reset your password. | [
"Send",
"an",
"email",
"to",
"reset",
"your",
"password",
"."
] | 5c0836ea2e6885a428c852dc392073f2a2541c71 | https://github.com/wardrobecms/core-archived/blob/5c0836ea2e6885a428c852dc392073f2a2541c71/src/Wardrobe/Core/Controllers/LoginController.php#L77-L85 |
233,814 | budde377/Part | lib/util/task/ExecuteDelayedExecutionTaskQueueTaskImpl.php | ExecuteDelayedExecutionTaskQueueTaskImpl.execute | public function execute()
{
$queue = $this->container->getDelayedExecutionTaskQueue();
if($queue->length() == 0){
return;
}
ignore_user_abort(true);
$queue->execute();
} | php | public function execute()
{
$queue = $this->container->getDelayedExecutionTaskQueue();
if($queue->length() == 0){
return;
}
ignore_user_abort(true);
$queue->execute();
} | [
"public",
"function",
"execute",
"(",
")",
"{",
"$",
"queue",
"=",
"$",
"this",
"->",
"container",
"->",
"getDelayedExecutionTaskQueue",
"(",
")",
";",
"if",
"(",
"$",
"queue",
"->",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
";",
"}",
"ignor... | This function runs the script
@return mixed | [
"This",
"function",
"runs",
"the",
"script"
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/util/task/ExecuteDelayedExecutionTaskQueueTaskImpl.php#L31-L39 |
233,815 | yeephp/yeephp | Yee/Middleware/Flash.php | Flash.loadMessages | public function loadMessages()
{
if (isset($_SESSION[$this->settings['key']])) {
$this->messages['prev'] = $_SESSION[$this->settings['key']];
}
} | php | public function loadMessages()
{
if (isset($_SESSION[$this->settings['key']])) {
$this->messages['prev'] = $_SESSION[$this->settings['key']];
}
} | [
"public",
"function",
"loadMessages",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_SESSION",
"[",
"$",
"this",
"->",
"settings",
"[",
"'key'",
"]",
"]",
")",
")",
"{",
"$",
"this",
"->",
"messages",
"[",
"'prev'",
"]",
"=",
"$",
"_SESSION",
"[",
... | Load messages from previous request if available | [
"Load",
"messages",
"from",
"previous",
"request",
"if",
"available"
] | 6107f60ceaf0811a6550872bd669580ac282cb1f | https://github.com/yeephp/yeephp/blob/6107f60ceaf0811a6550872bd669580ac282cb1f/Yee/Middleware/Flash.php#L138-L143 |
233,816 | yeephp/yeephp | Yee/Helper/Set.php | Set.singleton | public function singleton($key, $value)
{
$this->set($key, function ($c) use ($value) {
static $object;
if (null === $object) {
$object = $value($c);
}
return $object;
});
} | php | public function singleton($key, $value)
{
$this->set($key, function ($c) use ($value) {
static $object;
if (null === $object) {
$object = $value($c);
}
return $object;
});
} | [
"public",
"function",
"singleton",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"set",
"(",
"$",
"key",
",",
"function",
"(",
"$",
"c",
")",
"use",
"(",
"$",
"value",
")",
"{",
"static",
"$",
"object",
";",
"if",
"(",
"null"... | Ensure a value or object will remain globally unique
@param string $key The value or object name
@param Closure The closure that defines the object
@return mixed | [
"Ensure",
"a",
"value",
"or",
"object",
"will",
"remain",
"globally",
"unique"
] | 6107f60ceaf0811a6550872bd669580ac282cb1f | https://github.com/yeephp/yeephp/blob/6107f60ceaf0811a6550872bd669580ac282cb1f/Yee/Helper/Set.php#L222-L233 |
233,817 | skrz/meta | gen-src/Google/Protobuf/Meta/ServiceDescriptorProtoMeta.php | ServiceDescriptorProtoMeta.create | public static function create()
{
switch (func_num_args()) {
case 0:
return new ServiceDescriptorProto();
case 1:
return new ServiceDescriptorProto(func_get_arg(0));
case 2:
return new ServiceDescriptorProto(func_get_arg(0), func_get_arg(1));
case 3:
return new ServiceDescriptorProto(func... | php | public static function create()
{
switch (func_num_args()) {
case 0:
return new ServiceDescriptorProto();
case 1:
return new ServiceDescriptorProto(func_get_arg(0));
case 2:
return new ServiceDescriptorProto(func_get_arg(0), func_get_arg(1));
case 3:
return new ServiceDescriptorProto(func... | [
"public",
"static",
"function",
"create",
"(",
")",
"{",
"switch",
"(",
"func_num_args",
"(",
")",
")",
"{",
"case",
"0",
":",
"return",
"new",
"ServiceDescriptorProto",
"(",
")",
";",
"case",
"1",
":",
"return",
"new",
"ServiceDescriptorProto",
"(",
"func... | Creates new instance of \Google\Protobuf\ServiceDescriptorProto
@throws \InvalidArgumentException
@return ServiceDescriptorProto | [
"Creates",
"new",
"instance",
"of",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"ServiceDescriptorProto"
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Meta/ServiceDescriptorProtoMeta.php#L59-L83 |
233,818 | skrz/meta | gen-src/Google/Protobuf/Meta/ServiceDescriptorProtoMeta.php | ServiceDescriptorProtoMeta.reset | public static function reset($object)
{
if (!($object instanceof ServiceDescriptorProto)) {
throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\ServiceDescriptorProto.');
}
$object->name = NULL;
$object->method = NULL;
$object->options = NULL;
} | php | public static function reset($object)
{
if (!($object instanceof ServiceDescriptorProto)) {
throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\ServiceDescriptorProto.');
}
$object->name = NULL;
$object->method = NULL;
$object->options = NULL;
} | [
"public",
"static",
"function",
"reset",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"object",
"instanceof",
"ServiceDescriptorProto",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'You have to pass object of class Google\\Protob... | Resets properties of \Google\Protobuf\ServiceDescriptorProto to default values
@param ServiceDescriptorProto $object
@throws \InvalidArgumentException
@return void | [
"Resets",
"properties",
"of",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"ServiceDescriptorProto",
"to",
"default",
"values"
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Meta/ServiceDescriptorProtoMeta.php#L96-L104 |
233,819 | skrz/meta | gen-src/Google/Protobuf/Meta/ServiceDescriptorProtoMeta.php | ServiceDescriptorProtoMeta.hash | public static function hash($object, $algoOrCtx = 'md5', $raw = FALSE)
{
if (is_string($algoOrCtx)) {
$ctx = hash_init($algoOrCtx);
} else {
$ctx = $algoOrCtx;
}
if (isset($object->name)) {
hash_update($ctx, 'name');
hash_update($ctx, (string)$object->name);
}
if (isset($object->method)) {
... | php | public static function hash($object, $algoOrCtx = 'md5', $raw = FALSE)
{
if (is_string($algoOrCtx)) {
$ctx = hash_init($algoOrCtx);
} else {
$ctx = $algoOrCtx;
}
if (isset($object->name)) {
hash_update($ctx, 'name');
hash_update($ctx, (string)$object->name);
}
if (isset($object->method)) {
... | [
"public",
"static",
"function",
"hash",
"(",
"$",
"object",
",",
"$",
"algoOrCtx",
"=",
"'md5'",
",",
"$",
"raw",
"=",
"FALSE",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"algoOrCtx",
")",
")",
"{",
"$",
"ctx",
"=",
"hash_init",
"(",
"$",
"algoOrC... | Computes hash of \Google\Protobuf\ServiceDescriptorProto
@param object $object
@param string|resource $algoOrCtx
@param bool $raw
@return string|void | [
"Computes",
"hash",
"of",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"ServiceDescriptorProto"
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Meta/ServiceDescriptorProtoMeta.php#L116-L146 |
233,820 | skrz/meta | gen-src/Google/Protobuf/Meta/ServiceDescriptorProtoMeta.php | ServiceDescriptorProtoMeta.toProtobuf | public static function toProtobuf($object, $filter = NULL)
{
$output = '';
if (isset($object->name) && ($filter === null || isset($filter['name']))) {
$output .= "\x0a";
$output .= Binary::encodeVarint(strlen($object->name));
$output .= $object->name;
}
if (isset($object->method) && ($filter === nul... | php | public static function toProtobuf($object, $filter = NULL)
{
$output = '';
if (isset($object->name) && ($filter === null || isset($filter['name']))) {
$output .= "\x0a";
$output .= Binary::encodeVarint(strlen($object->name));
$output .= $object->name;
}
if (isset($object->method) && ($filter === nul... | [
"public",
"static",
"function",
"toProtobuf",
"(",
"$",
"object",
",",
"$",
"filter",
"=",
"NULL",
")",
"{",
"$",
"output",
"=",
"''",
";",
"if",
"(",
"isset",
"(",
"$",
"object",
"->",
"name",
")",
"&&",
"(",
"$",
"filter",
"===",
"null",
"||",
... | Serialized \Google\Protobuf\ServiceDescriptorProto to Protocol Buffers message.
@param ServiceDescriptorProto $object
@param array $filter
@throws \Exception
@return string | [
"Serialized",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"ServiceDescriptorProto",
"to",
"Protocol",
"Buffers",
"message",
"."
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Meta/ServiceDescriptorProtoMeta.php#L256-L283 |
233,821 | budde377/Part | lib/model/site/SiteImpl.php | SiteImpl.getVariables | public function getVariables()
{
return $this->variables == null?$this->variables = new SiteVariablesImpl($this->db):$this->variables;
} | php | public function getVariables()
{
return $this->variables == null?$this->variables = new SiteVariablesImpl($this->db):$this->variables;
} | [
"public",
"function",
"getVariables",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"variables",
"==",
"null",
"?",
"$",
"this",
"->",
"variables",
"=",
"new",
"SiteVariablesImpl",
"(",
"$",
"this",
"->",
"db",
")",
":",
"$",
"this",
"->",
"variables",
"... | Returns and reuses instance of site scoped variables
@return Variables | [
"Returns",
"and",
"reuses",
"instance",
"of",
"site",
"scoped",
"variables"
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/model/site/SiteImpl.php#L46-L49 |
233,822 | budde377/Part | lib/model/site/SiteImpl.php | SiteImpl.lastModified | public function lastModified()
{
return $this->lastMod == 0?$this->lastMod = $this->getVariables()->getValue("last_modified"):$this->lastMod;
} | php | public function lastModified()
{
return $this->lastMod == 0?$this->lastMod = $this->getVariables()->getValue("last_modified"):$this->lastMod;
} | [
"public",
"function",
"lastModified",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"lastMod",
"==",
"0",
"?",
"$",
"this",
"->",
"lastMod",
"=",
"$",
"this",
"->",
"getVariables",
"(",
")",
"->",
"getValue",
"(",
"\"last_modified\"",
")",
":",
"$",
"thi... | Returns last modified timestamp, 0 if site hasnot been modified
@return int 0 | [
"Returns",
"last",
"modified",
"timestamp",
"0",
"if",
"site",
"hasnot",
"been",
"modified"
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/model/site/SiteImpl.php#L55-L58 |
233,823 | budde377/Part | lib/model/site/SiteImpl.php | SiteImpl.getContentLibrary | public function getContentLibrary()
{
return $this->contentLibrary == null?
$this->contentLibrary = new SiteContentLibraryImpl($this->container):
$this->contentLibrary;
} | php | public function getContentLibrary()
{
return $this->contentLibrary == null?
$this->contentLibrary = new SiteContentLibraryImpl($this->container):
$this->contentLibrary;
} | [
"public",
"function",
"getContentLibrary",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"contentLibrary",
"==",
"null",
"?",
"$",
"this",
"->",
"contentLibrary",
"=",
"new",
"SiteContentLibraryImpl",
"(",
"$",
"this",
"->",
"container",
")",
":",
"$",
"this",... | Will get and reuse instance of content library.
@return ContentLibrary | [
"Will",
"get",
"and",
"reuse",
"instance",
"of",
"content",
"library",
"."
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/model/site/SiteImpl.php#L75-L80 |
233,824 | matrozov/yii2-couchbase | src/ActiveQuery.php | ActiveQuery.getBucket | public function getBucket($db = null)
{
/* @var $modelClass ActiveRecord */
$modelClass = $this->modelClass;
if ($db === null) {
$db = $modelClass::getDb();
}
if ($this->select === null) {
$bucketName = $db->quoteBucketName($modelClass::bucketName())... | php | public function getBucket($db = null)
{
/* @var $modelClass ActiveRecord */
$modelClass = $this->modelClass;
if ($db === null) {
$db = $modelClass::getDb();
}
if ($this->select === null) {
$bucketName = $db->quoteBucketName($modelClass::bucketName())... | [
"public",
"function",
"getBucket",
"(",
"$",
"db",
"=",
"null",
")",
"{",
"/* @var $modelClass ActiveRecord */",
"$",
"modelClass",
"=",
"$",
"this",
"->",
"modelClass",
";",
"if",
"(",
"$",
"db",
"===",
"null",
")",
"{",
"$",
"db",
"=",
"$",
"modelClass... | Returns the Couchbase bucket for this query.
@param Connection $db Couchbase connection.
@return Bucket bucket instance.
@throws Exception
@throws \yii\base\InvalidConfigException | [
"Returns",
"the",
"Couchbase",
"bucket",
"for",
"this",
"query",
"."
] | 07c2e9d18cb90f873c0d88dcacf6bb532e9d648c | https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/ActiveQuery.php#L188-L213 |
233,825 | xylemical/php-expressions | src/Parser.php | Parser.parse | public function parse($string) {
$output = new \SplQueue();
$operator = new \SplStack();
// Convert the string to tokens for the lexer.
$tokens = $this->lexer->tokenize($string);
// while there are tokens to be read:
while (count($tokens)) {
// read a token.... | php | public function parse($string) {
$output = new \SplQueue();
$operator = new \SplStack();
// Convert the string to tokens for the lexer.
$tokens = $this->lexer->tokenize($string);
// while there are tokens to be read:
while (count($tokens)) {
// read a token.... | [
"public",
"function",
"parse",
"(",
"$",
"string",
")",
"{",
"$",
"output",
"=",
"new",
"\\",
"SplQueue",
"(",
")",
";",
"$",
"operator",
"=",
"new",
"\\",
"SplStack",
"(",
")",
";",
"// Convert the string to tokens for the lexer.",
"$",
"tokens",
"=",
"$"... | Parses a string into a series of tokens in Reverse Polish Notation order.
@param string $string
@return \Xylemical\Expressions\Token[]
@throws \Xylemical\Expressions\ParserException
@see https://en.wikipedia.org/wiki/Shunting-yard_algorithm | [
"Parses",
"a",
"string",
"into",
"a",
"series",
"of",
"tokens",
"in",
"Reverse",
"Polish",
"Notation",
"order",
"."
] | 4dc7c3a4bb3f335a04cb05b0d41871529cfc9b73 | https://github.com/xylemical/php-expressions/blob/4dc7c3a4bb3f335a04cb05b0d41871529cfc9b73/src/Parser.php#L58-L155 |
233,826 | scherersoftware/cake-model-history | src/Model/Table/ModelHistoryTable.php | ModelHistoryTable._transformDataFields | protected function _transformDataFields(array $history, string $model): array
{
$tableConfig = [];
if (defined('PHPUNIT_TESTSUITE')) {
$tableConfig = ['className' => 'ModelHistoryTestApp\Model\Table\\' . ucfirst($model) . 'Table'];
$model = ucfirst($model) . 'Table';
... | php | protected function _transformDataFields(array $history, string $model): array
{
$tableConfig = [];
if (defined('PHPUNIT_TESTSUITE')) {
$tableConfig = ['className' => 'ModelHistoryTestApp\Model\Table\\' . ucfirst($model) . 'Table'];
$model = ucfirst($model) . 'Table';
... | [
"protected",
"function",
"_transformDataFields",
"(",
"array",
"$",
"history",
",",
"string",
"$",
"model",
")",
":",
"array",
"{",
"$",
"tableConfig",
"=",
"[",
"]",
";",
"if",
"(",
"defined",
"(",
"'PHPUNIT_TESTSUITE'",
")",
")",
"{",
"$",
"tableConfig",... | Transforms data fields to human readable form
@param array $history Data
@param string $model Model name
@return array | [
"Transforms",
"data",
"fields",
"to",
"human",
"readable",
"form"
] | 4dceac1cc7db0e6d443750dd9d76b960df385931 | https://github.com/scherersoftware/cake-model-history/blob/4dceac1cc7db0e6d443750dd9d76b960df385931/src/Model/Table/ModelHistoryTable.php#L213-L239 |
233,827 | scherersoftware/cake-model-history | src/Model/Table/ModelHistoryTable.php | ModelHistoryTable.getNextRevisionNumberForEntity | public function getNextRevisionNumberForEntity(EntityInterface $entity): int
{
$revision = 1;
$last = $this->find()
->select('revision')
->where([
'model' => $this->getEntityModel($entity),
'foreign_key' => $entity->id
])
... | php | public function getNextRevisionNumberForEntity(EntityInterface $entity): int
{
$revision = 1;
$last = $this->find()
->select('revision')
->where([
'model' => $this->getEntityModel($entity),
'foreign_key' => $entity->id
])
... | [
"public",
"function",
"getNextRevisionNumberForEntity",
"(",
"EntityInterface",
"$",
"entity",
")",
":",
"int",
"{",
"$",
"revision",
"=",
"1",
";",
"$",
"last",
"=",
"$",
"this",
"->",
"find",
"(",
")",
"->",
"select",
"(",
"'revision'",
")",
"->",
"whe... | Handles the revision sequence
@param EntityInterface $entity Entity to get the revision number for
@return int | [
"Handles",
"the",
"revision",
"sequence"
] | 4dceac1cc7db0e6d443750dd9d76b960df385931 | https://github.com/scherersoftware/cake-model-history/blob/4dceac1cc7db0e6d443750dd9d76b960df385931/src/Model/Table/ModelHistoryTable.php#L266-L284 |
233,828 | scherersoftware/cake-model-history | src/Model/Table/ModelHistoryTable.php | ModelHistoryTable.getEntityModel | public function getEntityModel(EntityInterface $entity): string
{
$source = $entity->source();
if (substr($source, -5) == 'Table') {
$source = substr($source, 0, -5);
}
return $source;
} | php | public function getEntityModel(EntityInterface $entity): string
{
$source = $entity->source();
if (substr($source, -5) == 'Table') {
$source = substr($source, 0, -5);
}
return $source;
} | [
"public",
"function",
"getEntityModel",
"(",
"EntityInterface",
"$",
"entity",
")",
":",
"string",
"{",
"$",
"source",
"=",
"$",
"entity",
"->",
"source",
"(",
")",
";",
"if",
"(",
"substr",
"(",
"$",
"source",
",",
"-",
"5",
")",
"==",
"'Table'",
")... | Extracts the string to be saved to the model field from an entity
@param EntityInterface $entity Entity
@return string | [
"Extracts",
"the",
"string",
"to",
"be",
"saved",
"to",
"the",
"model",
"field",
"from",
"an",
"entity"
] | 4dceac1cc7db0e6d443750dd9d76b960df385931 | https://github.com/scherersoftware/cake-model-history/blob/4dceac1cc7db0e6d443750dd9d76b960df385931/src/Model/Table/ModelHistoryTable.php#L292-L300 |
233,829 | scherersoftware/cake-model-history | src/Model/Table/ModelHistoryTable.php | ModelHistoryTable.getModelHistory | public function getModelHistory(string $model, $foreignKey, int $itemsToShow, int $page, array $conditions = [], array $options = []): array
{
$conditions = Hash::merge([
'model' => $model,
'foreign_key' => $foreignKey
], $conditions);
$options = Hash::merge([
... | php | public function getModelHistory(string $model, $foreignKey, int $itemsToShow, int $page, array $conditions = [], array $options = []): array
{
$conditions = Hash::merge([
'model' => $model,
'foreign_key' => $foreignKey
], $conditions);
$options = Hash::merge([
... | [
"public",
"function",
"getModelHistory",
"(",
"string",
"$",
"model",
",",
"$",
"foreignKey",
",",
"int",
"$",
"itemsToShow",
",",
"int",
"$",
"page",
",",
"array",
"$",
"conditions",
"=",
"[",
"]",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"... | Get Model History
@param string $model Model name
@param mixed $foreignKey Foreign key
@param int $itemsToShow Amount of items to be shown
@param int $page Current position
@param array $conditions Additional conditions for find
@param array $options Additional options
@return array | [
"Get",
"Model",
"History"
] | 4dceac1cc7db0e6d443750dd9d76b960df385931 | https://github.com/scherersoftware/cake-model-history/blob/4dceac1cc7db0e6d443750dd9d76b960df385931/src/Model/Table/ModelHistoryTable.php#L356-L390 |
233,830 | scherersoftware/cake-model-history | src/Model/Table/ModelHistoryTable.php | ModelHistoryTable.getModelHistoryCount | public function getModelHistoryCount(string $model, $foreignKey, array $conditions = [], array $options = []): int
{
$conditions = Hash::merge([
'model' => $model,
'foreign_key' => $foreignKey
], $conditions);
$options = Hash::merge([
'includeAssociated' =... | php | public function getModelHistoryCount(string $model, $foreignKey, array $conditions = [], array $options = []): int
{
$conditions = Hash::merge([
'model' => $model,
'foreign_key' => $foreignKey
], $conditions);
$options = Hash::merge([
'includeAssociated' =... | [
"public",
"function",
"getModelHistoryCount",
"(",
"string",
"$",
"model",
",",
"$",
"foreignKey",
",",
"array",
"$",
"conditions",
"=",
"[",
"]",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"int",
"{",
"$",
"conditions",
"=",
"Hash",
"::",
... | Get Model History entries count
@param string $model model name
@param mixed $foreignKey foreign key
@param array $conditions additional conditions for find
@return int | [
"Get",
"Model",
"History",
"entries",
"count"
] | 4dceac1cc7db0e6d443750dd9d76b960df385931 | https://github.com/scherersoftware/cake-model-history/blob/4dceac1cc7db0e6d443750dd9d76b960df385931/src/Model/Table/ModelHistoryTable.php#L400-L425 |
233,831 | scherersoftware/cake-model-history | src/Model/Table/ModelHistoryTable.php | ModelHistoryTable._translateFieldname | protected function _translateFieldname(string $fieldname, string $model): string
{
// Try to get the generic model.field translation string
$localeSlug = strtolower(Inflector::singularize(Inflector::delimit($model))) . '.' . strtolower($fieldname);
$translatedString = __($localeSlug);
... | php | protected function _translateFieldname(string $fieldname, string $model): string
{
// Try to get the generic model.field translation string
$localeSlug = strtolower(Inflector::singularize(Inflector::delimit($model))) . '.' . strtolower($fieldname);
$translatedString = __($localeSlug);
... | [
"protected",
"function",
"_translateFieldname",
"(",
"string",
"$",
"fieldname",
",",
"string",
"$",
"model",
")",
":",
"string",
"{",
"// Try to get the generic model.field translation string",
"$",
"localeSlug",
"=",
"strtolower",
"(",
"Inflector",
"::",
"singularize"... | Try to translate fieldname
@param string $fieldname Fieldname
@param string $model Model
@return string | [
"Try",
"to",
"translate",
"fieldname"
] | 4dceac1cc7db0e6d443750dd9d76b960df385931 | https://github.com/scherersoftware/cake-model-history/blob/4dceac1cc7db0e6d443750dd9d76b960df385931/src/Model/Table/ModelHistoryTable.php#L576-L588 |
233,832 | nfephp-org/sped-console | src/Processors/XsdGeneratePhp.php | XsdGeneratePhp.printMappedNamespaces | protected function printMappedNamespaces(PhpConverter $converter)
{
$this->outputWriteLine("Namespaces:");
foreach ($converter->getNamespaces() as $xsdTargetNamespace => $phpNamespace) {
$this->outputWriteLine(
" + <comment>{$this->outputFormatterEscape($xsdTargetNamespac... | php | protected function printMappedNamespaces(PhpConverter $converter)
{
$this->outputWriteLine("Namespaces:");
foreach ($converter->getNamespaces() as $xsdTargetNamespace => $phpNamespace) {
$this->outputWriteLine(
" + <comment>{$this->outputFormatterEscape($xsdTargetNamespac... | [
"protected",
"function",
"printMappedNamespaces",
"(",
"PhpConverter",
"$",
"converter",
")",
"{",
"$",
"this",
"->",
"outputWriteLine",
"(",
"\"Namespaces:\"",
")",
";",
"foreach",
"(",
"$",
"converter",
"->",
"getNamespaces",
"(",
")",
"as",
"$",
"xsdTargetNam... | Print all mapped namespaces from converter.
@param PhpConverter $converter | [
"Print",
"all",
"mapped",
"namespaces",
"from",
"converter",
"."
] | eaedaa8065744b2e47d8f7c711ae993ff238126f | https://github.com/nfephp-org/sped-console/blob/eaedaa8065744b2e47d8f7c711ae993ff238126f/src/Processors/XsdGeneratePhp.php#L103-L112 |
233,833 | kaliop-uk/kueueingbundle | Service/MessageConsumer/SymfonyService.php | SymfonyService.validateService | protected function validateService($serviceName, $methodName, $arguments = array())
{
$service = $this->container->get($serviceName);
if (!is_callable(array($service, $methodName))) {
throw new \UnexpectedValueException("Method $methodName not found in class " . get_class($service) . " i... | php | protected function validateService($serviceName, $methodName, $arguments = array())
{
$service = $this->container->get($serviceName);
if (!is_callable(array($service, $methodName))) {
throw new \UnexpectedValueException("Method $methodName not found in class " . get_class($service) . " i... | [
"protected",
"function",
"validateService",
"(",
"$",
"serviceName",
",",
"$",
"methodName",
",",
"$",
"arguments",
"=",
"array",
"(",
")",
")",
"{",
"$",
"service",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"$",
"serviceName",
")",
";",
"... | Throws an error if service is not declared or methodName does not apply
@param string $serviceName
@param string $methodName
@param array $arguments
@throws | [
"Throws",
"an",
"error",
"if",
"service",
"is",
"not",
"declared",
"or",
"methodName",
"does",
"not",
"apply"
] | 6a4f9b01ef1f5b8e5cdfad78f7c82b35f1007987 | https://github.com/kaliop-uk/kueueingbundle/blob/6a4f9b01ef1f5b8e5cdfad78f7c82b35f1007987/Service/MessageConsumer/SymfonyService.php#L63-L69 |
233,834 | MW-Peachy/Peachy | Includes/SSH.php | SSH.connect | protected function connect( $pgHost, $pgPort = 22, $pgProtocol, $pgTimeout = 10 ) {
pecho( "Connecting to $pgHost:$pgPort...\n\n", PECHO_NORMAL );
switch( $pgProtocol ){
case 1:
$this->SSHObject = new Net_SSH1($pgHost, $pgPort, $pgTimeout); // FIXME Directory doesn't exist
break;
case 2... | php | protected function connect( $pgHost, $pgPort = 22, $pgProtocol, $pgTimeout = 10 ) {
pecho( "Connecting to $pgHost:$pgPort...\n\n", PECHO_NORMAL );
switch( $pgProtocol ){
case 1:
$this->SSHObject = new Net_SSH1($pgHost, $pgPort, $pgTimeout); // FIXME Directory doesn't exist
break;
case 2... | [
"protected",
"function",
"connect",
"(",
"$",
"pgHost",
",",
"$",
"pgPort",
"=",
"22",
",",
"$",
"pgProtocol",
",",
"$",
"pgTimeout",
"=",
"10",
")",
"{",
"pecho",
"(",
"\"Connecting to $pgHost:$pgPort...\\n\\n\"",
",",
"PECHO_NORMAL",
")",
";",
"switch",
"(... | Establishes a connection to the remote server.
@FIXME: Codebase no longer includes SSH-related classes
@access protected
@param string $pgHost Host of server to connect to.
@param int $pgPort Port of server.
@param int $pgProtocol Which SSH protocol to use.
@param int $pgTimeout How long before the connectio... | [
"Establishes",
"a",
"connection",
"to",
"the",
"remote",
"server",
"."
] | 2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c | https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Includes/SSH.php#L201-L216 |
233,835 | MW-Peachy/Peachy | Includes/SSH.php | SSH.authenticate | protected function authenticate($pgUsername, $pgPassphrase, $pgPrivateKey)
{
//Determine the type of authentication to use.
if( is_null( $pgUsername ) ) {
pecho( "A username must at least be specified to authenticate to the server,\neven if there is authentication is none.\n\n", PECHO_FATAL );
return fals... | php | protected function authenticate($pgUsername, $pgPassphrase, $pgPrivateKey)
{
//Determine the type of authentication to use.
if( is_null( $pgUsername ) ) {
pecho( "A username must at least be specified to authenticate to the server,\neven if there is authentication is none.\n\n", PECHO_FATAL );
return fals... | [
"protected",
"function",
"authenticate",
"(",
"$",
"pgUsername",
",",
"$",
"pgPassphrase",
",",
"$",
"pgPrivateKey",
")",
"{",
"//Determine the type of authentication to use.",
"if",
"(",
"is_null",
"(",
"$",
"pgUsername",
")",
")",
"{",
"pecho",
"(",
"\"A usernam... | Authenticates to the remote server.
@access protected
@param string $pgUsername Username
@param string $pgPassphrase Password or passphrase of key file
@param string $pgPrivateKey File path of key file.
@return bool | [
"Authenticates",
"to",
"the",
"remote",
"server",
"."
] | 2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c | https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Includes/SSH.php#L227-L274 |
233,836 | MW-Peachy/Peachy | Includes/SSH.php | SSH.iExec | public function iExec($command, $expect = "", $expectRegex = false) {
trim( $command, "\n" );
if ($this->SSHObject->write($command . "\n")) {
return $this->SSHObject->read($expect,
($expectRegex ? NET_SSH . $this->protocol . _READ_REGEX : NET_SSH . $this->protocol . _READ_SIMPLE));... | php | public function iExec($command, $expect = "", $expectRegex = false) {
trim( $command, "\n" );
if ($this->SSHObject->write($command . "\n")) {
return $this->SSHObject->read($expect,
($expectRegex ? NET_SSH . $this->protocol . _READ_REGEX : NET_SSH . $this->protocol . _READ_SIMPLE));... | [
"public",
"function",
"iExec",
"(",
"$",
"command",
",",
"$",
"expect",
"=",
"\"\"",
",",
"$",
"expectRegex",
"=",
"false",
")",
"{",
"trim",
"(",
"$",
"command",
",",
"\"\\n\"",
")",
";",
"if",
"(",
"$",
"this",
"->",
"SSHObject",
"->",
"write",
"... | Opens an interactive shell if not done already and transmits commands and returns output.
@access public
@param string $command Command to execute
@param string $expect String of output to expect and remove from output.
@param bool $expectRegex Switches string expectation to regular expressions.
@returns bool|string
... | [
"Opens",
"an",
"interactive",
"shell",
"if",
"not",
"done",
"already",
"and",
"transmits",
"commands",
"and",
"returns",
"output",
"."
] | 2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c | https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Includes/SSH.php#L312-L318 |
233,837 | MW-Peachy/Peachy | Includes/SSH.php | SSH.file_put_contents | public function file_put_contents( $to, $data, $resume = false ) {
if( $resume ) {
return $this->SFTPObject->put($to, $data,
(is_file($data) && file_exists($data) ? NET_SFTP_LOCAL_FILE : NET_SFTP_STRING) | NET_SFTP_RESUME);
} else return $this->SFTPObject->put($to, $data,
... | php | public function file_put_contents( $to, $data, $resume = false ) {
if( $resume ) {
return $this->SFTPObject->put($to, $data,
(is_file($data) && file_exists($data) ? NET_SFTP_LOCAL_FILE : NET_SFTP_STRING) | NET_SFTP_RESUME);
} else return $this->SFTPObject->put($to, $data,
... | [
"public",
"function",
"file_put_contents",
"(",
"$",
"to",
",",
"$",
"data",
",",
"$",
"resume",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"resume",
")",
"{",
"return",
"$",
"this",
"->",
"SFTPObject",
"->",
"put",
"(",
"$",
"to",
",",
"$",
"data",
... | Write a file to a remote server
@access public
@param string $to location of file to be placed
@param string $data data to write or file location of file to upload
@param bool $resume resume an interrupted transfer
@return bool
FIXME Contains undefined constants | [
"Write",
"a",
"file",
"to",
"a",
"remote",
"server"
] | 2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c | https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Includes/SSH.php#L355-L362 |
233,838 | MW-Peachy/Peachy | Includes/SSH.php | SSH.file_get_contents | public function file_get_contents( $from, $to = false, $offset = 0, $length = -1 )
{
return $this->SFTPObject->get($from, $to, $offset, $length);
} | php | public function file_get_contents( $from, $to = false, $offset = 0, $length = -1 )
{
return $this->SFTPObject->get($from, $to, $offset, $length);
} | [
"public",
"function",
"file_get_contents",
"(",
"$",
"from",
",",
"$",
"to",
"=",
"false",
",",
"$",
"offset",
"=",
"0",
",",
"$",
"length",
"=",
"-",
"1",
")",
"{",
"return",
"$",
"this",
"->",
"SFTPObject",
"->",
"get",
"(",
"$",
"from",
",",
"... | Retrieve a file from a remote server
@access public
@param string $from Location on remote server to retrieve from.
@param string|bool $to Location to write to. If left blank, file contents is returned.
@param int $offset Where to start retrieving files from.
@param int $length How much of the file to retrieve.
@retu... | [
"Retrieve",
"a",
"file",
"from",
"a",
"remote",
"server"
] | 2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c | https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Includes/SSH.php#L374-L377 |
233,839 | MW-Peachy/Peachy | Includes/SSH.php | SSH.chmod | public function chmod( $path, $mode, $recursive = false )
{
return $this->SFTPObject->chmod($mode, $path, $recursive);
} | php | public function chmod( $path, $mode, $recursive = false )
{
return $this->SFTPObject->chmod($mode, $path, $recursive);
} | [
"public",
"function",
"chmod",
"(",
"$",
"path",
",",
"$",
"mode",
",",
"$",
"recursive",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"SFTPObject",
"->",
"chmod",
"(",
"$",
"mode",
",",
"$",
"path",
",",
"$",
"recursive",
")",
";",
"}"
] | Changes file mode
@access public
@param string $path Path to the directory or file
@param int $mode Mode to change to
@param bool $recursive Apply it to files within directory and children directories.
@return bool|int | [
"Changes",
"file",
"mode"
] | 2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c | https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Includes/SSH.php#L450-L453 |
233,840 | MW-Peachy/Peachy | Includes/SSH.php | SSH.touch | public function touch( $filename, $time = null, $atime = null )
{
return $this->SFTPObject->touch($filename, $time, $atime);
} | php | public function touch( $filename, $time = null, $atime = null )
{
return $this->SFTPObject->touch($filename, $time, $atime);
} | [
"public",
"function",
"touch",
"(",
"$",
"filename",
",",
"$",
"time",
"=",
"null",
",",
"$",
"atime",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"SFTPObject",
"->",
"touch",
"(",
"$",
"filename",
",",
"$",
"time",
",",
"$",
"atime",
")",
... | Sets access and modification time of file
@access public
@param string $filename The name of the file being touched.
@param int $time The touch time. If time is not supplied, the current system time is used.
@param int $atime If present, the access time of the given filename is set to the value of atime. Otherwise, it... | [
"Sets",
"access",
"and",
"modification",
"time",
"of",
"file"
] | 2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c | https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Includes/SSH.php#L464-L467 |
233,841 | MW-Peachy/Peachy | Includes/SSH.php | SSH.CheckForUpdate | protected function CheckForUpdate() {
global $pgIP;
$data = json_decode( $this->http->get( 'https://api.github.com/repos/phpseclib/phpseclib/branches/master', null, array(), false ), true );
$this->commits = $data;
if( !file_exists( $pgIP . 'Includes' . DIRECTORY_SEPARATOR . 'phpseclibupdate' ) ) return false;
... | php | protected function CheckForUpdate() {
global $pgIP;
$data = json_decode( $this->http->get( 'https://api.github.com/repos/phpseclib/phpseclib/branches/master', null, array(), false ), true );
$this->commits = $data;
if( !file_exists( $pgIP . 'Includes' . DIRECTORY_SEPARATOR . 'phpseclibupdate' ) ) return false;
... | [
"protected",
"function",
"CheckForUpdate",
"(",
")",
"{",
"global",
"$",
"pgIP",
";",
"$",
"data",
"=",
"json_decode",
"(",
"$",
"this",
"->",
"http",
"->",
"get",
"(",
"'https://api.github.com/repos/phpseclib/phpseclib/branches/master'",
",",
"null",
",",
"array"... | Check for Update Function
Checks the phpseclib/phpseclib library for updates.
@return bool Returns true if no updates
Returns false if updates needed
FIXME The .json file may no longer contain ['commit']['sha'], but possibly ['tree']['sha'] | [
"Check",
"for",
"Update",
"Function"
] | 2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c | https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Includes/SSH.php#L581-L592 |
233,842 | skrz/meta | gen-src/Google/Protobuf/Compiler/Meta/CodeGeneratorResponseMeta.php | CodeGeneratorResponseMeta.create | public static function create()
{
switch (func_num_args()) {
case 0:
return new CodeGeneratorResponse();
case 1:
return new CodeGeneratorResponse(func_get_arg(0));
case 2:
return new CodeGeneratorResponse(func_get_arg(0), func_get_arg(1));
case 3:
return new CodeGeneratorResponse(func_get... | php | public static function create()
{
switch (func_num_args()) {
case 0:
return new CodeGeneratorResponse();
case 1:
return new CodeGeneratorResponse(func_get_arg(0));
case 2:
return new CodeGeneratorResponse(func_get_arg(0), func_get_arg(1));
case 3:
return new CodeGeneratorResponse(func_get... | [
"public",
"static",
"function",
"create",
"(",
")",
"{",
"switch",
"(",
"func_num_args",
"(",
")",
")",
"{",
"case",
"0",
":",
"return",
"new",
"CodeGeneratorResponse",
"(",
")",
";",
"case",
"1",
":",
"return",
"new",
"CodeGeneratorResponse",
"(",
"func_g... | Creates new instance of \Google\Protobuf\Compiler\CodeGeneratorResponse
@throws \InvalidArgumentException
@return CodeGeneratorResponse | [
"Creates",
"new",
"instance",
"of",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Compiler",
"\\",
"CodeGeneratorResponse"
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Compiler/Meta/CodeGeneratorResponseMeta.php#L59-L83 |
233,843 | skrz/meta | gen-src/Google/Protobuf/Compiler/Meta/CodeGeneratorResponseMeta.php | CodeGeneratorResponseMeta.reset | public static function reset($object)
{
if (!($object instanceof CodeGeneratorResponse)) {
throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\Compiler\CodeGeneratorResponse.');
}
$object->error = NULL;
$object->file = NULL;
} | php | public static function reset($object)
{
if (!($object instanceof CodeGeneratorResponse)) {
throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\Compiler\CodeGeneratorResponse.');
}
$object->error = NULL;
$object->file = NULL;
} | [
"public",
"static",
"function",
"reset",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"object",
"instanceof",
"CodeGeneratorResponse",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'You have to pass object of class Google\\Protobu... | Resets properties of \Google\Protobuf\Compiler\CodeGeneratorResponse to default values
@param CodeGeneratorResponse $object
@throws \InvalidArgumentException
@return void | [
"Resets",
"properties",
"of",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Compiler",
"\\",
"CodeGeneratorResponse",
"to",
"default",
"values"
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Compiler/Meta/CodeGeneratorResponseMeta.php#L96-L103 |
233,844 | skrz/meta | gen-src/Google/Protobuf/Compiler/Meta/CodeGeneratorResponseMeta.php | CodeGeneratorResponseMeta.hash | public static function hash($object, $algoOrCtx = 'md5', $raw = FALSE)
{
if (is_string($algoOrCtx)) {
$ctx = hash_init($algoOrCtx);
} else {
$ctx = $algoOrCtx;
}
if (isset($object->error)) {
hash_update($ctx, 'error');
hash_update($ctx, (string)$object->error);
}
if (isset($object->file)) {
... | php | public static function hash($object, $algoOrCtx = 'md5', $raw = FALSE)
{
if (is_string($algoOrCtx)) {
$ctx = hash_init($algoOrCtx);
} else {
$ctx = $algoOrCtx;
}
if (isset($object->error)) {
hash_update($ctx, 'error');
hash_update($ctx, (string)$object->error);
}
if (isset($object->file)) {
... | [
"public",
"static",
"function",
"hash",
"(",
"$",
"object",
",",
"$",
"algoOrCtx",
"=",
"'md5'",
",",
"$",
"raw",
"=",
"FALSE",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"algoOrCtx",
")",
")",
"{",
"$",
"ctx",
"=",
"hash_init",
"(",
"$",
"algoOrC... | Computes hash of \Google\Protobuf\Compiler\CodeGeneratorResponse
@param object $object
@param string|resource $algoOrCtx
@param bool $raw
@return string|void | [
"Computes",
"hash",
"of",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Compiler",
"\\",
"CodeGeneratorResponse"
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Compiler/Meta/CodeGeneratorResponseMeta.php#L115-L140 |
233,845 | skrz/meta | gen-src/Google/Protobuf/Compiler/Meta/CodeGeneratorResponseMeta.php | CodeGeneratorResponseMeta.fromProtobuf | public static function fromProtobuf($input, $object = NULL, &$start = 0, $end = NULL)
{
if ($object === null) {
$object = new CodeGeneratorResponse();
}
if ($end === null) {
$end = strlen($input);
}
while ($start < $end) {
$tag = Binary::decodeVarint($input, $start);
$wireType = $tag & 0x7;
... | php | public static function fromProtobuf($input, $object = NULL, &$start = 0, $end = NULL)
{
if ($object === null) {
$object = new CodeGeneratorResponse();
}
if ($end === null) {
$end = strlen($input);
}
while ($start < $end) {
$tag = Binary::decodeVarint($input, $start);
$wireType = $tag & 0x7;
... | [
"public",
"static",
"function",
"fromProtobuf",
"(",
"$",
"input",
",",
"$",
"object",
"=",
"NULL",
",",
"&",
"$",
"start",
"=",
"0",
",",
"$",
"end",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"object",
"===",
"null",
")",
"{",
"$",
"object",
"=",
... | Creates \Google\Protobuf\Compiler\CodeGeneratorResponse object from serialized Protocol Buffers message.
@param string $input
@param CodeGeneratorResponse $object
@param int $start
@param int $end
@throws \Exception
@return CodeGeneratorResponse | [
"Creates",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Compiler",
"\\",
"CodeGeneratorResponse",
"object",
"from",
"serialized",
"Protocol",
"Buffers",
"message",
"."
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Compiler/Meta/CodeGeneratorResponseMeta.php#L155-L223 |
233,846 | skrz/meta | gen-src/Google/Protobuf/Compiler/Meta/CodeGeneratorResponseMeta.php | CodeGeneratorResponseMeta.toProtobuf | public static function toProtobuf($object, $filter = NULL)
{
$output = '';
if (isset($object->error) && ($filter === null || isset($filter['error']))) {
$output .= "\x0a";
$output .= Binary::encodeVarint(strlen($object->error));
$output .= $object->error;
}
if (isset($object->file) && ($filter === n... | php | public static function toProtobuf($object, $filter = NULL)
{
$output = '';
if (isset($object->error) && ($filter === null || isset($filter['error']))) {
$output .= "\x0a";
$output .= Binary::encodeVarint(strlen($object->error));
$output .= $object->error;
}
if (isset($object->file) && ($filter === n... | [
"public",
"static",
"function",
"toProtobuf",
"(",
"$",
"object",
",",
"$",
"filter",
"=",
"NULL",
")",
"{",
"$",
"output",
"=",
"''",
";",
"if",
"(",
"isset",
"(",
"$",
"object",
"->",
"error",
")",
"&&",
"(",
"$",
"filter",
"===",
"null",
"||",
... | Serialized \Google\Protobuf\Compiler\CodeGeneratorResponse to Protocol Buffers message.
@param CodeGeneratorResponse $object
@param array $filter
@throws \Exception
@return string | [
"Serialized",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Compiler",
"\\",
"CodeGeneratorResponse",
"to",
"Protocol",
"Buffers",
"message",
"."
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Compiler/Meta/CodeGeneratorResponseMeta.php#L236-L256 |
233,847 | budde377/Part | lib/model/ContentLibraryImpl.php | ContentLibraryImpl.listContents | public function listContents($time = 0)
{
$this->setUpList();
return array_filter($this->idArray, function (Content $content) use ($time) {
return $content->latestTime() >= $time;
});
} | php | public function listContents($time = 0)
{
$this->setUpList();
return array_filter($this->idArray, function (Content $content) use ($time) {
return $content->latestTime() >= $time;
});
} | [
"public",
"function",
"listContents",
"(",
"$",
"time",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"setUpList",
"(",
")",
";",
"return",
"array_filter",
"(",
"$",
"this",
"->",
"idArray",
",",
"function",
"(",
"Content",
"$",
"content",
")",
"use",
"(",
... | This will list site content.
It the timestamp is given, the latest time will be newer
than the timestamp.
@param int $time A Unix timestamp
@return array A array of PageContent. | [
"This",
"will",
"list",
"site",
"content",
".",
"It",
"the",
"timestamp",
"is",
"given",
"the",
"latest",
"time",
"will",
"be",
"newer",
"than",
"the",
"timestamp",
"."
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/model/ContentLibraryImpl.php#L39-L45 |
233,848 | budde377/Part | lib/model/ContentLibraryImpl.php | ContentLibraryImpl.getContent | public function getContent($id = "")
{
$this->setUpList();
return isset($this->idArray[$id]) ?
$this->idArray[$id] :
$this->idArray[$id] = $this->createContent($id);
} | php | public function getContent($id = "")
{
$this->setUpList();
return isset($this->idArray[$id]) ?
$this->idArray[$id] :
$this->idArray[$id] = $this->createContent($id);
} | [
"public",
"function",
"getContent",
"(",
"$",
"id",
"=",
"\"\"",
")",
"{",
"$",
"this",
"->",
"setUpList",
"(",
")",
";",
"return",
"isset",
"(",
"$",
"this",
"->",
"idArray",
"[",
"$",
"id",
"]",
")",
"?",
"$",
"this",
"->",
"idArray",
"[",
"$",... | This will return and reuse a instance of content related to the given id.
@param string $id
@return Content | [
"This",
"will",
"return",
"and",
"reuse",
"a",
"instance",
"of",
"content",
"related",
"to",
"the",
"given",
"id",
"."
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/model/ContentLibraryImpl.php#L53-L60 |
233,849 | budde377/Part | lib/model/ContentLibraryImpl.php | ContentLibraryImpl.searchLibrary | public function searchLibrary($string, $time = null)
{
$this->setUpList();
$this->search_library_stm->bindValue(':like', "%$string%");
$this->search_library_stm->bindValue(':time', $time == null ? 0 : $time);
$this->search_library_stm->execute();
$retArray = [];
fore... | php | public function searchLibrary($string, $time = null)
{
$this->setUpList();
$this->search_library_stm->bindValue(':like', "%$string%");
$this->search_library_stm->bindValue(':time', $time == null ? 0 : $time);
$this->search_library_stm->execute();
$retArray = [];
fore... | [
"public",
"function",
"searchLibrary",
"(",
"$",
"string",
",",
"$",
"time",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setUpList",
"(",
")",
";",
"$",
"this",
"->",
"search_library_stm",
"->",
"bindValue",
"(",
"':like'",
",",
"\"%$string%\"",
")",
";",... | This will search the content of each content
and return an array containing all contents matching
the search string.
@param String $string
@param int $time Will limit the search to those contents after given timestamp
@return array | [
"This",
"will",
"search",
"the",
"content",
"of",
"each",
"content",
"and",
"return",
"an",
"array",
"containing",
"all",
"contents",
"matching",
"the",
"search",
"string",
"."
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/model/ContentLibraryImpl.php#L87-L104 |
233,850 | praxisnetau/silverware-select2 | src/Forms/Select2AjaxField.php | Select2AjaxField.setSource | public function setSource($source)
{
if ($source instanceof DataList) {
$this->setDataClass($source->dataClass());
}
return parent::setSource($source);
} | php | public function setSource($source)
{
if ($source instanceof DataList) {
$this->setDataClass($source->dataClass());
}
return parent::setSource($source);
} | [
"public",
"function",
"setSource",
"(",
"$",
"source",
")",
"{",
"if",
"(",
"$",
"source",
"instanceof",
"DataList",
")",
"{",
"$",
"this",
"->",
"setDataClass",
"(",
"$",
"source",
"->",
"dataClass",
"(",
")",
")",
";",
"}",
"return",
"parent",
"::",
... | Defines the source for the receiver.
@param array|ArrayAccess
@return $this | [
"Defines",
"the",
"source",
"for",
"the",
"receiver",
"."
] | 81f3efe7f40eb87e1390f038c3c9eed415be7bc3 | https://github.com/praxisnetau/silverware-select2/blob/81f3efe7f40eb87e1390f038c3c9eed415be7bc3/src/Forms/Select2AjaxField.php#L197-L204 |
233,851 | praxisnetau/silverware-select2 | src/Forms/Select2AjaxField.php | Select2AjaxField.setAjaxConfig | public function setAjaxConfig($arg1, $arg2 = null)
{
if (is_array($arg1)) {
$this->ajaxConfig = $arg1;
} else {
$this->ajaxConfig[$arg1] = $arg2;
}
return $this;
} | php | public function setAjaxConfig($arg1, $arg2 = null)
{
if (is_array($arg1)) {
$this->ajaxConfig = $arg1;
} else {
$this->ajaxConfig[$arg1] = $arg2;
}
return $this;
} | [
"public",
"function",
"setAjaxConfig",
"(",
"$",
"arg1",
",",
"$",
"arg2",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"arg1",
")",
")",
"{",
"$",
"this",
"->",
"ajaxConfig",
"=",
"$",
"arg1",
";",
"}",
"else",
"{",
"$",
"this",
"->",... | Defines either the named Ajax config value, or the Ajax config array.
@param string|array $arg1
@param mixed $arg2
@return $this | [
"Defines",
"either",
"the",
"named",
"Ajax",
"config",
"value",
"or",
"the",
"Ajax",
"config",
"array",
"."
] | 81f3efe7f40eb87e1390f038c3c9eed415be7bc3 | https://github.com/praxisnetau/silverware-select2/blob/81f3efe7f40eb87e1390f038c3c9eed415be7bc3/src/Forms/Select2AjaxField.php#L214-L223 |
233,852 | praxisnetau/silverware-select2 | src/Forms/Select2AjaxField.php | Select2AjaxField.getAjaxConfig | public function getAjaxConfig($name = null)
{
if (!is_null($name)) {
return isset($this->ajaxConfig[$name]) ? $this->ajaxConfig[$name] : null;
}
return $this->ajaxConfig;
} | php | public function getAjaxConfig($name = null)
{
if (!is_null($name)) {
return isset($this->ajaxConfig[$name]) ? $this->ajaxConfig[$name] : null;
}
return $this->ajaxConfig;
} | [
"public",
"function",
"getAjaxConfig",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"name",
")",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"ajaxConfig",
"[",
"$",
"name",
"]",
")",
"?",
"$",
"this",
"->... | Answers either the named Ajax config value, or the Ajax config array.
@param string $name
@return mixed | [
"Answers",
"either",
"the",
"named",
"Ajax",
"config",
"value",
"or",
"the",
"Ajax",
"config",
"array",
"."
] | 81f3efe7f40eb87e1390f038c3c9eed415be7bc3 | https://github.com/praxisnetau/silverware-select2/blob/81f3efe7f40eb87e1390f038c3c9eed415be7bc3/src/Forms/Select2AjaxField.php#L232-L239 |
233,853 | praxisnetau/silverware-select2 | src/Forms/Select2AjaxField.php | Select2AjaxField.setDescriptor | public function setDescriptor($field, $order = 'ASC')
{
// Define Attributes:
$this->setTextField($field);
$this->setSearchFields([$field]);
$this->setSortBy([$field => $order]);
// Answer Self:
return $this;
} | php | public function setDescriptor($field, $order = 'ASC')
{
// Define Attributes:
$this->setTextField($field);
$this->setSearchFields([$field]);
$this->setSortBy([$field => $order]);
// Answer Self:
return $this;
} | [
"public",
"function",
"setDescriptor",
"(",
"$",
"field",
",",
"$",
"order",
"=",
"'ASC'",
")",
"{",
"// Define Attributes:",
"$",
"this",
"->",
"setTextField",
"(",
"$",
"field",
")",
";",
"$",
"this",
"->",
"setSearchFields",
"(",
"[",
"$",
"field",
"]... | Updates the text field, search fields and sort order to the specified field name.
@param string $field
@param string $order
@return $this | [
"Updates",
"the",
"text",
"field",
"search",
"fields",
"and",
"sort",
"order",
"to",
"the",
"specified",
"field",
"name",
"."
] | 81f3efe7f40eb87e1390f038c3c9eed415be7bc3 | https://github.com/praxisnetau/silverware-select2/blob/81f3efe7f40eb87e1390f038c3c9eed415be7bc3/src/Forms/Select2AjaxField.php#L489-L500 |
233,854 | praxisnetau/silverware-select2 | src/Forms/Select2AjaxField.php | Select2AjaxField.search | public function search(HTTPRequest $request)
{
// Detect Ajax:
if (!$request->isAjax()) {
return;
}
// Initialise:
$data = ['results' => []];
// Create Data List:
$list = $this->getList();
... | php | public function search(HTTPRequest $request)
{
// Detect Ajax:
if (!$request->isAjax()) {
return;
}
// Initialise:
$data = ['results' => []];
// Create Data List:
$list = $this->getList();
... | [
"public",
"function",
"search",
"(",
"HTTPRequest",
"$",
"request",
")",
"{",
"// Detect Ajax:",
"if",
"(",
"!",
"$",
"request",
"->",
"isAjax",
"(",
")",
")",
"{",
"return",
";",
"}",
"// Initialise:",
"$",
"data",
"=",
"[",
"'results'",
"=>",
"[",
"]... | Answers an HTTP response containing JSON results matching the given search parameters.
@param HTTPRequest $request
@return HTTPResponse | [
"Answers",
"an",
"HTTP",
"response",
"containing",
"JSON",
"results",
"matching",
"the",
"given",
"search",
"parameters",
"."
] | 81f3efe7f40eb87e1390f038c3c9eed415be7bc3 | https://github.com/praxisnetau/silverware-select2/blob/81f3efe7f40eb87e1390f038c3c9eed415be7bc3/src/Forms/Select2AjaxField.php#L539-L582 |
233,855 | praxisnetau/silverware-select2 | src/Forms/Select2AjaxField.php | Select2AjaxField.getSearchFilters | public function getSearchFilters($term)
{
$filters = [];
foreach ($this->getSearchFields() as $field) {
$filters[$this->getSearchFilterName($field)] = $term;
}
return $filters;
} | php | public function getSearchFilters($term)
{
$filters = [];
foreach ($this->getSearchFields() as $field) {
$filters[$this->getSearchFilterName($field)] = $term;
}
return $filters;
} | [
"public",
"function",
"getSearchFilters",
"(",
"$",
"term",
")",
"{",
"$",
"filters",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getSearchFields",
"(",
")",
"as",
"$",
"field",
")",
"{",
"$",
"filters",
"[",
"$",
"this",
"->",
"getSearch... | Answers an array of search filters for the given term.
@param string $term
@return array | [
"Answers",
"an",
"array",
"of",
"search",
"filters",
"for",
"the",
"given",
"term",
"."
] | 81f3efe7f40eb87e1390f038c3c9eed415be7bc3 | https://github.com/praxisnetau/silverware-select2/blob/81f3efe7f40eb87e1390f038c3c9eed415be7bc3/src/Forms/Select2AjaxField.php#L591-L600 |
233,856 | praxisnetau/silverware-select2 | src/Forms/Select2AjaxField.php | Select2AjaxField.saveIntoRelation | public function saveIntoRelation(Relation $relation)
{
$ids = [];
if ($values = $this->getValueArray()) {
$ids = $this->getList()->filter($this->getIDField(), $values)->getIDList();
}
$relation->setByIDList($ids);
} | php | public function saveIntoRelation(Relation $relation)
{
$ids = [];
if ($values = $this->getValueArray()) {
$ids = $this->getList()->filter($this->getIDField(), $values)->getIDList();
}
$relation->setByIDList($ids);
} | [
"public",
"function",
"saveIntoRelation",
"(",
"Relation",
"$",
"relation",
")",
"{",
"$",
"ids",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"values",
"=",
"$",
"this",
"->",
"getValueArray",
"(",
")",
")",
"{",
"$",
"ids",
"=",
"$",
"this",
"->",
"getLis... | Saves the value of the field into the given relation.
@param Relation $relation
@return void | [
"Saves",
"the",
"value",
"of",
"the",
"field",
"into",
"the",
"given",
"relation",
"."
] | 81f3efe7f40eb87e1390f038c3c9eed415be7bc3 | https://github.com/praxisnetau/silverware-select2/blob/81f3efe7f40eb87e1390f038c3c9eed415be7bc3/src/Forms/Select2AjaxField.php#L633-L642 |
233,857 | praxisnetau/silverware-select2 | src/Forms/Select2AjaxField.php | Select2AjaxField.getResultData | protected function getResultData(ViewableData $record, $selected = false)
{
return [
'id' => $record->{$this->getIDField()},
'text' => $record->{$this->getTextField()},
'formattedResult' => $this->getFormattedResult($record),
'formattedSelection' => $this->get... | php | protected function getResultData(ViewableData $record, $selected = false)
{
return [
'id' => $record->{$this->getIDField()},
'text' => $record->{$this->getTextField()},
'formattedResult' => $this->getFormattedResult($record),
'formattedSelection' => $this->get... | [
"protected",
"function",
"getResultData",
"(",
"ViewableData",
"$",
"record",
",",
"$",
"selected",
"=",
"false",
")",
"{",
"return",
"[",
"'id'",
"=>",
"$",
"record",
"->",
"{",
"$",
"this",
"->",
"getIDField",
"(",
")",
"}",
",",
"'text'",
"=>",
"$",... | Answers a result data array for the given record object.
@param ViewableData $record
@param boolean $selected
@return array | [
"Answers",
"a",
"result",
"data",
"array",
"for",
"the",
"given",
"record",
"object",
"."
] | 81f3efe7f40eb87e1390f038c3c9eed415be7bc3 | https://github.com/praxisnetau/silverware-select2/blob/81f3efe7f40eb87e1390f038c3c9eed415be7bc3/src/Forms/Select2AjaxField.php#L719-L728 |
233,858 | praxisnetau/silverware-select2 | src/Forms/Select2AjaxField.php | Select2AjaxField.getFormattedResult | protected function getFormattedResult(ViewableData $record)
{
if ($format = $this->getFormatResult()) {
return SSViewer::fromString($format)->process($record);
}
} | php | protected function getFormattedResult(ViewableData $record)
{
if ($format = $this->getFormatResult()) {
return SSViewer::fromString($format)->process($record);
}
} | [
"protected",
"function",
"getFormattedResult",
"(",
"ViewableData",
"$",
"record",
")",
"{",
"if",
"(",
"$",
"format",
"=",
"$",
"this",
"->",
"getFormatResult",
"(",
")",
")",
"{",
"return",
"SSViewer",
"::",
"fromString",
"(",
"$",
"format",
")",
"->",
... | Answers a formatted result string for the given record object.
@param ViewableData $record
@return string | [
"Answers",
"a",
"formatted",
"result",
"string",
"for",
"the",
"given",
"record",
"object",
"."
] | 81f3efe7f40eb87e1390f038c3c9eed415be7bc3 | https://github.com/praxisnetau/silverware-select2/blob/81f3efe7f40eb87e1390f038c3c9eed415be7bc3/src/Forms/Select2AjaxField.php#L737-L742 |
233,859 | praxisnetau/silverware-select2 | src/Forms/Select2AjaxField.php | Select2AjaxField.getFormattedSelection | protected function getFormattedSelection(ViewableData $record)
{
if ($format = $this->getFormatSelection()) {
return SSViewer::fromString($format)->process($record);
}
} | php | protected function getFormattedSelection(ViewableData $record)
{
if ($format = $this->getFormatSelection()) {
return SSViewer::fromString($format)->process($record);
}
} | [
"protected",
"function",
"getFormattedSelection",
"(",
"ViewableData",
"$",
"record",
")",
"{",
"if",
"(",
"$",
"format",
"=",
"$",
"this",
"->",
"getFormatSelection",
"(",
")",
")",
"{",
"return",
"SSViewer",
"::",
"fromString",
"(",
"$",
"format",
")",
"... | Answers a formatted selection string for the given record object.
@param ViewableData $record
@return string | [
"Answers",
"a",
"formatted",
"selection",
"string",
"for",
"the",
"given",
"record",
"object",
"."
] | 81f3efe7f40eb87e1390f038c3c9eed415be7bc3 | https://github.com/praxisnetau/silverware-select2/blob/81f3efe7f40eb87e1390f038c3c9eed415be7bc3/src/Forms/Select2AjaxField.php#L751-L756 |
233,860 | praxisnetau/silverware-select2 | src/Forms/Select2AjaxField.php | Select2AjaxField.getListMap | protected function getListMap($source)
{
// Extract Map from ID / Text Fields:
if ($source instanceof SS_List) {
$source = $source->map($this->getIDField(), $this->getTextField());
}
// Convert Map to Array:
if ($source instanceof Map) {... | php | protected function getListMap($source)
{
// Extract Map from ID / Text Fields:
if ($source instanceof SS_List) {
$source = $source->map($this->getIDField(), $this->getTextField());
}
// Convert Map to Array:
if ($source instanceof Map) {... | [
"protected",
"function",
"getListMap",
"(",
"$",
"source",
")",
"{",
"// Extract Map from ID / Text Fields:",
"if",
"(",
"$",
"source",
"instanceof",
"SS_List",
")",
"{",
"$",
"source",
"=",
"$",
"source",
"->",
"map",
"(",
"$",
"this",
"->",
"getIDField",
"... | Converts the given data source into an array.
@param array|ArrayAccess $source
@return array | [
"Converts",
"the",
"given",
"data",
"source",
"into",
"an",
"array",
"."
] | 81f3efe7f40eb87e1390f038c3c9eed415be7bc3 | https://github.com/praxisnetau/silverware-select2/blob/81f3efe7f40eb87e1390f038c3c9eed415be7bc3/src/Forms/Select2AjaxField.php#L765-L788 |
233,861 | praxisnetau/silverware-select2 | src/Forms/Select2AjaxField.php | Select2AjaxField.getFieldConfig | protected function getFieldConfig()
{
$config = parent::getFieldConfig();
if ($values = $this->getValueArray()) {
$data = [];
foreach ($values as $value) {
if ($record = $this->getValueRecord($value)) {
... | php | protected function getFieldConfig()
{
$config = parent::getFieldConfig();
if ($values = $this->getValueArray()) {
$data = [];
foreach ($values as $value) {
if ($record = $this->getValueRecord($value)) {
... | [
"protected",
"function",
"getFieldConfig",
"(",
")",
"{",
"$",
"config",
"=",
"parent",
"::",
"getFieldConfig",
"(",
")",
";",
"if",
"(",
"$",
"values",
"=",
"$",
"this",
"->",
"getValueArray",
"(",
")",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"... | Answers the field config for the receiver.
@return array | [
"Answers",
"the",
"field",
"config",
"for",
"the",
"receiver",
"."
] | 81f3efe7f40eb87e1390f038c3c9eed415be7bc3 | https://github.com/praxisnetau/silverware-select2/blob/81f3efe7f40eb87e1390f038c3c9eed415be7bc3/src/Forms/Select2AjaxField.php#L795-L816 |
233,862 | praxisnetau/silverware-select2 | src/Forms/Select2AjaxField.php | Select2AjaxField.getFieldAjaxConfig | protected function getFieldAjaxConfig()
{
$config = $this->getAjaxConfig();
if (!isset($config['url'])) {
$config['url'] = $this->Link('search');
}
return $config;
} | php | protected function getFieldAjaxConfig()
{
$config = $this->getAjaxConfig();
if (!isset($config['url'])) {
$config['url'] = $this->Link('search');
}
return $config;
} | [
"protected",
"function",
"getFieldAjaxConfig",
"(",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"getAjaxConfig",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"config",
"[",
"'url'",
"]",
")",
")",
"{",
"$",
"config",
"[",
"'url'",
"]",
"=... | Answers the field Ajax config for the receiver.
@return array | [
"Answers",
"the",
"field",
"Ajax",
"config",
"for",
"the",
"receiver",
"."
] | 81f3efe7f40eb87e1390f038c3c9eed415be7bc3 | https://github.com/praxisnetau/silverware-select2/blob/81f3efe7f40eb87e1390f038c3c9eed415be7bc3/src/Forms/Select2AjaxField.php#L823-L832 |
233,863 | lamoni/junosnetconf | JunosNetConf.php | JunosNetConf.loadConfigurationRaw | public function loadConfigurationRaw($configData="", $configNode="", array $customAttributes)
{
if ($configData !== "" && $configNode !== "") {
$loadConfig = "<load-configuration>".
"<{$configNode}>".
"{$configData}".
... | php | public function loadConfigurationRaw($configData="", $configNode="", array $customAttributes)
{
if ($configData !== "" && $configNode !== "") {
$loadConfig = "<load-configuration>".
"<{$configNode}>".
"{$configData}".
... | [
"public",
"function",
"loadConfigurationRaw",
"(",
"$",
"configData",
"=",
"\"\"",
",",
"$",
"configNode",
"=",
"\"\"",
",",
"array",
"$",
"customAttributes",
")",
"{",
"if",
"(",
"$",
"configData",
"!==",
"\"\"",
"&&",
"$",
"configNode",
"!==",
"\"\"",
")... | Base method for loading configuration into the device's candidate configuration.
@param string $configData
@param string $configNode
@param array $customAttributes
@return \Lamoni\NetConf\NetConfMessage\NetConfMessageRecv\NetConfMessageRecvRPC | [
"Base",
"method",
"for",
"loading",
"configuration",
"into",
"the",
"device",
"s",
"candidate",
"configuration",
"."
] | fc74d9c0c4eb32578e7c91c5457dd43841f327b2 | https://github.com/lamoni/junosnetconf/blob/fc74d9c0c4eb32578e7c91c5457dd43841f327b2/JunosNetConf.php#L101-L128 |
233,864 | lamoni/junosnetconf | JunosNetConf.php | JunosNetConf.commitConfigurationRaw | public function commitConfigurationRaw(array $customParams, $synchronize=true)
{
if ($synchronize === true) {
$customParams['synchronize'] = '';
}
$commitConfig = new \SimpleXMLElement('<commit-configuration/>');
foreach ($customParams as $paramName => $paramValue) {... | php | public function commitConfigurationRaw(array $customParams, $synchronize=true)
{
if ($synchronize === true) {
$customParams['synchronize'] = '';
}
$commitConfig = new \SimpleXMLElement('<commit-configuration/>');
foreach ($customParams as $paramName => $paramValue) {... | [
"public",
"function",
"commitConfigurationRaw",
"(",
"array",
"$",
"customParams",
",",
"$",
"synchronize",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"synchronize",
"===",
"true",
")",
"{",
"$",
"customParams",
"[",
"'synchronize'",
"]",
"=",
"''",
";",
"}",
... | Base for committing the candidate configuration to the active configuration.
@param array $customParams
@param bool $synchronize
@return \Lamoni\NetConf\NetConfMessage\NetConfMessageRecv\NetConfMessageRecvRPC | [
"Base",
"for",
"committing",
"the",
"candidate",
"configuration",
"to",
"the",
"active",
"configuration",
"."
] | fc74d9c0c4eb32578e7c91c5457dd43841f327b2 | https://github.com/lamoni/junosnetconf/blob/fc74d9c0c4eb32578e7c91c5457dd43841f327b2/JunosNetConf.php#L372-L394 |
233,865 | lamoni/junosnetconf | JunosNetConf.php | JunosNetConf.getConfigurationRaw | public function getConfigurationRaw($configData, array $customAttributes=[])
{
$getConfig = new \SimpleXMLElement(
"<get-configuration>".
"{$configData}".
"</get-configuration>"
);
foreach ($customAttributes as $attrName => $attrValue) {
... | php | public function getConfigurationRaw($configData, array $customAttributes=[])
{
$getConfig = new \SimpleXMLElement(
"<get-configuration>".
"{$configData}".
"</get-configuration>"
);
foreach ($customAttributes as $attrName => $attrValue) {
... | [
"public",
"function",
"getConfigurationRaw",
"(",
"$",
"configData",
",",
"array",
"$",
"customAttributes",
"=",
"[",
"]",
")",
"{",
"$",
"getConfig",
"=",
"new",
"\\",
"SimpleXMLElement",
"(",
"\"<get-configuration>\"",
".",
"\"{$configData}\"",
".",
"\"</get-con... | Base for getting the device's configuration.
@param $configData
@param array $customAttributes
@return \Lamoni\NetConf\NetConfMessage\NetConfMessageRecv\NetConfMessageRecvRPC | [
"Base",
"for",
"getting",
"the",
"device",
"s",
"configuration",
"."
] | fc74d9c0c4eb32578e7c91c5457dd43841f327b2 | https://github.com/lamoni/junosnetconf/blob/fc74d9c0c4eb32578e7c91c5457dd43841f327b2/JunosNetConf.php#L505-L523 |
233,866 | xylemical/php-expressions | src/Lexer.php | Lexer.tokenize | public function tokenize($string)
{
// Get the list of sorted operators.
$operators = $this->factory->getOperators();
// Get the operator regular expression.
$regex = $this->getRegex($operators);
// Check that we have matched all the tokens in the string.
if (!preg_... | php | public function tokenize($string)
{
// Get the list of sorted operators.
$operators = $this->factory->getOperators();
// Get the operator regular expression.
$regex = $this->getRegex($operators);
// Check that we have matched all the tokens in the string.
if (!preg_... | [
"public",
"function",
"tokenize",
"(",
"$",
"string",
")",
"{",
"// Get the list of sorted operators.",
"$",
"operators",
"=",
"$",
"this",
"->",
"factory",
"->",
"getOperators",
"(",
")",
";",
"// Get the operator regular expression.",
"$",
"regex",
"=",
"$",
"th... | Converts a string into tokens.
@param $string
@return \Xylemical\Expressions\Token[]
@throws \Xylemical\Expressions\LexerException | [
"Converts",
"a",
"string",
"into",
"tokens",
"."
] | 4dc7c3a4bb3f335a04cb05b0d41871529cfc9b73 | https://github.com/xylemical/php-expressions/blob/4dc7c3a4bb3f335a04cb05b0d41871529cfc9b73/src/Lexer.php#L41-L76 |
233,867 | xylemical/php-expressions | src/Lexer.php | Lexer.getRegex | protected function getRegex($operators)
{
$regexes = [];
/** @var \Xylemical\Expressions\Operator $operator */
foreach ($operators as $operator)
{
$regexes[] = $operator->getRegex();
}
// Add parentheses regexes.
$regexes[] = '\(';
$regex... | php | protected function getRegex($operators)
{
$regexes = [];
/** @var \Xylemical\Expressions\Operator $operator */
foreach ($operators as $operator)
{
$regexes[] = $operator->getRegex();
}
// Add parentheses regexes.
$regexes[] = '\(';
$regex... | [
"protected",
"function",
"getRegex",
"(",
"$",
"operators",
")",
"{",
"$",
"regexes",
"=",
"[",
"]",
";",
"/** @var \\Xylemical\\Expressions\\Operator $operator */",
"foreach",
"(",
"$",
"operators",
"as",
"$",
"operator",
")",
"{",
"$",
"regexes",
"[",
"]",
"... | Get the regex used to locate tokens.
@return string | [
"Get",
"the",
"regex",
"used",
"to",
"locate",
"tokens",
"."
] | 4dc7c3a4bb3f335a04cb05b0d41871529cfc9b73 | https://github.com/xylemical/php-expressions/blob/4dc7c3a4bb3f335a04cb05b0d41871529cfc9b73/src/Lexer.php#L83-L100 |
233,868 | baleen/migrations | src/Delta/Collection/Collection.php | Collection.find | public function find($element, $resolve = true)
{
$result = null;
if (is_object($element)) {
$element = (string) $element;
}
if ($resolve && is_string($element)) {
$result = $this->getResolver()->resolve($element, $this);
}
if (null === $res... | php | public function find($element, $resolve = true)
{
$result = null;
if (is_object($element)) {
$element = (string) $element;
}
if ($resolve && is_string($element)) {
$result = $this->getResolver()->resolve($element, $this);
}
if (null === $res... | [
"public",
"function",
"find",
"(",
"$",
"element",
",",
"$",
"resolve",
"=",
"true",
")",
"{",
"$",
"result",
"=",
"null",
";",
"if",
"(",
"is_object",
"(",
"$",
"element",
")",
")",
"{",
"$",
"element",
"=",
"(",
"string",
")",
"$",
"element",
"... | Gets an element.
@param mixed $element If an alias is given then it will be resolved to an element. Otherwise the $key will be used
to fetch the element by index.
@param bool $resolve Whether to use the resolver or not.
@return DeltaInterface|null Null if not present | [
"Gets",
"an",
"element",
"."
] | cfc8c439858cf4f0d4119af9eb67de493da8d95c | https://github.com/baleen/migrations/blob/cfc8c439858cf4f0d4119af9eb67de493da8d95c/src/Delta/Collection/Collection.php#L93-L110 |
233,869 | baleen/migrations | src/Delta/Collection/Collection.php | Collection.add | public function add(DeltaInterface $version)
{
$this->validate($version);
$result = parent::add($version);
if ($result) {
$this->invalidateResolverCache();
}
return $result;
} | php | public function add(DeltaInterface $version)
{
$this->validate($version);
$result = parent::add($version);
if ($result) {
$this->invalidateResolverCache();
}
return $result;
} | [
"public",
"function",
"add",
"(",
"DeltaInterface",
"$",
"version",
")",
"{",
"$",
"this",
"->",
"validate",
"(",
"$",
"version",
")",
";",
"$",
"result",
"=",
"parent",
"::",
"add",
"(",
"$",
"version",
")",
";",
"if",
"(",
"$",
"result",
")",
"{"... | Add a version to the collection
@param mixed $version
@return bool
@throws CollectionException
@throws InvalidArgumentException | [
"Add",
"a",
"version",
"to",
"the",
"collection"
] | cfc8c439858cf4f0d4119af9eb67de493da8d95c | https://github.com/baleen/migrations/blob/cfc8c439858cf4f0d4119af9eb67de493da8d95c/src/Delta/Collection/Collection.php#L151-L160 |
233,870 | kaliop-uk/kueueingbundle | Adapter/RabbitMq/Consumer.php | Consumer.setCallback | public function setCallback($callback)
{
if ($callback instanceof \OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface) {
$callback = array($callback, 'execute');
}
$this->callback = $callback;
return $this;
} | php | public function setCallback($callback)
{
if ($callback instanceof \OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface) {
$callback = array($callback, 'execute');
}
$this->callback = $callback;
return $this;
} | [
"public",
"function",
"setCallback",
"(",
"$",
"callback",
")",
"{",
"if",
"(",
"$",
"callback",
"instanceof",
"\\",
"OldSound",
"\\",
"RabbitMqBundle",
"\\",
"RabbitMq",
"\\",
"ConsumerInterface",
")",
"{",
"$",
"callback",
"=",
"array",
"(",
"$",
"callback... | Overridden to make it fluent, plus accept an object as well
@param callable|\OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface $callback
@return Consumer | [
"Overridden",
"to",
"make",
"it",
"fluent",
"plus",
"accept",
"an",
"object",
"as",
"well"
] | 6a4f9b01ef1f5b8e5cdfad78f7c82b35f1007987 | https://github.com/kaliop-uk/kueueingbundle/blob/6a4f9b01ef1f5b8e5cdfad78f7c82b35f1007987/Adapter/RabbitMq/Consumer.php#L77-L85 |
233,871 | kaliop-uk/kueueingbundle | Adapter/RabbitMq/Consumer.php | Consumer.setRoutingKey | public function setRoutingKey($routingKey)
{
// we have to throw an exception, otherwise the new routing key will just be ignored
if ($this->queueDeclared && $this->routingKey != $routingKey) {
throw new \RuntimeException('AMQP Consumer can not use a new routing key: queue has already be... | php | public function setRoutingKey($routingKey)
{
// we have to throw an exception, otherwise the new routing key will just be ignored
if ($this->queueDeclared && $this->routingKey != $routingKey) {
throw new \RuntimeException('AMQP Consumer can not use a new routing key: queue has already be... | [
"public",
"function",
"setRoutingKey",
"(",
"$",
"routingKey",
")",
"{",
"// we have to throw an exception, otherwise the new routing key will just be ignored",
"if",
"(",
"$",
"this",
"->",
"queueDeclared",
"&&",
"$",
"this",
"->",
"routingKey",
"!=",
"$",
"routingKey",
... | Overridden to make it fluent
@param string $routingKey
@return Consumer
@throws \RuntimeException | [
"Overridden",
"to",
"make",
"it",
"fluent"
] | 6a4f9b01ef1f5b8e5cdfad78f7c82b35f1007987 | https://github.com/kaliop-uk/kueueingbundle/blob/6a4f9b01ef1f5b8e5cdfad78f7c82b35f1007987/Adapter/RabbitMq/Consumer.php#L106-L115 |
233,872 | kaliop-uk/kueueingbundle | Adapter/RabbitMq/Consumer.php | Consumer.consume | public function consume($msgAmount, $timeout=0)
{
if ($timeout > 0) {
// save initial time
$loopBegin = time();
$remaining = $timeout;
// reimplement parent::consume() to inject the timeout
$this->target = $msgAmount;
$this->setupConsu... | php | public function consume($msgAmount, $timeout=0)
{
if ($timeout > 0) {
// save initial time
$loopBegin = time();
$remaining = $timeout;
// reimplement parent::consume() to inject the timeout
$this->target = $msgAmount;
$this->setupConsu... | [
"public",
"function",
"consume",
"(",
"$",
"msgAmount",
",",
"$",
"timeout",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"timeout",
">",
"0",
")",
"{",
"// save initial time",
"$",
"loopBegin",
"=",
"time",
"(",
")",
";",
"$",
"remaining",
"=",
"$",
"timeout... | Overridden to add support for timeout
@param int $msgAmount
@param int $timeout | [
"Overridden",
"to",
"add",
"support",
"for",
"timeout"
] | 6a4f9b01ef1f5b8e5cdfad78f7c82b35f1007987 | https://github.com/kaliop-uk/kueueingbundle/blob/6a4f9b01ef1f5b8e5cdfad78f7c82b35f1007987/Adapter/RabbitMq/Consumer.php#L122-L150 |
233,873 | kaliop-uk/kueueingbundle | Adapter/RabbitMq/Consumer.php | Consumer.processMessage | public function processMessage(BaseAMQPMessage $msg)
{
$newMsg = new AMQPMessage($msg->body, $msg->get_properties());
$newMsg->delivery_info = $msg->delivery_info;
$newMsg->body_size = $msg->body_size;
$newMsg->is_truncated = $msg->is_truncated;
$newMsg->setQueueName($this->q... | php | public function processMessage(BaseAMQPMessage $msg)
{
$newMsg = new AMQPMessage($msg->body, $msg->get_properties());
$newMsg->delivery_info = $msg->delivery_info;
$newMsg->body_size = $msg->body_size;
$newMsg->is_truncated = $msg->is_truncated;
$newMsg->setQueueName($this->q... | [
"public",
"function",
"processMessage",
"(",
"BaseAMQPMessage",
"$",
"msg",
")",
"{",
"$",
"newMsg",
"=",
"new",
"AMQPMessage",
"(",
"$",
"msg",
"->",
"body",
",",
"$",
"msg",
"->",
"get_properties",
"(",
")",
")",
";",
"$",
"newMsg",
"->",
"delivery_inf... | Overridden to inject the queue name into the AMQP message
@param BaseAMQPMessage $msg | [
"Overridden",
"to",
"inject",
"the",
"queue",
"name",
"into",
"the",
"AMQP",
"message"
] | 6a4f9b01ef1f5b8e5cdfad78f7c82b35f1007987 | https://github.com/kaliop-uk/kueueingbundle/blob/6a4f9b01ef1f5b8e5cdfad78f7c82b35f1007987/Adapter/RabbitMq/Consumer.php#L156-L166 |
233,874 | budde377/Part | lib/util/file/FileImpl.php | FileImpl.move | public function move($path)
{
if($this->isDirectory()){
return false;
}
$path = $this->relativeToAbsolute($path);
if (($ret = @rename($this->filePath, $path)) === true) {
$this->filePath = $path;
}
return $ret;
} | php | public function move($path)
{
if($this->isDirectory()){
return false;
}
$path = $this->relativeToAbsolute($path);
if (($ret = @rename($this->filePath, $path)) === true) {
$this->filePath = $path;
}
return $ret;
} | [
"public",
"function",
"move",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isDirectory",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"path",
"=",
"$",
"this",
"->",
"relativeToAbsolute",
"(",
"$",
"path",
")",
";",
"if",
"... | Will move the file to specified path
@param string $path
@return bool TRUE if success FALSE if failure | [
"Will",
"move",
"the",
"file",
"to",
"specified",
"path"
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/util/file/FileImpl.php#L93-L104 |
233,875 | budde377/Part | lib/util/file/FileImpl.php | FileImpl.write | public function write($string)
{
$handle = @fopen($this->filePath, $this->mode);
if ($handle === false) {
return $handle;
}
return @fwrite($handle, $string);
} | php | public function write($string)
{
$handle = @fopen($this->filePath, $this->mode);
if ($handle === false) {
return $handle;
}
return @fwrite($handle, $string);
} | [
"public",
"function",
"write",
"(",
"$",
"string",
")",
"{",
"$",
"handle",
"=",
"@",
"fopen",
"(",
"$",
"this",
"->",
"filePath",
",",
"$",
"this",
"->",
"mode",
")",
";",
"if",
"(",
"$",
"handle",
"===",
"false",
")",
"{",
"return",
"$",
"handl... | Writes to file
@param $string
@return int | bool Returns the number of bytes written, or FALSE on error. | [
"Writes",
"to",
"file"
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/util/file/FileImpl.php#L138-L147 |
233,876 | budde377/Part | lib/util/file/FileImpl.php | FileImpl.setAccessMode | public function setAccessMode($permissions)
{
switch ($permissions) {
case File::FILE_MODE_RW_POINTER_AT_END:
case File::FILE_MODE_W_POINTER_AT_END:
case File::FILE_MODE_R_POINTER_AT_BEGINNING:
case File::FILE_MODE_RW_POINTER_AT_BEGINNING:
case Fil... | php | public function setAccessMode($permissions)
{
switch ($permissions) {
case File::FILE_MODE_RW_POINTER_AT_END:
case File::FILE_MODE_W_POINTER_AT_END:
case File::FILE_MODE_R_POINTER_AT_BEGINNING:
case File::FILE_MODE_RW_POINTER_AT_BEGINNING:
case Fil... | [
"public",
"function",
"setAccessMode",
"(",
"$",
"permissions",
")",
"{",
"switch",
"(",
"$",
"permissions",
")",
"{",
"case",
"File",
"::",
"FILE_MODE_RW_POINTER_AT_END",
":",
"case",
"File",
"::",
"FILE_MODE_W_POINTER_AT_END",
":",
"case",
"File",
"::",
"FILE_... | Sets the access mode, available options is in FileModeEnum
@param string $permissions
@return void | [
"Sets",
"the",
"access",
"mode",
"available",
"options",
"is",
"in",
"FileModeEnum"
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/util/file/FileImpl.php#L154-L167 |
233,877 | skrz/meta | gen-src/Skrz/Meta/Fixtures/Protobuf/Meta/ClassWithFixed64PropertyMeta.php | ClassWithFixed64PropertyMeta.create | public static function create()
{
switch (func_num_args()) {
case 0:
return new ClassWithFixed64Property();
case 1:
return new ClassWithFixed64Property(func_get_arg(0));
case 2:
return new ClassWithFixed64Property(func_get_arg(0), func_get_arg(1));
case 3:
return new ClassWithFixed64Prope... | php | public static function create()
{
switch (func_num_args()) {
case 0:
return new ClassWithFixed64Property();
case 1:
return new ClassWithFixed64Property(func_get_arg(0));
case 2:
return new ClassWithFixed64Property(func_get_arg(0), func_get_arg(1));
case 3:
return new ClassWithFixed64Prope... | [
"public",
"static",
"function",
"create",
"(",
")",
"{",
"switch",
"(",
"func_num_args",
"(",
")",
")",
"{",
"case",
"0",
":",
"return",
"new",
"ClassWithFixed64Property",
"(",
")",
";",
"case",
"1",
":",
"return",
"new",
"ClassWithFixed64Property",
"(",
"... | Creates new instance of \Skrz\Meta\Fixtures\Protobuf\ClassWithFixed64Property
@throws \InvalidArgumentException
@return ClassWithFixed64Property | [
"Creates",
"new",
"instance",
"of",
"\\",
"Skrz",
"\\",
"Meta",
"\\",
"Fixtures",
"\\",
"Protobuf",
"\\",
"ClassWithFixed64Property"
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Skrz/Meta/Fixtures/Protobuf/Meta/ClassWithFixed64PropertyMeta.php#L66-L90 |
233,878 | skrz/meta | gen-src/Skrz/Meta/Fixtures/Protobuf/Meta/ClassWithFixed64PropertyMeta.php | ClassWithFixed64PropertyMeta.fromProtobuf | public static function fromProtobuf($input, $object = NULL, &$start = 0, $end = NULL)
{
if ($object === null) {
$object = new ClassWithFixed64Property();
}
if ($end === null) {
$end = strlen($input);
}
while ($start < $end) {
$tag = Binary::decodeVarint($input, $start);
$wireType = $tag & 0x7;
... | php | public static function fromProtobuf($input, $object = NULL, &$start = 0, $end = NULL)
{
if ($object === null) {
$object = new ClassWithFixed64Property();
}
if ($end === null) {
$end = strlen($input);
}
while ($start < $end) {
$tag = Binary::decodeVarint($input, $start);
$wireType = $tag & 0x7;
... | [
"public",
"static",
"function",
"fromProtobuf",
"(",
"$",
"input",
",",
"$",
"object",
"=",
"NULL",
",",
"&",
"$",
"start",
"=",
"0",
",",
"$",
"end",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"object",
"===",
"null",
")",
"{",
"$",
"object",
"=",
... | Creates \Skrz\Meta\Fixtures\Protobuf\ClassWithFixed64Property object from serialized Protocol Buffers message.
@param string $input
@param ClassWithFixed64Property $object
@param int $start
@param int $end
@throws \Exception
@return ClassWithFixed64Property | [
"Creates",
"\\",
"Skrz",
"\\",
"Meta",
"\\",
"Fixtures",
"\\",
"Protobuf",
"\\",
"ClassWithFixed64Property",
"object",
"from",
"serialized",
"Protocol",
"Buffers",
"message",
"."
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Skrz/Meta/Fixtures/Protobuf/Meta/ClassWithFixed64PropertyMeta.php#L332-L381 |
233,879 | willmorgan/silverstripe-cropperfield | code/CropperField.php | CropperField.saveInto | public function saveInto(DataObjectInterface $object) {
if(!$this->canCrop() || !$this->hasSourceFile()) {
return;
}
$object->setField($this->getName() . 'ID', $this->generateCropped()->ID);
$object->write();
} | php | public function saveInto(DataObjectInterface $object) {
if(!$this->canCrop() || !$this->hasSourceFile()) {
return;
}
$object->setField($this->getName() . 'ID', $this->generateCropped()->ID);
$object->write();
} | [
"public",
"function",
"saveInto",
"(",
"DataObjectInterface",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"canCrop",
"(",
")",
"||",
"!",
"$",
"this",
"->",
"hasSourceFile",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"object",
"->",... | If enabled, crop the image, save as a new file, and link it via relation
@return void | [
"If",
"enabled",
"crop",
"the",
"image",
"save",
"as",
"a",
"new",
"file",
"and",
"link",
"it",
"via",
"relation"
] | 855ca4f44dd392b1cf9d36f411a2c145b4b3d975 | https://github.com/willmorgan/silverstripe-cropperfield/blob/855ca4f44dd392b1cf9d36f411a2c145b4b3d975/code/CropperField.php#L269-L275 |
233,880 | willmorgan/silverstripe-cropperfield | code/CropperField.php | CropperField.requireFrontend | protected function requireFrontend() {
$extension = Director::isLive() ? '.min' : '';
$cssFiles = array(
CROPPERFIELD_PATH . '/cropper/cropper' . $extension . '.css',
CROPPERFIELD_PATH . '/cropper/CropperField.css',
);
$jsFiles = array(
CROPPERFIELD_PATH . '/cropper/cropper' . $extension . '.js',
CR... | php | protected function requireFrontend() {
$extension = Director::isLive() ? '.min' : '';
$cssFiles = array(
CROPPERFIELD_PATH . '/cropper/cropper' . $extension . '.css',
CROPPERFIELD_PATH . '/cropper/CropperField.css',
);
$jsFiles = array(
CROPPERFIELD_PATH . '/cropper/cropper' . $extension . '.js',
CR... | [
"protected",
"function",
"requireFrontend",
"(",
")",
"{",
"$",
"extension",
"=",
"Director",
"::",
"isLive",
"(",
")",
"?",
"'.min'",
":",
"''",
";",
"$",
"cssFiles",
"=",
"array",
"(",
"CROPPERFIELD_PATH",
".",
"'/cropper/cropper'",
".",
"$",
"extension",
... | Pull in the cropper.js requirements. If in dev mode, bring in unminified.
@return void | [
"Pull",
"in",
"the",
"cropper",
".",
"js",
"requirements",
".",
"If",
"in",
"dev",
"mode",
"bring",
"in",
"unminified",
"."
] | 855ca4f44dd392b1cf9d36f411a2c145b4b3d975 | https://github.com/willmorgan/silverstripe-cropperfield/blob/855ca4f44dd392b1cf9d36f411a2c145b4b3d975/code/CropperField.php#L391-L403 |
233,881 | MW-Peachy/Peachy | Includes/XMLParse.php | XMLParse.load | public static function load( $data ) {
$http = HTTP::getDefaultInstance();
if( !function_exists( 'simplexml_load_string' ) ) {
throw new DependencyError( "SimpleXML", "http://us.php.net/manual/en/book.simplexml.php" );
}
libxml_use_internal_errors( true );
if( in_string( "<?xml", $data ) ) {
$xmlout ... | php | public static function load( $data ) {
$http = HTTP::getDefaultInstance();
if( !function_exists( 'simplexml_load_string' ) ) {
throw new DependencyError( "SimpleXML", "http://us.php.net/manual/en/book.simplexml.php" );
}
libxml_use_internal_errors( true );
if( in_string( "<?xml", $data ) ) {
$xmlout ... | [
"public",
"static",
"function",
"load",
"(",
"$",
"data",
")",
"{",
"$",
"http",
"=",
"HTTP",
"::",
"getDefaultInstance",
"(",
")",
";",
"if",
"(",
"!",
"function_exists",
"(",
"'simplexml_load_string'",
")",
")",
"{",
"throw",
"new",
"DependencyError",
"(... | Converts an XML url or string to a PHP array format
@static
@access public
@param string $data Either an url to an xml file, or a raw XML string. Peachy will autodetect which is which.
@return array Parsed XML
@throws BadEntryError
@throws DependencyError
@throws HookError
@throws XMLError | [
"Converts",
"an",
"XML",
"url",
"or",
"string",
"to",
"a",
"PHP",
"array",
"format"
] | 2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c | https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Includes/XMLParse.php#L34-L71 |
233,882 | kaliop-uk/kueueingbundle | Service/MessageProducer.php | MessageProducer.doPublish | protected function doPublish($data, $routingKey = '', $extras = array())
{
$producer = $this->getProducerService();
$producer->setContentType($this->getContentType());
$producer->publish($this->encodeMessageBody($data), $routingKey, $extras);
} | php | protected function doPublish($data, $routingKey = '', $extras = array())
{
$producer = $this->getProducerService();
$producer->setContentType($this->getContentType());
$producer->publish($this->encodeMessageBody($data), $routingKey, $extras);
} | [
"protected",
"function",
"doPublish",
"(",
"$",
"data",
",",
"$",
"routingKey",
"=",
"''",
",",
"$",
"extras",
"=",
"array",
"(",
")",
")",
"{",
"$",
"producer",
"=",
"$",
"this",
"->",
"getProducerService",
"(",
")",
";",
"$",
"producer",
"->",
"set... | Some sugar for subclasses
NB: the "extras" parameter only works as long as our customized class is used instead of Kaliop\QueueingBundle\RabbitMq\Producer
(this happens naturally when this bundle is properly configured, as it is out of the box)
@param mixed $data
@param string $routingKey
@param array $extras | [
"Some",
"sugar",
"for",
"subclasses"
] | 6a4f9b01ef1f5b8e5cdfad78f7c82b35f1007987 | https://github.com/kaliop-uk/kueueingbundle/blob/6a4f9b01ef1f5b8e5cdfad78f7c82b35f1007987/Service/MessageProducer.php#L134-L139 |
233,883 | skrz/meta | gen-src/Skrz/Meta/Fixtures/Protobuf/Meta/ClassWithStringPropertyMeta.php | ClassWithStringPropertyMeta.create | public static function create()
{
switch (func_num_args()) {
case 0:
return new ClassWithStringProperty();
case 1:
return new ClassWithStringProperty(func_get_arg(0));
case 2:
return new ClassWithStringProperty(func_get_arg(0), func_get_arg(1));
case 3:
return new ClassWithStringProperty(... | php | public static function create()
{
switch (func_num_args()) {
case 0:
return new ClassWithStringProperty();
case 1:
return new ClassWithStringProperty(func_get_arg(0));
case 2:
return new ClassWithStringProperty(func_get_arg(0), func_get_arg(1));
case 3:
return new ClassWithStringProperty(... | [
"public",
"static",
"function",
"create",
"(",
")",
"{",
"switch",
"(",
"func_num_args",
"(",
")",
")",
"{",
"case",
"0",
":",
"return",
"new",
"ClassWithStringProperty",
"(",
")",
";",
"case",
"1",
":",
"return",
"new",
"ClassWithStringProperty",
"(",
"fu... | Creates new instance of \Skrz\Meta\Fixtures\Protobuf\ClassWithStringProperty
@throws \InvalidArgumentException
@return ClassWithStringProperty | [
"Creates",
"new",
"instance",
"of",
"\\",
"Skrz",
"\\",
"Meta",
"\\",
"Fixtures",
"\\",
"Protobuf",
"\\",
"ClassWithStringProperty"
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Skrz/Meta/Fixtures/Protobuf/Meta/ClassWithStringPropertyMeta.php#L66-L90 |
233,884 | praxisnetau/silverware-select2 | src/Forms/Select2Field.php | Select2Field.getOptions | public function getOptions()
{
// Create Options List:
$options = ArrayList::create();
// Iterate Source Items:
foreach ($this->getSourceEmpty() as $value => $title) {
$options->push($this->getFieldOption($value, $title));
}
... | php | public function getOptions()
{
// Create Options List:
$options = ArrayList::create();
// Iterate Source Items:
foreach ($this->getSourceEmpty() as $value => $title) {
$options->push($this->getFieldOption($value, $title));
}
... | [
"public",
"function",
"getOptions",
"(",
")",
"{",
"// Create Options List:",
"$",
"options",
"=",
"ArrayList",
"::",
"create",
"(",
")",
";",
"// Iterate Source Items:",
"foreach",
"(",
"$",
"this",
"->",
"getSourceEmpty",
"(",
")",
"as",
"$",
"value",
"=>",
... | Answers an array list containing the options for the field.
@return ArrayList | [
"Answers",
"an",
"array",
"list",
"containing",
"the",
"options",
"for",
"the",
"field",
"."
] | 81f3efe7f40eb87e1390f038c3c9eed415be7bc3 | https://github.com/praxisnetau/silverware-select2/blob/81f3efe7f40eb87e1390f038c3c9eed415be7bc3/src/Forms/Select2Field.php#L121-L162 |
233,885 | praxisnetau/silverware-select2 | src/Forms/Select2Field.php | Select2Field.getAttributes | public function getAttributes()
{
$attributes = array_merge(
parent::getAttributes(),
$this->getDataAttributes()
);
if ($this->isMultiple()) {
$attributes['multiple'] = true;
$attributes['name'] = $this->getMultipleName();
}
... | php | public function getAttributes()
{
$attributes = array_merge(
parent::getAttributes(),
$this->getDataAttributes()
);
if ($this->isMultiple()) {
$attributes['multiple'] = true;
$attributes['name'] = $this->getMultipleName();
}
... | [
"public",
"function",
"getAttributes",
"(",
")",
"{",
"$",
"attributes",
"=",
"array_merge",
"(",
"parent",
"::",
"getAttributes",
"(",
")",
",",
"$",
"this",
"->",
"getDataAttributes",
"(",
")",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isMultiple",
"(",... | Answers an array of HTML attributes for the field.
@return array | [
"Answers",
"an",
"array",
"of",
"HTML",
"attributes",
"for",
"the",
"field",
"."
] | 81f3efe7f40eb87e1390f038c3c9eed415be7bc3 | https://github.com/praxisnetau/silverware-select2/blob/81f3efe7f40eb87e1390f038c3c9eed415be7bc3/src/Forms/Select2Field.php#L260-L277 |
233,886 | praxisnetau/silverware-select2 | src/Forms/Select2Field.php | Select2Field.setValue | public function setValue($value, $data = null)
{
if ($data instanceof DataObject) {
$this->loadFrom($data);
return $this;
}
return parent::setValue($value);
} | php | public function setValue($value, $data = null)
{
if ($data instanceof DataObject) {
$this->loadFrom($data);
return $this;
}
return parent::setValue($value);
} | [
"public",
"function",
"setValue",
"(",
"$",
"value",
",",
"$",
"data",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"data",
"instanceof",
"DataObject",
")",
"{",
"$",
"this",
"->",
"loadFrom",
"(",
"$",
"data",
")",
";",
"return",
"$",
"this",
";",
"}",
... | Defines the value of the field.
@param mixed $value
@param array|DataObject $data
@return $this | [
"Defines",
"the",
"value",
"of",
"the",
"field",
"."
] | 81f3efe7f40eb87e1390f038c3c9eed415be7bc3 | https://github.com/praxisnetau/silverware-select2/blob/81f3efe7f40eb87e1390f038c3c9eed415be7bc3/src/Forms/Select2Field.php#L303-L311 |
233,887 | praxisnetau/silverware-select2 | src/Forms/Select2Field.php | Select2Field.isSelectedValue | public function isSelectedValue($dataValue, $userValue)
{
if (!$this->isMultiple() || !is_array($userValue)) {
return parent::isSelectedValue($dataValue, $userValue);
}
return in_array($dataValue, $userValue);
} | php | public function isSelectedValue($dataValue, $userValue)
{
if (!$this->isMultiple() || !is_array($userValue)) {
return parent::isSelectedValue($dataValue, $userValue);
}
return in_array($dataValue, $userValue);
} | [
"public",
"function",
"isSelectedValue",
"(",
"$",
"dataValue",
",",
"$",
"userValue",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isMultiple",
"(",
")",
"||",
"!",
"is_array",
"(",
"$",
"userValue",
")",
")",
"{",
"return",
"parent",
"::",
"isSelect... | Answers true if the current value of this field matches the given option value.
@param mixed $dataValue
@param mixed $userValue
@return boolean | [
"Answers",
"true",
"if",
"the",
"current",
"value",
"of",
"this",
"field",
"matches",
"the",
"given",
"option",
"value",
"."
] | 81f3efe7f40eb87e1390f038c3c9eed415be7bc3 | https://github.com/praxisnetau/silverware-select2/blob/81f3efe7f40eb87e1390f038c3c9eed415be7bc3/src/Forms/Select2Field.php#L321-L328 |
233,888 | praxisnetau/silverware-select2 | src/Forms/Select2Field.php | Select2Field.loadFrom | public function loadFrom(DataObjectInterface $record)
{
// Obtain Field Name:
$fieldName = $this->getName();
// Bail Early (if needed):
if (empty($fieldName) || empty($record)) {
return;
}
// Determine Value Mode:
... | php | public function loadFrom(DataObjectInterface $record)
{
// Obtain Field Name:
$fieldName = $this->getName();
// Bail Early (if needed):
if (empty($fieldName) || empty($record)) {
return;
}
// Determine Value Mode:
... | [
"public",
"function",
"loadFrom",
"(",
"DataObjectInterface",
"$",
"record",
")",
"{",
"// Obtain Field Name:",
"$",
"fieldName",
"=",
"$",
"this",
"->",
"getName",
"(",
")",
";",
"// Bail Early (if needed):",
"if",
"(",
"empty",
"(",
"$",
"fieldName",
")",
"|... | Loads the value of the field from the given data object.
@param DataObjectInterface $record
@return void | [
"Loads",
"the",
"value",
"of",
"the",
"field",
"from",
"the",
"given",
"data",
"object",
"."
] | 81f3efe7f40eb87e1390f038c3c9eed415be7bc3 | https://github.com/praxisnetau/silverware-select2/blob/81f3efe7f40eb87e1390f038c3c9eed415be7bc3/src/Forms/Select2Field.php#L347-L380 |
233,889 | praxisnetau/silverware-select2 | src/Forms/Select2Field.php | Select2Field.validate | public function validate($validator)
{
// Baily Early (if tags are used):
if ($this->usesTags()) {
return true;
}
// Call Parent Method (if not multiple):
if (!$this->isMultiple()) {
return parent::validate($validator);
... | php | public function validate($validator)
{
// Baily Early (if tags are used):
if ($this->usesTags()) {
return true;
}
// Call Parent Method (if not multiple):
if (!$this->isMultiple()) {
return parent::validate($validator);
... | [
"public",
"function",
"validate",
"(",
"$",
"validator",
")",
"{",
"// Baily Early (if tags are used):",
"if",
"(",
"$",
"this",
"->",
"usesTags",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"// Call Parent Method (if not multiple):",
"if",
"(",
"!",
"$",
... | Performs validation on the receiver.
@param Validator $validator
@return boolean | [
"Performs",
"validation",
"on",
"the",
"receiver",
"."
] | 81f3efe7f40eb87e1390f038c3c9eed415be7bc3 | https://github.com/praxisnetau/silverware-select2/blob/81f3efe7f40eb87e1390f038c3c9eed415be7bc3/src/Forms/Select2Field.php#L455-L510 |
233,890 | praxisnetau/silverware-select2 | src/Forms/Select2Field.php | Select2Field.getDataValue | protected function getDataValue($value)
{
if (is_bool($value)) {
return $value ? 'true' : 'false';
} elseif (is_array($value)) {
return Convert::array2json($value);
} else {
return Convert::raw2att($value);
}
} | php | protected function getDataValue($value)
{
if (is_bool($value)) {
return $value ? 'true' : 'false';
} elseif (is_array($value)) {
return Convert::array2json($value);
} else {
return Convert::raw2att($value);
}
} | [
"protected",
"function",
"getDataValue",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"is_bool",
"(",
"$",
"value",
")",
")",
"{",
"return",
"$",
"value",
"?",
"'true'",
":",
"'false'",
";",
"}",
"elseif",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"... | Converts the given data value to a string suitable for a data attribute.
@param mixed $value
@return string | [
"Converts",
"the",
"given",
"data",
"value",
"to",
"a",
"string",
"suitable",
"for",
"a",
"data",
"attribute",
"."
] | 81f3efe7f40eb87e1390f038c3c9eed415be7bc3 | https://github.com/praxisnetau/silverware-select2/blob/81f3efe7f40eb87e1390f038c3c9eed415be7bc3/src/Forms/Select2Field.php#L543-L552 |
233,891 | praxisnetau/silverware-select2 | src/Forms/Select2Field.php | Select2Field.getNamedRelation | protected function getNamedRelation(DataObjectInterface $record)
{
return $record->hasMethod($this->Name) ? $record->{$this->Name}() : null;
} | php | protected function getNamedRelation(DataObjectInterface $record)
{
return $record->hasMethod($this->Name) ? $record->{$this->Name}() : null;
} | [
"protected",
"function",
"getNamedRelation",
"(",
"DataObjectInterface",
"$",
"record",
")",
"{",
"return",
"$",
"record",
"->",
"hasMethod",
"(",
"$",
"this",
"->",
"Name",
")",
"?",
"$",
"record",
"->",
"{",
"$",
"this",
"->",
"Name",
"}",
"(",
")",
... | Answers the relation with the field name from the given data object.
@param DataObjectInterface $record
@return Relation | [
"Answers",
"the",
"relation",
"with",
"the",
"field",
"name",
"from",
"the",
"given",
"data",
"object",
"."
] | 81f3efe7f40eb87e1390f038c3c9eed415be7bc3 | https://github.com/praxisnetau/silverware-select2/blob/81f3efe7f40eb87e1390f038c3c9eed415be7bc3/src/Forms/Select2Field.php#L577-L580 |
233,892 | budde377/Part | lib/util/traits/EncryptionTrait.php | EncryptionTrait.encrypt | protected function encrypt($string, $key){
return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $string, MCRYPT_MODE_CBC, md5(md5($key))));
} | php | protected function encrypt($string, $key){
return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $string, MCRYPT_MODE_CBC, md5(md5($key))));
} | [
"protected",
"function",
"encrypt",
"(",
"$",
"string",
",",
"$",
"key",
")",
"{",
"return",
"base64_encode",
"(",
"mcrypt_encrypt",
"(",
"MCRYPT_RIJNDAEL_256",
",",
"md5",
"(",
"$",
"key",
")",
",",
"$",
"string",
",",
"MCRYPT_MODE_CBC",
",",
"md5",
"(",
... | Will encrypt string and return encrypted string.
The encryption will be an two-way function, so not as secure as could be,
but secure enough to hide passwords in database, and is highly encouraged to be used to that.
@param string $string
@param string $key
@return string | [
"Will",
"encrypt",
"string",
"and",
"return",
"encrypted",
"string",
".",
"The",
"encryption",
"will",
"be",
"an",
"two",
"-",
"way",
"function",
"so",
"not",
"as",
"secure",
"as",
"could",
"be",
"but",
"secure",
"enough",
"to",
"hide",
"passwords",
"in",
... | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/util/traits/EncryptionTrait.php#L20-L22 |
233,893 | kaliop-uk/kueueingbundle | Adapter/DriverManager.php | DriverManager.getDrivers | public function getDrivers()
{
$drivers = array();
foreach($this->aliases as $alias => $service) {
$drivers[$alias] = $this->container->get($service);
}
return $drivers;
} | php | public function getDrivers()
{
$drivers = array();
foreach($this->aliases as $alias => $service) {
$drivers[$alias] = $this->container->get($service);
}
return $drivers;
} | [
"public",
"function",
"getDrivers",
"(",
")",
"{",
"$",
"drivers",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"aliases",
"as",
"$",
"alias",
"=>",
"$",
"service",
")",
"{",
"$",
"drivers",
"[",
"$",
"alias",
"]",
"=",
"$",
"t... | returns all drivers
@return array key is alias, value is the service | [
"returns",
"all",
"drivers"
] | 6a4f9b01ef1f5b8e5cdfad78f7c82b35f1007987 | https://github.com/kaliop-uk/kueueingbundle/blob/6a4f9b01ef1f5b8e5cdfad78f7c82b35f1007987/Adapter/DriverManager.php#L84-L91 |
233,894 | amphp/http-server-session | src/Session.php | Session.regenerate | public function regenerate(): Promise
{
return $this->pending = call(function () {
if ($this->pending) {
yield $this->pending;
}
if ($this->id === null || !$this->isLocked()) {
throw new \Error('Cannot save an unlocked session');
... | php | public function regenerate(): Promise
{
return $this->pending = call(function () {
if ($this->pending) {
yield $this->pending;
}
if ($this->id === null || !$this->isLocked()) {
throw new \Error('Cannot save an unlocked session');
... | [
"public",
"function",
"regenerate",
"(",
")",
":",
"Promise",
"{",
"return",
"$",
"this",
"->",
"pending",
"=",
"call",
"(",
"function",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"pending",
")",
"{",
"yield",
"$",
"this",
"->",
"pending",
";",
"... | Regenerates a session identifier and locks the session.
@return Promise Resolving with the new session identifier. | [
"Regenerates",
"a",
"session",
"identifier",
"and",
"locks",
"the",
"session",
"."
] | c9117a378637d170d4dc4333b9a1e646fbbd03e7 | https://github.com/amphp/http-server-session/blob/c9117a378637d170d4dc4333b9a1e646fbbd03e7/src/Session.php#L84-L105 |
233,895 | amphp/http-server-session | src/Session.php | Session.open | public function open(): Promise
{
return $this->pending = call(function () {
if ($this->pending) {
yield $this->pending;
}
if ($this->id === null) {
$this->id = yield $this->storage->create();
} else {
$this->da... | php | public function open(): Promise
{
return $this->pending = call(function () {
if ($this->pending) {
yield $this->pending;
}
if ($this->id === null) {
$this->id = yield $this->storage->create();
} else {
$this->da... | [
"public",
"function",
"open",
"(",
")",
":",
"Promise",
"{",
"return",
"$",
"this",
"->",
"pending",
"=",
"call",
"(",
"function",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"pending",
")",
"{",
"yield",
"$",
"this",
"->",
"pending",
";",
"}",
... | Opens the session for writing.
@return Promise Resolved with the session. | [
"Opens",
"the",
"session",
"for",
"writing",
"."
] | c9117a378637d170d4dc4333b9a1e646fbbd03e7 | https://github.com/amphp/http-server-session/blob/c9117a378637d170d4dc4333b9a1e646fbbd03e7/src/Session.php#L134-L153 |
233,896 | amphp/http-server-session | src/Session.php | Session.save | public function save(): Promise
{
return $this->pending = call(function () {
if ($this->pending) {
yield $this->pending;
}
if (!$this->isLocked()) {
throw new \Error('Cannot save an unlocked session');
}
if ($this-... | php | public function save(): Promise
{
return $this->pending = call(function () {
if ($this->pending) {
yield $this->pending;
}
if (!$this->isLocked()) {
throw new \Error('Cannot save an unlocked session');
}
if ($this-... | [
"public",
"function",
"save",
"(",
")",
":",
"Promise",
"{",
"return",
"$",
"this",
"->",
"pending",
"=",
"call",
"(",
"function",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"pending",
")",
"{",
"yield",
"$",
"this",
"->",
"pending",
";",
"}",
... | Saves the given data in the session.
The session must be locked with either open() before calling this method.
@return Promise | [
"Saves",
"the",
"given",
"data",
"in",
"the",
"session",
"."
] | c9117a378637d170d4dc4333b9a1e646fbbd03e7 | https://github.com/amphp/http-server-session/blob/c9117a378637d170d4dc4333b9a1e646fbbd03e7/src/Session.php#L162-L190 |
233,897 | amphp/http-server-session | src/Session.php | Session.unlock | public function unlock(): Promise
{
return $this->pending = call(function () {
if ($this->pending) {
yield $this->pending;
}
if (!$this->isLocked()) {
return;
}
if ($this->openCount === 1) {
yield $... | php | public function unlock(): Promise
{
return $this->pending = call(function () {
if ($this->pending) {
yield $this->pending;
}
if (!$this->isLocked()) {
return;
}
if ($this->openCount === 1) {
yield $... | [
"public",
"function",
"unlock",
"(",
")",
":",
"Promise",
"{",
"return",
"$",
"this",
"->",
"pending",
"=",
"call",
"(",
"function",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"pending",
")",
"{",
"yield",
"$",
"this",
"->",
"pending",
";",
"}",
... | Unlocks the session.
@return Promise | [
"Unlocks",
"the",
"session",
"."
] | c9117a378637d170d4dc4333b9a1e646fbbd03e7 | https://github.com/amphp/http-server-session/blob/c9117a378637d170d4dc4333b9a1e646fbbd03e7/src/Session.php#L213-L231 |
233,898 | baleen/migrations | src/Delta/Comparator/NamespacesAwareComparator.php | NamespacesAwareComparator.compareNamespaces | private function compareNamespaces($class1, $class2)
{
$res = null;
// loop from highest namespace priority to lowest
foreach ($this->namespaces as $namespace) {
if (strpos($class1, $namespace) === 0) {
$res = 1;
}
if (strpos($class2, $name... | php | private function compareNamespaces($class1, $class2)
{
$res = null;
// loop from highest namespace priority to lowest
foreach ($this->namespaces as $namespace) {
if (strpos($class1, $namespace) === 0) {
$res = 1;
}
if (strpos($class2, $name... | [
"private",
"function",
"compareNamespaces",
"(",
"$",
"class1",
",",
"$",
"class2",
")",
"{",
"$",
"res",
"=",
"null",
";",
"// loop from highest namespace priority to lowest",
"foreach",
"(",
"$",
"this",
"->",
"namespaces",
"as",
"$",
"namespace",
")",
"{",
... | Compare using namespaces
@param $class1
@param $class2
@return int|null | [
"Compare",
"using",
"namespaces"
] | cfc8c439858cf4f0d4119af9eb67de493da8d95c | https://github.com/baleen/migrations/blob/cfc8c439858cf4f0d4119af9eb67de493da8d95c/src/Delta/Comparator/NamespacesAwareComparator.php#L120-L137 |
233,899 | meare/juggler | src/Imposter/Builder/AbstractImposterBuilder.php | AbstractImposterBuilder.build | public function build($json)
{
$contract = \GuzzleHttp\json_decode($json, true);
if (!isset($contract['protocol'])) {
throw new \InvalidArgumentException('Invalid contract; Protocol is not specified');
}
return $this->getBuilder($contract['protocol'])->build($contract);
... | php | public function build($json)
{
$contract = \GuzzleHttp\json_decode($json, true);
if (!isset($contract['protocol'])) {
throw new \InvalidArgumentException('Invalid contract; Protocol is not specified');
}
return $this->getBuilder($contract['protocol'])->build($contract);
... | [
"public",
"function",
"build",
"(",
"$",
"json",
")",
"{",
"$",
"contract",
"=",
"\\",
"GuzzleHttp",
"\\",
"json_decode",
"(",
"$",
"json",
",",
"true",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"contract",
"[",
"'protocol'",
"]",
")",
")",
"{",... | Builds Imposter object from JSON contract using appropriate Builder
@param string $json
@return \Meare\Juggler\Imposter\Imposter
@throws \InvalidArgumentException if contract has no protocol or no appropriate Builder found | [
"Builds",
"Imposter",
"object",
"from",
"JSON",
"contract",
"using",
"appropriate",
"Builder"
] | 11ec398c16e01c986679f53f8ece2c1e97ba4e29 | https://github.com/meare/juggler/blob/11ec398c16e01c986679f53f8ece2c1e97ba4e29/src/Imposter/Builder/AbstractImposterBuilder.php#L23-L31 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.