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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
195,300 | alphalemon/BootstrapBundle | Core/Autoloader/BundlesAutoloader.php | BundlesAutoloader.setupFolders | private function setupFolders()
{
$this->basePath = $this->kernelDir . '/config/bundles';
$this->autoloadersPath = $this->basePath . '/autoloaders';
$this->configPath = $this->basePath . '/config';
$this->routingPath = $this->basePath . '/routing';
$this->cachePath = $this->b... | php | private function setupFolders()
{
$this->basePath = $this->kernelDir . '/config/bundles';
$this->autoloadersPath = $this->basePath . '/autoloaders';
$this->configPath = $this->basePath . '/config';
$this->routingPath = $this->basePath . '/routing';
$this->cachePath = $this->b... | [
"private",
"function",
"setupFolders",
"(",
")",
"{",
"$",
"this",
"->",
"basePath",
"=",
"$",
"this",
"->",
"kernelDir",
".",
"'/config/bundles'",
";",
"$",
"this",
"->",
"autoloadersPath",
"=",
"$",
"this",
"->",
"basePath",
".",
"'/autoloaders'",
";",
"... | Sets up the paths and creates the folder if they not exist | [
"Sets",
"up",
"the",
"paths",
"and",
"creates",
"the",
"folder",
"if",
"they",
"not",
"exist"
] | 27ff5cbc58d58149ec72a974f2a9d765a6fd37a6 | https://github.com/alphalemon/BootstrapBundle/blob/27ff5cbc58d58149ec72a974f2a9d765a6fd37a6/Core/Autoloader/BundlesAutoloader.php#L365-L379 |
195,301 | alphalemon/BootstrapBundle | Core/Autoloader/BundlesAutoloader.php | BundlesAutoloader.requireCachedClasses | private function requireCachedClasses()
{
$classPath = $this->cachePath;
if (is_dir($classPath)) {
$finder = new Finder();
$actionManagerFiles = $finder->files()->depth(1)->name('*.php')->in($classPath);
foreach ($actionManagerFiles as $actionManagerFile) {
... | php | private function requireCachedClasses()
{
$classPath = $this->cachePath;
if (is_dir($classPath)) {
$finder = new Finder();
$actionManagerFiles = $finder->files()->depth(1)->name('*.php')->in($classPath);
foreach ($actionManagerFiles as $actionManagerFile) {
... | [
"private",
"function",
"requireCachedClasses",
"(",
")",
"{",
"$",
"classPath",
"=",
"$",
"this",
"->",
"cachePath",
";",
"if",
"(",
"is_dir",
"(",
"$",
"classPath",
")",
")",
"{",
"$",
"finder",
"=",
"new",
"Finder",
"(",
")",
";",
"$",
"actionManager... | Requires the cached classes when needed | [
"Requires",
"the",
"cached",
"classes",
"when",
"needed"
] | 27ff5cbc58d58149ec72a974f2a9d765a6fd37a6 | https://github.com/alphalemon/BootstrapBundle/blob/27ff5cbc58d58149ec72a974f2a9d765a6fd37a6/Core/Autoloader/BundlesAutoloader.php#L384-L400 |
195,302 | gplcart/cli | Main.php | Main.getRoutes | public function getRoutes()
{
$list = array();
foreach (glob(__DIR__ . '/config/commands/*.php') as $file) {
$command = pathinfo($file, PATHINFO_FILENAME);
$list[$command] = gplcart_config_get($file);
$method = $command;
$parts = explode('-', $comma... | php | public function getRoutes()
{
$list = array();
foreach (glob(__DIR__ . '/config/commands/*.php') as $file) {
$command = pathinfo($file, PATHINFO_FILENAME);
$list[$command] = gplcart_config_get($file);
$method = $command;
$parts = explode('-', $comma... | [
"public",
"function",
"getRoutes",
"(",
")",
"{",
"$",
"list",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"glob",
"(",
"__DIR__",
".",
"'/config/commands/*.php'",
")",
"as",
"$",
"file",
")",
"{",
"$",
"command",
"=",
"pathinfo",
"(",
"$",
"file",
... | Returns an array of supported command routes
@return array | [
"Returns",
"an",
"array",
"of",
"supported",
"command",
"routes"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/Main.php#L32-L55 |
195,303 | leprephp/di | src/Container.php | Container.set | public function set(string $id, $service)
{
if ($this->frozen) {
throw new FrozenContainerException(
"The container is frozen and is not possible to define the new service \"{$id}\"."
);
}
$this->definitions[$id] = $service;
// clean alias an... | php | public function set(string $id, $service)
{
if ($this->frozen) {
throw new FrozenContainerException(
"The container is frozen and is not possible to define the new service \"{$id}\"."
);
}
$this->definitions[$id] = $service;
// clean alias an... | [
"public",
"function",
"set",
"(",
"string",
"$",
"id",
",",
"$",
"service",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"frozen",
")",
"{",
"throw",
"new",
"FrozenContainerException",
"(",
"\"The container is frozen and is not possible to define the new service \\\"{$id}\... | Defines a new service.
@param string $id
@param mixed $service
@return $this | [
"Defines",
"a",
"new",
"service",
"."
] | d7de90c0d44714abd70c4f5bd5341a1a87203a7e | https://github.com/leprephp/di/blob/d7de90c0d44714abd70c4f5bd5341a1a87203a7e/src/Container.php#L80-L95 |
195,304 | leprephp/di | src/Container.php | Container.alias | public function alias(string $alias, string $original)
{
$this->aliases[$alias] = $this->getRealId($original);
return $this;
} | php | public function alias(string $alias, string $original)
{
$this->aliases[$alias] = $this->getRealId($original);
return $this;
} | [
"public",
"function",
"alias",
"(",
"string",
"$",
"alias",
",",
"string",
"$",
"original",
")",
"{",
"$",
"this",
"->",
"aliases",
"[",
"$",
"alias",
"]",
"=",
"$",
"this",
"->",
"getRealId",
"(",
"$",
"original",
")",
";",
"return",
"$",
"this",
... | Sets an alias for a service.
@param string $alias
@param string $original
@return $this | [
"Sets",
"an",
"alias",
"for",
"a",
"service",
"."
] | d7de90c0d44714abd70c4f5bd5341a1a87203a7e | https://github.com/leprephp/di/blob/d7de90c0d44714abd70c4f5bd5341a1a87203a7e/src/Container.php#L104-L109 |
195,305 | leprephp/di | src/Container.php | Container.getNew | public function getNew(string $id)
{
$definition = $this->raw($id);
if (is_callable($definition)) {
$service = call_user_func($definition, $this);
} else {
$service = $definition;
}
if (isset($this->extensionQueues[$id])) {
$service = $th... | php | public function getNew(string $id)
{
$definition = $this->raw($id);
if (is_callable($definition)) {
$service = call_user_func($definition, $this);
} else {
$service = $definition;
}
if (isset($this->extensionQueues[$id])) {
$service = $th... | [
"public",
"function",
"getNew",
"(",
"string",
"$",
"id",
")",
"{",
"$",
"definition",
"=",
"$",
"this",
"->",
"raw",
"(",
"$",
"id",
")",
";",
"if",
"(",
"is_callable",
"(",
"$",
"definition",
")",
")",
"{",
"$",
"service",
"=",
"call_user_func",
... | Forces the container to return a new instance of the service.
@param string $id
@return mixed
@throws \InvalidArgumentException | [
"Forces",
"the",
"container",
"to",
"return",
"a",
"new",
"instance",
"of",
"the",
"service",
"."
] | d7de90c0d44714abd70c4f5bd5341a1a87203a7e | https://github.com/leprephp/di/blob/d7de90c0d44714abd70c4f5bd5341a1a87203a7e/src/Container.php#L118-L133 |
195,306 | leprephp/di | src/Container.php | Container.raw | public function raw(string $id)
{
$id = $this->getRealId($id);
if (array_key_exists($id, $this->definitions)) {
return $this->definitions[$id];
}
throw new Exception\NotFoundException($id);
} | php | public function raw(string $id)
{
$id = $this->getRealId($id);
if (array_key_exists($id, $this->definitions)) {
return $this->definitions[$id];
}
throw new Exception\NotFoundException($id);
} | [
"public",
"function",
"raw",
"(",
"string",
"$",
"id",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getRealId",
"(",
"$",
"id",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"id",
",",
"$",
"this",
"->",
"definitions",
")",
")",
"{",
"retur... | Gets the raw definition of the service.
@param string $id
@return mixed
@throws Exception\NotFoundException | [
"Gets",
"the",
"raw",
"definition",
"of",
"the",
"service",
"."
] | d7de90c0d44714abd70c4f5bd5341a1a87203a7e | https://github.com/leprephp/di/blob/d7de90c0d44714abd70c4f5bd5341a1a87203a7e/src/Container.php#L142-L151 |
195,307 | TeknooSoftware/east-foundation | src/universal/Router/Result.php | Result.getReflectionInstance | private function getReflectionInstance()
{
if (\is_array($this->controller) && 2 === \count($this->controller)) {
//Reflection the method's argument in the controller class
return new \ReflectionMethod($this->controller[0], $this->controller[1]);
}
if (\is_object($th... | php | private function getReflectionInstance()
{
if (\is_array($this->controller) && 2 === \count($this->controller)) {
//Reflection the method's argument in the controller class
return new \ReflectionMethod($this->controller[0], $this->controller[1]);
}
if (\is_object($th... | [
"private",
"function",
"getReflectionInstance",
"(",
")",
"{",
"if",
"(",
"\\",
"is_array",
"(",
"$",
"this",
"->",
"controller",
")",
"&&",
"2",
"===",
"\\",
"count",
"(",
"$",
"this",
"->",
"controller",
")",
")",
"{",
"//Reflection the method's argument i... | To generate the \Reflection object dedicated to the controller. The controller is a callable, so it can be
a method of an object, a invokable object, or a function.
@return \ReflectionFunction|\ReflectionMethod
@throws \ReflectionException | [
"To",
"generate",
"the",
"\\",
"Reflection",
"object",
"dedicated",
"to",
"the",
"controller",
".",
"The",
"controller",
"is",
"a",
"callable",
"so",
"it",
"can",
"be",
"a",
"method",
"of",
"an",
"object",
"a",
"invokable",
"object",
"or",
"a",
"function",... | 45ca97c83ba08b973877a472c731f27ca1e82cdf | https://github.com/TeknooSoftware/east-foundation/blob/45ca97c83ba08b973877a472c731f27ca1e82cdf/src/universal/Router/Result.php#L92-L107 |
195,308 | TeknooSoftware/east-foundation | src/universal/Router/Result.php | Result.extractArguments | private function extractArguments(): array
{
$parameters = [];
//Use the Reflection API to create Parameter Value object
foreach ($this->getReflectionInstance()->getParameters() as $param) {
$name = $param->getName();
$hasDefault = $param->isDefaultValueAvailable();
... | php | private function extractArguments(): array
{
$parameters = [];
//Use the Reflection API to create Parameter Value object
foreach ($this->getReflectionInstance()->getParameters() as $param) {
$name = $param->getName();
$hasDefault = $param->isDefaultValueAvailable();
... | [
"private",
"function",
"extractArguments",
"(",
")",
":",
"array",
"{",
"$",
"parameters",
"=",
"[",
"]",
";",
"//Use the Reflection API to create Parameter Value object",
"foreach",
"(",
"$",
"this",
"->",
"getReflectionInstance",
"(",
")",
"->",
"getParameters",
"... | To extract controller's parameter from \Reflection Api and convert into ParameterInterface instance.
@return array
@throws \ReflectionException | [
"To",
"extract",
"controller",
"s",
"parameter",
"from",
"\\",
"Reflection",
"Api",
"and",
"convert",
"into",
"ParameterInterface",
"instance",
"."
] | 45ca97c83ba08b973877a472c731f27ca1e82cdf | https://github.com/TeknooSoftware/east-foundation/blob/45ca97c83ba08b973877a472c731f27ca1e82cdf/src/universal/Router/Result.php#L115-L135 |
195,309 | padosoft/HTTPClient | src/HTTPClient.php | HTTPClient.getHeadersString | public function getHeadersString(\Psr\Http\Message\ResponseInterface $psr7response)
{
$strHeaders = '';
if($psr7response === null)
{
return $strHeaders;
}
$arrHeaders = $psr7response->getHeaders();
if (!is_array($arrHeaders) || count($arrHeaders) < 1) {
... | php | public function getHeadersString(\Psr\Http\Message\ResponseInterface $psr7response)
{
$strHeaders = '';
if($psr7response === null)
{
return $strHeaders;
}
$arrHeaders = $psr7response->getHeaders();
if (!is_array($arrHeaders) || count($arrHeaders) < 1) {
... | [
"public",
"function",
"getHeadersString",
"(",
"\\",
"Psr",
"\\",
"Http",
"\\",
"Message",
"\\",
"ResponseInterface",
"$",
"psr7response",
")",
"{",
"$",
"strHeaders",
"=",
"''",
";",
"if",
"(",
"$",
"psr7response",
"===",
"null",
")",
"{",
"return",
"$",
... | Get psr7 headers array and return string representation.
@param \Psr\Http\Message\ResponseInterface
@return string | [
"Get",
"psr7",
"headers",
"array",
"and",
"return",
"string",
"representation",
"."
] | 916f3832275bfcb5cc0691a7f39e4c74557dabc4 | https://github.com/padosoft/HTTPClient/blob/916f3832275bfcb5cc0691a7f39e4c74557dabc4/src/HTTPClient.php#L227-L254 |
195,310 | yuncms/yii2-oauth2 | frontend/controllers/AuthController.php | AuthController.actionAuthorize | public function actionAuthorize()
{
$model = new LoginForm();
if ($model->load(Yii::$app->request->post()) && $model->login()) {
if ($this->isOauthRequest) {
$this->finishAuthorization();
} else {
return $this->goBack();
}
}... | php | public function actionAuthorize()
{
$model = new LoginForm();
if ($model->load(Yii::$app->request->post()) && $model->login()) {
if ($this->isOauthRequest) {
$this->finishAuthorization();
} else {
return $this->goBack();
}
}... | [
"public",
"function",
"actionAuthorize",
"(",
")",
"{",
"$",
"model",
"=",
"new",
"LoginForm",
"(",
")",
";",
"if",
"(",
"$",
"model",
"->",
"load",
"(",
"Yii",
"::",
"$",
"app",
"->",
"request",
"->",
"post",
"(",
")",
")",
"&&",
"$",
"model",
"... | Display login form, signup or something else.
AuthClients such as Google also may be used | [
"Display",
"login",
"form",
"signup",
"or",
"something",
"else",
".",
"AuthClients",
"such",
"as",
"Google",
"also",
"may",
"be",
"used"
] | 7fb41fc56d4a6a5f4107aec5429580729257ed3a | https://github.com/yuncms/yii2-oauth2/blob/7fb41fc56d4a6a5f4107aec5429580729257ed3a/frontend/controllers/AuthController.php#L65-L80 |
195,311 | yuncms/yii2-oauth2 | frontend/controllers/AuthController.php | AuthController.successCallback | public function successCallback($client)
{
$account = Social::find()->byClient($client)->one();
if ($account === null) {
$account = Social::create($client);
}
if ($account->user instanceof Yii::$app->user->id) {
if ($account->user->isBlocked) {
... | php | public function successCallback($client)
{
$account = Social::find()->byClient($client)->one();
if ($account === null) {
$account = Social::create($client);
}
if ($account->user instanceof Yii::$app->user->id) {
if ($account->user->isBlocked) {
... | [
"public",
"function",
"successCallback",
"(",
"$",
"client",
")",
"{",
"$",
"account",
"=",
"Social",
"::",
"find",
"(",
")",
"->",
"byClient",
"(",
"$",
"client",
")",
"->",
"one",
"(",
")",
";",
"if",
"(",
"$",
"account",
"===",
"null",
")",
"{",... | OPTIONAL
Third party oauth callback sample
@param \yii\authclient\OAuth2 $client | [
"OPTIONAL",
"Third",
"party",
"oauth",
"callback",
"sample"
] | 7fb41fc56d4a6a5f4107aec5429580729257ed3a | https://github.com/yuncms/yii2-oauth2/blob/7fb41fc56d4a6a5f4107aec5429580729257ed3a/frontend/controllers/AuthController.php#L96-L115 |
195,312 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/ValueGenerator/UuidGenerator.php | UuidGenerator.generate | public function generate(DocumentManager $dm, $document)
{
$UUID = $this->generateV4();
return $this->generateV5($UUID, $this->salt ?: php_uname('n'));
} | php | public function generate(DocumentManager $dm, $document)
{
$UUID = $this->generateV4();
return $this->generateV5($UUID, $this->salt ?: php_uname('n'));
} | [
"public",
"function",
"generate",
"(",
"DocumentManager",
"$",
"dm",
",",
"$",
"document",
")",
"{",
"$",
"UUID",
"=",
"$",
"this",
"->",
"generateV4",
"(",
")",
";",
"return",
"$",
"this",
"->",
"generateV5",
"(",
"$",
"UUID",
",",
"$",
"this",
"->"... | Generate a new UUID.
@param DocumentManager $dm Not used
@param object $document Not used
@return string | [
"Generate",
"a",
"new",
"UUID",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/ValueGenerator/UuidGenerator.php#L29-L34 |
195,313 | angrycoders/db-driver | src/Database/SQL/SQLEncoder.php | SQLEncoder.encodeCreateTable | public static function encodeCreateTable($tableName, $fields)
{
$query = "CREATE TABLE IF NOT EXISTS $tableName (";
$keys = array_keys($fields);
$size = sizeof($keys);
foreach ($keys as $index => $field) {
$query .= " $field";
$attribs = $fields[$field];
... | php | public static function encodeCreateTable($tableName, $fields)
{
$query = "CREATE TABLE IF NOT EXISTS $tableName (";
$keys = array_keys($fields);
$size = sizeof($keys);
foreach ($keys as $index => $field) {
$query .= " $field";
$attribs = $fields[$field];
... | [
"public",
"static",
"function",
"encodeCreateTable",
"(",
"$",
"tableName",
",",
"$",
"fields",
")",
"{",
"$",
"query",
"=",
"\"CREATE TABLE IF NOT EXISTS $tableName (\"",
";",
"$",
"keys",
"=",
"array_keys",
"(",
"$",
"fields",
")",
";",
"$",
"size",
"=",
"... | Creates a create table sql statement
@param $tableName
@param $fields
@return string executable sql statement | [
"Creates",
"a",
"create",
"table",
"sql",
"statement"
] | e5df527ac0ea5fa434cbda79692f37cf6f2abc73 | https://github.com/angrycoders/db-driver/blob/e5df527ac0ea5fa434cbda79692f37cf6f2abc73/src/Database/SQL/SQLEncoder.php#L25-L46 |
195,314 | angrycoders/db-driver | src/Database/SQL/SQLEncoder.php | SQLEncoder.encodeInsertRecord | public static function encodeInsertRecord($tableName, $newRecord)
{
$query = "INSERT INTO $tableName VALUES (";
$size = sizeof($newRecord);
foreach ($newRecord as $index => $record) {
$query .= " '$record'";
if ($index != ($size - 1))
$query .= " ,";
... | php | public static function encodeInsertRecord($tableName, $newRecord)
{
$query = "INSERT INTO $tableName VALUES (";
$size = sizeof($newRecord);
foreach ($newRecord as $index => $record) {
$query .= " '$record'";
if ($index != ($size - 1))
$query .= " ,";
... | [
"public",
"static",
"function",
"encodeInsertRecord",
"(",
"$",
"tableName",
",",
"$",
"newRecord",
")",
"{",
"$",
"query",
"=",
"\"INSERT INTO $tableName VALUES (\"",
";",
"$",
"size",
"=",
"sizeof",
"(",
"$",
"newRecord",
")",
";",
"foreach",
"(",
"$",
"ne... | Creates a insert record SQL statement
@param $tableName
@param $newRecord
@return string executable sql statement | [
"Creates",
"a",
"insert",
"record",
"SQL",
"statement"
] | e5df527ac0ea5fa434cbda79692f37cf6f2abc73 | https://github.com/angrycoders/db-driver/blob/e5df527ac0ea5fa434cbda79692f37cf6f2abc73/src/Database/SQL/SQLEncoder.php#L55-L66 |
195,315 | angrycoders/db-driver | src/Database/SQL/SQLEncoder.php | SQLEncoder.encodeGetRecord | public static function encodeGetRecord($tableName, $field, $value, $fields = array())
{
$select = "";
$size = sizeof($fields);
//Select fields to be returned
if (sizeof($fields) > 0) {
foreach ($fields as $i => $column) {
$select .= " $column";
... | php | public static function encodeGetRecord($tableName, $field, $value, $fields = array())
{
$select = "";
$size = sizeof($fields);
//Select fields to be returned
if (sizeof($fields) > 0) {
foreach ($fields as $i => $column) {
$select .= " $column";
... | [
"public",
"static",
"function",
"encodeGetRecord",
"(",
"$",
"tableName",
",",
"$",
"field",
",",
"$",
"value",
",",
"$",
"fields",
"=",
"array",
"(",
")",
")",
"{",
"$",
"select",
"=",
"\"\"",
";",
"$",
"size",
"=",
"sizeof",
"(",
"$",
"fields",
"... | Encodes get record statement
@param string $tableName
@param string $field field to match
@param string $value value to match with field
@param array $fields columns to be returned
@return string executable SQL statement | [
"Encodes",
"get",
"record",
"statement"
] | e5df527ac0ea5fa434cbda79692f37cf6f2abc73 | https://github.com/angrycoders/db-driver/blob/e5df527ac0ea5fa434cbda79692f37cf6f2abc73/src/Database/SQL/SQLEncoder.php#L89-L106 |
195,316 | angrycoders/db-driver | src/Database/SQL/SQLEncoder.php | SQLEncoder.encodeUpdateRecord | public static function encodeUpdateRecord($tableName, $fields, $values, $field, $value)
{
$query = "UPDATE $tableName SET";
$size = sizeof($fields);
foreach ($fields as $i => $column) {
$query .= " $column = '$values[$i]'";
if ($i != ($size - 1))
$quer... | php | public static function encodeUpdateRecord($tableName, $fields, $values, $field, $value)
{
$query = "UPDATE $tableName SET";
$size = sizeof($fields);
foreach ($fields as $i => $column) {
$query .= " $column = '$values[$i]'";
if ($i != ($size - 1))
$quer... | [
"public",
"static",
"function",
"encodeUpdateRecord",
"(",
"$",
"tableName",
",",
"$",
"fields",
",",
"$",
"values",
",",
"$",
"field",
",",
"$",
"value",
")",
"{",
"$",
"query",
"=",
"\"UPDATE $tableName SET\"",
";",
"$",
"size",
"=",
"sizeof",
"(",
"$"... | Encodes the params to an SQL statement
@param string $tableName the name of table in db
@param array $fields the fields to be updated
@param array $values the values to update the fields
@param string $field the field to check
@param string $value the value of the field to check
@return string executable SQL statement | [
"Encodes",
"the",
"params",
"to",
"an",
"SQL",
"statement"
] | e5df527ac0ea5fa434cbda79692f37cf6f2abc73 | https://github.com/angrycoders/db-driver/blob/e5df527ac0ea5fa434cbda79692f37cf6f2abc73/src/Database/SQL/SQLEncoder.php#L117-L128 |
195,317 | angrycoders/db-driver | src/Database/SQL/SQLEncoder.php | SQLEncoder.encodeGetAllRecords | public static function encodeGetAllRecords($tableName, $fields = array(), $limit = 0, $start = 0)
{
if ($fields == null)
$fields = array();
$select = "";
$size = sizeof($fields);
//Select fields to be returned
if (sizeof($fields) > 0) {
foreach ($fiel... | php | public static function encodeGetAllRecords($tableName, $fields = array(), $limit = 0, $start = 0)
{
if ($fields == null)
$fields = array();
$select = "";
$size = sizeof($fields);
//Select fields to be returned
if (sizeof($fields) > 0) {
foreach ($fiel... | [
"public",
"static",
"function",
"encodeGetAllRecords",
"(",
"$",
"tableName",
",",
"$",
"fields",
"=",
"array",
"(",
")",
",",
"$",
"limit",
"=",
"0",
",",
"$",
"start",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"fields",
"==",
"null",
")",
"$",
"fields"... | Encode Get all record to SQL statement
@param $tableName the name of table in db
@param array $fields the field to be returned. Returns all fields if not specified
@param int $limit the number of records to return. Returns all record if not returned
@param int $start the record index to start record. Starts from the fi... | [
"Encode",
"Get",
"all",
"record",
"to",
"SQL",
"statement"
] | e5df527ac0ea5fa434cbda79692f37cf6f2abc73 | https://github.com/angrycoders/db-driver/blob/e5df527ac0ea5fa434cbda79692f37cf6f2abc73/src/Database/SQL/SQLEncoder.php#L138-L169 |
195,318 | PaulDevelop/library-common | src/class/GenericCollection.php | GenericCollection.add | public
function add(
$value = null,
$key = ''
) {
//var_dump($this->type);
//var_dump($value);
//var_dump(is_object($value));
//die;
if ($this->isClass) {
//echo " isClass".PHP_EOL;
if (!is_a($value, $this->type)) {
... | php | public
function add(
$value = null,
$key = ''
) {
//var_dump($this->type);
//var_dump($value);
//var_dump(is_object($value));
//die;
if ($this->isClass) {
//echo " isClass".PHP_EOL;
if (!is_a($value, $this->type)) {
... | [
"public",
"function",
"add",
"(",
"$",
"value",
"=",
"null",
",",
"$",
"key",
"=",
"''",
")",
"{",
"//var_dump($this->type);",
"//var_dump($value);",
"//var_dump(is_object($value));",
"//die;",
"if",
"(",
"$",
"this",
"->",
"isClass",
")",
"{",
"//echo \" isCla... | Add value to collection.
@param mixed $value
@param string $key
@throws TypeCheckException
@throws ArgumentException | [
"Add",
"value",
"to",
"collection",
"."
] | 12ebf86e1b660fa55724d2a168a61fc6c3a77f8b | https://github.com/PaulDevelop/library-common/blob/12ebf86e1b660fa55724d2a168a61fc6c3a77f8b/src/class/GenericCollection.php#L116-L162 |
195,319 | spacek/contrastcms-application | src/model/TreeProvider.php | TreeProvider.hasChildren | public static function hasChildren($postRepository, $language, $postId)
{
$menuCount = $postRepository->countBy(array(
'lang' => $language,
'parent' => $postId
));
if ($menuCount > 0) {
return true;
}
return false;
} | php | public static function hasChildren($postRepository, $language, $postId)
{
$menuCount = $postRepository->countBy(array(
'lang' => $language,
'parent' => $postId
));
if ($menuCount > 0) {
return true;
}
return false;
} | [
"public",
"static",
"function",
"hasChildren",
"(",
"$",
"postRepository",
",",
"$",
"language",
",",
"$",
"postId",
")",
"{",
"$",
"menuCount",
"=",
"$",
"postRepository",
"->",
"countBy",
"(",
"array",
"(",
"'lang'",
"=>",
"$",
"language",
",",
"'parent'... | Returns bool value whether item is containing children.
@param $postRepository
@param $language
@param $postId
@return bool | [
"Returns",
"bool",
"value",
"whether",
"item",
"is",
"containing",
"children",
"."
] | 054844cd531f98a3694b4dba554c935d3ca412b9 | https://github.com/spacek/contrastcms-application/blob/054844cd531f98a3694b4dba554c935d3ca412b9/src/model/TreeProvider.php#L81-L93 |
195,320 | spacek/contrastcms-application | src/model/TreeProvider.php | TreeProvider.getChildren | public static function getChildren($postRepository, $language, $postId, $activeId = 0, $getUnpublished = true)
{
$menuObject = array();
$requirements = array(
'lang' => $language,
'parent' => $postId,
);
if (!$getUnpublished) {
$requirements['is_public'] = 1;
}
$subItems = $postRepository->find... | php | public static function getChildren($postRepository, $language, $postId, $activeId = 0, $getUnpublished = true)
{
$menuObject = array();
$requirements = array(
'lang' => $language,
'parent' => $postId,
);
if (!$getUnpublished) {
$requirements['is_public'] = 1;
}
$subItems = $postRepository->find... | [
"public",
"static",
"function",
"getChildren",
"(",
"$",
"postRepository",
",",
"$",
"language",
",",
"$",
"postId",
",",
"$",
"activeId",
"=",
"0",
",",
"$",
"getUnpublished",
"=",
"true",
")",
"{",
"$",
"menuObject",
"=",
"array",
"(",
")",
";",
"$",... | Returns array filled with MenuItem objects
@param $postRepository
@param $language
@param $postId
@return bool | [
"Returns",
"array",
"filled",
"with",
"MenuItem",
"objects"
] | 054844cd531f98a3694b4dba554c935d3ca412b9 | https://github.com/spacek/contrastcms-application/blob/054844cd531f98a3694b4dba554c935d3ca412b9/src/model/TreeProvider.php#L102-L137 |
195,321 | foxslider/cmg-plugin | common/models/resources/Slide.php | Slide.findByNameSliderId | public static function findByNameSliderId( $name, $sliderId ) {
return Slide::find()->where( 'sliderId=:id', [ ':id' => $sliderId ] )->andwhere( 'name=:name', [ ':name' => $name ] )->one();
} | php | public static function findByNameSliderId( $name, $sliderId ) {
return Slide::find()->where( 'sliderId=:id', [ ':id' => $sliderId ] )->andwhere( 'name=:name', [ ':name' => $name ] )->one();
} | [
"public",
"static",
"function",
"findByNameSliderId",
"(",
"$",
"name",
",",
"$",
"sliderId",
")",
"{",
"return",
"Slide",
"::",
"find",
"(",
")",
"->",
"where",
"(",
"'sliderId=:id'",
",",
"[",
"':id'",
"=>",
"$",
"sliderId",
"]",
")",
"->",
"andwhere",... | Find and return the slide associated with given name and slider id.
@param string $name
@param integer $sliderId
@return Slide[] | [
"Find",
"and",
"return",
"the",
"slide",
"associated",
"with",
"given",
"name",
"and",
"slider",
"id",
"."
] | 843f723ebb512ab833feff581beb9714df4e41bd | https://github.com/foxslider/cmg-plugin/blob/843f723ebb512ab833feff581beb9714df4e41bd/common/models/resources/Slide.php#L209-L212 |
195,322 | foxslider/cmg-plugin | common/models/resources/Slide.php | Slide.isExistByNameSliderId | public static function isExistByNameSliderId( $name, $sliderId ) {
$slide = self::findByNameSliderId( $name, $sliderId );
return isset( $slide );
} | php | public static function isExistByNameSliderId( $name, $sliderId ) {
$slide = self::findByNameSliderId( $name, $sliderId );
return isset( $slide );
} | [
"public",
"static",
"function",
"isExistByNameSliderId",
"(",
"$",
"name",
",",
"$",
"sliderId",
")",
"{",
"$",
"slide",
"=",
"self",
"::",
"findByNameSliderId",
"(",
"$",
"name",
",",
"$",
"sliderId",
")",
";",
"return",
"isset",
"(",
"$",
"slide",
")",... | Check whether slide exist by name and slider id.
@param string $name
@param integer $sliderId
@return boolean | [
"Check",
"whether",
"slide",
"exist",
"by",
"name",
"and",
"slider",
"id",
"."
] | 843f723ebb512ab833feff581beb9714df4e41bd | https://github.com/foxslider/cmg-plugin/blob/843f723ebb512ab833feff581beb9714df4e41bd/common/models/resources/Slide.php#L221-L226 |
195,323 | MayMeow/may-encrypt | src/Factory/SecurityFactory.php | SecurityFactory.setKeyPair | public function setKeyPair(KeyPairLoaderInterface $keyPairLoader)
{
$this->privateKey = $keyPairLoader->getPrivateKey();
$this->publicKey = $keyPairLoader->getPublicKey();
} | php | public function setKeyPair(KeyPairLoaderInterface $keyPairLoader)
{
$this->privateKey = $keyPairLoader->getPrivateKey();
$this->publicKey = $keyPairLoader->getPublicKey();
} | [
"public",
"function",
"setKeyPair",
"(",
"KeyPairLoaderInterface",
"$",
"keyPairLoader",
")",
"{",
"$",
"this",
"->",
"privateKey",
"=",
"$",
"keyPairLoader",
"->",
"getPrivateKey",
"(",
")",
";",
"$",
"this",
"->",
"publicKey",
"=",
"$",
"keyPairLoader",
"->"... | Set key pair
@param KeyPairLoaderInterface $keyPairLoader | [
"Set",
"key",
"pair"
] | d67122e240037e6cc31e1c0742911e87cda93a86 | https://github.com/MayMeow/may-encrypt/blob/d67122e240037e6cc31e1c0742911e87cda93a86/src/Factory/SecurityFactory.php#L108-L112 |
195,324 | Wedeto/Auth | src/ACL/Hierarchy.php | Hierarchy.is | public function is(Hierarchy $element)
{
if (get_class($this) !== get_class($element))
return false;
return $this->id === $element->id;
} | php | public function is(Hierarchy $element)
{
if (get_class($this) !== get_class($element))
return false;
return $this->id === $element->id;
} | [
"public",
"function",
"is",
"(",
"Hierarchy",
"$",
"element",
")",
"{",
"if",
"(",
"get_class",
"(",
"$",
"this",
")",
"!==",
"get_class",
"(",
"$",
"element",
")",
")",
"return",
"false",
";",
"return",
"$",
"this",
"->",
"id",
"===",
"$",
"element"... | Check if the objects are referring to the same element.
@return boolean True if both elements are the same class and ID, false otherwise | [
"Check",
"if",
"the",
"objects",
"are",
"referring",
"to",
"the",
"same",
"element",
"."
] | d53777d860a9e67154b84b425e29da5d4dcd28e0 | https://github.com/Wedeto/Auth/blob/d53777d860a9e67154b84b425e29da5d4dcd28e0/src/ACL/Hierarchy.php#L91-L96 |
195,325 | Wedeto/Auth | src/ACL/Hierarchy.php | Hierarchy.isAncestorOf | public function isAncestorOf(Hierarchy $element, LoaderInterface $loader = null)
{
return $loader !== null ? $element->isOffspringOf($this, $loader) : $element->isOffspringOf($this);
} | php | public function isAncestorOf(Hierarchy $element, LoaderInterface $loader = null)
{
return $loader !== null ? $element->isOffspringOf($this, $loader) : $element->isOffspringOf($this);
} | [
"public",
"function",
"isAncestorOf",
"(",
"Hierarchy",
"$",
"element",
",",
"LoaderInterface",
"$",
"loader",
"=",
"null",
")",
"{",
"return",
"$",
"loader",
"!==",
"null",
"?",
"$",
"element",
"->",
"isOffspringOf",
"(",
"$",
"this",
",",
"$",
"loader",
... | Check if the current element is an ancestor of the specified element
@param $element Hierarchy The element to check
@param $loader LoaderInterface A loader instance that can be used to load additional instances
@return boolean True when the current Entity is an ancestor of $element, false otherwise | [
"Check",
"if",
"the",
"current",
"element",
"is",
"an",
"ancestor",
"of",
"the",
"specified",
"element"
] | d53777d860a9e67154b84b425e29da5d4dcd28e0 | https://github.com/Wedeto/Auth/blob/d53777d860a9e67154b84b425e29da5d4dcd28e0/src/ACL/Hierarchy.php#L105-L108 |
195,326 | Wedeto/Auth | src/ACL/Hierarchy.php | Hierarchy.isOffspringOf | public function isOffspringOf(Hierarchy $element, LoaderInterface $loader = null)
{
if (get_class($element) !== get_class($this))
return 0;
$stack = [];
$parents = $this->getParents($loader);
foreach ($parents as $p)
$stack[] = [1, $p];
$seen = [];
... | php | public function isOffspringOf(Hierarchy $element, LoaderInterface $loader = null)
{
if (get_class($element) !== get_class($this))
return 0;
$stack = [];
$parents = $this->getParents($loader);
foreach ($parents as $p)
$stack[] = [1, $p];
$seen = [];
... | [
"public",
"function",
"isOffspringOf",
"(",
"Hierarchy",
"$",
"element",
",",
"LoaderInterface",
"$",
"loader",
"=",
"null",
")",
"{",
"if",
"(",
"get_class",
"(",
"$",
"element",
")",
"!==",
"get_class",
"(",
"$",
"this",
")",
")",
"return",
"0",
";",
... | Check if the current element is offspring of the specified element
@param $role Hierarchy The element to check
@param $loader LoaderInterface A loader that can be used to load additional instances
@return integer The number of generation levels between the $this and $element - 0 if they're not related | [
"Check",
"if",
"the",
"current",
"element",
"is",
"offspring",
"of",
"the",
"specified",
"element"
] | d53777d860a9e67154b84b425e29da5d4dcd28e0 | https://github.com/Wedeto/Auth/blob/d53777d860a9e67154b84b425e29da5d4dcd28e0/src/ACL/Hierarchy.php#L117-L152 |
195,327 | Wedeto/Auth | src/ACL/Hierarchy.php | Hierarchy.getParents | public function getParents(LoaderInterface $loader = null)
{
if (empty($this->parents) && $this->id !== static::$root)
$this->parents = [$this->getRoot()];
$acl = $this->getACL();
if (null === $acl)
throw new \RuntimeException("ACL is null on " . get_class($this));
... | php | public function getParents(LoaderInterface $loader = null)
{
if (empty($this->parents) && $this->id !== static::$root)
$this->parents = [$this->getRoot()];
$acl = $this->getACL();
if (null === $acl)
throw new \RuntimeException("ACL is null on " . get_class($this));
... | [
"public",
"function",
"getParents",
"(",
"LoaderInterface",
"$",
"loader",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"parents",
")",
"&&",
"$",
"this",
"->",
"id",
"!==",
"static",
"::",
"$",
"root",
")",
"$",
"this",
"->",
... | Return a list of all parent elements of this element
@param $loader LoaderInterface A loader that can be used to load additional instances
@return array An array of all parent elements | [
"Return",
"a",
"list",
"of",
"all",
"parent",
"elements",
"of",
"this",
"element"
] | d53777d860a9e67154b84b425e29da5d4dcd28e0 | https://github.com/Wedeto/Auth/blob/d53777d860a9e67154b84b425e29da5d4dcd28e0/src/ACL/Hierarchy.php#L160-L188 |
195,328 | Wedeto/Auth | src/ACL/Hierarchy.php | Hierarchy.setParents | public function setParents(array $parents)
{
$ownclass = get_class($this);
$is_root = ($this->id === static::$root);
$this->parents = array();
foreach ($parents as $parent)
{
if (is_object($parent) && get_class($parent) == $ownclass)
$this->parent... | php | public function setParents(array $parents)
{
$ownclass = get_class($this);
$is_root = ($this->id === static::$root);
$this->parents = array();
foreach ($parents as $parent)
{
if (is_object($parent) && get_class($parent) == $ownclass)
$this->parent... | [
"public",
"function",
"setParents",
"(",
"array",
"$",
"parents",
")",
"{",
"$",
"ownclass",
"=",
"get_class",
"(",
"$",
"this",
")",
";",
"$",
"is_root",
"=",
"(",
"$",
"this",
"->",
"id",
"===",
"static",
"::",
"$",
"root",
")",
";",
"$",
"this",... | Set the parent or parents of this element
@param $parents array One or more parent elements. The values can be instances of the same
class or scalars referring to these instances.
@Return $this Provides fluent interface
@throws Wedeto\ACL\Exception When invalid types of parents are specified | [
"Set",
"the",
"parent",
"or",
"parents",
"of",
"this",
"element"
] | d53777d860a9e67154b84b425e29da5d4dcd28e0 | https://github.com/Wedeto/Auth/blob/d53777d860a9e67154b84b425e29da5d4dcd28e0/src/ACL/Hierarchy.php#L198-L218 |
195,329 | nails/driver-cdn-awslocal | src/Aws.php | Aws.sdk | protected function sdk()
{
if (empty($this->oSdk)) {
$this->oSdk = new \Aws\S3\S3Client([
'version' => 'latest',
'region' => $this->getRegion(),
'credentials' => new \Aws\Credentials\Credentials(
$this->getSetting('acce... | php | protected function sdk()
{
if (empty($this->oSdk)) {
$this->oSdk = new \Aws\S3\S3Client([
'version' => 'latest',
'region' => $this->getRegion(),
'credentials' => new \Aws\Credentials\Credentials(
$this->getSetting('acce... | [
"protected",
"function",
"sdk",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"oSdk",
")",
")",
"{",
"$",
"this",
"->",
"oSdk",
"=",
"new",
"\\",
"Aws",
"\\",
"S3",
"\\",
"S3Client",
"(",
"[",
"'version'",
"=>",
"'latest'",
",",
"'re... | Returns an instance of the AWS S3 SDK
@return S3Client | [
"Returns",
"an",
"instance",
"of",
"the",
"AWS",
"S3",
"SDK"
] | 422fd0a7a911bec60dbe2791ac6bafd0a2502092 | https://github.com/nails/driver-cdn-awslocal/blob/422fd0a7a911bec60dbe2791ac6bafd0a2502092/src/Aws.php#L41-L55 |
195,330 | nails/driver-cdn-awslocal | src/Aws.php | Aws.getBucket | protected function getBucket()
{
if (empty($this->sS3Bucket)) {
$this->sS3Bucket = $this->getRegionAndBucket()->bucket;
if (empty($this->sS3Bucket)) {
throw new DriverException('S3 Bucket has not been defined.');
}
}
return $this->sS3Bucke... | php | protected function getBucket()
{
if (empty($this->sS3Bucket)) {
$this->sS3Bucket = $this->getRegionAndBucket()->bucket;
if (empty($this->sS3Bucket)) {
throw new DriverException('S3 Bucket has not been defined.');
}
}
return $this->sS3Bucke... | [
"protected",
"function",
"getBucket",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"sS3Bucket",
")",
")",
"{",
"$",
"this",
"->",
"sS3Bucket",
"=",
"$",
"this",
"->",
"getRegionAndBucket",
"(",
")",
"->",
"bucket",
";",
"if",
"(",
"empt... | Returns the AWS bucket for this environment
@return string
@throws DriverException | [
"Returns",
"the",
"AWS",
"bucket",
"for",
"this",
"environment"
] | 422fd0a7a911bec60dbe2791ac6bafd0a2502092 | https://github.com/nails/driver-cdn-awslocal/blob/422fd0a7a911bec60dbe2791ac6bafd0a2502092/src/Aws.php#L66-L76 |
195,331 | nails/driver-cdn-awslocal | src/Aws.php | Aws.getRegion | protected function getRegion()
{
if (empty($this->sS3Region)) {
$this->sS3Region = $this->getRegionAndBucket()->region;
if (empty($this->sS3Region)) {
throw new DriverException('S3 Region has not been defined.');
}
}
return $this->sS3Regio... | php | protected function getRegion()
{
if (empty($this->sS3Region)) {
$this->sS3Region = $this->getRegionAndBucket()->region;
if (empty($this->sS3Region)) {
throw new DriverException('S3 Region has not been defined.');
}
}
return $this->sS3Regio... | [
"protected",
"function",
"getRegion",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"sS3Region",
")",
")",
"{",
"$",
"this",
"->",
"sS3Region",
"=",
"$",
"this",
"->",
"getRegionAndBucket",
"(",
")",
"->",
"region",
";",
"if",
"(",
"empt... | Returns the AWS region for this environment
@return string
@throws DriverException | [
"Returns",
"the",
"AWS",
"region",
"for",
"this",
"environment"
] | 422fd0a7a911bec60dbe2791ac6bafd0a2502092 | https://github.com/nails/driver-cdn-awslocal/blob/422fd0a7a911bec60dbe2791ac6bafd0a2502092/src/Aws.php#L87-L97 |
195,332 | nails/driver-cdn-awslocal | src/Aws.php | Aws.getRegionAndBucket | protected function getRegionAndBucket()
{
$aSpaces = json_decode($this->getSetting('buckets'), true);
if (empty($aSpaces)) {
throw new DriverException('S3 Buckets have not been defined.');
} elseif (empty($aSpaces[Environment::get()])) {
throw new DriverException('No ... | php | protected function getRegionAndBucket()
{
$aSpaces = json_decode($this->getSetting('buckets'), true);
if (empty($aSpaces)) {
throw new DriverException('S3 Buckets have not been defined.');
} elseif (empty($aSpaces[Environment::get()])) {
throw new DriverException('No ... | [
"protected",
"function",
"getRegionAndBucket",
"(",
")",
"{",
"$",
"aSpaces",
"=",
"json_decode",
"(",
"$",
"this",
"->",
"getSetting",
"(",
"'buckets'",
")",
",",
"true",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"aSpaces",
")",
")",
"{",
"throw",
"new"... | Extracts the Region and Bucket from the configs
@return \stdClass
@throws DriverException | [
"Extracts",
"the",
"Region",
"and",
"Bucket",
"from",
"the",
"configs"
] | 422fd0a7a911bec60dbe2791ac6bafd0a2502092 | https://github.com/nails/driver-cdn-awslocal/blob/422fd0a7a911bec60dbe2791ac6bafd0a2502092/src/Aws.php#L108-L122 |
195,333 | PenoaksDev/Milky-Framework | src/Milky/Database/Eloquent/Nested/SetBuilder.php | SetBuilder.rebuild | public function rebuild( $force = false )
{
$alreadyValid = forward_static_call( [get_class( $this->model ), 'isValidNestedSet'] );
// Do not rebuild a valid Nested Set tree structure
if ( !$force && $alreadyValid )
return true;
// Rebuild lefts and rights for each root node and its children (recursively)... | php | public function rebuild( $force = false )
{
$alreadyValid = forward_static_call( [get_class( $this->model ), 'isValidNestedSet'] );
// Do not rebuild a valid Nested Set tree structure
if ( !$force && $alreadyValid )
return true;
// Rebuild lefts and rights for each root node and its children (recursively)... | [
"public",
"function",
"rebuild",
"(",
"$",
"force",
"=",
"false",
")",
"{",
"$",
"alreadyValid",
"=",
"forward_static_call",
"(",
"[",
"get_class",
"(",
"$",
"this",
"->",
"model",
")",
",",
"'isValidNestedSet'",
"]",
")",
";",
"// Do not rebuild a valid Neste... | Perform the re-calculation of the left and right indexes of the whole
nested set tree structure.
@param bool $force
@return bool | [
"Perform",
"the",
"re",
"-",
"calculation",
"of",
"the",
"left",
"and",
"right",
"indexes",
"of",
"the",
"whole",
"nested",
"set",
"tree",
"structure",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Nested/SetBuilder.php#L39-L61 |
195,334 | PenoaksDev/Milky-Framework | src/Milky/Database/Eloquent/Nested/SetBuilder.php | SetBuilder.roots | public function roots()
{
return $this->model->newQuery()->whereNull( $this->model->getQualifiedParentColumnName() )->orderBy( $this->model->getQualifiedLeftColumnName() )->orderBy( $this->model->getQualifiedRightColumnName() )->orderBy( $this->model->getQualifiedKeyName() )->get();
} | php | public function roots()
{
return $this->model->newQuery()->whereNull( $this->model->getQualifiedParentColumnName() )->orderBy( $this->model->getQualifiedLeftColumnName() )->orderBy( $this->model->getQualifiedRightColumnName() )->orderBy( $this->model->getQualifiedKeyName() )->get();
} | [
"public",
"function",
"roots",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"model",
"->",
"newQuery",
"(",
")",
"->",
"whereNull",
"(",
"$",
"this",
"->",
"model",
"->",
"getQualifiedParentColumnName",
"(",
")",
")",
"->",
"orderBy",
"(",
"$",
"this",
... | Return all root nodes for the current database table appropiately sorted.
@return Collection | [
"Return",
"all",
"root",
"nodes",
"for",
"the",
"current",
"database",
"table",
"appropiately",
"sorted",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Nested/SetBuilder.php#L68-L71 |
195,335 | PenoaksDev/Milky-Framework | src/Milky/Database/Eloquent/Nested/SetBuilder.php | SetBuilder.children | public function children( $model )
{
$query = $this->model->newQuery();
$query->where( $this->model->getQualifiedParentColumnName(), '=', $model->getKey() );
// We must also add the scoped column values to the query to compute valid
// left and right indexes.
foreach ( $this->scopedAttributes( $model ) as ... | php | public function children( $model )
{
$query = $this->model->newQuery();
$query->where( $this->model->getQualifiedParentColumnName(), '=', $model->getKey() );
// We must also add the scoped column values to the query to compute valid
// left and right indexes.
foreach ( $this->scopedAttributes( $model ) as ... | [
"public",
"function",
"children",
"(",
"$",
"model",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"model",
"->",
"newQuery",
"(",
")",
";",
"$",
"query",
"->",
"where",
"(",
"$",
"this",
"->",
"model",
"->",
"getQualifiedParentColumnName",
"(",
")",... | Return all children for the specified node.
@param NestedModel $model
@return Collection | [
"Return",
"all",
"children",
"for",
"the",
"specified",
"node",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Nested/SetBuilder.php#L98-L114 |
195,336 | PenoaksDev/Milky-Framework | src/Milky/Database/Eloquent/Nested/SetBuilder.php | SetBuilder.scopedAttributes | protected function scopedAttributes( $model )
{
$keys = $this->model->getScopedColumns();
if ( count( $keys ) == 0 )
return [];
$values = array_map( function ( $column ) use ( $model )
{
return $model->getAttribute( $column );
}, $keys );
return array_combine( $keys, $values );
} | php | protected function scopedAttributes( $model )
{
$keys = $this->model->getScopedColumns();
if ( count( $keys ) == 0 )
return [];
$values = array_map( function ( $column ) use ( $model )
{
return $model->getAttribute( $column );
}, $keys );
return array_combine( $keys, $values );
} | [
"protected",
"function",
"scopedAttributes",
"(",
"$",
"model",
")",
"{",
"$",
"keys",
"=",
"$",
"this",
"->",
"model",
"->",
"getScopedColumns",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"keys",
")",
"==",
"0",
")",
"return",
"[",
"]",
";",
"$"... | Return an array of the scoped attributes of the supplied node.
@param NestedModel $model
@return array | [
"Return",
"an",
"array",
"of",
"the",
"scoped",
"attributes",
"of",
"the",
"supplied",
"node",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Nested/SetBuilder.php#L122-L135 |
195,337 | jenskooij/cloudcontrol | src/storage/factories/UserFactory.php | UserFactory.createUserFromPostValues | public static function createUserFromPostValues($postValues)
{
if (isset($postValues['username'])) {
$user = new \stdClass();
$user->username = $postValues['username'];
$user->slug = StringUtil::slugify($postValues['username']);
$user->rights = array();
... | php | public static function createUserFromPostValues($postValues)
{
if (isset($postValues['username'])) {
$user = new \stdClass();
$user->username = $postValues['username'];
$user->slug = StringUtil::slugify($postValues['username']);
$user->rights = array();
... | [
"public",
"static",
"function",
"createUserFromPostValues",
"(",
"$",
"postValues",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"postValues",
"[",
"'username'",
"]",
")",
")",
"{",
"$",
"user",
"=",
"new",
"\\",
"stdClass",
"(",
")",
";",
"$",
"user",
"->"... | Create user from POST values
@param $postValues
@return \stdClass
@throws \Exception | [
"Create",
"user",
"from",
"POST",
"values"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/factories/UserFactory.php#L24-L48 |
195,338 | black-lamp/blcms-cart | backend/controllers/OrderStatusController.php | OrderStatusController.actionSave | public function actionSave($id = null, $languageId)
{
if (!empty($languageId)) {
if (!empty($id)) {
$model = $this->findModel($id);
}
else {
$model = new OrderStatus();
}
$modelTranslation = $this->findOrCreateModel... | php | public function actionSave($id = null, $languageId)
{
if (!empty($languageId)) {
if (!empty($id)) {
$model = $this->findModel($id);
}
else {
$model = new OrderStatus();
}
$modelTranslation = $this->findOrCreateModel... | [
"public",
"function",
"actionSave",
"(",
"$",
"id",
"=",
"null",
",",
"$",
"languageId",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"languageId",
")",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"id",
")",
")",
"{",
"$",
"model",
"=",
"$",
... | Creates a new or updates existing OrderStatus and OrderStatusTranslation models.
If creation is successful, the browser will be redirected to the 'view' page.
@param integer $id
@param integer $languageId
@return mixed
@throws Exception | [
"Creates",
"a",
"new",
"or",
"updates",
"existing",
"OrderStatus",
"and",
"OrderStatusTranslation",
"models",
".",
"If",
"creation",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"view",
"page",
"."
] | 314796eecae3ca4ed5fecfdc0231a738af50eba7 | https://github.com/black-lamp/blcms-cart/blob/314796eecae3ca4ed5fecfdc0231a738af50eba7/backend/controllers/OrderStatusController.php#L73-L109 |
195,339 | black-lamp/blcms-cart | backend/controllers/OrderStatusController.php | OrderStatusController.actionDelete | public function actionDelete($id)
{
if (!empty($id)) {
if ($id != OrderStatus::STATUS_INCOMPLETE && $id != OrderStatus::STATUS_CONFIRMED) {
$status = $this->findModel($id);
if (!empty($status)) {
\Yii::$app->session->setFlash('success', Yii::t(... | php | public function actionDelete($id)
{
if (!empty($id)) {
if ($id != OrderStatus::STATUS_INCOMPLETE && $id != OrderStatus::STATUS_CONFIRMED) {
$status = $this->findModel($id);
if (!empty($status)) {
\Yii::$app->session->setFlash('success', Yii::t(... | [
"public",
"function",
"actionDelete",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"id",
")",
")",
"{",
"if",
"(",
"$",
"id",
"!=",
"OrderStatus",
"::",
"STATUS_INCOMPLETE",
"&&",
"$",
"id",
"!=",
"OrderStatus",
"::",
"STATUS_CONFIRMED"... | Deletes an existing OrderStatus model.
If deletion is successful, the browser will be redirected to the 'index' page.
@param integer $id
@return mixed
@throws Exception if user try to delete default statuses.
@throws NotFoundHttpException if there is not $id. | [
"Deletes",
"an",
"existing",
"OrderStatus",
"model",
".",
"If",
"deletion",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"index",
"page",
"."
] | 314796eecae3ca4ed5fecfdc0231a738af50eba7 | https://github.com/black-lamp/blcms-cart/blob/314796eecae3ca4ed5fecfdc0231a738af50eba7/backend/controllers/OrderStatusController.php#L119-L135 |
195,340 | black-lamp/blcms-cart | backend/controllers/OrderStatusController.php | OrderStatusController.findOrCreateModelTranslation | protected function findOrCreateModelTranslation($id, $languageId)
{
$modelTranslations = OrderStatusTranslation::find()
->where(['order_status_id' => $id, 'language_id' => $languageId])->one();
return (!empty($modelTranslations)) ? $modelTranslations : new OrderStatusTranslation();
} | php | protected function findOrCreateModelTranslation($id, $languageId)
{
$modelTranslations = OrderStatusTranslation::find()
->where(['order_status_id' => $id, 'language_id' => $languageId])->one();
return (!empty($modelTranslations)) ? $modelTranslations : new OrderStatusTranslation();
} | [
"protected",
"function",
"findOrCreateModelTranslation",
"(",
"$",
"id",
",",
"$",
"languageId",
")",
"{",
"$",
"modelTranslations",
"=",
"OrderStatusTranslation",
"::",
"find",
"(",
")",
"->",
"where",
"(",
"[",
"'order_status_id'",
"=>",
"$",
"id",
",",
"'la... | Finds the OrderStatusTranslation model based on 'order_status_id' property.
If the model is not found, a new model will be created.
@param integer $id
@param integer $languageId
@return OrderStatusTranslation|ActiveRecord the loaded model | [
"Finds",
"the",
"OrderStatusTranslation",
"model",
"based",
"on",
"order_status_id",
"property",
".",
"If",
"the",
"model",
"is",
"not",
"found",
"a",
"new",
"model",
"will",
"be",
"created",
"."
] | 314796eecae3ca4ed5fecfdc0231a738af50eba7 | https://github.com/black-lamp/blcms-cart/blob/314796eecae3ca4ed5fecfdc0231a738af50eba7/backend/controllers/OrderStatusController.php#L160-L165 |
195,341 | eureka-framework/component-http | src/Http/Message/Request.php | Request.createFromServerRequest | public static function createFromServerRequest(ServerRequest $serverRequest)
{
return new Request(
$serverRequest->getMethod(),
$serverRequest->getUri(),
$serverRequest->getHeaders(),
$serverRequest->getBody(),
$serverRequest->getProtocolVersion()
... | php | public static function createFromServerRequest(ServerRequest $serverRequest)
{
return new Request(
$serverRequest->getMethod(),
$serverRequest->getUri(),
$serverRequest->getHeaders(),
$serverRequest->getBody(),
$serverRequest->getProtocolVersion()
... | [
"public",
"static",
"function",
"createFromServerRequest",
"(",
"ServerRequest",
"$",
"serverRequest",
")",
"{",
"return",
"new",
"Request",
"(",
"$",
"serverRequest",
"->",
"getMethod",
"(",
")",
",",
"$",
"serverRequest",
"->",
"getUri",
"(",
")",
",",
"$",
... | Build Request from a server Request.
@param ServerRequest $serverRequest
@return Request | [
"Build",
"Request",
"from",
"a",
"server",
"Request",
"."
] | 698c3b73581a9703a9c932890c57e50f8774607a | https://github.com/eureka-framework/component-http/blob/698c3b73581a9703a9c932890c57e50f8774607a/src/Http/Message/Request.php#L148-L157 |
195,342 | eureka-framework/component-http | src/Http/Message/Request.php | Request.replaceHostHeader | private function replaceHostHeader(UriInterface $uri)
{
$host = $uri->getHost();
if (!empty($host)) {
$port = $uri->getPort();
if (!empty($port)) {
$host .= ':' . $port;
}
//~ Ensure Host is the first header. See: http://tools.ietf.o... | php | private function replaceHostHeader(UriInterface $uri)
{
$host = $uri->getHost();
if (!empty($host)) {
$port = $uri->getPort();
if (!empty($port)) {
$host .= ':' . $port;
}
//~ Ensure Host is the first header. See: http://tools.ietf.o... | [
"private",
"function",
"replaceHostHeader",
"(",
"UriInterface",
"$",
"uri",
")",
"{",
"$",
"host",
"=",
"$",
"uri",
"->",
"getHost",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"host",
")",
")",
"{",
"$",
"port",
"=",
"$",
"uri",
"->",
"ge... | Update host header if host is not empty.
@param UriInterface $uri
@return void | [
"Update",
"host",
"header",
"if",
"host",
"is",
"not",
"empty",
"."
] | 698c3b73581a9703a9c932890c57e50f8774607a | https://github.com/eureka-framework/component-http/blob/698c3b73581a9703a9c932890c57e50f8774607a/src/Http/Message/Request.php#L165-L180 |
195,343 | brightnucleus/keys | src/UUID.php | UUID.unserialize | public function unserialize($serialized)
{
$string = unserialize($serialized, []);
$this->data = RamseyUUID::fromString($string);
} | php | public function unserialize($serialized)
{
$string = unserialize($serialized, []);
$this->data = RamseyUUID::fromString($string);
} | [
"public",
"function",
"unserialize",
"(",
"$",
"serialized",
")",
"{",
"$",
"string",
"=",
"unserialize",
"(",
"$",
"serialized",
",",
"[",
"]",
")",
";",
"$",
"this",
"->",
"data",
"=",
"RamseyUUID",
"::",
"fromString",
"(",
"$",
"string",
")",
";",
... | Restore the object from serialized data.
@since 0.1.0
@param string $serialized | [
"Restore",
"the",
"object",
"from",
"serialized",
"data",
"."
] | 1eb8043fea7a61b7ef17a8a2496e3fba79723762 | https://github.com/brightnucleus/keys/blob/1eb8043fea7a61b7ef17a8a2496e3fba79723762/src/UUID.php#L512-L516 |
195,344 | sndsgd/sndsgd-field | src/field/rule/ClosureRule.php | ClosureRule.getClass | public function getClass()
{
if (is_string($this->fn)) {
return $this->fn;
}
$hash = sha1(mt_rand().microtime(true));
return "sndsgd\\field\\rule\\Closure($hash)";
} | php | public function getClass()
{
if (is_string($this->fn)) {
return $this->fn;
}
$hash = sha1(mt_rand().microtime(true));
return "sndsgd\\field\\rule\\Closure($hash)";
} | [
"public",
"function",
"getClass",
"(",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"this",
"->",
"fn",
")",
")",
"{",
"return",
"$",
"this",
"->",
"fn",
";",
"}",
"$",
"hash",
"=",
"sha1",
"(",
"mt_rand",
"(",
")",
".",
"microtime",
"(",
"true",
... | Ensure that multiple Closure rules can be added to a field
@return string | [
"Ensure",
"that",
"multiple",
"Closure",
"rules",
"can",
"be",
"added",
"to",
"a",
"field"
] | 34ac3aabfe031bd9b259b3b93e84964b04031334 | https://github.com/sndsgd/sndsgd-field/blob/34ac3aabfe031bd9b259b3b93e84964b04031334/src/field/rule/ClosureRule.php#L52-L59 |
195,345 | symboo/BootstrapBundle | DependencyInjection/SymbooBootstrapExtension.php | SymbooBootstrapExtension.getAssets | protected function getAssets(array $config)
{
$bootstrapBasePath = $config['bootstrap']['dist_path'];
// Add CSS and JS assets
$assets = array(
'symboo_bootstrap_css' => array(
'inputs' => array($bootstrapBasePath . '/css/bootstrap.min.css'),
'fil... | php | protected function getAssets(array $config)
{
$bootstrapBasePath = $config['bootstrap']['dist_path'];
// Add CSS and JS assets
$assets = array(
'symboo_bootstrap_css' => array(
'inputs' => array($bootstrapBasePath . '/css/bootstrap.min.css'),
'fil... | [
"protected",
"function",
"getAssets",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"bootstrapBasePath",
"=",
"$",
"config",
"[",
"'bootstrap'",
"]",
"[",
"'dist_path'",
"]",
";",
"// Add CSS and JS assets",
"$",
"assets",
"=",
"array",
"(",
"'symboo_bootstrap_css... | Returns the assets to be added
@param array $config
@return array | [
"Returns",
"the",
"assets",
"to",
"be",
"added"
] | 55a7a8732e3bbe99b2b9e52993c4469f816d3055 | https://github.com/symboo/BootstrapBundle/blob/55a7a8732e3bbe99b2b9e52993c4469f816d3055/DependencyInjection/SymbooBootstrapExtension.php#L49-L80 |
195,346 | CroudTech/laravel-repositories | src/Providers/RepositoryServiceProvider.php | RepositoryServiceProvider.boot | public function boot()
{
$this->publishes([
dirname(dirname(__DIR__)).'/config/repositories.php' => config_path('repositories.php'),
]);
foreach (config('repositories.repositories', []) as $respository_contract => $repository) {
$this->app->bind($respository_contract... | php | public function boot()
{
$this->publishes([
dirname(dirname(__DIR__)).'/config/repositories.php' => config_path('repositories.php'),
]);
foreach (config('repositories.repositories', []) as $respository_contract => $repository) {
$this->app->bind($respository_contract... | [
"public",
"function",
"boot",
"(",
")",
"{",
"$",
"this",
"->",
"publishes",
"(",
"[",
"dirname",
"(",
"dirname",
"(",
"__DIR__",
")",
")",
".",
"'/config/repositories.php'",
"=>",
"config_path",
"(",
"'repositories.php'",
")",
",",
"]",
")",
";",
"foreach... | Register any repositories.
@return void | [
"Register",
"any",
"repositories",
"."
] | 3146285be911728fe7b00cf27d2494ad22b773dc | https://github.com/CroudTech/laravel-repositories/blob/3146285be911728fe7b00cf27d2494ad22b773dc/src/Providers/RepositoryServiceProvider.php#L15-L46 |
195,347 | RhubarbPHP/Scaffold.BackgroundTasks | src/BackgroundTask.php | BackgroundTask.executeInBackground | public static function executeInBackground(Task $task, $progressReportedCallback = null, BackgroundTaskStatus $persistentStatus = null)
{
if (!$persistentStatus){
$persistentStatus = new BackgroundTaskStatus();
$persistentStatus->TaskClass = get_class($task);
$persistentS... | php | public static function executeInBackground(Task $task, $progressReportedCallback = null, BackgroundTaskStatus $persistentStatus = null)
{
if (!$persistentStatus){
$persistentStatus = new BackgroundTaskStatus();
$persistentStatus->TaskClass = get_class($task);
$persistentS... | [
"public",
"static",
"function",
"executeInBackground",
"(",
"Task",
"$",
"task",
",",
"$",
"progressReportedCallback",
"=",
"null",
",",
"BackgroundTaskStatus",
"$",
"persistentStatus",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"persistentStatus",
")",
"{",
... | Executes a task and provisions a BackgroundTaskStatus model to store a persistent record of the state.
@param Task $task The task to execute
@param callable|null $progressReportedCallback An optional call back to receive progress events
@param BackgroundTaskStatus|null $persistentStatus If you have a pre-provisioned Ba... | [
"Executes",
"a",
"task",
"and",
"provisions",
"a",
"BackgroundTaskStatus",
"model",
"to",
"store",
"a",
"persistent",
"record",
"of",
"the",
"state",
"."
] | 92a5feab27599288e8bf39deb522588115838904 | https://github.com/RhubarbPHP/Scaffold.BackgroundTasks/blob/92a5feab27599288e8bf39deb522588115838904/src/BackgroundTask.php#L32-L88 |
195,348 | squareproton/Bond | src/Bond/RecordManager/Task/Normality.php | Normality.buildQueryDelete | public static function buildQueryDelete( QuoteInterface $quoting, $table, array $data, array $returning = null )
{
if( !count($data) === 0 ) {
throw new NothingToDoException("Nothing to generate.");
}
$keys = self::keyTuple( $quoting, $data );
$tuples = self::dataTuples... | php | public static function buildQueryDelete( QuoteInterface $quoting, $table, array $data, array $returning = null )
{
if( !count($data) === 0 ) {
throw new NothingToDoException("Nothing to generate.");
}
$keys = self::keyTuple( $quoting, $data );
$tuples = self::dataTuples... | [
"public",
"static",
"function",
"buildQueryDelete",
"(",
"QuoteInterface",
"$",
"quoting",
",",
"$",
"table",
",",
"array",
"$",
"data",
",",
"array",
"$",
"returning",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"count",
"(",
"$",
"data",
")",
"===",
"0",
... | Delete query for a data array
@param string Table (unquoted)
@param array of data | [
"Delete",
"query",
"for",
"a",
"data",
"array"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/RecordManager/Task/Normality.php#L161-L179 |
195,349 | squareproton/Bond | src/Bond/RecordManager/Task/Normality.php | Normality.buildQueryUpdate | public static function buildQueryUpdate( QuoteInterface $quoting, $table, array $primaryKeys, array $data, array $dataInitial, array $returning = null )
{
if( !count($data) === 0 ) {
throw new NothingToDoException("Nothing to generate.");
}
$columnNames = array_keys( $data[0] )... | php | public static function buildQueryUpdate( QuoteInterface $quoting, $table, array $primaryKeys, array $data, array $dataInitial, array $returning = null )
{
if( !count($data) === 0 ) {
throw new NothingToDoException("Nothing to generate.");
}
$columnNames = array_keys( $data[0] )... | [
"public",
"static",
"function",
"buildQueryUpdate",
"(",
"QuoteInterface",
"$",
"quoting",
",",
"$",
"table",
",",
"array",
"$",
"primaryKeys",
",",
"array",
"$",
"data",
",",
"array",
"$",
"dataInitial",
",",
"array",
"$",
"returning",
"=",
"null",
")",
"... | Update query for a data array
@param string $table
@param array $primaryKeys
@param array $data
@return string SQL insert statement | [
"Update",
"query",
"for",
"a",
"data",
"array"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/RecordManager/Task/Normality.php#L188-L266 |
195,350 | squareproton/Bond | src/Bond/RecordManager/Task/Normality.php | Normality.getReturningClause | protected static function getReturningClause( QuoteInterface $quoting, array $returning = null, $table = '' )
{
if( $returning === null ) {
return 'RETURNING *';
} elseif ( $returning === array() ) {
return '';
} elseif( !empty( $table ) ) {
foreach( $retu... | php | protected static function getReturningClause( QuoteInterface $quoting, array $returning = null, $table = '' )
{
if( $returning === null ) {
return 'RETURNING *';
} elseif ( $returning === array() ) {
return '';
} elseif( !empty( $table ) ) {
foreach( $retu... | [
"protected",
"static",
"function",
"getReturningClause",
"(",
"QuoteInterface",
"$",
"quoting",
",",
"array",
"$",
"returning",
"=",
"null",
",",
"$",
"table",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"returning",
"===",
"null",
")",
"{",
"return",
"'RETURNING... | Turn a array of columns into a comma separated identifier list suitable for being passed into a RETURNING
@param array $returning
@return string | [
"Turn",
"a",
"array",
"of",
"columns",
"into",
"a",
"comma",
"separated",
"identifier",
"list",
"suitable",
"for",
"being",
"passed",
"into",
"a",
"RETURNING"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/RecordManager/Task/Normality.php#L299-L318 |
195,351 | squareproton/Bond | src/Bond/RecordManager/Task/Normality.php | Normality.validateQueryDatas | protected static function validateQueryDatas( array &$datas, array $modifiers )
{
foreach( $datas as $key => &$data ) {
self::validateQueryData( $data, $modifiers );
}
} | php | protected static function validateQueryDatas( array &$datas, array $modifiers )
{
foreach( $datas as $key => &$data ) {
self::validateQueryData( $data, $modifiers );
}
} | [
"protected",
"static",
"function",
"validateQueryDatas",
"(",
"array",
"&",
"$",
"datas",
",",
"array",
"$",
"modifiers",
")",
"{",
"foreach",
"(",
"$",
"datas",
"as",
"$",
"key",
"=>",
"&",
"$",
"data",
")",
"{",
"self",
"::",
"validateQueryData",
"(",
... | Validate a array of query datas arrays
@param array datas array of datas
@param array validation callback | [
"Validate",
"a",
"array",
"of",
"query",
"datas",
"arrays"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/RecordManager/Task/Normality.php#L326-L331 |
195,352 | squareproton/Bond | src/Bond/RecordManager/Task/Normality.php | Normality.validateQueryData | protected static function validateQueryData( array &$data, array $modifiers )
{
foreach( $data as $column => &$value ) {
$value = $modifiers[$column]->exec( $value );
}
} | php | protected static function validateQueryData( array &$data, array $modifiers )
{
foreach( $data as $column => &$value ) {
$value = $modifiers[$column]->exec( $value );
}
} | [
"protected",
"static",
"function",
"validateQueryData",
"(",
"array",
"&",
"$",
"data",
",",
"array",
"$",
"modifiers",
")",
"{",
"foreach",
"(",
"$",
"data",
"as",
"$",
"column",
"=>",
"&",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"$",
"modifiers",
... | Validate a query datas array
@param array query datas array
@param array validation callback | [
"Validate",
"a",
"query",
"datas",
"array"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/RecordManager/Task/Normality.php#L339-L344 |
195,353 | squareproton/Bond | src/Bond/RecordManager/Task/Normality.php | Normality.buildChainTasks | protected static function buildChainTasks( \Bond\Entity\Base $entity, $columns )
{
$tasks = array();
foreach( $columns as $column ) {
$value = $entity->get($column);
// chain saving
if( is_object($value) and $value instanceof ChainSavingInterface ) {
... | php | protected static function buildChainTasks( \Bond\Entity\Base $entity, $columns )
{
$tasks = array();
foreach( $columns as $column ) {
$value = $entity->get($column);
// chain saving
if( is_object($value) and $value instanceof ChainSavingInterface ) {
... | [
"protected",
"static",
"function",
"buildChainTasks",
"(",
"\\",
"Bond",
"\\",
"Entity",
"\\",
"Base",
"$",
"entity",
",",
"$",
"columns",
")",
"{",
"$",
"tasks",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"columns",
"as",
"$",
"column",
")",
... | Get chain tasks
@param Bond\Entity\Base $entity
@param array $chainTasks
@param array $columns
@return null | [
"Get",
"chain",
"tasks"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/RecordManager/Task/Normality.php#L402-L420 |
195,354 | bazzline/php_component_requirement | source/AbstractCondition.php | AbstractCondition.itemSupportsMethodCall | protected function itemSupportsMethodCall(IsMetInterface $item, $methodName)
{
$hash = spl_object_hash($item);
if (empty($this->methodNamesPerItem)
|| !isset($this->methodNamesPerItem[$hash])) {
$itemMethods = array_flip(get_class_methods($item));
$this->methodNa... | php | protected function itemSupportsMethodCall(IsMetInterface $item, $methodName)
{
$hash = spl_object_hash($item);
if (empty($this->methodNamesPerItem)
|| !isset($this->methodNamesPerItem[$hash])) {
$itemMethods = array_flip(get_class_methods($item));
$this->methodNa... | [
"protected",
"function",
"itemSupportsMethodCall",
"(",
"IsMetInterface",
"$",
"item",
",",
"$",
"methodName",
")",
"{",
"$",
"hash",
"=",
"spl_object_hash",
"(",
"$",
"item",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"methodNamesPerItem",
")",
... | Checks if item implements method name
@param IsMetInterface $item
@param string $methodName
@return bool
@author stev leibelt <artodeto@bazzline.net>
@since 2013-07-20 | [
"Checks",
"if",
"item",
"implements",
"method",
"name"
] | 84ee943b6aa8df783e2cfa5897de3a4a70c39990 | https://github.com/bazzline/php_component_requirement/blob/84ee943b6aa8df783e2cfa5897de3a4a70c39990/source/AbstractCondition.php#L143-L154 |
195,355 | Linkvalue-Interne/MajoraOrientDBBundle | src/Majora/Component/Graph/Engine/OrientDbMetadata.php | OrientDbMetadata.registerVertex | public function registerVertex(Vertex $vertex)
{
$this->vertexes->set($vertex->getName(), $vertex);
return $this;
} | php | public function registerVertex(Vertex $vertex)
{
$this->vertexes->set($vertex->getName(), $vertex);
return $this;
} | [
"public",
"function",
"registerVertex",
"(",
"Vertex",
"$",
"vertex",
")",
"{",
"$",
"this",
"->",
"vertexes",
"->",
"set",
"(",
"$",
"vertex",
"->",
"getName",
"(",
")",
",",
"$",
"vertex",
")",
";",
"return",
"$",
"this",
";",
"}"
] | register a new vertex into metadata
@param Vertex $vertex
@return OrientDbMetadata | [
"register",
"a",
"new",
"vertex",
"into",
"metadata"
] | 9fc9a409604472b558319c274442f75bbd055435 | https://github.com/Linkvalue-Interne/MajoraOrientDBBundle/blob/9fc9a409604472b558319c274442f75bbd055435/src/Majora/Component/Graph/Engine/OrientDbMetadata.php#L179-L184 |
195,356 | AthensFramework/CSRF | src/CSRF.php | CSRF.getSuppliedCSRF | protected static function getSuppliedCSRF()
{
$headers = function_exists('getallheaders') === true ? getallheaders() : [];
$requestArguments = [];
parse_str(file_get_contents('php://input'), $requestArguments);
$requestArguments = array_merge($_POST, $requestArguments);
if ... | php | protected static function getSuppliedCSRF()
{
$headers = function_exists('getallheaders') === true ? getallheaders() : [];
$requestArguments = [];
parse_str(file_get_contents('php://input'), $requestArguments);
$requestArguments = array_merge($_POST, $requestArguments);
if ... | [
"protected",
"static",
"function",
"getSuppliedCSRF",
"(",
")",
"{",
"$",
"headers",
"=",
"function_exists",
"(",
"'getallheaders'",
")",
"===",
"true",
"?",
"getallheaders",
"(",
")",
":",
"[",
"]",
";",
"$",
"requestArguments",
"=",
"[",
"]",
";",
"parse... | Get the CSRF token, presented as a header, a PUT parameter, or a POST parameter.
@return string|null | [
"Get",
"the",
"CSRF",
"token",
"presented",
"as",
"a",
"header",
"a",
"PUT",
"parameter",
"or",
"a",
"POST",
"parameter",
"."
] | 17cd1e330a9e47d1d41fec43a30ba8a6394acd94 | https://github.com/AthensFramework/CSRF/blob/17cd1e330a9e47d1d41fec43a30ba8a6394acd94/src/CSRF.php#L100-L115 |
195,357 | mtils/file-db | src/FileDB/Model/EloquentFileDBModel.php | EloquentFileDBModel.importFile | public function importFile($localPath, FileInterface $folder = null)
{
if(!$folder->isDir()){
throw new RuntimeException('Files can only be moved into directories');
}
//$fileName = $uploadedFile->getClientOriginalName();
$fileName = basename($localPath);
$targe... | php | public function importFile($localPath, FileInterface $folder = null)
{
if(!$folder->isDir()){
throw new RuntimeException('Files can only be moved into directories');
}
//$fileName = $uploadedFile->getClientOriginalName();
$fileName = basename($localPath);
$targe... | [
"public",
"function",
"importFile",
"(",
"$",
"localPath",
",",
"FileInterface",
"$",
"folder",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"folder",
"->",
"isDir",
"(",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"'Files can only be moved into d... | Import a local file into the FileDB
@param string $localPath
@param FileInterface $folder (optional)
@return FileInterface The new file | [
"Import",
"a",
"local",
"file",
"into",
"the",
"FileDB"
] | 270ebc26b0fa3d2c996ca8861507fa63d2db6814 | https://github.com/mtils/file-db/blob/270ebc26b0fa3d2c996ca8861507fa63d2db6814/src/FileDB/Model/EloquentFileDBModel.php#L441-L466 |
195,358 | Xsaven/laravel-intelect-admin | src/Addons/JWTAuth/Validators/PayloadValidator.php | PayloadValidator.validateTimestamps | protected function validateTimestamps(array $payload)
{
if (isset($payload['nbf']) && Utils::timestamp($payload['nbf'])->isFuture()) {
throw new TokenInvalidException('Not Before (nbf) timestamp cannot be in the future', 400);
}
if (isset($payload['iat']) && Utils::timestamp($pa... | php | protected function validateTimestamps(array $payload)
{
if (isset($payload['nbf']) && Utils::timestamp($payload['nbf'])->isFuture()) {
throw new TokenInvalidException('Not Before (nbf) timestamp cannot be in the future', 400);
}
if (isset($payload['iat']) && Utils::timestamp($pa... | [
"protected",
"function",
"validateTimestamps",
"(",
"array",
"$",
"payload",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"payload",
"[",
"'nbf'",
"]",
")",
"&&",
"Utils",
"::",
"timestamp",
"(",
"$",
"payload",
"[",
"'nbf'",
"]",
")",
"->",
"isFuture",
"("... | Validate the payload timestamps.
@param array $payload
@throws \Lia\Addons\JWTAuth\Exceptions\TokenExpiredException
@throws \Lia\Addons\JWTAuth\Exceptions\TokenInvalidException
@return bool | [
"Validate",
"the",
"payload",
"timestamps",
"."
] | 592574633d12c74cf25b43dd6694fee496abefcb | https://github.com/Xsaven/laravel-intelect-admin/blob/592574633d12c74cf25b43dd6694fee496abefcb/src/Addons/JWTAuth/Validators/PayloadValidator.php#L63-L78 |
195,359 | praxigento/mobi_mod_pv | Observer/Z/PvRegister.php | PvRegister.accountPv | public function accountPv(\Magento\Sales\Api\Data\OrderInterface $order)
{
/* sale state validation should be performed before */
$orderId = $order->getEntityId();
/* update record state in the registry */
$this->updateDatePaid($orderId);
/* ... then transfer PV to the custom... | php | public function accountPv(\Magento\Sales\Api\Data\OrderInterface $order)
{
/* sale state validation should be performed before */
$orderId = $order->getEntityId();
/* update record state in the registry */
$this->updateDatePaid($orderId);
/* ... then transfer PV to the custom... | [
"public",
"function",
"accountPv",
"(",
"\\",
"Magento",
"\\",
"Sales",
"\\",
"Api",
"\\",
"Data",
"\\",
"OrderInterface",
"$",
"order",
")",
"{",
"/* sale state validation should be performed before */",
"$",
"orderId",
"=",
"$",
"order",
"->",
"getEntityId",
"("... | Collect order data and call service method to transfer PV to customer account.
@param \Magento\Sales\Api\Data\OrderInterface $order
@throws \Exception | [
"Collect",
"order",
"data",
"and",
"call",
"service",
"method",
"to",
"transfer",
"PV",
"to",
"customer",
"account",
"."
] | d1540b7e94264527006e8b9fa68904a72a63928e | https://github.com/praxigento/mobi_mod_pv/blob/d1540b7e94264527006e8b9fa68904a72a63928e/Observer/Z/PvRegister.php#L51-L61 |
195,360 | praxigento/mobi_mod_pv | Observer/Z/PvRegister.php | PvRegister.getServiceItemForMageItem | private function getServiceItemForMageItem(\Magento\Sales\Api\Data\OrderItemInterface $item, $stockId = null)
{
$result = new \Praxigento\Pv\Service\Sale\Data\Item();
$prodId = $item->getProductId();
$itemId = $item->getItemId();
/* qty of the product can be changed in invoice but we... | php | private function getServiceItemForMageItem(\Magento\Sales\Api\Data\OrderItemInterface $item, $stockId = null)
{
$result = new \Praxigento\Pv\Service\Sale\Data\Item();
$prodId = $item->getProductId();
$itemId = $item->getItemId();
/* qty of the product can be changed in invoice but we... | [
"private",
"function",
"getServiceItemForMageItem",
"(",
"\\",
"Magento",
"\\",
"Sales",
"\\",
"Api",
"\\",
"Data",
"\\",
"OrderItemInterface",
"$",
"item",
",",
"$",
"stockId",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"new",
"\\",
"Praxigento",
"\\",
"P... | Convert Magento SaleOrderItem to service item.
@param \Magento\Sales\Api\Data\OrderItemInterface $item
@param int $stockId
@return \Praxigento\Pv\Service\Sale\Data\Item
@throws \Exception | [
"Convert",
"Magento",
"SaleOrderItem",
"to",
"service",
"item",
"."
] | d1540b7e94264527006e8b9fa68904a72a63928e | https://github.com/praxigento/mobi_mod_pv/blob/d1540b7e94264527006e8b9fa68904a72a63928e/Observer/Z/PvRegister.php#L71-L84 |
195,361 | praxigento/mobi_mod_pv | Observer/Z/PvRegister.php | PvRegister.savePv | public function savePv(\Magento\Sales\Api\Data\OrderInterface $order)
{
$orderId = $order->getId();
$state = $order->getState();
$dateCreated = $order->getCreatedAt();
$itemsData = $this->getServiceItemsForMageSaleOrder($order);
/* compose request data and request itself */
... | php | public function savePv(\Magento\Sales\Api\Data\OrderInterface $order)
{
$orderId = $order->getId();
$state = $order->getState();
$dateCreated = $order->getCreatedAt();
$itemsData = $this->getServiceItemsForMageSaleOrder($order);
/* compose request data and request itself */
... | [
"public",
"function",
"savePv",
"(",
"\\",
"Magento",
"\\",
"Sales",
"\\",
"Api",
"\\",
"Data",
"\\",
"OrderInterface",
"$",
"order",
")",
"{",
"$",
"orderId",
"=",
"$",
"order",
"->",
"getId",
"(",
")",
";",
"$",
"state",
"=",
"$",
"order",
"->",
... | Collect orders data and call service method to register order PV.
@param \Magento\Sales\Api\Data\OrderInterface $order
@throws \Exception | [
"Collect",
"orders",
"data",
"and",
"call",
"service",
"method",
"to",
"register",
"order",
"PV",
"."
] | d1540b7e94264527006e8b9fa68904a72a63928e | https://github.com/praxigento/mobi_mod_pv/blob/d1540b7e94264527006e8b9fa68904a72a63928e/Observer/Z/PvRegister.php#L113-L128 |
195,362 | praxigento/mobi_mod_pv | Observer/Z/PvRegister.php | PvRegister.updateDatePaid | private function updateDatePaid($orderId)
{
$datePaid = $this->hlpDate->getUtcNowForDb();
$data = [ESale::A_DATE_PAID => $datePaid];
$this->daoSale->updateById($orderId, $data);
$this->logger->info("Update paid date in PV registry when sale order (#$orderId) is paid.");
} | php | private function updateDatePaid($orderId)
{
$datePaid = $this->hlpDate->getUtcNowForDb();
$data = [ESale::A_DATE_PAID => $datePaid];
$this->daoSale->updateById($orderId, $data);
$this->logger->info("Update paid date in PV registry when sale order (#$orderId) is paid.");
} | [
"private",
"function",
"updateDatePaid",
"(",
"$",
"orderId",
")",
"{",
"$",
"datePaid",
"=",
"$",
"this",
"->",
"hlpDate",
"->",
"getUtcNowForDb",
"(",
")",
";",
"$",
"data",
"=",
"[",
"ESale",
"::",
"A_DATE_PAID",
"=>",
"$",
"datePaid",
"]",
";",
"$"... | Update paid date in sale order registry of PV module.
@param int $orderId | [
"Update",
"paid",
"date",
"in",
"sale",
"order",
"registry",
"of",
"PV",
"module",
"."
] | d1540b7e94264527006e8b9fa68904a72a63928e | https://github.com/praxigento/mobi_mod_pv/blob/d1540b7e94264527006e8b9fa68904a72a63928e/Observer/Z/PvRegister.php#L135-L141 |
195,363 | rabbitcms/forms | src/Controls/InputGroup.php | InputGroup.setForm | public function setForm(ControlCollection $form = null): Control
{
$this->control->setForm($form);
return parent::setForm($form);
} | php | public function setForm(ControlCollection $form = null): Control
{
$this->control->setForm($form);
return parent::setForm($form);
} | [
"public",
"function",
"setForm",
"(",
"ControlCollection",
"$",
"form",
"=",
"null",
")",
":",
"Control",
"{",
"$",
"this",
"->",
"control",
"->",
"setForm",
"(",
"$",
"form",
")",
";",
"return",
"parent",
"::",
"setForm",
"(",
"$",
"form",
")",
";",
... | Set control form.
@param ControlCollection|null $form
@return static | [
"Set",
"control",
"form",
"."
] | 4dd657d1c8caeb0b87f25239fabf5fa064db29cd | https://github.com/rabbitcms/forms/blob/4dd657d1c8caeb0b87f25239fabf5fa064db29cd/src/Controls/InputGroup.php#L78-L83 |
195,364 | libreworks/microformats | src/Geo.php | Geo.distance | public function distance(Geo $other)
{
if ($other === $this) {
return 0.0;
} else {
return self::DEG_KM * rad2deg(
acos(
(sin(deg2rad($this->latitude)) * sin(deg2rad($other->latitude))) +
(cos(deg2rad($this->latitude)) *... | php | public function distance(Geo $other)
{
if ($other === $this) {
return 0.0;
} else {
return self::DEG_KM * rad2deg(
acos(
(sin(deg2rad($this->latitude)) * sin(deg2rad($other->latitude))) +
(cos(deg2rad($this->latitude)) *... | [
"public",
"function",
"distance",
"(",
"Geo",
"$",
"other",
")",
"{",
"if",
"(",
"$",
"other",
"===",
"$",
"this",
")",
"{",
"return",
"0.0",
";",
"}",
"else",
"{",
"return",
"self",
"::",
"DEG_KM",
"*",
"rad2deg",
"(",
"acos",
"(",
"(",
"sin",
"... | Uses the Haversine formula to calculate kilometer point distance.
@param \Libreworks\Microformats\Geo $other
@return float The distance | [
"Uses",
"the",
"Haversine",
"formula",
"to",
"calculate",
"kilometer",
"point",
"distance",
"."
] | f208650cb83e8711f5f35878cfa285b7cb505d3d | https://github.com/libreworks/microformats/blob/f208650cb83e8711f5f35878cfa285b7cb505d3d/src/Geo.php#L95-L107 |
195,365 | jenskooij/cloudcontrol | src/search/Search.php | Search.getIndexedDocuments | public function getIndexedDocuments()
{
$db = $this->getSearchDbHandle();
$sql = '
SELECT count(DISTINCT documentPath) AS indexedDocuments
FROM term_frequency
';
if (!$stmt = $db->query($sql)) {
$errorInfo = $db->errorInfo();
$errorMsg = $errorInfo[2];
... | php | public function getIndexedDocuments()
{
$db = $this->getSearchDbHandle();
$sql = '
SELECT count(DISTINCT documentPath) AS indexedDocuments
FROM term_frequency
';
if (!$stmt = $db->query($sql)) {
$errorInfo = $db->errorInfo();
$errorMsg = $errorInfo[2];
... | [
"public",
"function",
"getIndexedDocuments",
"(",
")",
"{",
"$",
"db",
"=",
"$",
"this",
"->",
"getSearchDbHandle",
"(",
")",
";",
"$",
"sql",
"=",
"'\n\t\t\tSELECT count(DISTINCT documentPath) AS indexedDocuments\n\t\t\t FROM term_frequency\n\t\t'",
";",
"if",
"(",
"!... | Returns the amount of distinct documents
that are currently in the search index.
@return int
@throws \Exception | [
"Returns",
"the",
"amount",
"of",
"distinct",
"documents",
"that",
"are",
"currently",
"in",
"the",
"search",
"index",
"."
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/search/Search.php#L74-L93 |
195,366 | jenskooij/cloudcontrol | src/search/Search.php | Search.queryTokens | private function queryTokens()
{
$tokens = $this->getTokens();
$queryNorm = $this->getQueryNorm($tokens);
$results = array();
foreach ($tokens as $token) {
$results[$token] = $this->getResultsForToken($token, $queryNorm);
}
return $results;
} | php | private function queryTokens()
{
$tokens = $this->getTokens();
$queryNorm = $this->getQueryNorm($tokens);
$results = array();
foreach ($tokens as $token) {
$results[$token] = $this->getResultsForToken($token, $queryNorm);
}
return $results;
} | [
"private",
"function",
"queryTokens",
"(",
")",
"{",
"$",
"tokens",
"=",
"$",
"this",
"->",
"getTokens",
"(",
")",
";",
"$",
"queryNorm",
"=",
"$",
"this",
"->",
"getQueryNorm",
"(",
"$",
"tokens",
")",
";",
"$",
"results",
"=",
"array",
"(",
")",
... | Queries each token present in the Tokenizer
and returns SearchResult objects for the found
documents
@return array
@throws \Exception | [
"Queries",
"each",
"token",
"present",
"in",
"the",
"Tokenizer",
"and",
"returns",
"SearchResult",
"objects",
"for",
"the",
"found",
"documents"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/search/Search.php#L102-L112 |
195,367 | jenskooij/cloudcontrol | src/search/Search.php | Search.getSearchSuggestions | private function getSearchSuggestions()
{
$tokens = $this->getTokens();
$allResults = array();
foreach ($tokens as $token) {
$allResults = $this->getSearchSuggestion($token, $allResults);
}
return $allResults;
} | php | private function getSearchSuggestions()
{
$tokens = $this->getTokens();
$allResults = array();
foreach ($tokens as $token) {
$allResults = $this->getSearchSuggestion($token, $allResults);
}
return $allResults;
} | [
"private",
"function",
"getSearchSuggestions",
"(",
")",
"{",
"$",
"tokens",
"=",
"$",
"this",
"->",
"getTokens",
"(",
")",
";",
"$",
"allResults",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"tokens",
"as",
"$",
"token",
")",
"{",
"$",
"allRes... | Uses the levenshtein algorithm to determine the term that is
closest to the token that was input for the search
@return array
@throws \Exception | [
"Uses",
"the",
"levenshtein",
"algorithm",
"to",
"determine",
"the",
"term",
"that",
"is",
"closest",
"to",
"the",
"token",
"that",
"was",
"input",
"for",
"the",
"search"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/search/Search.php#L276-L284 |
195,368 | jenskooij/cloudcontrol | src/search/Search.php | Search.getTokens | private function getTokens()
{
$tokenVector = array(
'query' => array(),
);
$tokenVector['query'] = $this->tokenizer->getTokenVector();
$tokens = $this->applyFilters($tokenVector);
if (!empty($tokens)) {
$tokens = array_keys($tokens['query']);
... | php | private function getTokens()
{
$tokenVector = array(
'query' => array(),
);
$tokenVector['query'] = $this->tokenizer->getTokenVector();
$tokens = $this->applyFilters($tokenVector);
if (!empty($tokens)) {
$tokens = array_keys($tokens['query']);
... | [
"private",
"function",
"getTokens",
"(",
")",
"{",
"$",
"tokenVector",
"=",
"array",
"(",
"'query'",
"=>",
"array",
"(",
")",
",",
")",
";",
"$",
"tokenVector",
"[",
"'query'",
"]",
"=",
"$",
"this",
"->",
"tokenizer",
"->",
"getTokenVector",
"(",
")",... | Retrieves all tokens from the tokenizer
@return array | [
"Retrieves",
"all",
"tokens",
"from",
"the",
"tokenizer"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/search/Search.php#L290-L302 |
195,369 | nochso/ORM2 | src/ResultSet.php | ResultSet.delete | public function delete()
{
if (count($this) == 0) {
return;
}
$ids = $this->getPrimaryKeyList();
$hitman = new $this->className();
$hitman->in($hitman->getPrimaryKey(), $ids)->delete();
} | php | public function delete()
{
if (count($this) == 0) {
return;
}
$ids = $this->getPrimaryKeyList();
$hitman = new $this->className();
$hitman->in($hitman->getPrimaryKey(), $ids)->delete();
} | [
"public",
"function",
"delete",
"(",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
")",
"==",
"0",
")",
"{",
"return",
";",
"}",
"$",
"ids",
"=",
"$",
"this",
"->",
"getPrimaryKeyList",
"(",
")",
";",
"$",
"hitman",
"=",
"new",
"$",
"this",
"... | Functions to operate on all elements of the ResultSet at once | [
"Functions",
"to",
"operate",
"on",
"all",
"elements",
"of",
"the",
"ResultSet",
"at",
"once"
] | 89f9a5c61ad5f575fbdd52990171b52d54f8bfbc | https://github.com/nochso/ORM2/blob/89f9a5c61ad5f575fbdd52990171b52d54f8bfbc/src/ResultSet.php#L27-L35 |
195,370 | nochso/ORM2 | src/ResultSet.php | ResultSet.update | public function update($data)
{
if (count($this) == 0) {
return;
}
$ids = $this->getPrimaryKeyList();
$updater = new $this->className();
$updater->in($updater->getPrimaryKey(), $ids)->update($data);
} | php | public function update($data)
{
if (count($this) == 0) {
return;
}
$ids = $this->getPrimaryKeyList();
$updater = new $this->className();
$updater->in($updater->getPrimaryKey(), $ids)->update($data);
} | [
"public",
"function",
"update",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
")",
"==",
"0",
")",
"{",
"return",
";",
"}",
"$",
"ids",
"=",
"$",
"this",
"->",
"getPrimaryKeyList",
"(",
")",
";",
"$",
"updater",
"=",
"new",
... | Update all entries in this ResultSet with the same values | [
"Update",
"all",
"entries",
"in",
"this",
"ResultSet",
"with",
"the",
"same",
"values"
] | 89f9a5c61ad5f575fbdd52990171b52d54f8bfbc | https://github.com/nochso/ORM2/blob/89f9a5c61ad5f575fbdd52990171b52d54f8bfbc/src/ResultSet.php#L40-L48 |
195,371 | nochso/ORM2 | src/ResultSet.php | ResultSet.getPrimaryKeyList | public function getPrimaryKeyList()
{
$ids = [];
if (count($this) > 0) {
foreach ($this as $row) {
$ids[] = $row->getPrimaryKeyValue();
}
}
return $ids;
} | php | public function getPrimaryKeyList()
{
$ids = [];
if (count($this) > 0) {
foreach ($this as $row) {
$ids[] = $row->getPrimaryKeyValue();
}
}
return $ids;
} | [
"public",
"function",
"getPrimaryKeyList",
"(",
")",
"{",
"$",
"ids",
"=",
"[",
"]",
";",
"if",
"(",
"count",
"(",
"$",
"this",
")",
">",
"0",
")",
"{",
"foreach",
"(",
"$",
"this",
"as",
"$",
"row",
")",
"{",
"$",
"ids",
"[",
"]",
"=",
"$",
... | Returns an array of all primary keys contained in the ResultSet
@return array | [
"Returns",
"an",
"array",
"of",
"all",
"primary",
"keys",
"contained",
"in",
"the",
"ResultSet"
] | 89f9a5c61ad5f575fbdd52990171b52d54f8bfbc | https://github.com/nochso/ORM2/blob/89f9a5c61ad5f575fbdd52990171b52d54f8bfbc/src/ResultSet.php#L74-L83 |
195,372 | stubbles/stubbles-peer | src/main/php/HeaderList.php | HeaderList.parse | private static function parse(string $headers): array
{
$header = [];
$matches = [];
preg_match_all(
'=^(.[^: ]+): ([^\r\n]*)=m',
$headers,
$matches,
PREG_SET_ORDER
);
foreach ($matches as $line) {
$... | php | private static function parse(string $headers): array
{
$header = [];
$matches = [];
preg_match_all(
'=^(.[^: ]+): ([^\r\n]*)=m',
$headers,
$matches,
PREG_SET_ORDER
);
foreach ($matches as $line) {
$... | [
"private",
"static",
"function",
"parse",
"(",
"string",
"$",
"headers",
")",
":",
"array",
"{",
"$",
"header",
"=",
"[",
"]",
";",
"$",
"matches",
"=",
"[",
"]",
";",
"preg_match_all",
"(",
"'=^(.[^: ]+): ([^\\r\\n]*)=m'",
",",
"$",
"headers",
",",
"$",... | parses given header string and returns a list of headers
@param string $headers
@return array | [
"parses",
"given",
"header",
"string",
"and",
"returns",
"a",
"list",
"of",
"headers"
] | dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc | https://github.com/stubbles/stubbles-peer/blob/dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc/src/main/php/HeaderList.php#L54-L69 |
195,373 | stubbles/stubbles-peer | src/main/php/HeaderList.php | HeaderList.append | public function append($headers): self
{
if (is_string($headers)) {
$append = self::parse($headers);
} elseif (is_array($headers)) {
$append = $headers;
} elseif ($headers instanceof self) {
$append = $headers->headers;
} else {
throw n... | php | public function append($headers): self
{
if (is_string($headers)) {
$append = self::parse($headers);
} elseif (is_array($headers)) {
$append = $headers;
} elseif ($headers instanceof self) {
$append = $headers->headers;
} else {
throw n... | [
"public",
"function",
"append",
"(",
"$",
"headers",
")",
":",
"self",
"{",
"if",
"(",
"is_string",
"(",
"$",
"headers",
")",
")",
"{",
"$",
"append",
"=",
"self",
"::",
"parse",
"(",
"$",
"headers",
")",
";",
"}",
"elseif",
"(",
"is_array",
"(",
... | appends given headers
If the header to append contain an already set header the existing header
value will be overwritten by the new one.
@param string|array|\stubbles\peer\HeaderList $headers
@return \stubbles\peer\HeaderList
@throws \InvalidArgumentException
@since 2.0.0 | [
"appends",
"given",
"headers"
] | dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc | https://github.com/stubbles/stubbles-peer/blob/dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc/src/main/php/HeaderList.php#L82-L99 |
195,374 | stubbles/stubbles-peer | src/main/php/HeaderList.php | HeaderList.put | public function put(string $key, $value): self
{
if (!is_scalar($value)) {
throw new \InvalidArgumentException(
'Argument 2 passed to ' . __METHOD__
. ' must be an instance of a scalar value.'
);
}
$this->headers[$key] = (strin... | php | public function put(string $key, $value): self
{
if (!is_scalar($value)) {
throw new \InvalidArgumentException(
'Argument 2 passed to ' . __METHOD__
. ' must be an instance of a scalar value.'
);
}
$this->headers[$key] = (strin... | [
"public",
"function",
"put",
"(",
"string",
"$",
"key",
",",
"$",
"value",
")",
":",
"self",
"{",
"if",
"(",
"!",
"is_scalar",
"(",
"$",
"value",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Argument 2 passed to '",
".",
"__MET... | creates header with value for key
@param string $key name of header
@param scalar $value value of header
@return \stubbles\peer\HeaderList
@throws \InvalidArgumentException | [
"creates",
"header",
"with",
"value",
"for",
"key"
] | dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc | https://github.com/stubbles/stubbles-peer/blob/dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc/src/main/php/HeaderList.php#L109-L120 |
195,375 | stubbles/stubbles-peer | src/main/php/HeaderList.php | HeaderList.remove | public function remove(string $key): self
{
if (isset($this->headers[$key]) == true) {
unset($this->headers[$key]);
}
return $this;
} | php | public function remove(string $key): self
{
if (isset($this->headers[$key]) == true) {
unset($this->headers[$key]);
}
return $this;
} | [
"public",
"function",
"remove",
"(",
"string",
"$",
"key",
")",
":",
"self",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"headers",
"[",
"$",
"key",
"]",
")",
"==",
"true",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"headers",
"[",
"$",
"k... | removes header with given key
@param string $key name of header
@return \stubbles\peer\HeaderList | [
"removes",
"header",
"with",
"given",
"key"
] | dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc | https://github.com/stubbles/stubbles-peer/blob/dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc/src/main/php/HeaderList.php#L128-L135 |
195,376 | stubbles/stubbles-peer | src/main/php/HeaderList.php | HeaderList.putCookie | public function putCookie(array $cookieValues): self
{
$cookieValue = '';
foreach ($cookieValues as $key => $value) {
$cookieValue .= $key . '=' . urlencode($value) . ';';
}
$this->put('Cookie', $cookieValue);
return $this;
} | php | public function putCookie(array $cookieValues): self
{
$cookieValue = '';
foreach ($cookieValues as $key => $value) {
$cookieValue .= $key . '=' . urlencode($value) . ';';
}
$this->put('Cookie', $cookieValue);
return $this;
} | [
"public",
"function",
"putCookie",
"(",
"array",
"$",
"cookieValues",
")",
":",
"self",
"{",
"$",
"cookieValue",
"=",
"''",
";",
"foreach",
"(",
"$",
"cookieValues",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"cookieValue",
".=",
"$",
"key",
... | creates header for cookie
@param array $cookieValues cookie values
@return \stubbles\peer\HeaderList | [
"creates",
"header",
"for",
"cookie"
] | dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc | https://github.com/stubbles/stubbles-peer/blob/dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc/src/main/php/HeaderList.php#L167-L176 |
195,377 | stubbles/stubbles-peer | src/main/php/HeaderList.php | HeaderList.putAuthorization | public function putAuthorization(string $user, string $password): self
{
$this->put('Authorization', 'BASIC ' . base64_encode($user . ':' . $password));
return $this;
} | php | public function putAuthorization(string $user, string $password): self
{
$this->put('Authorization', 'BASIC ' . base64_encode($user . ':' . $password));
return $this;
} | [
"public",
"function",
"putAuthorization",
"(",
"string",
"$",
"user",
",",
"string",
"$",
"password",
")",
":",
"self",
"{",
"$",
"this",
"->",
"put",
"(",
"'Authorization'",
",",
"'BASIC '",
".",
"base64_encode",
"(",
"$",
"user",
".",
"':'",
".",
"$",
... | creates header for authorization
@param string $user login name
@param string $password login password
@return \stubbles\peer\HeaderList | [
"creates",
"header",
"for",
"authorization"
] | dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc | https://github.com/stubbles/stubbles-peer/blob/dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc/src/main/php/HeaderList.php#L185-L189 |
195,378 | stubbles/stubbles-peer | src/main/php/HeaderList.php | HeaderList.putDate | public function putDate(int $timestamp = null): self
{
if (null === $timestamp) {
$date = gmdate('D, d M Y H:i:s');
} else {
$date = gmdate('D, d M Y H:i:s', $timestamp);
}
$this->put('Date', $date . ' GMT');
return $this;
} | php | public function putDate(int $timestamp = null): self
{
if (null === $timestamp) {
$date = gmdate('D, d M Y H:i:s');
} else {
$date = gmdate('D, d M Y H:i:s', $timestamp);
}
$this->put('Date', $date . ' GMT');
return $this;
} | [
"public",
"function",
"putDate",
"(",
"int",
"$",
"timestamp",
"=",
"null",
")",
":",
"self",
"{",
"if",
"(",
"null",
"===",
"$",
"timestamp",
")",
"{",
"$",
"date",
"=",
"gmdate",
"(",
"'D, d M Y H:i:s'",
")",
";",
"}",
"else",
"{",
"$",
"date",
"... | adds a date header
@param int $timestamp timestamp to use as date, defaults to current timestamp
@return \stubbles\peer\HeaderList | [
"adds",
"a",
"date",
"header"
] | dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc | https://github.com/stubbles/stubbles-peer/blob/dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc/src/main/php/HeaderList.php#L197-L207 |
195,379 | romm/configuration_object | Classes/TypeConverter/ConfigurationObjectConverter.php | ConfigurationObjectConverter.getTypeOfChildProperty | public function getTypeOfChildProperty($targetType, $propertyName, PropertyMappingConfigurationInterface $configuration)
{
$specificTargetType = $this->objectContainer->getImplementationClassName($targetType);
if (Core::get()->classExists($specificTargetType)) {
$propertyTags = $this->r... | php | public function getTypeOfChildProperty($targetType, $propertyName, PropertyMappingConfigurationInterface $configuration)
{
$specificTargetType = $this->objectContainer->getImplementationClassName($targetType);
if (Core::get()->classExists($specificTargetType)) {
$propertyTags = $this->r... | [
"public",
"function",
"getTypeOfChildProperty",
"(",
"$",
"targetType",
",",
"$",
"propertyName",
",",
"PropertyMappingConfigurationInterface",
"$",
"configuration",
")",
"{",
"$",
"specificTargetType",
"=",
"$",
"this",
"->",
"objectContainer",
"->",
"getImplementation... | Will check the type of the given class property, if reflection gives no
result, the parent function is called.
@inheritdoc | [
"Will",
"check",
"the",
"type",
"of",
"the",
"given",
"class",
"property",
"if",
"reflection",
"gives",
"no",
"result",
"the",
"parent",
"function",
"is",
"called",
"."
] | d3a40903386c2e0766bd8279337fe6da45cf5ce3 | https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/TypeConverter/ConfigurationObjectConverter.php#L34-L47 |
195,380 | cubicmushroom/exceptions | src/CubicMushroom/Exceptions/AbstractException.php | AbstractException.build | public static function build(array $constructorArguments = array(), $additionalProperties = array())
{
$constructorDefaults = array('message' => null, 'code' => null, 'previous' => null);
$constructorArguments = array_merge($constructorDefaults, $constructorArguments);
$message = self::prep... | php | public static function build(array $constructorArguments = array(), $additionalProperties = array())
{
$constructorDefaults = array('message' => null, 'code' => null, 'previous' => null);
$constructorArguments = array_merge($constructorDefaults, $constructorArguments);
$message = self::prep... | [
"public",
"static",
"function",
"build",
"(",
"array",
"$",
"constructorArguments",
"=",
"array",
"(",
")",
",",
"$",
"additionalProperties",
"=",
"array",
"(",
")",
")",
"{",
"$",
"constructorDefaults",
"=",
"array",
"(",
"'message'",
"=>",
"null",
",",
"... | Helper method to prepare all but the most complex exceptions
Pass in an array containing any or all of the following keys
- message (string)
- code (int)
- previous (\Exception)
If you don't pass in a 'message' or a 'code' then the method will attempt to get these from the exception class
getDefaultMessage or getDefa... | [
"Helper",
"method",
"to",
"prepare",
"all",
"but",
"the",
"most",
"complex",
"exceptions"
] | d6f48c92881b677d8c45527a7d6a1c687aa06227 | https://github.com/cubicmushroom/exceptions/blob/d6f48c92881b677d8c45527a7d6a1c687aa06227/src/CubicMushroom/Exceptions/AbstractException.php#L47-L61 |
195,381 | SagittariusX/Beluga.DynamicProperties | src/Beluga/DynamicProperties/ExplicitGetterSetter.php | ExplicitGetterSetter.__isset | public function __isset( string $name )
{
if ( $this->hasWritableProperty( $name, $setterName ) )
{
return true;
}
return parent::__isset( $name );
} | php | public function __isset( string $name )
{
if ( $this->hasWritableProperty( $name, $setterName ) )
{
return true;
}
return parent::__isset( $name );
} | [
"public",
"function",
"__isset",
"(",
"string",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasWritableProperty",
"(",
"$",
"name",
",",
"$",
"setterName",
")",
")",
"{",
"return",
"true",
";",
"}",
"return",
"parent",
"::",
"__isset",
"(",
... | Magic isset implementation.
@param string $name The name of the required property.
@return boolean | [
"Magic",
"isset",
"implementation",
"."
] | 39a036030d768d64e5a9c5d715c4218bf06b1ce5 | https://github.com/SagittariusX/Beluga.DynamicProperties/blob/39a036030d768d64e5a9c5d715c4218bf06b1ce5/src/Beluga/DynamicProperties/ExplicitGetterSetter.php#L73-L83 |
195,382 | SagittariusX/Beluga.DynamicProperties | src/Beluga/DynamicProperties/ExplicitGetterSetter.php | ExplicitGetterSetter.hasWritableProperty | public function hasWritableProperty( string $name, &$setterName ) : bool
{
if ( \in_array( $name, $this->ignoreSetProperties ) )
{
return false;
}
$setterName = 'set' . \ucfirst( $name );
return \method_exists( $this, $setterName );
} | php | public function hasWritableProperty( string $name, &$setterName ) : bool
{
if ( \in_array( $name, $this->ignoreSetProperties ) )
{
return false;
}
$setterName = 'set' . \ucfirst( $name );
return \method_exists( $this, $setterName );
} | [
"public",
"function",
"hasWritableProperty",
"(",
"string",
"$",
"name",
",",
"&",
"$",
"setterName",
")",
":",
"bool",
"{",
"if",
"(",
"\\",
"in_array",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"ignoreSetProperties",
")",
")",
"{",
"return",
"false",
... | Returns, if a property with the defined name exists for write access.
@param string $name The name of the property.
@param string $setterName Returns the name of the associated set method, if method returns TRUE.
@return boolean | [
"Returns",
"if",
"a",
"property",
"with",
"the",
"defined",
"name",
"exists",
"for",
"write",
"access",
"."
] | 39a036030d768d64e5a9c5d715c4218bf06b1ce5 | https://github.com/SagittariusX/Beluga.DynamicProperties/blob/39a036030d768d64e5a9c5d715c4218bf06b1ce5/src/Beluga/DynamicProperties/ExplicitGetterSetter.php#L92-L104 |
195,383 | randomhost/image | src/php/Image.php | Image.getInstanceByPath | public static function getInstanceByPath($path, $cacheDir = '')
{
$instance = new self();
$instance->pathFile = $path;
if (!empty($cacheDir)) {
$instance->setCacheDir($cacheDir);
$instance->setCachePath();
}
$instance->readImage();
return $... | php | public static function getInstanceByPath($path, $cacheDir = '')
{
$instance = new self();
$instance->pathFile = $path;
if (!empty($cacheDir)) {
$instance->setCacheDir($cacheDir);
$instance->setCachePath();
}
$instance->readImage();
return $... | [
"public",
"static",
"function",
"getInstanceByPath",
"(",
"$",
"path",
",",
"$",
"cacheDir",
"=",
"''",
")",
"{",
"$",
"instance",
"=",
"new",
"self",
"(",
")",
";",
"$",
"instance",
"->",
"pathFile",
"=",
"$",
"path",
";",
"if",
"(",
"!",
"empty",
... | Creates a new image from file or URL.
@param string $path Path to the image.
@param string $cacheDir Optional: Directory path for caching image files.
@return $this | [
"Creates",
"a",
"new",
"image",
"from",
"file",
"or",
"URL",
"."
] | bd669ba6b50fd2bbbe50c4ef06235b111a8a30b0 | https://github.com/randomhost/image/blob/bd669ba6b50fd2bbbe50c4ef06235b111a8a30b0/src/php/Image.php#L123-L137 |
195,384 | randomhost/image | src/php/Image.php | Image.getInstanceByCreate | public static function getInstanceByCreate($width, $height)
{
$instance = new self();
// set image dimensions
$instance->width = (int)$width;
$instance->height = (int)$height;
$instance->createImage();
return $instance;
} | php | public static function getInstanceByCreate($width, $height)
{
$instance = new self();
// set image dimensions
$instance->width = (int)$width;
$instance->height = (int)$height;
$instance->createImage();
return $instance;
} | [
"public",
"static",
"function",
"getInstanceByCreate",
"(",
"$",
"width",
",",
"$",
"height",
")",
"{",
"$",
"instance",
"=",
"new",
"self",
"(",
")",
";",
"// set image dimensions",
"$",
"instance",
"->",
"width",
"=",
"(",
"int",
")",
"$",
"width",
";"... | Creates a new image in memory.
@param int $width Image width.
@param int $height Image height.
@return $this | [
"Creates",
"a",
"new",
"image",
"in",
"memory",
"."
] | bd669ba6b50fd2bbbe50c4ef06235b111a8a30b0 | https://github.com/randomhost/image/blob/bd669ba6b50fd2bbbe50c4ef06235b111a8a30b0/src/php/Image.php#L147-L158 |
195,385 | randomhost/image | src/php/Image.php | Image.merge | public function merge(
Image $srcImage,
$dstX,
$dstY,
$strategy = self::MERGE_SCALE_SRC
) {
if (!is_resource($this->image) || !is_resource($srcImage->image)) {
throw new \RuntimeException(
'Attempt to merge image data using an invalid image resourc... | php | public function merge(
Image $srcImage,
$dstX,
$dstY,
$strategy = self::MERGE_SCALE_SRC
) {
if (!is_resource($this->image) || !is_resource($srcImage->image)) {
throw new \RuntimeException(
'Attempt to merge image data using an invalid image resourc... | [
"public",
"function",
"merge",
"(",
"Image",
"$",
"srcImage",
",",
"$",
"dstX",
",",
"$",
"dstY",
",",
"$",
"strategy",
"=",
"self",
"::",
"MERGE_SCALE_SRC",
")",
"{",
"if",
"(",
"!",
"is_resource",
"(",
"$",
"this",
"->",
"image",
")",
"||",
"!",
... | Copies the given Image image stream into the image stream of the active
instance using a scaling strategy.
@param Image $srcImage The source image.
@param int $dstX x-coordinate of destination point.
@param int $dstY y-coordinate of destination point.
@param int $strategy Scaling strategy. Default: self:... | [
"Copies",
"the",
"given",
"Image",
"image",
"stream",
"into",
"the",
"image",
"stream",
"of",
"the",
"active",
"instance",
"using",
"a",
"scaling",
"strategy",
"."
] | bd669ba6b50fd2bbbe50c4ef06235b111a8a30b0 | https://github.com/randomhost/image/blob/bd669ba6b50fd2bbbe50c4ef06235b111a8a30b0/src/php/Image.php#L185-L242 |
195,386 | randomhost/image | src/php/Image.php | Image.mergeAlpha | public function mergeAlpha(
Image $srcImage,
$dstX,
$dstY,
$alpha = 127
) {
if (!is_resource($this->image) || !is_resource($srcImage->image)) {
throw new \RuntimeException(
'Attempt to merge image data using an invalid image resource.'
... | php | public function mergeAlpha(
Image $srcImage,
$dstX,
$dstY,
$alpha = 127
) {
if (!is_resource($this->image) || !is_resource($srcImage->image)) {
throw new \RuntimeException(
'Attempt to merge image data using an invalid image resource.'
... | [
"public",
"function",
"mergeAlpha",
"(",
"Image",
"$",
"srcImage",
",",
"$",
"dstX",
",",
"$",
"dstY",
",",
"$",
"alpha",
"=",
"127",
")",
"{",
"if",
"(",
"!",
"is_resource",
"(",
"$",
"this",
"->",
"image",
")",
"||",
"!",
"is_resource",
"(",
"$",... | Copies the given Image image stream into the image stream of the active
instance while applying the given alpha transparency.
This method does not support scaling.
@param Image $srcImage The source image.
@param int $dstX x-coordinate of destination point.
@param int $dstY y-coordinate of destination poin... | [
"Copies",
"the",
"given",
"Image",
"image",
"stream",
"into",
"the",
"image",
"stream",
"of",
"the",
"active",
"instance",
"while",
"applying",
"the",
"given",
"alpha",
"transparency",
"."
] | bd669ba6b50fd2bbbe50c4ef06235b111a8a30b0 | https://github.com/randomhost/image/blob/bd669ba6b50fd2bbbe50c4ef06235b111a8a30b0/src/php/Image.php#L260-L288 |
195,387 | randomhost/image | src/php/Image.php | Image.render | public function render()
{
if (!is_resource($this->image)) {
throw new \RuntimeException(
'Attempt to render invalid resource as image.'
);
}
header('Content-type: image/png');
imagepng($this->image, null, 9, PNG_ALL_FILTERS);
return ... | php | public function render()
{
if (!is_resource($this->image)) {
throw new \RuntimeException(
'Attempt to render invalid resource as image.'
);
}
header('Content-type: image/png');
imagepng($this->image, null, 9, PNG_ALL_FILTERS);
return ... | [
"public",
"function",
"render",
"(",
")",
"{",
"if",
"(",
"!",
"is_resource",
"(",
"$",
"this",
"->",
"image",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Attempt to render invalid resource as image.'",
")",
";",
"}",
"header",
"(",
"'Con... | Outputs the image stream to the browser.
@return $this
@throws \RuntimeException Thrown if $this->image is not a valid image
resource. | [
"Outputs",
"the",
"image",
"stream",
"to",
"the",
"browser",
"."
] | bd669ba6b50fd2bbbe50c4ef06235b111a8a30b0 | https://github.com/randomhost/image/blob/bd669ba6b50fd2bbbe50c4ef06235b111a8a30b0/src/php/Image.php#L298-L310 |
195,388 | randomhost/image | src/php/Image.php | Image.setCacheDir | protected function setCacheDir($path)
{
if (!is_dir($path)) {
throw new \InvalidArgumentException(
sprintf(
'Cache directory at %s could not be found',
$path
)
);
}
if (!is_readable($path)) {
... | php | protected function setCacheDir($path)
{
if (!is_dir($path)) {
throw new \InvalidArgumentException(
sprintf(
'Cache directory at %s could not be found',
$path
)
);
}
if (!is_readable($path)) {
... | [
"protected",
"function",
"setCacheDir",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"path",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Cache directory at %s could not be found'",
",",
"$",
"path"... | Sets the path to the cache directory.
@param string $path Path to cache directory
@return void
@throws \InvalidArgumentException | [
"Sets",
"the",
"path",
"to",
"the",
"cache",
"directory",
"."
] | bd669ba6b50fd2bbbe50c4ef06235b111a8a30b0 | https://github.com/randomhost/image/blob/bd669ba6b50fd2bbbe50c4ef06235b111a8a30b0/src/php/Image.php#L360-L388 |
195,389 | randomhost/image | src/php/Image.php | Image.isCached | protected function isCached()
{
$cacheTime = self::CACHE_TIME * 60;
if (!is_file($this->pathCache)) {
return false;
}
$cachedTime = filemtime($this->pathCache);
$cacheAge = $this->time - $cachedTime;
return $cacheAge < $cacheTime;
} | php | protected function isCached()
{
$cacheTime = self::CACHE_TIME * 60;
if (!is_file($this->pathCache)) {
return false;
}
$cachedTime = filemtime($this->pathCache);
$cacheAge = $this->time - $cachedTime;
return $cacheAge < $cacheTime;
} | [
"protected",
"function",
"isCached",
"(",
")",
"{",
"$",
"cacheTime",
"=",
"self",
"::",
"CACHE_TIME",
"*",
"60",
";",
"if",
"(",
"!",
"is_file",
"(",
"$",
"this",
"->",
"pathCache",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"cachedTime",
"=",... | Checks if the image file exists in the cache.
@return bool | [
"Checks",
"if",
"the",
"image",
"file",
"exists",
"in",
"the",
"cache",
"."
] | bd669ba6b50fd2bbbe50c4ef06235b111a8a30b0 | https://github.com/randomhost/image/blob/bd669ba6b50fd2bbbe50c4ef06235b111a8a30b0/src/php/Image.php#L407-L419 |
195,390 | randomhost/image | src/php/Image.php | Image.readImage | protected function readImage()
{
// set default path
$path = $this->pathFile;
// handle caching
if (!empty($this->pathCache)) {
// write / refresh cache file if necessary
if (!$this->isCached()) {
$this->writeCache();
}
... | php | protected function readImage()
{
// set default path
$path = $this->pathFile;
// handle caching
if (!empty($this->pathCache)) {
// write / refresh cache file if necessary
if (!$this->isCached()) {
$this->writeCache();
}
... | [
"protected",
"function",
"readImage",
"(",
")",
"{",
"// set default path",
"$",
"path",
"=",
"$",
"this",
"->",
"pathFile",
";",
"// handle caching",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"pathCache",
")",
")",
"{",
"// write / refresh cache file i... | Reads the image file.
@return void
@throws \RuntimeException Thrown if the image could not be processed.
@throws \UnexpectedValueException Thrown if the image type is not supported. | [
"Reads",
"the",
"image",
"file",
"."
] | bd669ba6b50fd2bbbe50c4ef06235b111a8a30b0 | https://github.com/randomhost/image/blob/bd669ba6b50fd2bbbe50c4ef06235b111a8a30b0/src/php/Image.php#L491-L563 |
195,391 | randomhost/image | src/php/Image.php | Image.createImage | protected function createImage()
{
// create image
$this->image = @imagecreatetruecolor($this->width, $this->height);
// set mime type
$this->mimeType = 'image/png';
// set modified date
$this->modified = time();
} | php | protected function createImage()
{
// create image
$this->image = @imagecreatetruecolor($this->width, $this->height);
// set mime type
$this->mimeType = 'image/png';
// set modified date
$this->modified = time();
} | [
"protected",
"function",
"createImage",
"(",
")",
"{",
"// create image",
"$",
"this",
"->",
"image",
"=",
"@",
"imagecreatetruecolor",
"(",
"$",
"this",
"->",
"width",
",",
"$",
"this",
"->",
"height",
")",
";",
"// set mime type",
"$",
"this",
"->",
"mim... | Creates a new true color image.
@return void | [
"Creates",
"a",
"new",
"true",
"color",
"image",
"."
] | bd669ba6b50fd2bbbe50c4ef06235b111a8a30b0 | https://github.com/randomhost/image/blob/bd669ba6b50fd2bbbe50c4ef06235b111a8a30b0/src/php/Image.php#L570-L580 |
195,392 | agentmedia/phine-builtin | src/BuiltIn/Modules/Frontend/Repeater.php | Repeater.Init | protected function Init()
{
$this->repeater = ContentRepeater::Schema()->ByContent($this->content);
$this->current = $this->tree->FirstChildOf($this->item);
$this->isEmpty = !$this->current;
return parent::Init();
} | php | protected function Init()
{
$this->repeater = ContentRepeater::Schema()->ByContent($this->content);
$this->current = $this->tree->FirstChildOf($this->item);
$this->isEmpty = !$this->current;
return parent::Init();
} | [
"protected",
"function",
"Init",
"(",
")",
"{",
"$",
"this",
"->",
"repeater",
"=",
"ContentRepeater",
"::",
"Schema",
"(",
")",
"->",
"ByContent",
"(",
"$",
"this",
"->",
"content",
")",
";",
"$",
"this",
"->",
"current",
"=",
"$",
"this",
"->",
"tr... | Initializes the repeater frontend module
@return boolean Returns tru | [
"Initializes",
"the",
"repeater",
"frontend",
"module"
] | 4dd05bc406a71e997bd4eaa16b12e23dbe62a456 | https://github.com/agentmedia/phine-builtin/blob/4dd05bc406a71e997bd4eaa16b12e23dbe62a456/src/BuiltIn/Modules/Frontend/Repeater.php#L50-L56 |
195,393 | agentmedia/phine-builtin | src/BuiltIn/Modules/Frontend/Repeater.php | Repeater.NextChild | protected function NextChild()
{
$item = $this->current;
$this->current = $this->tree->NextOf($item);
return $item;
} | php | protected function NextChild()
{
$item = $this->current;
$this->current = $this->tree->NextOf($item);
return $item;
} | [
"protected",
"function",
"NextChild",
"(",
")",
"{",
"$",
"item",
"=",
"$",
"this",
"->",
"current",
";",
"$",
"this",
"->",
"current",
"=",
"$",
"this",
"->",
"tree",
"->",
"NextOf",
"(",
"$",
"item",
")",
";",
"return",
"$",
"item",
";",
"}"
] | Gets the next child
@return mixed Returns the next tree item | [
"Gets",
"the",
"next",
"child"
] | 4dd05bc406a71e997bd4eaa16b12e23dbe62a456 | https://github.com/agentmedia/phine-builtin/blob/4dd05bc406a71e997bd4eaa16b12e23dbe62a456/src/BuiltIn/Modules/Frontend/Repeater.php#L62-L67 |
195,394 | t-kanstantsin/fileupload | src/config/Factory.php | Factory.prepareAliases | public static function prepareAliases(array $defaultAliasConfig, array $aliasArray): array
{
$factory = new static($defaultAliasConfig);
foreach ($aliasArray as $name => $config) {
$name = (string) $name;
$aliasArray[$name] = $factory->createAlias($name, $config);
}
... | php | public static function prepareAliases(array $defaultAliasConfig, array $aliasArray): array
{
$factory = new static($defaultAliasConfig);
foreach ($aliasArray as $name => $config) {
$name = (string) $name;
$aliasArray[$name] = $factory->createAlias($name, $config);
}
... | [
"public",
"static",
"function",
"prepareAliases",
"(",
"array",
"$",
"defaultAliasConfig",
",",
"array",
"$",
"aliasArray",
")",
":",
"array",
"{",
"$",
"factory",
"=",
"new",
"static",
"(",
"$",
"defaultAliasConfig",
")",
";",
"foreach",
"(",
"$",
"aliasArr... | Prepares aliases config in proper view.
@param array $defaultAliasConfig
@param array $aliasArray
@return array
@throws InvalidConfigException | [
"Prepares",
"aliases",
"config",
"in",
"proper",
"view",
"."
] | d6317a9b9b36d992f09affe3900ef7d7ddfd855f | https://github.com/t-kanstantsin/fileupload/blob/d6317a9b9b36d992f09affe3900ef7d7ddfd855f/src/config/Factory.php#L29-L38 |
195,395 | pluf/tenant | src/Tenant/SPA/Manager/Remote.php | Tenant_SPA_Manager_Remote.install | public static function install($request, $object)
{
$spa = Tenant_SpaService::installFromRepository($object->id);
return Tenant_Shortcuts_SpaManager($spa)->apply($spa, 'create');
} | php | public static function install($request, $object)
{
$spa = Tenant_SpaService::installFromRepository($object->id);
return Tenant_Shortcuts_SpaManager($spa)->apply($spa, 'create');
} | [
"public",
"static",
"function",
"install",
"(",
"$",
"request",
",",
"$",
"object",
")",
"{",
"$",
"spa",
"=",
"Tenant_SpaService",
"::",
"installFromRepository",
"(",
"$",
"object",
"->",
"id",
")",
";",
"return",
"Tenant_Shortcuts_SpaManager",
"(",
"$",
"s... | Install an spa
@param Pluf_HTTP_Request $request
@param Tenant_SPA $object | [
"Install",
"an",
"spa"
] | a06359c52b9a257b5a0a186264e8770acfc54b73 | https://github.com/pluf/tenant/blob/a06359c52b9a257b5a0a186264e8770acfc54b73/src/Tenant/SPA/Manager/Remote.php#L101-L105 |
195,396 | drdplusinfo/drdplus-codes | DrdPlus/Codes/Partials/AbstractCode.php | AbstractCode.getPossibleValues | public static function getPossibleValues(): array
{
if ((static::$possibleValues[static::class] ?? null) === null) {
static::$possibleValues[static::class] = [];
try {
$reflectionClass = new \ReflectionClass(static::class);
} catch (\ReflectionException $r... | php | public static function getPossibleValues(): array
{
if ((static::$possibleValues[static::class] ?? null) === null) {
static::$possibleValues[static::class] = [];
try {
$reflectionClass = new \ReflectionClass(static::class);
} catch (\ReflectionException $r... | [
"public",
"static",
"function",
"getPossibleValues",
"(",
")",
":",
"array",
"{",
"if",
"(",
"(",
"static",
"::",
"$",
"possibleValues",
"[",
"static",
"::",
"class",
"]",
"??",
"null",
")",
"===",
"null",
")",
"{",
"static",
"::",
"$",
"possibleValues",... | Overload this by basic array with listed constants. Taking them via Reflection is not the fastest way.
@return array|string[] | [
"Overload",
"this",
"by",
"basic",
"array",
"with",
"listed",
"constants",
".",
"Taking",
"them",
"via",
"Reflection",
"is",
"not",
"the",
"fastest",
"way",
"."
] | b84db134f789e924f18ba471cf8e709a063e1807 | https://github.com/drdplusinfo/drdplus-codes/blob/b84db134f789e924f18ba471cf8e709a063e1807/DrdPlus/Codes/Partials/AbstractCode.php#L23-L40 |
195,397 | kdaviesnz/Molecule | src/FactoryClient.php | FactoryClient.getMolecule | public function getMolecule(string $canonicalSMILE)
{
$this->operations = new Operations();
$atoms = array();
// Recursive. $atoms is passed by reference.
$this->operations->addBranches($canonicalSMILE, $atoms);
$this->operations->addLoopBonds($atoms);
$this->ope... | php | public function getMolecule(string $canonicalSMILE)
{
$this->operations = new Operations();
$atoms = array();
// Recursive. $atoms is passed by reference.
$this->operations->addBranches($canonicalSMILE, $atoms);
$this->operations->addLoopBonds($atoms);
$this->ope... | [
"public",
"function",
"getMolecule",
"(",
"string",
"$",
"canonicalSMILE",
")",
"{",
"$",
"this",
"->",
"operations",
"=",
"new",
"Operations",
"(",
")",
";",
"$",
"atoms",
"=",
"array",
"(",
")",
";",
"// Recursive. $atoms is passed by reference.",
"$",
"this... | FactoryClient constructor. | [
"FactoryClient",
"constructor",
"."
] | 1e6897fb6c0c0012f4706f67ab2b644b7a7b1e8b | https://github.com/kdaviesnz/Molecule/blob/1e6897fb6c0c0012f4706f67ab2b644b7a7b1e8b/src/FactoryClient.php#L20-L52 |
195,398 | PieterScheffers/arrr | src/Ar.php | Ar.sortBy | public static function sortBy($array, $sortByKeys, $sorters, $orders = [])
{
if( is_string($sortByKeys) )
{
$sortByKeys = explode('.', $sortByKeys);
}
$sortByKeys = array_values((array)$sortByKeys);
$sorters = array_values((array)$sorters);
uasort($array, function($a, $b) use ($sortByKeys, $sorters, $... | php | public static function sortBy($array, $sortByKeys, $sorters, $orders = [])
{
if( is_string($sortByKeys) )
{
$sortByKeys = explode('.', $sortByKeys);
}
$sortByKeys = array_values((array)$sortByKeys);
$sorters = array_values((array)$sorters);
uasort($array, function($a, $b) use ($sortByKeys, $sorters, $... | [
"public",
"static",
"function",
"sortBy",
"(",
"$",
"array",
",",
"$",
"sortByKeys",
",",
"$",
"sorters",
",",
"$",
"orders",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"sortByKeys",
")",
")",
"{",
"$",
"sortByKeys",
"=",
"explode",
... | Sort by multiple keys
Usages:
String of attributes
Ar::sortBy($array, 'created_at.firstName', [ 'Sort::byDateTime', 'Sort::byString' ], [ 'asc', 'desc' ]);
Array
Ar::sortBy($array, [ 'created_at', function($i) { return strtolower($i->firstName); } ], [ 'Sort::byDateTime', 'Sort::byString' ], [ 'asc', 'desc' ])
@par... | [
"Sort",
"by",
"multiple",
"keys"
] | f920d911ae32641248131f1a510da287929cbd6e | https://github.com/PieterScheffers/arrr/blob/f920d911ae32641248131f1a510da287929cbd6e/src/Ar.php#L202-L257 |
195,399 | PieterScheffers/arrr | src/Ar.php | Ar.groupBy | public static function groupBy($array, $groupBy = "id")
{
return static::reduce($array, function($arr, $item) use($groupBy) {
// get value of attribute
if( is_closure($groupBy) )
{
// execute closure
$value = $groupBy($item);
}
else
{
// get attribute of object
$value = pisc\upper... | php | public static function groupBy($array, $groupBy = "id")
{
return static::reduce($array, function($arr, $item) use($groupBy) {
// get value of attribute
if( is_closure($groupBy) )
{
// execute closure
$value = $groupBy($item);
}
else
{
// get attribute of object
$value = pisc\upper... | [
"public",
"static",
"function",
"groupBy",
"(",
"$",
"array",
",",
"$",
"groupBy",
"=",
"\"id\"",
")",
"{",
"return",
"static",
"::",
"reduce",
"(",
"$",
"array",
",",
"function",
"(",
"$",
"arr",
",",
"$",
"item",
")",
"use",
"(",
"$",
"groupBy",
... | Group an array of objects by an attribute of an object or the result of a closure
@param array $array Array of objects
@param string/closure $groupBy Attribute of object or a closure. Closure gets object as parameter and should return a value that can be a key of the array
@return array ... | [
"Group",
"an",
"array",
"of",
"objects",
"by",
"an",
"attribute",
"of",
"an",
"object",
"or",
"the",
"result",
"of",
"a",
"closure"
] | f920d911ae32641248131f1a510da287929cbd6e | https://github.com/PieterScheffers/arrr/blob/f920d911ae32641248131f1a510da287929cbd6e/src/Ar.php#L363-L392 |
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.