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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
239,000 | BapCat/Services | src/ServiceContainer.php | ServiceContainer.boot | public function boot(): void {
if(count($this->queue) !== 0) {
throw new ServiceDependenciesNotRegisteredException($this->queue);
}
foreach($this->services as $service) {
$service->boot();
}
} | php | public function boot(): void {
if(count($this->queue) !== 0) {
throw new ServiceDependenciesNotRegisteredException($this->queue);
}
foreach($this->services as $service) {
$service->boot();
}
} | [
"public",
"function",
"boot",
"(",
")",
":",
"void",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"queue",
")",
"!==",
"0",
")",
"{",
"throw",
"new",
"ServiceDependenciesNotRegisteredException",
"(",
"$",
"this",
"->",
"queue",
")",
";",
"}",
"fore... | Boot all Service Providers
@throws ServiceDependenciesNotRegisteredException If any service provider's dependencies have not been registered | [
"Boot",
"all",
"Service",
"Providers"
] | 7318092a316f8f8f2ce9f09598fb5e750119dd30 | https://github.com/BapCat/Services/blob/7318092a316f8f8f2ce9f09598fb5e750119dd30/src/ServiceContainer.php#L94-L102 |
239,001 | thecmsthread/core-admin | src/Controller/Auth.php | Auth.handleLogin | public function handleLogin(array $request = [])
{
$validator = new \Valitron\Validator($request);
$validator->rule('required', ['username', 'password']);
$validator->rule(function ($field, $value, array $params, array $fields) {
return is_string($value);
}, ['username', ... | php | public function handleLogin(array $request = [])
{
$validator = new \Valitron\Validator($request);
$validator->rule('required', ['username', 'password']);
$validator->rule(function ($field, $value, array $params, array $fields) {
return is_string($value);
}, ['username', ... | [
"public",
"function",
"handleLogin",
"(",
"array",
"$",
"request",
"=",
"[",
"]",
")",
"{",
"$",
"validator",
"=",
"new",
"\\",
"Valitron",
"\\",
"Validator",
"(",
"$",
"request",
")",
";",
"$",
"validator",
"->",
"rule",
"(",
"'required'",
",",
"[",
... | Handle the login page submission | [
"Handle",
"the",
"login",
"page",
"submission"
] | 020595646e2dd521683e5352e6d9dbad420c06fb | https://github.com/thecmsthread/core-admin/blob/020595646e2dd521683e5352e6d9dbad420c06fb/src/Controller/Auth.php#L147-L198 |
239,002 | thecmsthread/core-admin | src/Controller/Auth.php | Auth.handleRegister | public function handleRegister(array $request = [])
{
$validator = new \Valitron\Validator($request);
$validator->rule('required', ['username', 'password', 'confirm_password']);
$validator->rule(function ($field, $value, array $params, array $fields) {
return is_string($value);
... | php | public function handleRegister(array $request = [])
{
$validator = new \Valitron\Validator($request);
$validator->rule('required', ['username', 'password', 'confirm_password']);
$validator->rule(function ($field, $value, array $params, array $fields) {
return is_string($value);
... | [
"public",
"function",
"handleRegister",
"(",
"array",
"$",
"request",
"=",
"[",
"]",
")",
"{",
"$",
"validator",
"=",
"new",
"\\",
"Valitron",
"\\",
"Validator",
"(",
"$",
"request",
")",
";",
"$",
"validator",
"->",
"rule",
"(",
"'required'",
",",
"["... | Handle the registration page submission | [
"Handle",
"the",
"registration",
"page",
"submission"
] | 020595646e2dd521683e5352e6d9dbad420c06fb | https://github.com/thecmsthread/core-admin/blob/020595646e2dd521683e5352e6d9dbad420c06fb/src/Controller/Auth.php#L219-L272 |
239,003 | thecmsthread/core-admin | src/Controller/Auth.php | Auth.handleForgot | public function handleForgot(array $request = [])
{
$validator = new \Valitron\Validator($request);
$validator->rule('required', 'email');
$validator->rule('email', 'email');
if ($validator->validate() === false) {
if (headers_sent() === false) {
header('X... | php | public function handleForgot(array $request = [])
{
$validator = new \Valitron\Validator($request);
$validator->rule('required', 'email');
$validator->rule('email', 'email');
if ($validator->validate() === false) {
if (headers_sent() === false) {
header('X... | [
"public",
"function",
"handleForgot",
"(",
"array",
"$",
"request",
"=",
"[",
"]",
")",
"{",
"$",
"validator",
"=",
"new",
"\\",
"Valitron",
"\\",
"Validator",
"(",
"$",
"request",
")",
";",
"$",
"validator",
"->",
"rule",
"(",
"'required'",
",",
"'ema... | Handle the forgot password page submission | [
"Handle",
"the",
"forgot",
"password",
"page",
"submission"
] | 020595646e2dd521683e5352e6d9dbad420c06fb | https://github.com/thecmsthread/core-admin/blob/020595646e2dd521683e5352e6d9dbad420c06fb/src/Controller/Auth.php#L292-L340 |
239,004 | thecmsthread/core-admin | src/Controller/Auth.php | Auth.showReset | public function showReset(string $reset_code = null)
{
if ($reset_code === null) {
if (isset($_GET['template']) === false) {
return redirect($this->router->generate('login-page') . "?m=3");
} else {
return 'Redirect: ' . $this->router->generate('login-... | php | public function showReset(string $reset_code = null)
{
if ($reset_code === null) {
if (isset($_GET['template']) === false) {
return redirect($this->router->generate('login-page') . "?m=3");
} else {
return 'Redirect: ' . $this->router->generate('login-... | [
"public",
"function",
"showReset",
"(",
"string",
"$",
"reset_code",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"reset_code",
"===",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_GET",
"[",
"'template'",
"]",
")",
"===",
"false",
")",
"{",
"return",
... | Show the password reset page | [
"Show",
"the",
"password",
"reset",
"page"
] | 020595646e2dd521683e5352e6d9dbad420c06fb | https://github.com/thecmsthread/core-admin/blob/020595646e2dd521683e5352e6d9dbad420c06fb/src/Controller/Auth.php#L345-L371 |
239,005 | TAMULib/Pipit | Core/Classes/Data/DBObject.php | DBObject.executeUpdate | protected function executeUpdate($sql,$bindparams=NULL) {
$result = $this->db->handle->prepare($sql);
$result->execute($bindparams);
if ($result->errorCode() == '00000') {
return true;
}
$this->logStatementError($result->errorInfo(),$sql);
return false;
} | php | protected function executeUpdate($sql,$bindparams=NULL) {
$result = $this->db->handle->prepare($sql);
$result->execute($bindparams);
if ($result->errorCode() == '00000') {
return true;
}
$this->logStatementError($result->errorInfo(),$sql);
return false;
} | [
"protected",
"function",
"executeUpdate",
"(",
"$",
"sql",
",",
"$",
"bindparams",
"=",
"NULL",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"db",
"->",
"handle",
"->",
"prepare",
"(",
"$",
"sql",
")",
";",
"$",
"result",
"->",
"execute",
"(",
... | Execute an update query
@param string $sql The SQL query
@param mixed[] $bindparams An array of values to be binded by PDO to any query parameters
@return boolean True on success, false on anything else | [
"Execute",
"an",
"update",
"query"
] | dcf90237d9ad8b4ebf47662daa3e8b419ef177ed | https://github.com/TAMULib/Pipit/blob/dcf90237d9ad8b4ebf47662daa3e8b419ef177ed/Core/Classes/Data/DBObject.php#L110-L118 |
239,006 | TAMULib/Pipit | Core/Classes/Data/DBObject.php | DBObject.queryWithIndex | protected function queryWithIndex($sql,$index,$findex=NULL,$bindparams=NULL) {
if ($result = $this->executeQuery($sql,$bindparams)) {
$temp = array();
if ($findex) {
foreach ($result as $row) {
$temp[$row[$findex]][$row[$index]] = $row;
}
} else {
foreach ($result as $row) {
$temp[$row[... | php | protected function queryWithIndex($sql,$index,$findex=NULL,$bindparams=NULL) {
if ($result = $this->executeQuery($sql,$bindparams)) {
$temp = array();
if ($findex) {
foreach ($result as $row) {
$temp[$row[$findex]][$row[$index]] = $row;
}
} else {
foreach ($result as $row) {
$temp[$row[... | [
"protected",
"function",
"queryWithIndex",
"(",
"$",
"sql",
",",
"$",
"index",
",",
"$",
"findex",
"=",
"NULL",
",",
"$",
"bindparams",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"result",
"=",
"$",
"this",
"->",
"executeQuery",
"(",
"$",
"sql",
",",
"... | Query the DB and return the rows as a 1 or 2 dimensional indexed array
@param string $sql The query string
@param string $index The table's primary key
@param string $findex An optional foreign key from the table (when used, returns a 2 dimensional array, indexed first by $index, second by $findex)
@param mixed[] $bind... | [
"Query",
"the",
"DB",
"and",
"return",
"the",
"rows",
"as",
"a",
"1",
"or",
"2",
"dimensional",
"indexed",
"array"
] | dcf90237d9ad8b4ebf47662daa3e8b419ef177ed | https://github.com/TAMULib/Pipit/blob/dcf90237d9ad8b4ebf47662daa3e8b419ef177ed/Core/Classes/Data/DBObject.php#L138-L153 |
239,007 | TAMULib/Pipit | Core/Classes/Data/DBObject.php | DBObject.buildIn | protected function buildIn($ar,&$bindparams,$varprefix = 'v') {
$x=1;
foreach ($ar as $value) {
$sql .= ":{$varprefix}{$x},";
$bindparams[":{$varprefix}{$x}"] = $value;
$x++;
}
return 'IN ('.rtrim($sql,',').')';
} | php | protected function buildIn($ar,&$bindparams,$varprefix = 'v') {
$x=1;
foreach ($ar as $value) {
$sql .= ":{$varprefix}{$x},";
$bindparams[":{$varprefix}{$x}"] = $value;
$x++;
}
return 'IN ('.rtrim($sql,',').')';
} | [
"protected",
"function",
"buildIn",
"(",
"$",
"ar",
",",
"&",
"$",
"bindparams",
",",
"$",
"varprefix",
"=",
"'v'",
")",
"{",
"$",
"x",
"=",
"1",
";",
"foreach",
"(",
"$",
"ar",
"as",
"$",
"value",
")",
"{",
"$",
"sql",
".=",
"\":{$varprefix}{$x},\... | Returns a parametrized IN clause for use in a prepared statement
@param mixed[] $ar An array of values representing the contents of the IN clause
@param mixed[] $bindparams A reference to the caller's array of binded parameters
@param string $varprefix Can be used to avoid bind parameter naming collisions when calling ... | [
"Returns",
"a",
"parametrized",
"IN",
"clause",
"for",
"use",
"in",
"a",
"prepared",
"statement"
] | dcf90237d9ad8b4ebf47662daa3e8b419ef177ed | https://github.com/TAMULib/Pipit/blob/dcf90237d9ad8b4ebf47662daa3e8b419ef177ed/Core/Classes/Data/DBObject.php#L178-L186 |
239,008 | TAMULib/Pipit | Core/Classes/Data/DBObject.php | DBObject.buildInsertStatement | protected function buildInsertStatement($data,$table=null) {
if (!$table) {
$table = $this->primaryTable;
}
$bindparams = array();
$sql_fields = NULL;
$sql_values = NULL;
foreach ($data as $field=>$value) {
$sql_fields .= "{$field},";
$sql_values .= ":{$field},";
$bindparams[":{$field}"] = $valu... | php | protected function buildInsertStatement($data,$table=null) {
if (!$table) {
$table = $this->primaryTable;
}
$bindparams = array();
$sql_fields = NULL;
$sql_values = NULL;
foreach ($data as $field=>$value) {
$sql_fields .= "{$field},";
$sql_values .= ":{$field},";
$bindparams[":{$field}"] = $valu... | [
"protected",
"function",
"buildInsertStatement",
"(",
"$",
"data",
",",
"$",
"table",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"table",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"primaryTable",
";",
"}",
"$",
"bindparams",
"=",
"array",
"(",... | Builds and executes an insert statement
@param mixed[] $data An associative array (ColumnName->Value) of data representing the new DB record
@param string $table Optional - The table to insert the new record into. Defaults to $primaryTable
@return int/false Returns the ID of the new record on success, false on failure | [
"Builds",
"and",
"executes",
"an",
"insert",
"statement"
] | dcf90237d9ad8b4ebf47662daa3e8b419ef177ed | https://github.com/TAMULib/Pipit/blob/dcf90237d9ad8b4ebf47662daa3e8b419ef177ed/Core/Classes/Data/DBObject.php#L194-L213 |
239,009 | TAMULib/Pipit | Core/Classes/Data/DBObject.php | DBObject.buildMultiRowInsertStatement | protected function buildMultiRowInsertStatement($rows,$table=null) {
if (!$table) {
$table = $this->primaryTable;
}
$bindparams = array();
$sqlRows = NULL;
$sqlFields = implode(',',array_keys(current($rows)));
$x = 1;
foreach ($rows as $data) {
$sqlValues = NULL;
foreach ($data as $field=>$value)... | php | protected function buildMultiRowInsertStatement($rows,$table=null) {
if (!$table) {
$table = $this->primaryTable;
}
$bindparams = array();
$sqlRows = NULL;
$sqlFields = implode(',',array_keys(current($rows)));
$x = 1;
foreach ($rows as $data) {
$sqlValues = NULL;
foreach ($data as $field=>$value)... | [
"protected",
"function",
"buildMultiRowInsertStatement",
"(",
"$",
"rows",
",",
"$",
"table",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"table",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"primaryTable",
";",
"}",
"$",
"bindparams",
"=",
"array"... | Builds and executes a single insert statement that inserts multiple new records
@param mixed[][] $rows An array of associative arrays (ColumnName->Value) of data representing the new DB records
@param string $table Optional - The table to insert the new records into. Defaults to $primaryTable
@return boolean True on su... | [
"Builds",
"and",
"executes",
"a",
"single",
"insert",
"statement",
"that",
"inserts",
"multiple",
"new",
"records"
] | dcf90237d9ad8b4ebf47662daa3e8b419ef177ed | https://github.com/TAMULib/Pipit/blob/dcf90237d9ad8b4ebf47662daa3e8b419ef177ed/Core/Classes/Data/DBObject.php#L221-L241 |
239,010 | TAMULib/Pipit | Core/Classes/Data/DBObject.php | DBObject.buildUpdateStatement | protected function buildUpdateStatement($id,$data,$table=null) {
if (!$table) {
$table = $this->primaryTable;
}
$sql = "UPDATE {$table} SET ";
foreach ($data as $field=>$value) {
$sql .= "{$field}=:{$field},";
$bindparams[":{$field}"] = $value;
}
$sql = rtrim($sql,',')." WHERE id=:id";
$bindpa... | php | protected function buildUpdateStatement($id,$data,$table=null) {
if (!$table) {
$table = $this->primaryTable;
}
$sql = "UPDATE {$table} SET ";
foreach ($data as $field=>$value) {
$sql .= "{$field}=:{$field},";
$bindparams[":{$field}"] = $value;
}
$sql = rtrim($sql,',')." WHERE id=:id";
$bindpa... | [
"protected",
"function",
"buildUpdateStatement",
"(",
"$",
"id",
",",
"$",
"data",
",",
"$",
"table",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"table",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"primaryTable",
";",
"}",
"$",
"sql",
"=",
... | Builds and executes an update statement
@param int $id The id of the record to be updated
@param mixed[] $data An associative array (ColumnName->Value) of data representing the updated data
@param string $table Optional - The table to insert the new record into. Defaults to $primaryTable
@return boolean True on success... | [
"Builds",
"and",
"executes",
"an",
"update",
"statement"
] | dcf90237d9ad8b4ebf47662daa3e8b419ef177ed | https://github.com/TAMULib/Pipit/blob/dcf90237d9ad8b4ebf47662daa3e8b419ef177ed/Core/Classes/Data/DBObject.php#L250-L266 |
239,011 | TAMULib/Pipit | Core/Classes/Data/DBObject.php | DBObject.logStatementError | protected function logStatementError($error,$sql=null) {
if (!empty($GLOBALS['config']['DB_DEBUG'])) {
$message = "Error with query - CODE: {$error[1]}";
if ($sql) {
$message .= " QUERY: {$sql}";
}
$this->getLogger()->error($message);
}
} | php | protected function logStatementError($error,$sql=null) {
if (!empty($GLOBALS['config']['DB_DEBUG'])) {
$message = "Error with query - CODE: {$error[1]}";
if ($sql) {
$message .= " QUERY: {$sql}";
}
$this->getLogger()->error($message);
}
} | [
"protected",
"function",
"logStatementError",
"(",
"$",
"error",
",",
"$",
"sql",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"GLOBALS",
"[",
"'config'",
"]",
"[",
"'DB_DEBUG'",
"]",
")",
")",
"{",
"$",
"message",
"=",
"\"Error with query... | Logs SQL errors to the logger
@param array $error A PDO::errorInfo() error
@param string $sql The SQL query that triggered the error | [
"Logs",
"SQL",
"errors",
"to",
"the",
"logger"
] | dcf90237d9ad8b4ebf47662daa3e8b419ef177ed | https://github.com/TAMULib/Pipit/blob/dcf90237d9ad8b4ebf47662daa3e8b419ef177ed/Core/Classes/Data/DBObject.php#L273-L281 |
239,012 | themichaelhall/bluemvc-core | src/Base/AbstractResponse.php | AbstractResponse.setCookieValue | public function setCookieValue(string $name, string $value, ?\DateTimeInterface $expiry = null, ?UrlPathInterface $path = null, ?HostInterface $domain = null, bool $isSecure = false, bool $isHttpOnly = false): void
{
$this->cookies->set($name, new ResponseCookie($value, $expiry, $path, $domain, $isSecure, $... | php | public function setCookieValue(string $name, string $value, ?\DateTimeInterface $expiry = null, ?UrlPathInterface $path = null, ?HostInterface $domain = null, bool $isSecure = false, bool $isHttpOnly = false): void
{
$this->cookies->set($name, new ResponseCookie($value, $expiry, $path, $domain, $isSecure, $... | [
"public",
"function",
"setCookieValue",
"(",
"string",
"$",
"name",
",",
"string",
"$",
"value",
",",
"?",
"\\",
"DateTimeInterface",
"$",
"expiry",
"=",
"null",
",",
"?",
"UrlPathInterface",
"$",
"path",
"=",
"null",
",",
"?",
"HostInterface",
"$",
"domai... | Sets a cookie value.
@since 1.1.0
@param string $name The name.
@param string $value The value.
@param \DateTimeInterface|null $expiry The expiry time or null if no expiry time.
@param UrlPathInterface|null $path The path or null if no path.
@param HostInterfac... | [
"Sets",
"a",
"cookie",
"value",
"."
] | cbc8ccf8ed4f15ec6105837b29c2bd3db3f93680 | https://github.com/themichaelhall/bluemvc-core/blob/cbc8ccf8ed4f15ec6105837b29c2bd3db3f93680/src/Base/AbstractResponse.php#L172-L175 |
239,013 | themichaelhall/bluemvc-core | src/Base/AbstractResponse.php | AbstractResponse.setExpiry | public function setExpiry(?\DateTimeImmutable $expiry = null): void
{
$date = new \DateTimeImmutable();
$expiry = $expiry ?: $date;
$this->setHeader('Date', $date->setTimezone(new \DateTimeZone('UTC'))->format('D, d M Y H:i:s \G\M\T'));
$this->setHeader('Expires', $expiry->setTimezo... | php | public function setExpiry(?\DateTimeImmutable $expiry = null): void
{
$date = new \DateTimeImmutable();
$expiry = $expiry ?: $date;
$this->setHeader('Date', $date->setTimezone(new \DateTimeZone('UTC'))->format('D, d M Y H:i:s \G\M\T'));
$this->setHeader('Expires', $expiry->setTimezo... | [
"public",
"function",
"setExpiry",
"(",
"?",
"\\",
"DateTimeImmutable",
"$",
"expiry",
"=",
"null",
")",
":",
"void",
"{",
"$",
"date",
"=",
"new",
"\\",
"DateTimeImmutable",
"(",
")",
";",
"$",
"expiry",
"=",
"$",
"expiry",
"?",
":",
"$",
"date",
";... | Sets the expiry time.
@since 1.0.0
@param \DateTimeImmutable|null $expiry The expiry time or null for immediate expiry. | [
"Sets",
"the",
"expiry",
"time",
"."
] | cbc8ccf8ed4f15ec6105837b29c2bd3db3f93680 | https://github.com/themichaelhall/bluemvc-core/blob/cbc8ccf8ed4f15ec6105837b29c2bd3db3f93680/src/Base/AbstractResponse.php#L184-L200 |
239,014 | tarsana/filesystem | src/Resource/Buffer.php | Buffer.readUntil | public function readUntil($end)
{
if (empty($end)) {
throw new ResourceException("Empty string given to Reader::readUntil()");
}
fseek($this->resource, $this->readPosition);
// Reading the first character (maybe blocking)
$buffer = stream_get_contents($this->resou... | php | public function readUntil($end)
{
if (empty($end)) {
throw new ResourceException("Empty string given to Reader::readUntil()");
}
fseek($this->resource, $this->readPosition);
// Reading the first character (maybe blocking)
$buffer = stream_get_contents($this->resou... | [
"public",
"function",
"readUntil",
"(",
"$",
"end",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"end",
")",
")",
"{",
"throw",
"new",
"ResourceException",
"(",
"\"Empty string given to Reader::readUntil()\"",
")",
";",
"}",
"fseek",
"(",
"$",
"this",
"->",
"re... | Reads until the given string or the end of contents.
Returns the read string without the ending string.
@param string $end
@return string
@throws ResourceException if the given $end is empty | [
"Reads",
"until",
"the",
"given",
"string",
"or",
"the",
"end",
"of",
"contents",
".",
"Returns",
"the",
"read",
"string",
"without",
"the",
"ending",
"string",
"."
] | db6c8f040af38dfb01066e382645aff6c72530fa | https://github.com/tarsana/filesystem/blob/db6c8f040af38dfb01066e382645aff6c72530fa/src/Resource/Buffer.php#L78-L102 |
239,015 | tarsana/filesystem | src/Resource/Buffer.php | Buffer.write | public function write($content)
{
fseek($this->resource, $this->writePosition);
if(false === fwrite($this->resource, $content))
throw new ResourceException("Unable to write content to resource");
$this->writePosition = ftell($this->resource);
return $this;
} | php | public function write($content)
{
fseek($this->resource, $this->writePosition);
if(false === fwrite($this->resource, $content))
throw new ResourceException("Unable to write content to resource");
$this->writePosition = ftell($this->resource);
return $this;
} | [
"public",
"function",
"write",
"(",
"$",
"content",
")",
"{",
"fseek",
"(",
"$",
"this",
"->",
"resource",
",",
"$",
"this",
"->",
"writePosition",
")",
";",
"if",
"(",
"false",
"===",
"fwrite",
"(",
"$",
"this",
"->",
"resource",
",",
"$",
"content"... | Writes content.
@return self | [
"Writes",
"content",
"."
] | db6c8f040af38dfb01066e382645aff6c72530fa | https://github.com/tarsana/filesystem/blob/db6c8f040af38dfb01066e382645aff6c72530fa/src/Resource/Buffer.php#L109-L116 |
239,016 | PublisherHub/Publisher | src/Publisher/Manager/Publisher.php | Publisher.initialiseMonitoring | protected function initialiseMonitoring()
{
for ($i = 0; $i < count($this->entries); $i++) {
$this->monitor->monitor($this->entries[$i]['entry']);
}
} | php | protected function initialiseMonitoring()
{
for ($i = 0; $i < count($this->entries); $i++) {
$this->monitor->monitor($this->entries[$i]['entry']);
}
} | [
"protected",
"function",
"initialiseMonitoring",
"(",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"count",
"(",
"$",
"this",
"->",
"entries",
")",
";",
"$",
"i",
"++",
")",
"{",
"$",
"this",
"->",
"monitor",
"->",
"monitor",
"("... | Registers all entries at the monitor as 'not executed'.
@return void | [
"Registers",
"all",
"entries",
"at",
"the",
"monitor",
"as",
"not",
"executed",
"."
] | 954e05118be9956e0c8631e44958af4ba42606b3 | https://github.com/PublisherHub/Publisher/blob/954e05118be9956e0c8631e44958af4ba42606b3/src/Publisher/Manager/Publisher.php#L112-L117 |
239,017 | PublisherHub/Publisher | src/Publisher/Manager/Publisher.php | Publisher.publishEntry | protected function publishEntry(
string $entryId,
array $parameters,
array $content
) {
$entry = $this->entryFactory->getEntry($entryId, $parameters);
$entry->setBody($content);
$response = $this->publish($entry);
$t... | php | protected function publishEntry(
string $entryId,
array $parameters,
array $content
) {
$entry = $this->entryFactory->getEntry($entryId, $parameters);
$entry->setBody($content);
$response = $this->publish($entry);
$t... | [
"protected",
"function",
"publishEntry",
"(",
"string",
"$",
"entryId",
",",
"array",
"$",
"parameters",
",",
"array",
"$",
"content",
")",
"{",
"$",
"entry",
"=",
"$",
"this",
"->",
"entryFactory",
"->",
"getEntry",
"(",
"$",
"entryId",
",",
"$",
"param... | Creates the entry, gets the request, executes it
and sets the status of the request as successful or failed.
@return void; | [
"Creates",
"the",
"entry",
"gets",
"the",
"request",
"executes",
"it",
"and",
"sets",
"the",
"status",
"of",
"the",
"request",
"as",
"successful",
"or",
"failed",
"."
] | 954e05118be9956e0c8631e44958af4ba42606b3 | https://github.com/PublisherHub/Publisher/blob/954e05118be9956e0c8631e44958af4ba42606b3/src/Publisher/Manager/Publisher.php#L125-L136 |
239,018 | wp-pluginner/framework | src/Support/PluginOptions.php | PluginOptions.update | public function update( $options = [] )
{
if ( is_null( $this->row ) ) {
return $this->reset();
}
$mergeOptions = array_replace_recursive( $this->_value, $options );
$result = WpOption::updateOrCreate(
['option_name' => $this->optionsName],
['op... | php | public function update( $options = [] )
{
if ( is_null( $this->row ) ) {
return $this->reset();
}
$mergeOptions = array_replace_recursive( $this->_value, $options );
$result = WpOption::updateOrCreate(
['option_name' => $this->optionsName],
['op... | [
"public",
"function",
"update",
"(",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"row",
")",
")",
"{",
"return",
"$",
"this",
"->",
"reset",
"(",
")",
";",
"}",
"$",
"mergeOptions",
"=",
"array_replace_rec... | Update a branch of options.
@param array $options
@return false|int | [
"Update",
"a",
"branch",
"of",
"options",
"."
] | 557d62674acf6ca43b2523f8d4a0aa0dbf8e674d | https://github.com/wp-pluginner/framework/blob/557d62674acf6ca43b2523f8d4a0aa0dbf8e674d/src/Support/PluginOptions.php#L215-L234 |
239,019 | wp-pluginner/framework | src/Support/PluginOptions.php | PluginOptions.delta | public function delta()
{
$mergeOptions = $this->__delta( $this->optionsData, $this->_value );
$result = WpOption::updateOrCreate(
['option_name' => $this->optionsName],
['option_value' => json_encode( $mergeOptions )]
);
$this->_value = (array) $mergeOpt... | php | public function delta()
{
$mergeOptions = $this->__delta( $this->optionsData, $this->_value );
$result = WpOption::updateOrCreate(
['option_name' => $this->optionsName],
['option_value' => json_encode( $mergeOptions )]
);
$this->_value = (array) $mergeOpt... | [
"public",
"function",
"delta",
"(",
")",
"{",
"$",
"mergeOptions",
"=",
"$",
"this",
"->",
"__delta",
"(",
"$",
"this",
"->",
"optionsData",
",",
"$",
"this",
"->",
"_value",
")",
";",
"$",
"result",
"=",
"WpOption",
"::",
"updateOrCreate",
"(",
"[",
... | Execute a delta from the current version of the options and the previous version stored in the database.
@return false|int | [
"Execute",
"a",
"delta",
"from",
"the",
"current",
"version",
"of",
"the",
"options",
"and",
"the",
"previous",
"version",
"stored",
"in",
"the",
"database",
"."
] | 557d62674acf6ca43b2523f8d4a0aa0dbf8e674d | https://github.com/wp-pluginner/framework/blob/557d62674acf6ca43b2523f8d4a0aa0dbf8e674d/src/Support/PluginOptions.php#L241-L257 |
239,020 | Koudela/eArc-payload-container | src/Traits/PayloadContainerTrait.php | PayloadContainerTrait.set | public function set(string $name, $item): void
{
$this->payloadContainerItems->set($name, $item);
} | php | public function set(string $name, $item): void
{
$this->payloadContainerItems->set($name, $item);
} | [
"public",
"function",
"set",
"(",
"string",
"$",
"name",
",",
"$",
"item",
")",
":",
"void",
"{",
"$",
"this",
"->",
"payloadContainerItems",
"->",
"set",
"(",
"$",
"name",
",",
"$",
"item",
")",
";",
"}"
] | Add a specific item to the container.
@param string $name
@param mixed $item
@throws ItemOverwriteException | [
"Add",
"a",
"specific",
"item",
"to",
"the",
"container",
"."
] | d085ccaf2041441a2b55cf8a500b8a849b8ac5a4 | https://github.com/Koudela/eArc-payload-container/blob/d085ccaf2041441a2b55cf8a500b8a849b8ac5a4/src/Traits/PayloadContainerTrait.php#L88-L91 |
239,021 | alanly/picnik | src/Picnik/Requests/Word/AbstractWordRequest.php | AbstractWordRequest.checkResponseErrors | protected function checkResponseErrors(ResponseInterface $response)
{
$status = intval($response->getStatusCode());
if ($status === 200) return;
switch ($status) {
case 401:
throw new AuthorizationException($response);
default:
throw new RequestException($response);
}
} | php | protected function checkResponseErrors(ResponseInterface $response)
{
$status = intval($response->getStatusCode());
if ($status === 200) return;
switch ($status) {
case 401:
throw new AuthorizationException($response);
default:
throw new RequestException($response);
}
} | [
"protected",
"function",
"checkResponseErrors",
"(",
"ResponseInterface",
"$",
"response",
")",
"{",
"$",
"status",
"=",
"intval",
"(",
"$",
"response",
"->",
"getStatusCode",
"(",
")",
")",
";",
"if",
"(",
"$",
"status",
"===",
"200",
")",
"return",
";",
... | Checks the given response for error codes, throwing the appropriate
exceptions if needed.
@param ResponseInterface $response | [
"Checks",
"the",
"given",
"response",
"for",
"error",
"codes",
"throwing",
"the",
"appropriate",
"exceptions",
"if",
"needed",
"."
] | 17cf7afa43141f217b68ef181401f18b12ae2def | https://github.com/alanly/picnik/blob/17cf7afa43141f217b68ef181401f18b12ae2def/src/Picnik/Requests/Word/AbstractWordRequest.php#L81-L93 |
239,022 | bd808/moar-log | src/Moar/Log/Monolog/LoggerFactory.php | LoggerFactory.getDafaultLogger | public function getDafaultLogger () {
if (null === $this->root) {
$this->root = new HierarchialLogger(null);
}
return $this->root;
} | php | public function getDafaultLogger () {
if (null === $this->root) {
$this->root = new HierarchialLogger(null);
}
return $this->root;
} | [
"public",
"function",
"getDafaultLogger",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"root",
")",
"{",
"$",
"this",
"->",
"root",
"=",
"new",
"HierarchialLogger",
"(",
"null",
")",
";",
"}",
"return",
"$",
"this",
"->",
"root",
";",
... | Get the default logger.
Must return the same logger instance on each call.
@return LoggerInterface | [
"Get",
"the",
"default",
"logger",
"."
] | 01f44c46fef9a612cef6209c3bd69c97f3475064 | https://github.com/bd808/moar-log/blob/01f44c46fef9a612cef6209c3bd69c97f3475064/src/Moar/Log/Monolog/LoggerFactory.php#L32-L37 |
239,023 | bd808/moar-log | src/Moar/Log/Monolog/LoggerFactory.php | LoggerFactory.newLogger | protected function newLogger ($name, LoggerInterface $parent) {
$logger = $parent;
if ($parent instanceof HierarchialLogger) {
$logger = new HierarchialLogger($name);
$logger->setParent($parent);
}
return $logger;
} | php | protected function newLogger ($name, LoggerInterface $parent) {
$logger = $parent;
if ($parent instanceof HierarchialLogger) {
$logger = new HierarchialLogger($name);
$logger->setParent($parent);
}
return $logger;
} | [
"protected",
"function",
"newLogger",
"(",
"$",
"name",
",",
"LoggerInterface",
"$",
"parent",
")",
"{",
"$",
"logger",
"=",
"$",
"parent",
";",
"if",
"(",
"$",
"parent",
"instanceof",
"HierarchialLogger",
")",
"{",
"$",
"logger",
"=",
"new",
"HierarchialL... | Create a new LoggerInterface instance.
@param string $name Name of new logger
@param LoggerInterface $parent Closest known ancestor logger
@return LoggerInterface Logger | [
"Create",
"a",
"new",
"LoggerInterface",
"instance",
"."
] | 01f44c46fef9a612cef6209c3bd69c97f3475064 | https://github.com/bd808/moar-log/blob/01f44c46fef9a612cef6209c3bd69c97f3475064/src/Moar/Log/Monolog/LoggerFactory.php#L46-L53 |
239,024 | mtoolkit/mtoolkit-core | src/MList.php | MList.removeOne | public function removeOne($value): bool
{
if ($this->isValidType($value) === false) {
throw new MWrongTypeException("\$value", $this->getType(), $value);
}
$result = array_search($value, $this->list);
if ($result === false) {
throw new \OutOfBoundsException(... | php | public function removeOne($value): bool
{
if ($this->isValidType($value) === false) {
throw new MWrongTypeException("\$value", $this->getType(), $value);
}
$result = array_search($value, $this->list);
if ($result === false) {
throw new \OutOfBoundsException(... | [
"public",
"function",
"removeOne",
"(",
"$",
"value",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"isValidType",
"(",
"$",
"value",
")",
"===",
"false",
")",
"{",
"throw",
"new",
"MWrongTypeException",
"(",
"\"\\$value\"",
",",
"$",
"this",
"-... | Removes the first occurrence of value in the list and returns true on success;
otherwise returns false.
@param $value mixed
@return bool | [
"Removes",
"the",
"first",
"occurrence",
"of",
"value",
"in",
"the",
"list",
"and",
"returns",
"true",
"on",
"success",
";",
"otherwise",
"returns",
"false",
"."
] | 66c53273288a8652ff38240e063bdcffdf7c30aa | https://github.com/mtoolkit/mtoolkit-core/blob/66c53273288a8652ff38240e063bdcffdf7c30aa/src/MList.php#L476-L491 |
239,025 | mtoolkit/mtoolkit-core | src/MList.php | MList.startsWith | public function startsWith($value): bool
{
if ($this->isValidType($value) === false) {
throw new MWrongTypeException("\$value", $this->getType(), $value);
}
if ($this->count() <= 0) {
return false;
}
$lastValue = $this->list[0];
return ($las... | php | public function startsWith($value): bool
{
if ($this->isValidType($value) === false) {
throw new MWrongTypeException("\$value", $this->getType(), $value);
}
if ($this->count() <= 0) {
return false;
}
$lastValue = $this->list[0];
return ($las... | [
"public",
"function",
"startsWith",
"(",
"$",
"value",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"isValidType",
"(",
"$",
"value",
")",
"===",
"false",
")",
"{",
"throw",
"new",
"MWrongTypeException",
"(",
"\"\\$value\"",
",",
"$",
"this",
"... | Returns true if this list is not empty and its first item is equal
to value; otherwise returns false.
@param mixed $value
@return bool | [
"Returns",
"true",
"if",
"this",
"list",
"is",
"not",
"empty",
"and",
"its",
"first",
"item",
"is",
"equal",
"to",
"value",
";",
"otherwise",
"returns",
"false",
"."
] | 66c53273288a8652ff38240e063bdcffdf7c30aa | https://github.com/mtoolkit/mtoolkit-core/blob/66c53273288a8652ff38240e063bdcffdf7c30aa/src/MList.php#L526-L539 |
239,026 | mtoolkit/mtoolkit-core | src/MList.php | MList.offsetExists | public function offsetExists($offset): bool
{
MDataType::mustBe(array(MDataType::INT));
return (array_key_exists($offset, $this->list) === true);
} | php | public function offsetExists($offset): bool
{
MDataType::mustBe(array(MDataType::INT));
return (array_key_exists($offset, $this->list) === true);
} | [
"public",
"function",
"offsetExists",
"(",
"$",
"offset",
")",
":",
"bool",
"{",
"MDataType",
"::",
"mustBe",
"(",
"array",
"(",
"MDataType",
"::",
"INT",
")",
")",
";",
"return",
"(",
"array_key_exists",
"(",
"$",
"offset",
",",
"$",
"this",
"->",
"li... | Return if a key exists.
@param int $offset
@return bool | [
"Return",
"if",
"a",
"key",
"exists",
"."
] | 66c53273288a8652ff38240e063bdcffdf7c30aa | https://github.com/mtoolkit/mtoolkit-core/blob/66c53273288a8652ff38240e063bdcffdf7c30aa/src/MList.php#L653-L658 |
239,027 | bishopb/vanilla | library/core/class.pluggable.php | Gdn_Pluggable.FireAs | public function FireAs($Options) {
if (!is_array($Options))
$Options = array('FireClass' => $Options);
if (array_key_exists('FireClass', $Options))
$this->FireAs = GetValue('FireClass', $Options);
return $this;
} | php | public function FireAs($Options) {
if (!is_array($Options))
$Options = array('FireClass' => $Options);
if (array_key_exists('FireClass', $Options))
$this->FireAs = GetValue('FireClass', $Options);
return $this;
} | [
"public",
"function",
"FireAs",
"(",
"$",
"Options",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"Options",
")",
")",
"$",
"Options",
"=",
"array",
"(",
"'FireClass'",
"=>",
"$",
"Options",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"'FireClass'... | Fire the next event off a custom parent class
@param mixed $Options Either the parent class, or an option array | [
"Fire",
"the",
"next",
"event",
"off",
"a",
"custom",
"parent",
"class"
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.pluggable.php#L111-L119 |
239,028 | dzentota/zoya-coin | src/Zoya/Coin/Generic.php | Generic.flip | public function flip()
{
$this->counter++;
unset($this->isLucky);
$this->currentSide = $this->isLucky()? $this->expectedSide : $this->getOppositeSide($this->expectedSide);
return $this->currentSide;
} | php | public function flip()
{
$this->counter++;
unset($this->isLucky);
$this->currentSide = $this->isLucky()? $this->expectedSide : $this->getOppositeSide($this->expectedSide);
return $this->currentSide;
} | [
"public",
"function",
"flip",
"(",
")",
"{",
"$",
"this",
"->",
"counter",
"++",
";",
"unset",
"(",
"$",
"this",
"->",
"isLucky",
")",
";",
"$",
"this",
"->",
"currentSide",
"=",
"$",
"this",
"->",
"isLucky",
"(",
")",
"?",
"$",
"this",
"->",
"ex... | Flips the coin and returns its side
@return string | [
"Flips",
"the",
"coin",
"and",
"returns",
"its",
"side"
] | 92ef80f767f0313f0723b10b868842bb11ef4b3c | https://github.com/dzentota/zoya-coin/blob/92ef80f767f0313f0723b10b868842bb11ef4b3c/src/Zoya/Coin/Generic.php#L61-L67 |
239,029 | dzentota/zoya-coin | src/Zoya/Coin/Generic.php | Generic.isLucky | public function isLucky()
{
if (isset($this->isLucky)) {
return $this->isLucky;
}
$this->isLucky = $this->checkLuck();
return $this->isLucky;
} | php | public function isLucky()
{
if (isset($this->isLucky)) {
return $this->isLucky;
}
$this->isLucky = $this->checkLuck();
return $this->isLucky;
} | [
"public",
"function",
"isLucky",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"isLucky",
")",
")",
"{",
"return",
"$",
"this",
"->",
"isLucky",
";",
"}",
"$",
"this",
"->",
"isLucky",
"=",
"$",
"this",
"->",
"checkLuck",
"(",
")",
"... | Returns true if you are lucky
@return bool | [
"Returns",
"true",
"if",
"you",
"are",
"lucky"
] | 92ef80f767f0313f0723b10b868842bb11ef4b3c | https://github.com/dzentota/zoya-coin/blob/92ef80f767f0313f0723b10b868842bb11ef4b3c/src/Zoya/Coin/Generic.php#L73-L80 |
239,030 | patrikx3/resume-php-common | src/Analytics.php | Analytics.createCookie | private function createCookie()
{
$rand_id = rand(10000000, 99999999);
$random = rand(1000000000, 2147483647);
$var = '-';
$time = time();
$cookie = '';
$cookie .= '__utma=' . $rand_id . '.' . $random . '.' . $time . '.' . $time . '.' . $time . '.2;+';
$cookie... | php | private function createCookie()
{
$rand_id = rand(10000000, 99999999);
$random = rand(1000000000, 2147483647);
$var = '-';
$time = time();
$cookie = '';
$cookie .= '__utma=' . $rand_id . '.' . $random . '.' . $time . '.' . $time . '.' . $time . '.2;+';
$cookie... | [
"private",
"function",
"createCookie",
"(",
")",
"{",
"$",
"rand_id",
"=",
"rand",
"(",
"10000000",
",",
"99999999",
")",
";",
"$",
"random",
"=",
"rand",
"(",
"1000000000",
",",
"2147483647",
")",
";",
"$",
"var",
"=",
"'-'",
";",
"$",
"time",
"=",
... | Create unique cookie
@return string | [
"Create",
"unique",
"cookie"
] | 1e58ebc830cbd2becaf99c11147f086669d86025 | https://github.com/patrikx3/resume-php-common/blob/1e58ebc830cbd2becaf99c11147f086669d86025/src/Analytics.php#L91-L104 |
239,031 | patrikx3/resume-php-common | src/Analytics.php | Analytics.createGif | public function createGif()
{
$data = array();
foreach ($this->data as $key => $item) {
if ($item !== null) {
$data[$key] = $item;
}
}
return $this->tracking = self::GA_URL . '?' . http_build_query($data);
} | php | public function createGif()
{
$data = array();
foreach ($this->data as $key => $item) {
if ($item !== null) {
$data[$key] = $item;
}
}
return $this->tracking = self::GA_URL . '?' . http_build_query($data);
} | [
"public",
"function",
"createGif",
"(",
")",
"{",
"$",
"data",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"data",
"as",
"$",
"key",
"=>",
"$",
"item",
")",
"{",
"if",
"(",
"$",
"item",
"!==",
"null",
")",
"{",
"$",
"data",
... | Create the GA callback url, aka the gif
@return string | [
"Create",
"the",
"GA",
"callback",
"url",
"aka",
"the",
"gif"
] | 1e58ebc830cbd2becaf99c11147f086669d86025 | https://github.com/patrikx3/resume-php-common/blob/1e58ebc830cbd2becaf99c11147f086669d86025/src/Analytics.php#L155-L164 |
239,032 | patrikx3/resume-php-common | src/Analytics.php | Analytics.remoteCall | private function remoteCall()
{
if (function_exists(
'wp_remote_head'
)) { // Check if this is being used with WordPress, if so use it's excellent HTTP class
$response = wp_remote_head($this->tracking);
return $response;
} elseif (function_exists('curl_... | php | private function remoteCall()
{
if (function_exists(
'wp_remote_head'
)) { // Check if this is being used with WordPress, if so use it's excellent HTTP class
$response = wp_remote_head($this->tracking);
return $response;
} elseif (function_exists('curl_... | [
"private",
"function",
"remoteCall",
"(",
")",
"{",
"if",
"(",
"function_exists",
"(",
"'wp_remote_head'",
")",
")",
"{",
"// Check if this is being used with WordPress, if so use it's excellent HTTP class",
"$",
"response",
"=",
"wp_remote_head",
"(",
"$",
"this",
"->",
... | Use WP's HTTP class or CURL or fopen
@return array|null|void | [
"Use",
"WP",
"s",
"HTTP",
"class",
"or",
"CURL",
"or",
"fopen"
] | 1e58ebc830cbd2becaf99c11147f086669d86025 | https://github.com/patrikx3/resume-php-common/blob/1e58ebc830cbd2becaf99c11147f086669d86025/src/Analytics.php#L171-L195 |
239,033 | patrikx3/resume-php-common | src/Analytics.php | Analytics.sendTransaction | public function sendTransaction($transaction_id, $affiliation, $total, $tax, $shipping, $city, $region, $country)
{
$this->data['utmvw'] = '5.6.4dc';
$this->data['utms'] = ++self::$RequestsForThisSession;
$this->data['utmt'] = 'tran';
$this->data['utmtid'] = $transaction_id;
... | php | public function sendTransaction($transaction_id, $affiliation, $total, $tax, $shipping, $city, $region, $country)
{
$this->data['utmvw'] = '5.6.4dc';
$this->data['utms'] = ++self::$RequestsForThisSession;
$this->data['utmt'] = 'tran';
$this->data['utmtid'] = $transaction_id;
... | [
"public",
"function",
"sendTransaction",
"(",
"$",
"transaction_id",
",",
"$",
"affiliation",
",",
"$",
"total",
",",
"$",
"tax",
",",
"$",
"shipping",
",",
"$",
"city",
",",
"$",
"region",
",",
"$",
"country",
")",
"{",
"$",
"this",
"->",
"data",
"[... | Create and send a transaction object
Parameter order from https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingEcommerce
@param $transaction_id
@param $affiliation
@param $total
@param $tax
@param $shipping
@param $city
@param $region
@param $country
@return $this | [
"Create",
"and",
"send",
"a",
"transaction",
"object"
] | 1e58ebc830cbd2becaf99c11147f086669d86025 | https://github.com/patrikx3/resume-php-common/blob/1e58ebc830cbd2becaf99c11147f086669d86025/src/Analytics.php#L489-L508 |
239,034 | slickframework/template | src/Utils/Text.php | Text.truncate | public static function truncate(
$value, $length = 80, $terminator = "\n", $preserve = false
) {
$length = $preserve
? static::preserveBreakpoint($value, $length)
: $length;
if (mb_strlen($value) > $length) {
$value = rtrim(mb_substr($value, 0, $length)).
... | php | public static function truncate(
$value, $length = 80, $terminator = "\n", $preserve = false
) {
$length = $preserve
? static::preserveBreakpoint($value, $length)
: $length;
if (mb_strlen($value) > $length) {
$value = rtrim(mb_substr($value, 0, $length)).
... | [
"public",
"static",
"function",
"truncate",
"(",
"$",
"value",
",",
"$",
"length",
"=",
"80",
",",
"$",
"terminator",
"=",
"\"\\n\"",
",",
"$",
"preserve",
"=",
"false",
")",
"{",
"$",
"length",
"=",
"$",
"preserve",
"?",
"static",
"::",
"preserveBreak... | Truncates the value string with the provided length
If the string length is lower the the desired truncate length
the value is returned intact.
If the string is bigger then the provided length then it will
be cut and the a terminator will be added to the end of the string.
If you specify $preserve arg as true the wo... | [
"Truncates",
"the",
"value",
"string",
"with",
"the",
"provided",
"length"
] | d31abe9608acb30cfb8a6abd9cdf9d334f682fef | https://github.com/slickframework/template/blob/d31abe9608acb30cfb8a6abd9cdf9d334f682fef/src/Utils/Text.php#L40-L51 |
239,035 | slickframework/template | src/Utils/Text.php | Text.preserveBreakpoint | private static function preserveBreakpoint($value, $length)
{
if (strlen($value) <= $length) {
return $length;
}
$breakpoint = mb_strpos($value, ' ', $length);
$length = $breakpoint;
if (false === $breakpoint) {
$length = mb_strlen($value);
}
... | php | private static function preserveBreakpoint($value, $length)
{
if (strlen($value) <= $length) {
return $length;
}
$breakpoint = mb_strpos($value, ' ', $length);
$length = $breakpoint;
if (false === $breakpoint) {
$length = mb_strlen($value);
}
... | [
"private",
"static",
"function",
"preserveBreakpoint",
"(",
"$",
"value",
",",
"$",
"length",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"value",
")",
"<=",
"$",
"length",
")",
"{",
"return",
"$",
"length",
";",
"}",
"$",
"breakpoint",
"=",
"mb_strpos",
... | Check truncate length to avoid split a word
@param string $value
@param int $length
@return int | [
"Check",
"truncate",
"length",
"to",
"avoid",
"split",
"a",
"word"
] | d31abe9608acb30cfb8a6abd9cdf9d334f682fef | https://github.com/slickframework/template/blob/d31abe9608acb30cfb8a6abd9cdf9d334f682fef/src/Utils/Text.php#L85-L96 |
239,036 | spiral/validation | src/Validator.php | Validator.validate | protected function validate()
{
if (!empty($this->errors)) {
// already validated
return;
}
$this->errors = [];
foreach ($this->rules as $field => $rules) {
$value = $this->getValue($field);
foreach ($this->provider->getRules($rules... | php | protected function validate()
{
if (!empty($this->errors)) {
// already validated
return;
}
$this->errors = [];
foreach ($this->rules as $field => $rules) {
$value = $this->getValue($field);
foreach ($this->provider->getRules($rules... | [
"protected",
"function",
"validate",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"errors",
")",
")",
"{",
"// already validated",
"return",
";",
"}",
"$",
"this",
"->",
"errors",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
... | Validate data over given rules and context.
@throws \Spiral\Validation\Exception\ValidationException | [
"Validate",
"data",
"over",
"given",
"rules",
"and",
"context",
"."
] | aa8977dfe93904acfcce354e000d7d384579e2e3 | https://github.com/spiral/validation/blob/aa8977dfe93904acfcce354e000d7d384579e2e3/src/Validator.php#L111-L143 |
239,037 | davewwww/TaggedServices | src/Dwo/TaggedServices/DependencyInjection/Compiler/TaggedServicesPass.php | TaggedServicesPass.getDefinitionForServiceId | private function getDefinitionForServiceId($serviceId, ServiceConfig $serviceConfig)
{
if ($serviceConfig->has(ServiceConfig::LAZY) && !$serviceConfig->get(ServiceConfig::LAZY)) {
return new Reference($serviceId);
} else {
return new Definition($this->invokeClass, array(new ... | php | private function getDefinitionForServiceId($serviceId, ServiceConfig $serviceConfig)
{
if ($serviceConfig->has(ServiceConfig::LAZY) && !$serviceConfig->get(ServiceConfig::LAZY)) {
return new Reference($serviceId);
} else {
return new Definition($this->invokeClass, array(new ... | [
"private",
"function",
"getDefinitionForServiceId",
"(",
"$",
"serviceId",
",",
"ServiceConfig",
"$",
"serviceConfig",
")",
"{",
"if",
"(",
"$",
"serviceConfig",
"->",
"has",
"(",
"ServiceConfig",
"::",
"LAZY",
")",
"&&",
"!",
"$",
"serviceConfig",
"->",
"get"... | return a InvokeClass for lazyLoading or a reference of the service
@param string $serviceId
@param ServiceConfig $serviceConfig
@return object|Definition | [
"return",
"a",
"InvokeClass",
"for",
"lazyLoading",
"or",
"a",
"reference",
"of",
"the",
"service"
] | ca1f864c56616c47ff94f3651cd879628c3e07d5 | https://github.com/davewwww/TaggedServices/blob/ca1f864c56616c47ff94f3651cd879628c3e07d5/src/Dwo/TaggedServices/DependencyInjection/Compiler/TaggedServicesPass.php#L128-L136 |
239,038 | SlabPHP/display | src/Template.php | Template.load | protected function load($filename, $data = array(), $return = false)
{
$template = $this->createSubTemplate();
try {
return $template->renderTemplate($filename, $data, $return);
} catch (\Exception $exception) {
if (!empty($this->log))
{
$... | php | protected function load($filename, $data = array(), $return = false)
{
$template = $this->createSubTemplate();
try {
return $template->renderTemplate($filename, $data, $return);
} catch (\Exception $exception) {
if (!empty($this->log))
{
$... | [
"protected",
"function",
"load",
"(",
"$",
"filename",
",",
"$",
"data",
"=",
"array",
"(",
")",
",",
"$",
"return",
"=",
"false",
")",
"{",
"$",
"template",
"=",
"$",
"this",
"->",
"createSubTemplate",
"(",
")",
";",
"try",
"{",
"return",
"$",
"te... | Build a template
@param string $filename
@param mixed $data
@param boolean $return
@return string | [
"Build",
"a",
"template"
] | aa2c61cf4066f0373b1b5dd0a7aba52e93d158b4 | https://github.com/SlabPHP/display/blob/aa2c61cf4066f0373b1b5dd0a7aba52e93d158b4/src/Template.php#L137-L150 |
239,039 | SlabPHP/display | src/Template.php | Template.parseTemplate | private function parseTemplate($filename, $data)
{
if (is_array($data)) {
$this->_templateData = $data;
} else if (is_object($data)) {
if (method_exists($data, 'getTemplateData')) {
$this->_templateData = $data->getTemplateData();
} else {
... | php | private function parseTemplate($filename, $data)
{
if (is_array($data)) {
$this->_templateData = $data;
} else if (is_object($data)) {
if (method_exists($data, 'getTemplateData')) {
$this->_templateData = $data->getTemplateData();
} else {
... | [
"private",
"function",
"parseTemplate",
"(",
"$",
"filename",
",",
"$",
"data",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"data",
")",
")",
"{",
"$",
"this",
"->",
"_templateData",
"=",
"$",
"data",
";",
"}",
"else",
"if",
"(",
"is_object",
"(",
"... | Parse a specific filename with data
@param string $filename
@param array $data
@return bool|string | [
"Parse",
"a",
"specific",
"filename",
"with",
"data"
] | aa2c61cf4066f0373b1b5dd0a7aba52e93d158b4 | https://github.com/SlabPHP/display/blob/aa2c61cf4066f0373b1b5dd0a7aba52e93d158b4/src/Template.php#L185-L215 |
239,040 | SlabPHP/display | src/Template.php | Template.locateViewFile | public function locateViewFile($filename, $requiredNamespace = '')
{
foreach ($this->templateSearchDirectories as $namespace => $location) {
if (!empty($requiredNamespace) && ($namespace != $requiredNamespace)) {
continue;
}
$fullFilename = $location . DI... | php | public function locateViewFile($filename, $requiredNamespace = '')
{
foreach ($this->templateSearchDirectories as $namespace => $location) {
if (!empty($requiredNamespace) && ($namespace != $requiredNamespace)) {
continue;
}
$fullFilename = $location . DI... | [
"public",
"function",
"locateViewFile",
"(",
"$",
"filename",
",",
"$",
"requiredNamespace",
"=",
"''",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"templateSearchDirectories",
"as",
"$",
"namespace",
"=>",
"$",
"location",
")",
"{",
"if",
"(",
"!",
"empt... | Locate a desired view file
@param string $filename
@param string $requiredNamespace
@return string | [
"Locate",
"a",
"desired",
"view",
"file"
] | aa2c61cf4066f0373b1b5dd0a7aba52e93d158b4 | https://github.com/SlabPHP/display/blob/aa2c61cf4066f0373b1b5dd0a7aba52e93d158b4/src/Template.php#L224-L252 |
239,041 | nullivex/lib-xport | LSS/Xport/Common.php | Common.humanize | public function humanize(){
$this->stream->setCompression(Stream::COMPRESS_OFF);
$this->stream->setEncryption(Stream::CRYPT_OFF);
$this->setEncoding(Common::ENC_XML);
return $this;
} | php | public function humanize(){
$this->stream->setCompression(Stream::COMPRESS_OFF);
$this->stream->setEncryption(Stream::CRYPT_OFF);
$this->setEncoding(Common::ENC_XML);
return $this;
} | [
"public",
"function",
"humanize",
"(",
")",
"{",
"$",
"this",
"->",
"stream",
"->",
"setCompression",
"(",
"Stream",
"::",
"COMPRESS_OFF",
")",
";",
"$",
"this",
"->",
"stream",
"->",
"setEncryption",
"(",
"Stream",
"::",
"CRYPT_OFF",
")",
";",
"$",
"thi... | good for debugging, bad for security, size, flexibility | [
"good",
"for",
"debugging",
"bad",
"for",
"security",
"size",
"flexibility"
] | 87a2156d9d15a8eecbcab3e5a00326dc24b9e97e | https://github.com/nullivex/lib-xport/blob/87a2156d9d15a8eecbcab3e5a00326dc24b9e97e/LSS/Xport/Common.php#L39-L44 |
239,042 | kiler129/CherryHttp | src/Http/Response/ResponseFactory.php | ResponseFactory.getResponse | public function getResponse($code = ResponseCode::NO_CONTENT, $content = null, $headers = [])
{
$response = clone $this->baseResponse;
if ($code !== false) {
$response->setStatus($code);
}
if ($content !== false) {
$response->setBody($content);
}
... | php | public function getResponse($code = ResponseCode::NO_CONTENT, $content = null, $headers = [])
{
$response = clone $this->baseResponse;
if ($code !== false) {
$response->setStatus($code);
}
if ($content !== false) {
$response->setBody($content);
}
... | [
"public",
"function",
"getResponse",
"(",
"$",
"code",
"=",
"ResponseCode",
"::",
"NO_CONTENT",
",",
"$",
"content",
"=",
"null",
",",
"$",
"headers",
"=",
"[",
"]",
")",
"{",
"$",
"response",
"=",
"clone",
"$",
"this",
"->",
"baseResponse",
";",
"if",... | Produces response with default values.
@param int|false $code Code to use. If you pass false code will be derived from base response.
@param null|false $content Content to use in new response. If you pass false content from default response will
be used.
@param array|false $headers Additional headers to add to n... | [
"Produces",
"response",
"with",
"default",
"values",
"."
] | 05927f26183cbd6fd5ccb0853befecdea279308d | https://github.com/kiler129/CherryHttp/blob/05927f26183cbd6fd5ccb0853befecdea279308d/src/Http/Response/ResponseFactory.php#L107-L131 |
239,043 | nano7/Foundation | src/Discover/PackageManifest.php | PackageManifest.providers | public function providers()
{
return collect($this->getManifest())->flatMap(function ($configuration) {
return (array) ($configuration['providers'] ? $configuration['providers'] : []);
})->filter()->all();
} | php | public function providers()
{
return collect($this->getManifest())->flatMap(function ($configuration) {
return (array) ($configuration['providers'] ? $configuration['providers'] : []);
})->filter()->all();
} | [
"public",
"function",
"providers",
"(",
")",
"{",
"return",
"collect",
"(",
"$",
"this",
"->",
"getManifest",
"(",
")",
")",
"->",
"flatMap",
"(",
"function",
"(",
"$",
"configuration",
")",
"{",
"return",
"(",
"array",
")",
"(",
"$",
"configuration",
... | Get all of the service provider class names for all packages.
@return array | [
"Get",
"all",
"of",
"the",
"service",
"provider",
"class",
"names",
"for",
"all",
"packages",
"."
] | 8328423f81c69b8fabc04b4f6b1f3ba712695374 | https://github.com/nano7/Foundation/blob/8328423f81c69b8fabc04b4f6b1f3ba712695374/src/Discover/PackageManifest.php#L64-L69 |
239,044 | nano7/Foundation | src/Discover/PackageManifest.php | PackageManifest.aliases | public function aliases()
{
return collect($this->getManifest())->flatMap(function ($configuration) {
return (array) ($configuration['aliases'] ? $configuration['aliases'] : []);
})->filter()->all();
} | php | public function aliases()
{
return collect($this->getManifest())->flatMap(function ($configuration) {
return (array) ($configuration['aliases'] ? $configuration['aliases'] : []);
})->filter()->all();
} | [
"public",
"function",
"aliases",
"(",
")",
"{",
"return",
"collect",
"(",
"$",
"this",
"->",
"getManifest",
"(",
")",
")",
"->",
"flatMap",
"(",
"function",
"(",
"$",
"configuration",
")",
"{",
"return",
"(",
"array",
")",
"(",
"$",
"configuration",
"[... | Get all of the aliases for all packages.
@return array | [
"Get",
"all",
"of",
"the",
"aliases",
"for",
"all",
"packages",
"."
] | 8328423f81c69b8fabc04b4f6b1f3ba712695374 | https://github.com/nano7/Foundation/blob/8328423f81c69b8fabc04b4f6b1f3ba712695374/src/Discover/PackageManifest.php#L76-L81 |
239,045 | nano7/Foundation | src/Discover/PackageManifest.php | PackageManifest.build | public function build()
{
$packages = [];
if ($this->files->exists($path = $this->vendorPath.'/composer/installed.json')) {
$packages = json_decode($this->files->get($path), true);
}
$ignoreAll = in_array('*', $ignore = $this->packagesToIgnore());
$this->write(... | php | public function build()
{
$packages = [];
if ($this->files->exists($path = $this->vendorPath.'/composer/installed.json')) {
$packages = json_decode($this->files->get($path), true);
}
$ignoreAll = in_array('*', $ignore = $this->packagesToIgnore());
$this->write(... | [
"public",
"function",
"build",
"(",
")",
"{",
"$",
"packages",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"files",
"->",
"exists",
"(",
"$",
"path",
"=",
"$",
"this",
"->",
"vendorPath",
".",
"'/composer/installed.json'",
")",
")",
"{",
"$",
... | Build the manifest and write it to disk.
@return array | [
"Build",
"the",
"manifest",
"and",
"write",
"it",
"to",
"disk",
"."
] | 8328423f81c69b8fabc04b4f6b1f3ba712695374 | https://github.com/nano7/Foundation/blob/8328423f81c69b8fabc04b4f6b1f3ba712695374/src/Discover/PackageManifest.php#L107-L126 |
239,046 | marando/phpSOFA | src/Marando/IAU/iauTaitt.php | iauTaitt.Taitt | public static function Taitt($tai1, $tai2, &$tt1, &$tt2) {
/* TT minus TAI (days). */
$dtat = TTMTAI / DAYSEC;
/* Result, safeguarding precision. */
if ($tai1 > $tai2) {
$tt1 = $tai1;
$tt2 = $tai2 + $dtat;
}
else {
$tt1 = $tai1 + $dtat;
$tt2 = $tai2;
}
/* Status... | php | public static function Taitt($tai1, $tai2, &$tt1, &$tt2) {
/* TT minus TAI (days). */
$dtat = TTMTAI / DAYSEC;
/* Result, safeguarding precision. */
if ($tai1 > $tai2) {
$tt1 = $tai1;
$tt2 = $tai2 + $dtat;
}
else {
$tt1 = $tai1 + $dtat;
$tt2 = $tai2;
}
/* Status... | [
"public",
"static",
"function",
"Taitt",
"(",
"$",
"tai1",
",",
"$",
"tai2",
",",
"&",
"$",
"tt1",
",",
"&",
"$",
"tt2",
")",
"{",
"/* TT minus TAI (days). */",
"$",
"dtat",
"=",
"TTMTAI",
"/",
"DAYSEC",
";",
"/* Result, safeguarding precision. */",
"if",
... | - - - - - - - - -
i a u T a i t t
- - - - - - - - -
Time scale transformation: International Atomic Time, TAI, to
Terrestrial Time, TT.
This function is part of the International Astronomical Union's
SOFA (Standards of Fundamental Astronomy) software collection.
Status: canonical.
Given:
tai1,tai2 double TAI ... | [
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"i",
"a",
"u",
"T",
"a",
"i",
"t",
"t",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-"
] | 757fa49fe335ae1210eaa7735473fd4388b13f07 | https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauTaitt.php#L50-L66 |
239,047 | maestrano/maestrano-php | lib/Api/Util.php | Maestrano_Api_Util.convertToMaestranoObject | public static function convertToMaestranoObject($resp, $preset)
{
$types = array(
'account_bill' => 'Maestrano_Account_Bill',
'account_recurring_bill' => 'Maestrano_Account_RecurringBill',
'account_group' => 'Maestrano_Account_Group',
'account_user' => 'Maestrano_Account_User',
'acco... | php | public static function convertToMaestranoObject($resp, $preset)
{
$types = array(
'account_bill' => 'Maestrano_Account_Bill',
'account_recurring_bill' => 'Maestrano_Account_RecurringBill',
'account_group' => 'Maestrano_Account_Group',
'account_user' => 'Maestrano_Account_User',
'acco... | [
"public",
"static",
"function",
"convertToMaestranoObject",
"(",
"$",
"resp",
",",
"$",
"preset",
")",
"{",
"$",
"types",
"=",
"array",
"(",
"'account_bill'",
"=>",
"'Maestrano_Account_Bill'",
",",
"'account_recurring_bill'",
"=>",
"'Maestrano_Account_RecurringBill'",
... | Converts a response from the Maestrano API to the corresponding PHP object.
@param array $resp The response from the Maestrano API.
@param string $apiToken
@return Maestrano_Api_Object|array | [
"Converts",
"a",
"response",
"from",
"the",
"Maestrano",
"API",
"to",
"the",
"corresponding",
"PHP",
"object",
"."
] | 757cbefb0f0bf07cb35ea7442041d9bfdcce1558 | https://github.com/maestrano/maestrano-php/blob/757cbefb0f0bf07cb35ea7442041d9bfdcce1558/lib/Api/Util.php#L66-L100 |
239,048 | emhar/SearchDoctrineBundle | Mapping/ItemMetaDataFactory.php | ItemMetaDataFactory.doLoad | protected function doLoad($itemClass)
{
$itemMetaData = $this->newItemMetaDataInstance($itemClass);
$entityDefinitions = $this->annotationDriver->loadEntityDefinitions($itemClass);
$itemMetaData->mapEntities($entityDefinitions);
$hitDefinitions = $this->annotationDriver->loadHitDefinitions($itemClass);
$item... | php | protected function doLoad($itemClass)
{
$itemMetaData = $this->newItemMetaDataInstance($itemClass);
$entityDefinitions = $this->annotationDriver->loadEntityDefinitions($itemClass);
$itemMetaData->mapEntities($entityDefinitions);
$hitDefinitions = $this->annotationDriver->loadHitDefinitions($itemClass);
$item... | [
"protected",
"function",
"doLoad",
"(",
"$",
"itemClass",
")",
"{",
"$",
"itemMetaData",
"=",
"$",
"this",
"->",
"newItemMetaDataInstance",
"(",
"$",
"itemClass",
")",
";",
"$",
"entityDefinitions",
"=",
"$",
"this",
"->",
"annotationDriver",
"->",
"loadEntity... | Loads the itemMetaData of the item class
@param string $itemClass The name of the item class for which the itemMetaData should get loaded.
@param null $datas unused
@return ItemMetaData | [
"Loads",
"the",
"itemMetaData",
"of",
"the",
"item",
"class"
] | 0844cda4a6972dd71c04c0b38dba1ebf9b15c238 | https://github.com/emhar/SearchDoctrineBundle/blob/0844cda4a6972dd71c04c0b38dba1ebf9b15c238/Mapping/ItemMetaDataFactory.php#L55-L63 |
239,049 | indigophp-archive/codeception-fuel-module | fuel/fuel/packages/email/classes/email.php | Email.forge | public static function forge($setup = null, array $config = array())
{
empty($setup) and $setup = \Config::get('email.default_setup', 'default');
is_string($setup) and $setup = \Config::get('email.setups.'.$setup, array());
$setup = \Arr::merge(static::$_defaults, $setup);
$config = \Arr::merge($setup, $confi... | php | public static function forge($setup = null, array $config = array())
{
empty($setup) and $setup = \Config::get('email.default_setup', 'default');
is_string($setup) and $setup = \Config::get('email.setups.'.$setup, array());
$setup = \Arr::merge(static::$_defaults, $setup);
$config = \Arr::merge($setup, $confi... | [
"public",
"static",
"function",
"forge",
"(",
"$",
"setup",
"=",
"null",
",",
"array",
"$",
"config",
"=",
"array",
"(",
")",
")",
"{",
"empty",
"(",
"$",
"setup",
")",
"and",
"$",
"setup",
"=",
"\\",
"Config",
"::",
"get",
"(",
"'email.default_setup... | Email driver forge.
@param string|array $setup setup key for array defined in email.setups config or config array
@param array $config extra config array
@throws \FuelException Could not find Email driver
@return Email_Driver one of the email drivers | [
"Email",
"driver",
"forge",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/packages/email/classes/email.php#L59-L77 |
239,050 | klaravel/settings | src/SettingHelper.php | SettingHelper.get | public function get($key)
{
if (!$this->has($key)) {
return null;
}
return (new SettingModel)
->cached()
->where('key', $key)
->first()
->value;
} | php | public function get($key)
{
if (!$this->has($key)) {
return null;
}
return (new SettingModel)
->cached()
->where('key', $key)
->first()
->value;
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"key",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"(",
"new",
"SettingModel",
")",
"->",
"cached",
"(",
")",
"->",
"where",
"(... | Get value if key exists else it will return null
@param string $key
@return string|null | [
"Get",
"value",
"if",
"key",
"exists",
"else",
"it",
"will",
"return",
"null"
] | 00bf02b38286b2ef9a2a9399455c74019176466a | https://github.com/klaravel/settings/blob/00bf02b38286b2ef9a2a9399455c74019176466a/src/SettingHelper.php#L34-L45 |
239,051 | klaravel/settings | src/SettingHelper.php | SettingHelper.put | public function put($key, $value)
{
// if key exits then override
if ($this::has($key)) {
$setting = (new SettingModel)
->cached()
->where('key', $key)
->first();
$setting->value = $value;
return $setting->save();
... | php | public function put($key, $value)
{
// if key exits then override
if ($this::has($key)) {
$setting = (new SettingModel)
->cached()
->where('key', $key)
->first();
$setting->value = $value;
return $setting->save();
... | [
"public",
"function",
"put",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"// if key exits then override",
"if",
"(",
"$",
"this",
"::",
"has",
"(",
"$",
"key",
")",
")",
"{",
"$",
"setting",
"=",
"(",
"new",
"SettingModel",
")",
"->",
"cached",
"("... | Store new key and value in settings if it's already
exits then override.
@param string $key
@param string $value
@return null | [
"Store",
"new",
"key",
"and",
"value",
"in",
"settings",
"if",
"it",
"s",
"already",
"exits",
"then",
"override",
"."
] | 00bf02b38286b2ef9a2a9399455c74019176466a | https://github.com/klaravel/settings/blob/00bf02b38286b2ef9a2a9399455c74019176466a/src/SettingHelper.php#L55-L73 |
239,052 | klaravel/settings | src/SettingHelper.php | SettingHelper.forget | public function forget($key)
{
$isDeleted = SettingModel::where('key', $key)
->delete();
// if delete record then delete cache
if ($isDeleted) {
Cache::forget('Klaravel\Settings\Setting');
}
return $isDeleted;
} | php | public function forget($key)
{
$isDeleted = SettingModel::where('key', $key)
->delete();
// if delete record then delete cache
if ($isDeleted) {
Cache::forget('Klaravel\Settings\Setting');
}
return $isDeleted;
} | [
"public",
"function",
"forget",
"(",
"$",
"key",
")",
"{",
"$",
"isDeleted",
"=",
"SettingModel",
"::",
"where",
"(",
"'key'",
",",
"$",
"key",
")",
"->",
"delete",
"(",
")",
";",
"// if delete record then delete cache",
"if",
"(",
"$",
"isDeleted",
")",
... | Delete setting data from databasse
@param string $key
@return boolean | [
"Delete",
"setting",
"data",
"from",
"databasse"
] | 00bf02b38286b2ef9a2a9399455c74019176466a | https://github.com/klaravel/settings/blob/00bf02b38286b2ef9a2a9399455c74019176466a/src/SettingHelper.php#L94-L105 |
239,053 | gbprod/elastica-extra-bundle | src/ElasticaExtraBundle/Command/ElasticaAwareCommand.php | ElasticaAwareCommand.getClient | protected function getClient($clientName)
{
$clientName = $clientName ?: 'gbprod.elastica_extra.default_client';
$client = $this->getContainer()
->get(
$clientName,
ContainerInterface::NULL_ON_INVALID_REFERENCE
)
;
$this->vali... | php | protected function getClient($clientName)
{
$clientName = $clientName ?: 'gbprod.elastica_extra.default_client';
$client = $this->getContainer()
->get(
$clientName,
ContainerInterface::NULL_ON_INVALID_REFERENCE
)
;
$this->vali... | [
"protected",
"function",
"getClient",
"(",
"$",
"clientName",
")",
"{",
"$",
"clientName",
"=",
"$",
"clientName",
"?",
":",
"'gbprod.elastica_extra.default_client'",
";",
"$",
"client",
"=",
"$",
"this",
"->",
"getContainer",
"(",
")",
"->",
"get",
"(",
"$"... | Get elasticsearch client from his name
@param string $clientName
@return Client | [
"Get",
"elasticsearch",
"client",
"from",
"his",
"name"
] | 7a3d925c79903a328a3d07fefe998c0056be7e59 | https://github.com/gbprod/elastica-extra-bundle/blob/7a3d925c79903a328a3d07fefe998c0056be7e59/src/ElasticaExtraBundle/Command/ElasticaAwareCommand.php#L23-L37 |
239,054 | redreams/class-finder | src/ClassFinder.php | ClassFinder.find | public static function find(string $source): ?string
{
$class = false;
$namespace = false;
$tokens = token_get_all($source);
if (1 === count($tokens) && T_INLINE_HTML === $tokens[0][0]) {
return null;
}
for ($i = 0; isset($tokens[$i]); ++$i) {
... | php | public static function find(string $source): ?string
{
$class = false;
$namespace = false;
$tokens = token_get_all($source);
if (1 === count($tokens) && T_INLINE_HTML === $tokens[0][0]) {
return null;
}
for ($i = 0; isset($tokens[$i]); ++$i) {
... | [
"public",
"static",
"function",
"find",
"(",
"string",
"$",
"source",
")",
":",
"?",
"string",
"{",
"$",
"class",
"=",
"false",
";",
"$",
"namespace",
"=",
"false",
";",
"$",
"tokens",
"=",
"token_get_all",
"(",
"$",
"source",
")",
";",
"if",
"(",
... | Find class and return fully qualified name in the source
@param string $source PHP source code
@return string|null Fully qualified class name if found, null otherwise | [
"Find",
"class",
"and",
"return",
"fully",
"qualified",
"name",
"in",
"the",
"source"
] | 86dafd757d3d00783dce5edbd9767b3af5ab1462 | https://github.com/redreams/class-finder/blob/86dafd757d3d00783dce5edbd9767b3af5ab1462/src/ClassFinder.php#L29-L76 |
239,055 | vphantom/pyritephp | src/Pyrite/Templating.php | Templating.shutdown | public static function shutdown()
{
global $PPHP;
$req = grab('request');
if (!$req['binary']) {
$body = ob_get_contents();
ob_end_clean();
try {
array_merge_assoc(
self::$_stash,
array(
... | php | public static function shutdown()
{
global $PPHP;
$req = grab('request');
if (!$req['binary']) {
$body = ob_get_contents();
ob_end_clean();
try {
array_merge_assoc(
self::$_stash,
array(
... | [
"public",
"static",
"function",
"shutdown",
"(",
")",
"{",
"global",
"$",
"PPHP",
";",
"$",
"req",
"=",
"grab",
"(",
"'request'",
")",
";",
"if",
"(",
"!",
"$",
"req",
"[",
"'binary'",
"]",
")",
"{",
"$",
"body",
"=",
"ob_get_contents",
"(",
")",
... | Clean up content capture and display main template
@return null | [
"Clean",
"up",
"content",
"capture",
"and",
"display",
"main",
"template"
] | e609daa714298a254bf5a945a1d6985c9d4d539d | https://github.com/vphantom/pyritephp/blob/e609daa714298a254bf5a945a1d6985c9d4d539d/src/Pyrite/Templating.php#L293-L317 |
239,056 | vphantom/pyritephp | src/Pyrite/Templating.php | Templating.gettext | function gettext($string)
{
global $PPHP;
$req = grab('request');
$default = $PPHP['config']['global']['default_lang'];
$current = $req['lang'];
$res = $string;
try {
if (self::$_gettext !== null) {
$res = self::$_gettext->gettext($string... | php | function gettext($string)
{
global $PPHP;
$req = grab('request');
$default = $PPHP['config']['global']['default_lang'];
$current = $req['lang'];
$res = $string;
try {
if (self::$_gettext !== null) {
$res = self::$_gettext->gettext($string... | [
"function",
"gettext",
"(",
"$",
"string",
")",
"{",
"global",
"$",
"PPHP",
";",
"$",
"req",
"=",
"grab",
"(",
"'request'",
")",
";",
"$",
"default",
"=",
"$",
"PPHP",
"[",
"'config'",
"]",
"[",
"'global'",
"]",
"[",
"'default_lang'",
"]",
";",
"$"... | Simple no-plurals translation lookup in config.ini
@param string $string String
@return string Translated string in current locale | [
"Simple",
"no",
"-",
"plurals",
"translation",
"lookup",
"in",
"config",
".",
"ini"
] | e609daa714298a254bf5a945a1d6985c9d4d539d | https://github.com/vphantom/pyritephp/blob/e609daa714298a254bf5a945a1d6985c9d4d539d/src/Pyrite/Templating.php#L338-L355 |
239,057 | vphantom/pyritephp | src/Pyrite/Templating.php | Templating.title | public static function title($prepend, $sep = ' - ')
{
self::$_stash['title'] = $prepend
. (
isset(self::$_stash['title'])
? ($sep . self::$_stash['title'])
: ''
);
} | php | public static function title($prepend, $sep = ' - ')
{
self::$_stash['title'] = $prepend
. (
isset(self::$_stash['title'])
? ($sep . self::$_stash['title'])
: ''
);
} | [
"public",
"static",
"function",
"title",
"(",
"$",
"prepend",
",",
"$",
"sep",
"=",
"' - '",
")",
"{",
"self",
"::",
"$",
"_stash",
"[",
"'title'",
"]",
"=",
"$",
"prepend",
".",
"(",
"isset",
"(",
"self",
"::",
"$",
"_stash",
"[",
"'title'",
"]",
... | Prepend new section to page title
@param string $prepend New section of title text
@param string $sep Separator with current title
@return null | [
"Prepend",
"new",
"section",
"to",
"page",
"title"
] | e609daa714298a254bf5a945a1d6985c9d4d539d | https://github.com/vphantom/pyritephp/blob/e609daa714298a254bf5a945a1d6985c9d4d539d/src/Pyrite/Templating.php#L392-L400 |
239,058 | vphantom/pyritephp | src/Pyrite/Templating.php | Templating.renderBlocks | public static function renderBlocks($name, $args = array())
{
global $PPHP, $_SESSION;
array_merge_assoc(
self::$_stash,
$args,
array(
'config' => $PPHP['config'],
'session' => $_SESSION,
'req' => grab('request')
... | php | public static function renderBlocks($name, $args = array())
{
global $PPHP, $_SESSION;
array_merge_assoc(
self::$_stash,
$args,
array(
'config' => $PPHP['config'],
'session' => $_SESSION,
'req' => grab('request')
... | [
"public",
"static",
"function",
"renderBlocks",
"(",
"$",
"name",
",",
"$",
"args",
"=",
"array",
"(",
")",
")",
"{",
"global",
"$",
"PPHP",
",",
"$",
"_SESSION",
";",
"array_merge_assoc",
"(",
"self",
"::",
"$",
"_stash",
",",
"$",
"args",
",",
"arr... | Render all blocks from a template
@param string $name File name from within templates/
@param array $args Associative array of variables to pass along
@return array Associative array of all blocks rendered from the template | [
"Render",
"all",
"blocks",
"from",
"a",
"template"
] | e609daa714298a254bf5a945a1d6985c9d4d539d | https://github.com/vphantom/pyritephp/blob/e609daa714298a254bf5a945a1d6985c9d4d539d/src/Pyrite/Templating.php#L438-L462 |
239,059 | vutran/wpmvc-core | src/Repository/CommentRepository.php | CommentRepository.convertAndReturn | protected function convertAndReturn($comments)
{
// Create the return value
$retval = false;
if ($comments && is_array($comments) && count($comments)) {
// Create the array
$retval = array();
foreach ($comments as $theComment) {
// Create a... | php | protected function convertAndReturn($comments)
{
// Create the return value
$retval = false;
if ($comments && is_array($comments) && count($comments)) {
// Create the array
$retval = array();
foreach ($comments as $theComment) {
// Create a... | [
"protected",
"function",
"convertAndReturn",
"(",
"$",
"comments",
")",
"{",
"// Create the return value",
"$",
"retval",
"=",
"false",
";",
"if",
"(",
"$",
"comments",
"&&",
"is_array",
"(",
"$",
"comments",
")",
"&&",
"count",
"(",
"$",
"comments",
")",
... | Converts an array of standard object instances to Comment model instances
@access protected
@param array $comments
@return array | [
"Converts",
"an",
"array",
"of",
"standard",
"object",
"instances",
"to",
"Comment",
"model",
"instances"
] | 4081be36116ae8e79abfd182d783d28d0fb42219 | https://github.com/vutran/wpmvc-core/blob/4081be36116ae8e79abfd182d783d28d0fb42219/src/Repository/CommentRepository.php#L29-L44 |
239,060 | vinala/kernel | src/Strings/Strings.php | Strings.concat | public static function concat()
{
$args = func_get_arg();
$string = '';
foreach ($args as $arg) {
$string .= $arg;
}
return $string;
} | php | public static function concat()
{
$args = func_get_arg();
$string = '';
foreach ($args as $arg) {
$string .= $arg;
}
return $string;
} | [
"public",
"static",
"function",
"concat",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_arg",
"(",
")",
";",
"$",
"string",
"=",
"''",
";",
"foreach",
"(",
"$",
"args",
"as",
"$",
"arg",
")",
"{",
"$",
"string",
".=",
"$",
"arg",
";",
"}",
"return",... | Concat strings as many as args.
@param param[]
@return string | [
"Concat",
"strings",
"as",
"many",
"as",
"args",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Strings/Strings.php#L95-L105 |
239,061 | vinala/kernel | src/Strings/Strings.php | Strings.compare | public static function compare($str1, $str2, $ignoreCase = true)
{
if ($ignoreCase) {
if (strcasecmp($str1, $str2) == 0) {
return true;
}
} else {
if (strcmp($str1, $str2) == 0) {
return true;
}
}
return... | php | public static function compare($str1, $str2, $ignoreCase = true)
{
if ($ignoreCase) {
if (strcasecmp($str1, $str2) == 0) {
return true;
}
} else {
if (strcmp($str1, $str2) == 0) {
return true;
}
}
return... | [
"public",
"static",
"function",
"compare",
"(",
"$",
"str1",
",",
"$",
"str2",
",",
"$",
"ignoreCase",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"ignoreCase",
")",
"{",
"if",
"(",
"strcasecmp",
"(",
"$",
"str1",
",",
"$",
"str2",
")",
"==",
"0",
")"... | Compare between two strings.
@param string $str1
@param string $str2
@param bool $ignoreCase
@return bool | [
"Compare",
"between",
"two",
"strings",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Strings/Strings.php#L116-L129 |
239,062 | vinala/kernel | src/Strings/Strings.php | Strings.join | public static function join($strings, $separator, $start = 0, $count = -1)
{
$string = '';
$end = $count == -1 ? Collection::count($strings) : $count;
for ($i = $start; $i < $end; $i++) {
$string .= $strings[$i].$separator;
if ($i == ($end - 1)) {
$... | php | public static function join($strings, $separator, $start = 0, $count = -1)
{
$string = '';
$end = $count == -1 ? Collection::count($strings) : $count;
for ($i = $start; $i < $end; $i++) {
$string .= $strings[$i].$separator;
if ($i == ($end - 1)) {
$... | [
"public",
"static",
"function",
"join",
"(",
"$",
"strings",
",",
"$",
"separator",
",",
"$",
"start",
"=",
"0",
",",
"$",
"count",
"=",
"-",
"1",
")",
"{",
"$",
"string",
"=",
"''",
";",
"$",
"end",
"=",
"$",
"count",
"==",
"-",
"1",
"?",
"C... | Join array element to string.
@param array $strings
@param string $separator
@param int $start
@param int $count
@return simplexml_load_string | [
"Join",
"array",
"element",
"to",
"string",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Strings/Strings.php#L141-L156 |
239,063 | vinala/kernel | src/Strings/Strings.php | Strings.at | public static function at($string, $index)
{
if (self::length($string) >= ($index + 1)) {
return $string[$index];
}
exception(StringOutIndexException::class);
} | php | public static function at($string, $index)
{
if (self::length($string) >= ($index + 1)) {
return $string[$index];
}
exception(StringOutIndexException::class);
} | [
"public",
"static",
"function",
"at",
"(",
"$",
"string",
",",
"$",
"index",
")",
"{",
"if",
"(",
"self",
"::",
"length",
"(",
"$",
"string",
")",
">=",
"(",
"$",
"index",
"+",
"1",
")",
")",
"{",
"return",
"$",
"string",
"[",
"$",
"index",
"]"... | Get the char at an index from a given string.
@param string $string
@param int $index
@return string | bool | [
"Get",
"the",
"char",
"at",
"an",
"index",
"from",
"a",
"given",
"string",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Strings/Strings.php#L197-L204 |
239,064 | vinala/kernel | src/Strings/Strings.php | Strings.insert | public static function insert($string, $substring, $index)
{
exception_if(!self::checkIndex($string, $index), StringOutIndexException::class);
$str = '';
for ($i = 0; $i < static::length($string); $i++) {
if ($i == $index) {
$str .= $substring;
}
... | php | public static function insert($string, $substring, $index)
{
exception_if(!self::checkIndex($string, $index), StringOutIndexException::class);
$str = '';
for ($i = 0; $i < static::length($string); $i++) {
if ($i == $index) {
$str .= $substring;
}
... | [
"public",
"static",
"function",
"insert",
"(",
"$",
"string",
",",
"$",
"substring",
",",
"$",
"index",
")",
"{",
"exception_if",
"(",
"!",
"self",
"::",
"checkIndex",
"(",
"$",
"string",
",",
"$",
"index",
")",
",",
"StringOutIndexException",
"::",
"cla... | Insert a substring inside another string.
@param string $string
@param string $substring
@return string | [
"Insert",
"a",
"substring",
"inside",
"another",
"string",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Strings/Strings.php#L214-L229 |
239,065 | vinala/kernel | src/Strings/Strings.php | Strings.trim | public static function trim($string, $side = self::TRIM_BOTH, $chars = null)
{
if ($side == self::TRIM_START) {
return ltrim($string, $chars);
} elseif ($side == self::TRIM_END) {
return rtrim($string, $chars);
} elseif ($side == self::TRIM_BOTH) {
return ... | php | public static function trim($string, $side = self::TRIM_BOTH, $chars = null)
{
if ($side == self::TRIM_START) {
return ltrim($string, $chars);
} elseif ($side == self::TRIM_END) {
return rtrim($string, $chars);
} elseif ($side == self::TRIM_BOTH) {
return ... | [
"public",
"static",
"function",
"trim",
"(",
"$",
"string",
",",
"$",
"side",
"=",
"self",
"::",
"TRIM_BOTH",
",",
"$",
"chars",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"side",
"==",
"self",
"::",
"TRIM_START",
")",
"{",
"return",
"ltrim",
"(",
"$",... | Trim a string.
@param string $string
@param string $chars
@param string side
@return string | [
"Trim",
"a",
"string",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Strings/Strings.php#L271-L280 |
239,066 | vinala/kernel | src/Strings/Strings.php | Strings.startsWith | public static function startsWith($string, $substrings)
{
if (is_array($substrings)) {
foreach ((array) $substrings as $substring) {
if ($substring != '' && mb_strpos($string, $substring) === 0) {
return true;
}
}
} elseif (... | php | public static function startsWith($string, $substrings)
{
if (is_array($substrings)) {
foreach ((array) $substrings as $substring) {
if ($substring != '' && mb_strpos($string, $substring) === 0) {
return true;
}
}
} elseif (... | [
"public",
"static",
"function",
"startsWith",
"(",
"$",
"string",
",",
"$",
"substrings",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"substrings",
")",
")",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"substrings",
"as",
"$",
"substring",
")",
"{",
... | Check if string starts with another string of collection of strings.
@param string $string
@param string|array $substring
@return bool | [
"Check",
"if",
"string",
"starts",
"with",
"another",
"string",
"of",
"collection",
"of",
"strings",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Strings/Strings.php#L338-L353 |
239,067 | vinala/kernel | src/Strings/Strings.php | Strings.endsWith | public static function endsWith($string, $substrings)
{
if (is_array($substrings)) {
foreach ((array) $substrings as $substring) {
if ((string) $substring === static::subString($string, -static::length($substring))) {
return true;
}
... | php | public static function endsWith($string, $substrings)
{
if (is_array($substrings)) {
foreach ((array) $substrings as $substring) {
if ((string) $substring === static::subString($string, -static::length($substring))) {
return true;
}
... | [
"public",
"static",
"function",
"endsWith",
"(",
"$",
"string",
",",
"$",
"substrings",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"substrings",
")",
")",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"substrings",
"as",
"$",
"substring",
")",
"{",
"i... | Check ifstring ends with another string of collection of strings.
@param string $string
@param string|array $substring
@return bool | [
"Check",
"ifstring",
"ends",
"with",
"another",
"string",
"of",
"collection",
"of",
"strings",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Strings/Strings.php#L363-L378 |
239,068 | uthando-cms/uthando-navigation | src/UthandoNavigation/Service/SiteMapService.php | SiteMapService.getSiteMap | public function getSiteMap()
{
$sitemap = $this->getCacheItem('site-map');
if (null === $sitemap) {
/* @var $menuService MenuService */
$menuService = $this->getService(MenuService::class);
$navigation = $menuService->getPages();
$argv = $this->prep... | php | public function getSiteMap()
{
$sitemap = $this->getCacheItem('site-map');
if (null === $sitemap) {
/* @var $menuService MenuService */
$menuService = $this->getService(MenuService::class);
$navigation = $menuService->getPages();
$argv = $this->prep... | [
"public",
"function",
"getSiteMap",
"(",
")",
"{",
"$",
"sitemap",
"=",
"$",
"this",
"->",
"getCacheItem",
"(",
"'site-map'",
")",
";",
"if",
"(",
"null",
"===",
"$",
"sitemap",
")",
"{",
"/* @var $menuService MenuService */",
"$",
"menuService",
"=",
"$",
... | Returns a formatted xml sitemap string
@return string | [
"Returns",
"a",
"formatted",
"xml",
"sitemap",
"string"
] | 3aeb687697c3cc94710113246f517745964ac281 | https://github.com/uthando-cms/uthando-navigation/blob/3aeb687697c3cc94710113246f517745964ac281/src/UthandoNavigation/Service/SiteMapService.php#L33-L56 |
239,069 | calgamo/config | src/ConfigUtil.php | ConfigUtil.includeConfigFile | private static function includeConfigFile(array &$config, $config_file, File $base_dir, ConfigReader $reader)
{
// try relative path
$file = new File($config_file, $base_dir);
if ( $file->exists() ){
$included = self::loadConfigFileByFormat( $file, $reader );
... | php | private static function includeConfigFile(array &$config, $config_file, File $base_dir, ConfigReader $reader)
{
// try relative path
$file = new File($config_file, $base_dir);
if ( $file->exists() ){
$included = self::loadConfigFileByFormat( $file, $reader );
... | [
"private",
"static",
"function",
"includeConfigFile",
"(",
"array",
"&",
"$",
"config",
",",
"$",
"config_file",
",",
"File",
"$",
"base_dir",
",",
"ConfigReader",
"$",
"reader",
")",
"{",
"// try relative path",
"$",
"file",
"=",
"new",
"File",
"(",
"$",
... | Include other config file
@param array $config
@param string $config_file
@param File $base_dir
@param ConfigReader $reader
@throws IncludeConfigFileNotFoundException
@throws UnsupportedConfigFileFormatException | [
"Include",
"other",
"config",
"file"
] | 315c87f0ab1283a805a24db3a6220eda281d49e8 | https://github.com/calgamo/config/blob/315c87f0ab1283a805a24db3a6220eda281d49e8/src/ConfigUtil.php#L62-L83 |
239,070 | shakahl/hups-util-htmlcompressor | src/Hups/Util/HTMLCompressor.php | HTMLCompressor.replaceAbsoluteUrls | public function replaceAbsoluteUrls($currentHost = true)
{
$hosts = array();
if ($currentHost === true)
{
$hosts[] = $_SERVER["HTTP_HOST"];
}
elseif (is_array($currentHost))
{
foreach ($currentHost as $h)
{
$hosts[]... | php | public function replaceAbsoluteUrls($currentHost = true)
{
$hosts = array();
if ($currentHost === true)
{
$hosts[] = $_SERVER["HTTP_HOST"];
}
elseif (is_array($currentHost))
{
foreach ($currentHost as $h)
{
$hosts[]... | [
"public",
"function",
"replaceAbsoluteUrls",
"(",
"$",
"currentHost",
"=",
"true",
")",
"{",
"$",
"hosts",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"currentHost",
"===",
"true",
")",
"{",
"$",
"hosts",
"[",
"]",
"=",
"$",
"_SERVER",
"[",
"\"HTTP_... | Replace absolute urls with relative path
@return Hups\Util\HTMLCompressor | [
"Replace",
"absolute",
"urls",
"with",
"relative",
"path"
] | 2b659d2f35aa54c89f2294557dbbd718235183ab | https://github.com/shakahl/hups-util-htmlcompressor/blob/2b659d2f35aa54c89f2294557dbbd718235183ab/src/Hups/Util/HTMLCompressor.php#L93-L115 |
239,071 | fkooman/php-lib-oauth | src/fkooman/OAuth/Scope.php | Scope.hasScope | public function hasScope(Scope $scope)
{
foreach ($scope->toArray() as $scopeToken) {
if (!$this->hasScopeToken($scopeToken)) {
return false;
}
}
return true;
} | php | public function hasScope(Scope $scope)
{
foreach ($scope->toArray() as $scopeToken) {
if (!$this->hasScopeToken($scopeToken)) {
return false;
}
}
return true;
} | [
"public",
"function",
"hasScope",
"(",
"Scope",
"$",
"scope",
")",
"{",
"foreach",
"(",
"$",
"scope",
"->",
"toArray",
"(",
")",
"as",
"$",
"scopeToken",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasScopeToken",
"(",
"$",
"scopeToken",
")",
")",
... | Check if all scope tokens from the provided scope are in this object's
scope tokens.
@param Scope $scope the scope object to check
@return bool | [
"Check",
"if",
"all",
"scope",
"tokens",
"from",
"the",
"provided",
"scope",
"are",
"in",
"this",
"object",
"s",
"scope",
"tokens",
"."
] | 537c0f1b003fe562175ec85fd3ae6cc0ca0ed4ca | https://github.com/fkooman/php-lib-oauth/blob/537c0f1b003fe562175ec85fd3ae6cc0ca0ed4ca/src/fkooman/OAuth/Scope.php#L74-L83 |
239,072 | phlexible/phlexible | src/Phlexible/Bundle/GuiBundle/Controller/PollController.php | PollController.indexAction | public function indexAction(Request $request)
{
$messages = [];
$data = [];
foreach ($this->get('phlexible_dashboard.portlets') as $portlet) {
$data[$portlet->getId()] = $portlet->getData();
}
$message = new \stdClass();
$message->type = 'start';
... | php | public function indexAction(Request $request)
{
$messages = [];
$data = [];
foreach ($this->get('phlexible_dashboard.portlets') as $portlet) {
$data[$portlet->getId()] = $portlet->getData();
}
$message = new \stdClass();
$message->type = 'start';
... | [
"public",
"function",
"indexAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"messages",
"=",
"[",
"]",
";",
"$",
"data",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"get",
"(",
"'phlexible_dashboard.portlets'",
")",
"as",
"$",
"portl... | Poll Action.
@param Request $request
@return JsonResponse
@Route("", name="gui_poll") | [
"Poll",
"Action",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/GuiBundle/Controller/PollController.php#L35-L96 |
239,073 | sebardo/ecommerce | EcommerceBundle/Controller/SubcategoryController.php | SubcategoryController.indexAction | public function indexAction($categoryId)
{
$em = $this->getDoctrine()->getManager();
/** @var Category $entity */
$entity = $em->getRepository('EcommerceBundle:Category')->find($categoryId);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Category e... | php | public function indexAction($categoryId)
{
$em = $this->getDoctrine()->getManager();
/** @var Category $entity */
$entity = $em->getRepository('EcommerceBundle:Category')->find($categoryId);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Category e... | [
"public",
"function",
"indexAction",
"(",
"$",
"categoryId",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getManager",
"(",
")",
";",
"/** @var Category $entity */",
"$",
"entity",
"=",
"$",
"em",
"->",
"getRepository",
"(",... | Lists all subcategories from a Category entity.
@param int $categoryId The category id
@throws NotFoundHttpException
@return array
@Route("/")
@Method("GET")
@Template("EcommerceBundle:Subcategory:index.html.twig") | [
"Lists",
"all",
"subcategories",
"from",
"a",
"Category",
"entity",
"."
] | 3e17545e69993f10a1df17f9887810c7378fc7f9 | https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Controller/SubcategoryController.php#L37-L51 |
239,074 | sebardo/ecommerce | EcommerceBundle/Controller/SubcategoryController.php | SubcategoryController.createAction | public function createAction(Request $request, $categoryId)
{
$em = $this->getDoctrine()->getManager();
/** @var Category $category */
$category = $em->getRepository('EcommerceBundle:Category')->find($categoryId);
if (!$category) {
throw $this->createNotFoundException('... | php | public function createAction(Request $request, $categoryId)
{
$em = $this->getDoctrine()->getManager();
/** @var Category $category */
$category = $em->getRepository('EcommerceBundle:Category')->find($categoryId);
if (!$category) {
throw $this->createNotFoundException('... | [
"public",
"function",
"createAction",
"(",
"Request",
"$",
"request",
",",
"$",
"categoryId",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getManager",
"(",
")",
";",
"/** @var Category $category */",
"$",
"category",
"=",
"... | Creates a new Category entity.
@param Request $request The request
@param int $categoryId The category id
@throws NotFoundHttpException
@return array|RedirectResponse
@Route("/")
@Method("POST")
@Template("EcommerceBundle:Category:new.html.twig") | [
"Creates",
"a",
"new",
"Category",
"entity",
"."
] | 3e17545e69993f10a1df17f9887810c7378fc7f9 | https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Controller/SubcategoryController.php#L90-L122 |
239,075 | lyrixx/lifestream | Lifestream/LifestreamFactory.php | LifestreamFactory.createLifestream | public function createLifestream($serviceName, array $arguments = array(), array $filters = array(), array $formatters = array())
{
if (!array_key_exists($serviceName, $this->services)) {
throw new \InvalidArgumentException(sprintf(
'Service "%s" not Found. Services supported: "%... | php | public function createLifestream($serviceName, array $arguments = array(), array $filters = array(), array $formatters = array())
{
if (!array_key_exists($serviceName, $this->services)) {
throw new \InvalidArgumentException(sprintf(
'Service "%s" not Found. Services supported: "%... | [
"public",
"function",
"createLifestream",
"(",
"$",
"serviceName",
",",
"array",
"$",
"arguments",
"=",
"array",
"(",
")",
",",
"array",
"$",
"filters",
"=",
"array",
"(",
")",
",",
"array",
"$",
"formatters",
"=",
"array",
"(",
")",
")",
"{",
"if",
... | Create a Lifestream with a nammed service
@param string $serviceName A service among LifestreamFactory::getSupportedServices
@param string[] $arguments Arguments to give to service constructor
@param FormatterInterface[] $filters A collection of FormatterInterface
@param FormatterInterf... | [
"Create",
"a",
"Lifestream",
"with",
"a",
"nammed",
"service"
] | 2cf959b08b0ae0a2ff4938a227018a00f00dfc0f | https://github.com/lyrixx/lifestream/blob/2cf959b08b0ae0a2ff4938a227018a00f00dfc0f/Lifestream/LifestreamFactory.php#L50-L67 |
239,076 | MacFJA/Symfony-Console-Filechooser | lib/FileFilter.php | FileFilter.finderWrapperInject | protected function finderWrapperInject($finder)
{
foreach ($this->wrappedMethodHistory as $row) {
call_user_func_array(array($finder, $row['method']), $row['args']);
}
} | php | protected function finderWrapperInject($finder)
{
foreach ($this->wrappedMethodHistory as $row) {
call_user_func_array(array($finder, $row['method']), $row['args']);
}
} | [
"protected",
"function",
"finderWrapperInject",
"(",
"$",
"finder",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"wrappedMethodHistory",
"as",
"$",
"row",
")",
"{",
"call_user_func_array",
"(",
"array",
"(",
"$",
"finder",
",",
"$",
"row",
"[",
"'method'",
... | Configure a Symfony Finder
@param Finder $finder | [
"Configure",
"a",
"Symfony",
"Finder"
] | f27248a6993718fcc469d442e305e1d83f5e1eb5 | https://github.com/MacFJA/Symfony-Console-Filechooser/blob/f27248a6993718fcc469d442e305e1d83f5e1eb5/lib/FileFilter.php#L210-L215 |
239,077 | joegreen88/zf1-component-http | src/Zend/Http/Client/Adapter/Socket.php | Zend_Http_Client_Adapter_Socket.setConfig | public function setConfig($config = array())
{
if ($config instanceof Zend_Config) {
$config = $config->toArray();
} elseif (! is_array($config)) {
throw new Zend_Http_Client_Adapter_Exception(
'Array or Zend_Config object expected, got ' . gettype($config)
... | php | public function setConfig($config = array())
{
if ($config instanceof Zend_Config) {
$config = $config->toArray();
} elseif (! is_array($config)) {
throw new Zend_Http_Client_Adapter_Exception(
'Array or Zend_Config object expected, got ' . gettype($config)
... | [
"public",
"function",
"setConfig",
"(",
"$",
"config",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"config",
"instanceof",
"Zend_Config",
")",
"{",
"$",
"config",
"=",
"$",
"config",
"->",
"toArray",
"(",
")",
";",
"}",
"elseif",
"(",
"!",
"i... | Set the configuration array for the adapter
@param Zend_Config | array $config | [
"Set",
"the",
"configuration",
"array",
"for",
"the",
"adapter"
] | 39e834e8f0393cf4223d099a0acaab5fa05e9ad4 | https://github.com/joegreen88/zf1-component-http/blob/39e834e8f0393cf4223d099a0acaab5fa05e9ad4/src/Zend/Http/Client/Adapter/Socket.php#L109-L124 |
239,078 | joegreen88/zf1-component-http | src/Zend/Http/Client/Adapter/Socket.php | Zend_Http_Client_Adapter_Socket.setStreamContext | public function setStreamContext($context)
{
if (is_resource($context) && get_resource_type($context) == 'stream-context') {
$this->_context = $context;
} elseif (is_array($context)) {
$this->_context = stream_context_create($context);
} else {
// Invali... | php | public function setStreamContext($context)
{
if (is_resource($context) && get_resource_type($context) == 'stream-context') {
$this->_context = $context;
} elseif (is_array($context)) {
$this->_context = stream_context_create($context);
} else {
// Invali... | [
"public",
"function",
"setStreamContext",
"(",
"$",
"context",
")",
"{",
"if",
"(",
"is_resource",
"(",
"$",
"context",
")",
"&&",
"get_resource_type",
"(",
"$",
"context",
")",
"==",
"'stream-context'",
")",
"{",
"$",
"this",
"->",
"_context",
"=",
"$",
... | Set the stream context for the TCP connection to the server
Can accept either a pre-existing stream context resource, or an array
of stream options, similar to the options array passed to the
stream_context_create() PHP function. In such case a new stream context
will be created using the passed options.
@since Zend... | [
"Set",
"the",
"stream",
"context",
"for",
"the",
"TCP",
"connection",
"to",
"the",
"server"
] | 39e834e8f0393cf4223d099a0acaab5fa05e9ad4 | https://github.com/joegreen88/zf1-component-http/blob/39e834e8f0393cf4223d099a0acaab5fa05e9ad4/src/Zend/Http/Client/Adapter/Socket.php#L149-L166 |
239,079 | joegreen88/zf1-component-http | src/Zend/Http/Client/Adapter/Socket.php | Zend_Http_Client_Adapter_Socket._checkSocketReadTimeout | protected function _checkSocketReadTimeout()
{
if ($this->socket) {
$info = stream_get_meta_data($this->socket);
$timedout = $info['timed_out'];
if ($timedout) {
$this->close();
throw new Zend_Http_Client_Adapter_Exception(
... | php | protected function _checkSocketReadTimeout()
{
if ($this->socket) {
$info = stream_get_meta_data($this->socket);
$timedout = $info['timed_out'];
if ($timedout) {
$this->close();
throw new Zend_Http_Client_Adapter_Exception(
... | [
"protected",
"function",
"_checkSocketReadTimeout",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"socket",
")",
"{",
"$",
"info",
"=",
"stream_get_meta_data",
"(",
"$",
"this",
"->",
"socket",
")",
";",
"$",
"timedout",
"=",
"$",
"info",
"[",
"'timed_out... | Check if the socket has timed out - if so close connection and throw
an exception
@throws Zend_Http_Client_Adapter_Exception with READ_TIMEOUT code | [
"Check",
"if",
"the",
"socket",
"has",
"timed",
"out",
"-",
"if",
"so",
"close",
"connection",
"and",
"throw",
"an",
"exception"
] | 39e834e8f0393cf4223d099a0acaab5fa05e9ad4 | https://github.com/joegreen88/zf1-component-http/blob/39e834e8f0393cf4223d099a0acaab5fa05e9ad4/src/Zend/Http/Client/Adapter/Socket.php#L502-L516 |
239,080 | tekkla/core-html | Core/Html/Bootstrap/Buttongroups/ButtonGroup.php | ButtonGroup.& | public function &createButton($button_class='Bootstrap\Button\Button')
{
$button = $this->factory->create($button_class);
$this->addButton($button);
return $button;
} | php | public function &createButton($button_class='Bootstrap\Button\Button')
{
$button = $this->factory->create($button_class);
$this->addButton($button);
return $button;
} | [
"public",
"function",
"&",
"createButton",
"(",
"$",
"button_class",
"=",
"'Bootstrap\\Button\\Button'",
")",
"{",
"$",
"button",
"=",
"$",
"this",
"->",
"factory",
"->",
"create",
"(",
"$",
"button_class",
")",
";",
"$",
"this",
"->",
"addButton",
"(",
"$... | Creates a Bootstrap button element and adds it to the buttonlist
@return Button | [
"Creates",
"a",
"Bootstrap",
"button",
"element",
"and",
"adds",
"it",
"to",
"the",
"buttonlist"
] | 00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3 | https://github.com/tekkla/core-html/blob/00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3/Core/Html/Bootstrap/Buttongroups/ButtonGroup.php#L37-L44 |
239,081 | zoopcommerce/gateway-module | src/Zoop/GatewayModule/Controller/AuthenticatedUserController.php | AuthenticatedUserController.create | public function create($data)
{
$authService = $this->options->getAuthenticationService();
if ($authService->hasIdentity()) {
$authService->logout();
}
$result = $authService->login(
$data[$this->options->getDataUsernameKey()],
$data[$this->optio... | php | public function create($data)
{
$authService = $this->options->getAuthenticationService();
if ($authService->hasIdentity()) {
$authService->logout();
}
$result = $authService->login(
$data[$this->options->getDataUsernameKey()],
$data[$this->optio... | [
"public",
"function",
"create",
"(",
"$",
"data",
")",
"{",
"$",
"authService",
"=",
"$",
"this",
"->",
"options",
"->",
"getAuthenticationService",
"(",
")",
";",
"if",
"(",
"$",
"authService",
"->",
"hasIdentity",
"(",
")",
")",
"{",
"$",
"authService"... | Checks the provided username and password against the AuthenticationService and
returns the active user
@param type $data
@return type
@throws Exception\LoginFailedException | [
"Checks",
"the",
"provided",
"username",
"and",
"password",
"against",
"the",
"AuthenticationService",
"and",
"returns",
"the",
"active",
"user"
] | ea8770512d16f3d0099da380e4829aedec01a0e8 | https://github.com/zoopcommerce/gateway-module/blob/ea8770512d16f3d0099da380e4829aedec01a0e8/src/Zoop/GatewayModule/Controller/AuthenticatedUserController.php#L91-L115 |
239,082 | slickframework/mvc | src/Console/MetaDataGenerator/Composer.php | Composer.setComposerFile | protected function setComposerFile($file)
{
if (null != $file && !is_file($file)) {
throw new FileNotFoundException(
"The file {$file} was not found."
);
}
$this->composerFile = $file;
} | php | protected function setComposerFile($file)
{
if (null != $file && !is_file($file)) {
throw new FileNotFoundException(
"The file {$file} was not found."
);
}
$this->composerFile = $file;
} | [
"protected",
"function",
"setComposerFile",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"null",
"!=",
"$",
"file",
"&&",
"!",
"is_file",
"(",
"$",
"file",
")",
")",
"{",
"throw",
"new",
"FileNotFoundException",
"(",
"\"The file {$file} was not found.\"",
")",
";"... | Sets the composer file to parse
@param $file | [
"Sets",
"the",
"composer",
"file",
"to",
"parse"
] | 91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab | https://github.com/slickframework/mvc/blob/91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab/src/Console/MetaDataGenerator/Composer.php#L78-L87 |
239,083 | slickframework/mvc | src/Console/MetaDataGenerator/Composer.php | Composer.getComposerData | protected function getComposerData()
{
if (null == $this->composerData) {
$json = file_get_contents($this->getComposerFile());
$this->composerData = json_decode($json);
if (null === $this->composerData) {
throw new ComposerParseException(
... | php | protected function getComposerData()
{
if (null == $this->composerData) {
$json = file_get_contents($this->getComposerFile());
$this->composerData = json_decode($json);
if (null === $this->composerData) {
throw new ComposerParseException(
... | [
"protected",
"function",
"getComposerData",
"(",
")",
"{",
"if",
"(",
"null",
"==",
"$",
"this",
"->",
"composerData",
")",
"{",
"$",
"json",
"=",
"file_get_contents",
"(",
"$",
"this",
"->",
"getComposerFile",
"(",
")",
")",
";",
"$",
"this",
"->",
"c... | Gets the data object from json file
@return mixed|Object | [
"Gets",
"the",
"data",
"object",
"from",
"json",
"file"
] | 91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab | https://github.com/slickframework/mvc/blob/91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab/src/Console/MetaDataGenerator/Composer.php#L94-L108 |
239,084 | slickframework/mvc | src/Console/MetaDataGenerator/Composer.php | Composer.getAuthor | protected function getAuthor()
{
if (
!isset($this->getComposerData()->authors) ||
count($this->getComposerData()->authors) != 1
) {
return $this->requestAuthor();
}
return [
'authorName' => $this->getComposerData()->authors[0]->name,
... | php | protected function getAuthor()
{
if (
!isset($this->getComposerData()->authors) ||
count($this->getComposerData()->authors) != 1
) {
return $this->requestAuthor();
}
return [
'authorName' => $this->getComposerData()->authors[0]->name,
... | [
"protected",
"function",
"getAuthor",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"getComposerData",
"(",
")",
"->",
"authors",
")",
"||",
"count",
"(",
"$",
"this",
"->",
"getComposerData",
"(",
")",
"->",
"authors",
")",
"!=",
"... | Gets the author name and e-mail
@return array | [
"Gets",
"the",
"author",
"name",
"and",
"e",
"-",
"mail"
] | 91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab | https://github.com/slickframework/mvc/blob/91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab/src/Console/MetaDataGenerator/Composer.php#L141-L154 |
239,085 | slickframework/mvc | src/Console/MetaDataGenerator/Composer.php | Composer.requestAuthor | protected function requestAuthor()
{
if (!empty($this->getComposerData()->authors)) {
return $this->selectAuthors();
}
$nameQuestion = new Question('Please enter your name: ');
$emailQuestion = new Question('Please enter your e-mail address: ');
$this->getOutput(... | php | protected function requestAuthor()
{
if (!empty($this->getComposerData()->authors)) {
return $this->selectAuthors();
}
$nameQuestion = new Question('Please enter your name: ');
$emailQuestion = new Question('Please enter your e-mail address: ');
$this->getOutput(... | [
"protected",
"function",
"requestAuthor",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"getComposerData",
"(",
")",
"->",
"authors",
")",
")",
"{",
"return",
"$",
"this",
"->",
"selectAuthors",
"(",
")",
";",
"}",
"$",
"nameQuestion"... | Asks the author name and e-mail and returns them
@return array | [
"Asks",
"the",
"author",
"name",
"and",
"e",
"-",
"mail",
"and",
"returns",
"them"
] | 91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab | https://github.com/slickframework/mvc/blob/91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab/src/Console/MetaDataGenerator/Composer.php#L161-L191 |
239,086 | slickframework/mvc | src/Console/MetaDataGenerator/Composer.php | Composer.selectAuthors | protected function selectAuthors()
{
$options = $this->getAuthorsAsOptions();
$this->getOutput()->writeln('');
$this->getOutput()->writeln(
'<info>Multiple authors found on ' .
'project\'s composer.json file.</info>'
);
$question = new ChoiceQuestion(
... | php | protected function selectAuthors()
{
$options = $this->getAuthorsAsOptions();
$this->getOutput()->writeln('');
$this->getOutput()->writeln(
'<info>Multiple authors found on ' .
'project\'s composer.json file.</info>'
);
$question = new ChoiceQuestion(
... | [
"protected",
"function",
"selectAuthors",
"(",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"getAuthorsAsOptions",
"(",
")",
";",
"$",
"this",
"->",
"getOutput",
"(",
")",
"->",
"writeln",
"(",
"''",
")",
";",
"$",
"this",
"->",
"getOutput",
"(",
... | Requests user to select author form a list of composer authors
and returns them.
@return array | [
"Requests",
"user",
"to",
"select",
"author",
"form",
"a",
"list",
"of",
"composer",
"authors",
"and",
"returns",
"them",
"."
] | 91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab | https://github.com/slickframework/mvc/blob/91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab/src/Console/MetaDataGenerator/Composer.php#L199-L220 |
239,087 | treffynnon/command-wrap | src/Runners/Passthru.php | Passthru.run | public function run(RunnableInterface $command, callable $func = null)
{
if ($func) {
throw new \Exception('You cannot process passthru with a callable. Use another Runner instead.');
}
$command = (string) $command->getCommandAssembler();
passthru($command, $status);
... | php | public function run(RunnableInterface $command, callable $func = null)
{
if ($func) {
throw new \Exception('You cannot process passthru with a callable. Use another Runner instead.');
}
$command = (string) $command->getCommandAssembler();
passthru($command, $status);
... | [
"public",
"function",
"run",
"(",
"RunnableInterface",
"$",
"command",
",",
"callable",
"$",
"func",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"func",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'You cannot process passthru with a callable. Use another Runner ... | Passes through result of the command so no output is set
@link http://php.net/passthru
@param RunnableInterface $command | [
"Passes",
"through",
"result",
"of",
"the",
"command",
"so",
"no",
"output",
"is",
"set"
] | 381f1a7d1bd76e2b7d0898f51e3dd5caffbf5e4b | https://github.com/treffynnon/command-wrap/blob/381f1a7d1bd76e2b7d0898f51e3dd5caffbf5e4b/src/Runners/Passthru.php#L15-L24 |
239,088 | InnoGr/FivePercent-Api | src/Server/JsonRpc/JsonRpcServer.php | JsonRpcServer.processApiMethod | private function processApiMethod(SfRequest $request)
{
// Try parse JSON
$content = $request->getContent();
if (!$content) {
throw new MissingHttpContentException('Missing HTTP content.');
}
$query = @json_decode($content, true);
if (false === $query) ... | php | private function processApiMethod(SfRequest $request)
{
// Try parse JSON
$content = $request->getContent();
if (!$content) {
throw new MissingHttpContentException('Missing HTTP content.');
}
$query = @json_decode($content, true);
if (false === $query) ... | [
"private",
"function",
"processApiMethod",
"(",
"SfRequest",
"$",
"request",
")",
"{",
"// Try parse JSON",
"$",
"content",
"=",
"$",
"request",
"->",
"getContent",
"(",
")",
";",
"if",
"(",
"!",
"$",
"content",
")",
"{",
"throw",
"new",
"MissingHttpContentE... | Process API method
@param SfRequest $request
@return JsonResponse
@throws \Exception | [
"Process",
"API",
"method"
] | 57b78ddc3c9d91a7139c276711e5792824ceab9c | https://github.com/InnoGr/FivePercent-Api/blob/57b78ddc3c9d91a7139c276711e5792824ceab9c/src/Server/JsonRpc/JsonRpcServer.php#L200-L216 |
239,089 | InnoGr/FivePercent-Api | src/Server/JsonRpc/JsonRpcServer.php | JsonRpcServer.processApiQuery | private function processApiQuery(array $query)
{
$query += array(
'params' => array(),
'id' => null
);
if (empty($query['method'])) {
throw new MissingMethodException('Missing "method" parameter in query.');
}
if ($query['id'] !== null &&... | php | private function processApiQuery(array $query)
{
$query += array(
'params' => array(),
'id' => null
);
if (empty($query['method'])) {
throw new MissingMethodException('Missing "method" parameter in query.');
}
if ($query['id'] !== null &&... | [
"private",
"function",
"processApiQuery",
"(",
"array",
"$",
"query",
")",
"{",
"$",
"query",
"+=",
"array",
"(",
"'params'",
"=>",
"array",
"(",
")",
",",
"'id'",
"=>",
"null",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"query",
"[",
"'method'",
"]",
... | Process api query
@param array $query
@return JsonResponse
@throws \Exception | [
"Process",
"api",
"query"
] | 57b78ddc3c9d91a7139c276711e5792824ceab9c | https://github.com/InnoGr/FivePercent-Api/blob/57b78ddc3c9d91a7139c276711e5792824ceab9c/src/Server/JsonRpc/JsonRpcServer.php#L227-L269 |
239,090 | InnoGr/FivePercent-Api | src/Server/JsonRpc/JsonRpcServer.php | JsonRpcServer.createErrorResponse | private function createErrorResponse($code, $message = null, array $data = [])
{
if (!$message) {
$messages = $this->handler->getErrors()->getErrors();
$message = isset($messages[$code]) ? $messages[$code] : 'Error';
}
$json = [
'jsonrpc' => self::JSON_RP... | php | private function createErrorResponse($code, $message = null, array $data = [])
{
if (!$message) {
$messages = $this->handler->getErrors()->getErrors();
$message = isset($messages[$code]) ? $messages[$code] : 'Error';
}
$json = [
'jsonrpc' => self::JSON_RP... | [
"private",
"function",
"createErrorResponse",
"(",
"$",
"code",
",",
"$",
"message",
"=",
"null",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"$",
"message",
")",
"{",
"$",
"messages",
"=",
"$",
"this",
"->",
"handler",
"->"... | Create error response
@param integer $code
@param string $message
@param array $data
@return JsonResponse | [
"Create",
"error",
"response"
] | 57b78ddc3c9d91a7139c276711e5792824ceab9c | https://github.com/InnoGr/FivePercent-Api/blob/57b78ddc3c9d91a7139c276711e5792824ceab9c/src/Server/JsonRpc/JsonRpcServer.php#L280-L301 |
239,091 | InnoGr/FivePercent-Api | src/Server/JsonRpc/JsonRpcServer.php | JsonRpcServer.createViolationErrorResponse | public function createViolationErrorResponse(ViolationListException $exception)
{
$errorData = [];
/** @var \Symfony\Component\Validator\ConstraintViolationInterface $violation */
foreach ($exception->getViolationList() as $violation) {
$errorData[$violation->getPropertyPath()] ... | php | public function createViolationErrorResponse(ViolationListException $exception)
{
$errorData = [];
/** @var \Symfony\Component\Validator\ConstraintViolationInterface $violation */
foreach ($exception->getViolationList() as $violation) {
$errorData[$violation->getPropertyPath()] ... | [
"public",
"function",
"createViolationErrorResponse",
"(",
"ViolationListException",
"$",
"exception",
")",
"{",
"$",
"errorData",
"=",
"[",
"]",
";",
"/** @var \\Symfony\\Component\\Validator\\ConstraintViolationInterface $violation */",
"foreach",
"(",
"$",
"exception",
"->... | Create violation error response
@param ViolationListException $exception
@return JsonResponse | [
"Create",
"violation",
"error",
"response"
] | 57b78ddc3c9d91a7139c276711e5792824ceab9c | https://github.com/InnoGr/FivePercent-Api/blob/57b78ddc3c9d91a7139c276711e5792824ceab9c/src/Server/JsonRpc/JsonRpcServer.php#L310-L324 |
239,092 | mpoiriert/draw-test-helper-bundle | Helper/RequestHelper.php | RequestHelper.head | public function head($uri = null, $expectedStatus = null)
{
$this->setMethod('HEAD');
$this->setUri($uri);
if (!is_null($expectedStatus)) {
$this->expectingStatusCode($expectedStatus);
}
return $this;
} | php | public function head($uri = null, $expectedStatus = null)
{
$this->setMethod('HEAD');
$this->setUri($uri);
if (!is_null($expectedStatus)) {
$this->expectingStatusCode($expectedStatus);
}
return $this;
} | [
"public",
"function",
"head",
"(",
"$",
"uri",
"=",
"null",
",",
"$",
"expectedStatus",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setMethod",
"(",
"'HEAD'",
")",
";",
"$",
"this",
"->",
"setUri",
"(",
"$",
"uri",
")",
";",
"if",
"(",
"!",
"is_nu... | Set the HTTP method to HEAD and the uri if any.
Return $this for a fluent interface.
@param string|null $uri
@param integer|null $expectedStatus
@return $this | [
"Set",
"the",
"HTTP",
"method",
"to",
"HEAD",
"and",
"the",
"uri",
"if",
"any",
"."
] | cd8bb9cb38f2ee0b333ba1a68152fb20d7d70889 | https://github.com/mpoiriert/draw-test-helper-bundle/blob/cd8bb9cb38f2ee0b333ba1a68152fb20d7d70889/Helper/RequestHelper.php#L180-L189 |
239,093 | agentmedia/phine-news | src/News/Modules/Backend/ArticleList.php | ArticleList.InitCategoryArticles | private function InitCategoryArticles()
{
$tblArticle = Article::Schema()->Table();
$sql = Access::SqlBuilder();
$orderBy = $sql->OrderList($sql->OrderDesc($tblArticle->Field('Created')));
$this->articles = Article::Schema()->FetchByCategory(false, $this->category, $orderBy, null, $t... | php | private function InitCategoryArticles()
{
$tblArticle = Article::Schema()->Table();
$sql = Access::SqlBuilder();
$orderBy = $sql->OrderList($sql->OrderDesc($tblArticle->Field('Created')));
$this->articles = Article::Schema()->FetchByCategory(false, $this->category, $orderBy, null, $t... | [
"private",
"function",
"InitCategoryArticles",
"(",
")",
"{",
"$",
"tblArticle",
"=",
"Article",
"::",
"Schema",
"(",
")",
"->",
"Table",
"(",
")",
";",
"$",
"sql",
"=",
"Access",
"::",
"SqlBuilder",
"(",
")",
";",
"$",
"orderBy",
"=",
"$",
"sql",
"-... | Initializes the article array by category | [
"Initializes",
"the",
"article",
"array",
"by",
"category"
] | 51abc830fecd1325f0b7d28391ecd924cdc7c945 | https://github.com/agentmedia/phine-news/blob/51abc830fecd1325f0b7d28391ecd924cdc7c945/src/News/Modules/Backend/ArticleList.php#L101-L108 |
239,094 | agentmedia/phine-news | src/News/Modules/Backend/ArticleList.php | ArticleList.RemovalObject | protected function RemovalObject()
{
$id = Request::PostData('delete');
return $id ? Article::Schema()->ByID($id) : null;
} | php | protected function RemovalObject()
{
$id = Request::PostData('delete');
return $id ? Article::Schema()->ByID($id) : null;
} | [
"protected",
"function",
"RemovalObject",
"(",
")",
"{",
"$",
"id",
"=",
"Request",
"::",
"PostData",
"(",
"'delete'",
")",
";",
"return",
"$",
"id",
"?",
"Article",
"::",
"Schema",
"(",
")",
"->",
"ByID",
"(",
"$",
"id",
")",
":",
"null",
";",
"}"... | Gets the object to remove in case there is any
@return Article Returns the article to remove or null if none is requested | [
"Gets",
"the",
"object",
"to",
"remove",
"in",
"case",
"there",
"is",
"any"
] | 51abc830fecd1325f0b7d28391ecd924cdc7c945 | https://github.com/agentmedia/phine-news/blob/51abc830fecd1325f0b7d28391ecd924cdc7c945/src/News/Modules/Backend/ArticleList.php#L124-L128 |
239,095 | agentmedia/phine-news | src/News/Modules/Backend/ArticleList.php | ArticleList.BackLink | protected function BackLink()
{
if ($this->category) {
return BackendRouter::ModuleUrl(new CategoryList(), array('archive'=>$this->archive->GetID()));
}
else {
return BackendRouter::ModuleUrl(new ArchiveList());
}
} | php | protected function BackLink()
{
if ($this->category) {
return BackendRouter::ModuleUrl(new CategoryList(), array('archive'=>$this->archive->GetID()));
}
else {
return BackendRouter::ModuleUrl(new ArchiveList());
}
} | [
"protected",
"function",
"BackLink",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"category",
")",
"{",
"return",
"BackendRouter",
"::",
"ModuleUrl",
"(",
"new",
"CategoryList",
"(",
")",
",",
"array",
"(",
"'archive'",
"=>",
"$",
"this",
"->",
"archive"... | The backlink; either links to the category list or the archive list
@return string Returns the link for the back button | [
"The",
"backlink",
";",
"either",
"links",
"to",
"the",
"category",
"list",
"or",
"the",
"archive",
"list"
] | 51abc830fecd1325f0b7d28391ecd924cdc7c945 | https://github.com/agentmedia/phine-news/blob/51abc830fecd1325f0b7d28391ecd924cdc7c945/src/News/Modules/Backend/ArticleList.php#L134-L142 |
239,096 | mszewcz/php-light-framework | src/Filesystem/AbstractFilesystem.php | AbstractFilesystem.setNewDirectoryMode | public static function setNewDirectoryMode(string $mode = '740'): void
{
static::init();
static::$newDirectoryMode = \preg_match('/^[0-7]{3}$/', $mode) ? \intval($mode, 8) : 0740;
} | php | public static function setNewDirectoryMode(string $mode = '740'): void
{
static::init();
static::$newDirectoryMode = \preg_match('/^[0-7]{3}$/', $mode) ? \intval($mode, 8) : 0740;
} | [
"public",
"static",
"function",
"setNewDirectoryMode",
"(",
"string",
"$",
"mode",
"=",
"'740'",
")",
":",
"void",
"{",
"static",
"::",
"init",
"(",
")",
";",
"static",
"::",
"$",
"newDirectoryMode",
"=",
"\\",
"preg_match",
"(",
"'/^[0-7]{3}$/'",
",",
"$"... | Sets default mode for newly created directories
@param string $mode | [
"Sets",
"default",
"mode",
"for",
"newly",
"created",
"directories"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Filesystem/AbstractFilesystem.php#L91-L95 |
239,097 | mszewcz/php-light-framework | src/Filesystem/AbstractFilesystem.php | AbstractFilesystem.setNewFileMode | public static function setNewFileMode(string $mode = '740'): void
{
static::init();
static::$newFileMode = \preg_match('/^[0-7]{3}$/', $mode) ? \intval($mode, 8) : 0740;
} | php | public static function setNewFileMode(string $mode = '740'): void
{
static::init();
static::$newFileMode = \preg_match('/^[0-7]{3}$/', $mode) ? \intval($mode, 8) : 0740;
} | [
"public",
"static",
"function",
"setNewFileMode",
"(",
"string",
"$",
"mode",
"=",
"'740'",
")",
":",
"void",
"{",
"static",
"::",
"init",
"(",
")",
";",
"static",
"::",
"$",
"newFileMode",
"=",
"\\",
"preg_match",
"(",
"'/^[0-7]{3}$/'",
",",
"$",
"mode"... | Sets default mode for newly created files
@param string $mode | [
"Sets",
"default",
"mode",
"for",
"newly",
"created",
"files"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Filesystem/AbstractFilesystem.php#L113-L117 |
239,098 | mszewcz/php-light-framework | src/Filesystem/AbstractFilesystem.php | AbstractFilesystem.setNewSymbolicLinkMode | public static function setNewSymbolicLinkMode(string $mode = '740'): void
{
static::init();
static::$newSymlinkMode = \preg_match('/^[0-7]{3}$/', $mode) ? \intval($mode, 8) : 0740;
} | php | public static function setNewSymbolicLinkMode(string $mode = '740'): void
{
static::init();
static::$newSymlinkMode = \preg_match('/^[0-7]{3}$/', $mode) ? \intval($mode, 8) : 0740;
} | [
"public",
"static",
"function",
"setNewSymbolicLinkMode",
"(",
"string",
"$",
"mode",
"=",
"'740'",
")",
":",
"void",
"{",
"static",
"::",
"init",
"(",
")",
";",
"static",
"::",
"$",
"newSymlinkMode",
"=",
"\\",
"preg_match",
"(",
"'/^[0-7]{3}$/'",
",",
"$... | Sets default mode for newly created symbolic links
@param string $mode | [
"Sets",
"default",
"mode",
"for",
"newly",
"created",
"symbolic",
"links"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Filesystem/AbstractFilesystem.php#L135-L139 |
239,099 | unyx/console | output/formatting/Formatter.php | Formatter.createDefaultStyles | protected function createDefaultStyles() : styles\Map
{
return new styles\Map([
'error' => new Style('white', 'red'),
'info' => new Style('green'),
'comment' => new Style('cyan'),
'important' => new Style('red'),
'header' => new Style... | php | protected function createDefaultStyles() : styles\Map
{
return new styles\Map([
'error' => new Style('white', 'red'),
'info' => new Style('green'),
'comment' => new Style('cyan'),
'important' => new Style('red'),
'header' => new Style... | [
"protected",
"function",
"createDefaultStyles",
"(",
")",
":",
"styles",
"\\",
"Map",
"{",
"return",
"new",
"styles",
"\\",
"Map",
"(",
"[",
"'error'",
"=>",
"new",
"Style",
"(",
"'white'",
",",
"'red'",
")",
",",
"'info'",
"=>",
"new",
"Style",
"(",
"... | Creates a default Map of Styles to be used by this Formatter.
@return styles\Map | [
"Creates",
"a",
"default",
"Map",
"of",
"Styles",
"to",
"be",
"used",
"by",
"this",
"Formatter",
"."
] | b4a76e08bbb5428b0349c0ec4259a914f81a2957 | https://github.com/unyx/console/blob/b4a76e08bbb5428b0349c0ec4259a914f81a2957/output/formatting/Formatter.php#L129-L138 |
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.