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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
11,100 | magnus-eriksson/file-db | src/QueryBuilder.php | QueryBuilder.batchInsert | public function batchInsert(array $data)
{
$ids = [];
foreach ($data as $item) {
if (isset($item['id'])) {
if (array_key_exists($item['id'], $this->table->data['data'])) {
continue;
}
} else {
$item = ['id' =... | php | public function batchInsert(array $data)
{
$ids = [];
foreach ($data as $item) {
if (isset($item['id'])) {
if (array_key_exists($item['id'], $this->table->data['data'])) {
continue;
}
} else {
$item = ['id' =... | [
"public",
"function",
"batchInsert",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"ids",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"item",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"item",
"[",
"'id'",
"]",
")",
")",
"{",
"if",
"... | Batch insert multiple records
@param array $data List of records
@return array $ids | [
"Batch",
"insert",
"multiple",
"records"
] | 61d50511b1dcb483eec13a9baf3994fdc86b70a2 | https://github.com/magnus-eriksson/file-db/blob/61d50511b1dcb483eec13a9baf3994fdc86b70a2/src/QueryBuilder.php#L95-L111 |
11,101 | magnus-eriksson/file-db | src/QueryBuilder.php | QueryBuilder.orderBy | public function orderBy($column, $order = 'asc')
{
$this->order[0] = $column;
$this->order[1] = strtolower($order) == 'desc' ? 'desc' : 'asc';
return $this;
} | php | public function orderBy($column, $order = 'asc')
{
$this->order[0] = $column;
$this->order[1] = strtolower($order) == 'desc' ? 'desc' : 'asc';
return $this;
} | [
"public",
"function",
"orderBy",
"(",
"$",
"column",
",",
"$",
"order",
"=",
"'asc'",
")",
"{",
"$",
"this",
"->",
"order",
"[",
"0",
"]",
"=",
"$",
"column",
";",
"$",
"this",
"->",
"order",
"[",
"1",
"]",
"=",
"strtolower",
"(",
"$",
"order",
... | Set sort column and order
@param string $column
@param string $order Either 'asc' or 'desc'
@return $this | [
"Set",
"sort",
"column",
"and",
"order"
] | 61d50511b1dcb483eec13a9baf3994fdc86b70a2 | https://github.com/magnus-eriksson/file-db/blob/61d50511b1dcb483eec13a9baf3994fdc86b70a2/src/QueryBuilder.php#L217-L222 |
11,102 | magnus-eriksson/file-db | src/QueryBuilder.php | QueryBuilder.first | public function first()
{
$data = $this->getData();
if (!$this->where) {
return $data
? $this->convertItem(reset($data))
: null;
}
foreach ($data as &$rs) {
if ($this->matchWhere($rs)) {
return $this->convertIt... | php | public function first()
{
$data = $this->getData();
if (!$this->where) {
return $data
? $this->convertItem(reset($data))
: null;
}
foreach ($data as &$rs) {
if ($this->matchWhere($rs)) {
return $this->convertIt... | [
"public",
"function",
"first",
"(",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"getData",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"where",
")",
"{",
"return",
"$",
"data",
"?",
"$",
"this",
"->",
"convertItem",
"(",
"reset",
"(",
... | Get first record
@return array | [
"Get",
"first",
"record"
] | 61d50511b1dcb483eec13a9baf3994fdc86b70a2 | https://github.com/magnus-eriksson/file-db/blob/61d50511b1dcb483eec13a9baf3994fdc86b70a2/src/QueryBuilder.php#L296-L313 |
11,103 | magnus-eriksson/file-db | src/QueryBuilder.php | QueryBuilder.offset | public function offset($offset)
{
if (intval($offset) != $offset) {
throw new \Exception('The offset must be an integer');
}
$this->offset = (int) $offset;
return $this;
} | php | public function offset($offset)
{
if (intval($offset) != $offset) {
throw new \Exception('The offset must be an integer');
}
$this->offset = (int) $offset;
return $this;
} | [
"public",
"function",
"offset",
"(",
"$",
"offset",
")",
"{",
"if",
"(",
"intval",
"(",
"$",
"offset",
")",
"!=",
"$",
"offset",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'The offset must be an integer'",
")",
";",
"}",
"$",
"this",
"->",
"off... | Offset the result
@param integer $offset
@return $this | [
"Offset",
"the",
"result"
] | 61d50511b1dcb483eec13a9baf3994fdc86b70a2 | https://github.com/magnus-eriksson/file-db/blob/61d50511b1dcb483eec13a9baf3994fdc86b70a2/src/QueryBuilder.php#L355-L364 |
11,104 | magnus-eriksson/file-db | src/QueryBuilder.php | QueryBuilder.where | public function where($column, $operator, $value = null)
{
if (is_null($value)) {
if (is_callable($operator)) {
$this->where[] = [$column, 'func', $operator];
} else {
$this->where[] = [$column, '=', $operator];
}
} else {
... | php | public function where($column, $operator, $value = null)
{
if (is_null($value)) {
if (is_callable($operator)) {
$this->where[] = [$column, 'func', $operator];
} else {
$this->where[] = [$column, '=', $operator];
}
} else {
... | [
"public",
"function",
"where",
"(",
"$",
"column",
",",
"$",
"operator",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"value",
")",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"operator",
")",
")",
"{",
"$",
"this",... | Value must exist in the array
@param string $column Column to search
@param string $operator Operator or value
@param mixed $value
@return $this | [
"Value",
"must",
"exist",
"in",
"the",
"array"
] | 61d50511b1dcb483eec13a9baf3994fdc86b70a2 | https://github.com/magnus-eriksson/file-db/blob/61d50511b1dcb483eec13a9baf3994fdc86b70a2/src/QueryBuilder.php#L375-L388 |
11,105 | magnus-eriksson/file-db | src/QueryBuilder.php | QueryBuilder.getData | protected function getData()
{
if (is_null($this->order[0])) {
return $this->table->data['data'];
}
$items = $this->table->data['data'];
$col = $this->order[0];
$order = $this->order[1];
usort($items, function ($a, $b) use ($col, $order) {
... | php | protected function getData()
{
if (is_null($this->order[0])) {
return $this->table->data['data'];
}
$items = $this->table->data['data'];
$col = $this->order[0];
$order = $this->order[1];
usort($items, function ($a, $b) use ($col, $order) {
... | [
"protected",
"function",
"getData",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"order",
"[",
"0",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"table",
"->",
"data",
"[",
"'data'",
"]",
";",
"}",
"$",
"items",
"=",
"$",
"t... | Order the table
@param array $data
@return array | [
"Order",
"the",
"table"
] | 61d50511b1dcb483eec13a9baf3994fdc86b70a2 | https://github.com/magnus-eriksson/file-db/blob/61d50511b1dcb483eec13a9baf3994fdc86b70a2/src/QueryBuilder.php#L503-L536 |
11,106 | magnus-eriksson/file-db | src/QueryBuilder.php | QueryBuilder.convertItem | protected function convertItem($rs)
{
if ('array' == $this->returnAs) {
return $rs;
}
if ('stdclass' == $this->returnAs) {
return (object) $rs;
}
return new $this->returnAs($rs);
} | php | protected function convertItem($rs)
{
if ('array' == $this->returnAs) {
return $rs;
}
if ('stdclass' == $this->returnAs) {
return (object) $rs;
}
return new $this->returnAs($rs);
} | [
"protected",
"function",
"convertItem",
"(",
"$",
"rs",
")",
"{",
"if",
"(",
"'array'",
"==",
"$",
"this",
"->",
"returnAs",
")",
"{",
"return",
"$",
"rs",
";",
"}",
"if",
"(",
"'stdclass'",
"==",
"$",
"this",
"->",
"returnAs",
")",
"{",
"return",
... | Convert a record set
@param array $rs
@return mixed | [
"Convert",
"a",
"record",
"set"
] | 61d50511b1dcb483eec13a9baf3994fdc86b70a2 | https://github.com/magnus-eriksson/file-db/blob/61d50511b1dcb483eec13a9baf3994fdc86b70a2/src/QueryBuilder.php#L545-L556 |
11,107 | magnus-eriksson/file-db | src/QueryBuilder.php | QueryBuilder.matchWhere | protected function matchWhere($rs)
{
foreach ($this->where as $where) {
list($key, $op, $test) = $where;
$found = array_key_exists($key, $rs);
$real = $found ? $rs[$key] : null;
if ($this->filters->match($op, $found, $real, $test) === false) {
... | php | protected function matchWhere($rs)
{
foreach ($this->where as $where) {
list($key, $op, $test) = $where;
$found = array_key_exists($key, $rs);
$real = $found ? $rs[$key] : null;
if ($this->filters->match($op, $found, $real, $test) === false) {
... | [
"protected",
"function",
"matchWhere",
"(",
"$",
"rs",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"where",
"as",
"$",
"where",
")",
"{",
"list",
"(",
"$",
"key",
",",
"$",
"op",
",",
"$",
"test",
")",
"=",
"$",
"where",
";",
"$",
"found",
"="... | Match an item with the where conditions
@return boolean | [
"Match",
"an",
"item",
"with",
"the",
"where",
"conditions"
] | 61d50511b1dcb483eec13a9baf3994fdc86b70a2 | https://github.com/magnus-eriksson/file-db/blob/61d50511b1dcb483eec13a9baf3994fdc86b70a2/src/QueryBuilder.php#L564-L577 |
11,108 | koolkode/event | src/MethodListener.php | MethodListener.getEventName | public function getEventName()
{
if($this->eventName !== NULL)
{
return $this->eventName;
}
if($this->reflection === NULL)
{
$this->reflection = new \ReflectionMethod($this->object, $this->methodName);
}
$params = $this->reflection->getParameters();
if(empty($params))
{
throw new \... | php | public function getEventName()
{
if($this->eventName !== NULL)
{
return $this->eventName;
}
if($this->reflection === NULL)
{
$this->reflection = new \ReflectionMethod($this->object, $this->methodName);
}
$params = $this->reflection->getParameters();
if(empty($params))
{
throw new \... | [
"public",
"function",
"getEventName",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"eventName",
"!==",
"NULL",
")",
"{",
"return",
"$",
"this",
"->",
"eventName",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"reflection",
"===",
"NULL",
")",
"{",
"$",
"... | Get the name of the event being assembled using reflection.
@return string | [
"Get",
"the",
"name",
"of",
"the",
"event",
"being",
"assembled",
"using",
"reflection",
"."
] | 0f823ec5aaa2df0e3e437592a4dd3a4456af7be9 | https://github.com/koolkode/event/blob/0f823ec5aaa2df0e3e437592a4dd3a4456af7be9/src/MethodListener.php#L135-L164 |
11,109 | nwjeffm/laravel-pattern-generator | src/Core/Commands/BindingsServiceProviderMakeCommand.php | BindingsServiceProviderMakeCommand.commandResponseInfo | private function commandResponseInfo()
{
$configCode = '';
$configCode .= 'App\Providers\Bindings\\';
if ($this->getFolderOptionInput()) {
$configCode .= $this->getFolderOptionInput() . '\\';
}
$configCode .= $this->getNameInput() .'ServiceProvi... | php | private function commandResponseInfo()
{
$configCode = '';
$configCode .= 'App\Providers\Bindings\\';
if ($this->getFolderOptionInput()) {
$configCode .= $this->getFolderOptionInput() . '\\';
}
$configCode .= $this->getNameInput() .'ServiceProvi... | [
"private",
"function",
"commandResponseInfo",
"(",
")",
"{",
"$",
"configCode",
"=",
"''",
";",
"$",
"configCode",
".=",
"'App\\Providers\\Bindings\\\\'",
";",
"if",
"(",
"$",
"this",
"->",
"getFolderOptionInput",
"(",
")",
")",
"{",
"$",
"configCode",
".=",
... | Command response info.
@return string | [
"Command",
"response",
"info",
"."
] | 1a1964917b67be9fdf29a4959781bfef84a70c82 | https://github.com/nwjeffm/laravel-pattern-generator/blob/1a1964917b67be9fdf29a4959781bfef84a70c82/src/Core/Commands/BindingsServiceProviderMakeCommand.php#L48-L60 |
11,110 | railsphp/framework | src/Rails/ActionView/ActionView.php | ActionView.generateMissingExceptionMessage | protected function generateMissingExceptionMessage(
$type,
$name,
array $prefixes,
array $locales,
array $formats,
array $handlers
) {
$searchedPaths = [];
if ($prefixes) {
foreach ($prefixes as $prefix) {
$searched... | php | protected function generateMissingExceptionMessage(
$type,
$name,
array $prefixes,
array $locales,
array $formats,
array $handlers
) {
$searchedPaths = [];
if ($prefixes) {
foreach ($prefixes as $prefix) {
$searched... | [
"protected",
"function",
"generateMissingExceptionMessage",
"(",
"$",
"type",
",",
"$",
"name",
",",
"array",
"$",
"prefixes",
",",
"array",
"$",
"locales",
",",
"array",
"$",
"formats",
",",
"array",
"$",
"handlers",
")",
"{",
"$",
"searchedPaths",
"=",
"... | Generate missing exception message
@return string | [
"Generate",
"missing",
"exception",
"message"
] | 2ac9d3e493035dcc68f3c3812423327127327cd5 | https://github.com/railsphp/framework/blob/2ac9d3e493035dcc68f3c3812423327127327cd5/src/Rails/ActionView/ActionView.php#L246-L279 |
11,111 | jivoo/core | src/Random.php | Random.bytes | public static function bytes($n, &$method = null)
{
$bytes = self::php7Bytes($n);
$method = 'php7';
if (! isset($bytes)) {
$bytes = self::mcryptBytes($n);
$method = 'mcrypt';
}
if (! isset($bytes)) {
$bytes = self::opensslBytes($n);
... | php | public static function bytes($n, &$method = null)
{
$bytes = self::php7Bytes($n);
$method = 'php7';
if (! isset($bytes)) {
$bytes = self::mcryptBytes($n);
$method = 'mcrypt';
}
if (! isset($bytes)) {
$bytes = self::opensslBytes($n);
... | [
"public",
"static",
"function",
"bytes",
"(",
"$",
"n",
",",
"&",
"$",
"method",
"=",
"null",
")",
"{",
"$",
"bytes",
"=",
"self",
"::",
"php7Bytes",
"(",
"$",
"n",
")",
";",
"$",
"method",
"=",
"'php7'",
";",
"if",
"(",
"!",
"isset",
"(",
"$",... | Generate a random sequence of bytes.
@param int $n
Number of bytes.
@param string $method
Output parameter for the method used to generate
bytes: 'php7', 'mcrypt', 'openssl', 'urandom', or 'mt_rand'.
@return string String of bytes. | [
"Generate",
"a",
"random",
"sequence",
"of",
"bytes",
"."
] | 4ef3445068f0ff9c0a6512cb741831a847013b76 | https://github.com/jivoo/core/blob/4ef3445068f0ff9c0a6512cb741831a847013b76/src/Random.php#L119-L144 |
11,112 | open-orchestra/open-orchestra-migration-bundle | MigrationBundle/Migrations/Version20170307181737.php | Version20170307181737.updateBlocks | protected function updateBlocks(Database $db)
{
$this->write(' + Updating block documents');
$this->write(' + updating medias in tinyMce attributes');
$this->checkExecute($db->execute(
$this->getJSFunctions() . '
db.block.find({}).snapshot().forEach(function(block)... | php | protected function updateBlocks(Database $db)
{
$this->write(' + Updating block documents');
$this->write(' + updating medias in tinyMce attributes');
$this->checkExecute($db->execute(
$this->getJSFunctions() . '
db.block.find({}).snapshot().forEach(function(block)... | [
"protected",
"function",
"updateBlocks",
"(",
"Database",
"$",
"db",
")",
"{",
"$",
"this",
"->",
"write",
"(",
"' + Updating block documents'",
")",
";",
"$",
"this",
"->",
"write",
"(",
"' + updating medias in tinyMce attributes'",
")",
";",
"$",
"this",
"->",... | Add alt+legend to tinyMce attributes in blocks
alt is taken from the media document
@param Database $db | [
"Add",
"alt",
"+",
"legend",
"to",
"tinyMce",
"attributes",
"in",
"blocks",
"alt",
"is",
"taken",
"from",
"the",
"media",
"document"
] | ef9210bb14eb3715df2b43775a63086db5a64964 | https://github.com/open-orchestra/open-orchestra-migration-bundle/blob/ef9210bb14eb3715df2b43775a63086db5a64964/MigrationBundle/Migrations/Version20170307181737.php#L42-L107 |
11,113 | open-orchestra/open-orchestra-migration-bundle | MigrationBundle/Migrations/Version20170307181737.php | Version20170307181737.updateContents | protected function updateContents(Database $db)
{
$this->write(' + Updating content documents');
$this->updateTinyMCEInContent($db);
$this->updateMediaInContent($db);
} | php | protected function updateContents(Database $db)
{
$this->write(' + Updating content documents');
$this->updateTinyMCEInContent($db);
$this->updateMediaInContent($db);
} | [
"protected",
"function",
"updateContents",
"(",
"Database",
"$",
"db",
")",
"{",
"$",
"this",
"->",
"write",
"(",
"' + Updating content documents'",
")",
";",
"$",
"this",
"->",
"updateTinyMCEInContent",
"(",
"$",
"db",
")",
";",
"$",
"this",
"->",
"updateMe... | Update Content documents
@param Database $db | [
"Update",
"Content",
"documents"
] | ef9210bb14eb3715df2b43775a63086db5a64964 | https://github.com/open-orchestra/open-orchestra-migration-bundle/blob/ef9210bb14eb3715df2b43775a63086db5a64964/MigrationBundle/Migrations/Version20170307181737.php#L114-L120 |
11,114 | open-orchestra/open-orchestra-migration-bundle | MigrationBundle/Migrations/Version20170307181737.php | Version20170307181737.updateTinyMCEInContent | protected function updateTinyMCEInContent(Database $db)
{
$this->write(' + Updating medias in tinyMce attributes');
$this->checkExecute($db->execute(
$this->getJSFunctions() . '
db.content.find({}).snapshot().forEach(function(content) {
var updated = false;... | php | protected function updateTinyMCEInContent(Database $db)
{
$this->write(' + Updating medias in tinyMce attributes');
$this->checkExecute($db->execute(
$this->getJSFunctions() . '
db.content.find({}).snapshot().forEach(function(content) {
var updated = false;... | [
"protected",
"function",
"updateTinyMCEInContent",
"(",
"Database",
"$",
"db",
")",
"{",
"$",
"this",
"->",
"write",
"(",
"' + Updating medias in tinyMce attributes'",
")",
";",
"$",
"this",
"->",
"checkExecute",
"(",
"$",
"db",
"->",
"execute",
"(",
"$",
"th... | Add alt+legend to tinyMce attributes in contents
alt is taken from the media document
@param Database $db | [
"Add",
"alt",
"+",
"legend",
"to",
"tinyMce",
"attributes",
"in",
"contents",
"alt",
"is",
"taken",
"from",
"the",
"media",
"document"
] | ef9210bb14eb3715df2b43775a63086db5a64964 | https://github.com/open-orchestra/open-orchestra-migration-bundle/blob/ef9210bb14eb3715df2b43775a63086db5a64964/MigrationBundle/Migrations/Version20170307181737.php#L128-L157 |
11,115 | open-orchestra/open-orchestra-migration-bundle | MigrationBundle/Migrations/Version20170307181737.php | Version20170307181737.updateMediaInContent | protected function updateMediaInContent(Database $db)
{
$this->write(' + Updating orchestra_media attributes');
$configMediaFieldType = $this->container->getParameter('open_orchestra_migration.media_configuration');
$this->checkExecute($db->execute(
$this->getJSFunctions() . '
... | php | protected function updateMediaInContent(Database $db)
{
$this->write(' + Updating orchestra_media attributes');
$configMediaFieldType = $this->container->getParameter('open_orchestra_migration.media_configuration');
$this->checkExecute($db->execute(
$this->getJSFunctions() . '
... | [
"protected",
"function",
"updateMediaInContent",
"(",
"Database",
"$",
"db",
")",
"{",
"$",
"this",
"->",
"write",
"(",
"' + Updating orchestra_media attributes'",
")",
";",
"$",
"configMediaFieldType",
"=",
"$",
"this",
"->",
"container",
"->",
"getParameter",
"... | Update Medias in contents by adding alt and legend
alt is taken from the media document
@param Database $db | [
"Update",
"Medias",
"in",
"contents",
"by",
"adding",
"alt",
"and",
"legend",
"alt",
"is",
"taken",
"from",
"the",
"media",
"document"
] | ef9210bb14eb3715df2b43775a63086db5a64964 | https://github.com/open-orchestra/open-orchestra-migration-bundle/blob/ef9210bb14eb3715df2b43775a63086db5a64964/MigrationBundle/Migrations/Version20170307181737.php#L165-L200 |
11,116 | open-orchestra/open-orchestra-migration-bundle | MigrationBundle/Migrations/Version20170307181737.php | Version20170307181737.updateFolders | protected function updateFolders(Database $db)
{
$this->write(' + Updating media folder documents');
$this->createFolderId($db);
$this->createFolderPath();
$this->updateFolderNames($db);
} | php | protected function updateFolders(Database $db)
{
$this->write(' + Updating media folder documents');
$this->createFolderId($db);
$this->createFolderPath();
$this->updateFolderNames($db);
} | [
"protected",
"function",
"updateFolders",
"(",
"Database",
"$",
"db",
")",
"{",
"$",
"this",
"->",
"write",
"(",
"' + Updating media folder documents'",
")",
";",
"$",
"this",
"->",
"createFolderId",
"(",
"$",
"db",
")",
";",
"$",
"this",
"->",
"createFolder... | Update folder documents
@param Database $db | [
"Update",
"folder",
"documents"
] | ef9210bb14eb3715df2b43775a63086db5a64964 | https://github.com/open-orchestra/open-orchestra-migration-bundle/blob/ef9210bb14eb3715df2b43775a63086db5a64964/MigrationBundle/Migrations/Version20170307181737.php#L207-L214 |
11,117 | open-orchestra/open-orchestra-migration-bundle | MigrationBundle/Migrations/Version20170307181737.php | Version20170307181737.updateMedias | protected function updateMedias(Database $db)
{
$this->write(' + Updating media documents');
$this->write(' + Removing alts');
$this->checkExecute($db->execute('
db.media.update({}, {$unset: {alts: ""}}, {multi: true});
'));
} | php | protected function updateMedias(Database $db)
{
$this->write(' + Updating media documents');
$this->write(' + Removing alts');
$this->checkExecute($db->execute('
db.media.update({}, {$unset: {alts: ""}}, {multi: true});
'));
} | [
"protected",
"function",
"updateMedias",
"(",
"Database",
"$",
"db",
")",
"{",
"$",
"this",
"->",
"write",
"(",
"' + Updating media documents'",
")",
";",
"$",
"this",
"->",
"write",
"(",
"' + Removing alts'",
")",
";",
"$",
"this",
"->",
"checkExecute",
"(... | Update media documents
@param Database $db | [
"Update",
"media",
"documents"
] | ef9210bb14eb3715df2b43775a63086db5a64964 | https://github.com/open-orchestra/open-orchestra-migration-bundle/blob/ef9210bb14eb3715df2b43775a63086db5a64964/MigrationBundle/Migrations/Version20170307181737.php#L221-L229 |
11,118 | open-orchestra/open-orchestra-migration-bundle | MigrationBundle/Migrations/Version20170307181737.php | Version20170307181737.createFolderPath | protected function createFolderPath()
{
$this->write(' + Adding folderPath');
$rootFolders = $this->container->get('open_orchestra_media.repository.media_folder')->findBy(array('parent' => null));
foreach ($rootFolders as $folder) {
$oldPath = $folder->getPath();
$f... | php | protected function createFolderPath()
{
$this->write(' + Adding folderPath');
$rootFolders = $this->container->get('open_orchestra_media.repository.media_folder')->findBy(array('parent' => null));
foreach ($rootFolders as $folder) {
$oldPath = $folder->getPath();
$f... | [
"protected",
"function",
"createFolderPath",
"(",
")",
"{",
"$",
"this",
"->",
"write",
"(",
"' + Adding folderPath'",
")",
";",
"$",
"rootFolders",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'open_orchestra_media.repository.media_folder'",
")",
"->"... | Add Path to each folder | [
"Add",
"Path",
"to",
"each",
"folder"
] | ef9210bb14eb3715df2b43775a63086db5a64964 | https://github.com/open-orchestra/open-orchestra-migration-bundle/blob/ef9210bb14eb3715df2b43775a63086db5a64964/MigrationBundle/Migrations/Version20170307181737.php#L253-L268 |
11,119 | open-orchestra/open-orchestra-migration-bundle | MigrationBundle/Migrations/Version20170307181737.php | Version20170307181737.updateFolderNames | protected function updateFolderNames(Database $db)
{
$this->write(' + Updating folderNames');
$this->checkExecute($db->execute('
var backLanguages = ' . json_encode($this->container->getParameter('open_orchestra_base.administration_languages')) . ';
db.folder.find({}).snap... | php | protected function updateFolderNames(Database $db)
{
$this->write(' + Updating folderNames');
$this->checkExecute($db->execute('
var backLanguages = ' . json_encode($this->container->getParameter('open_orchestra_base.administration_languages')) . ';
db.folder.find({}).snap... | [
"protected",
"function",
"updateFolderNames",
"(",
"Database",
"$",
"db",
")",
"{",
"$",
"this",
"->",
"write",
"(",
"' + Updating folderNames'",
")",
";",
"$",
"this",
"->",
"checkExecute",
"(",
"$",
"db",
"->",
"execute",
"(",
"'\n var backLanguage... | Internationalize Folder name
@param Database $db | [
"Internationalize",
"Folder",
"name"
] | ef9210bb14eb3715df2b43775a63086db5a64964 | https://github.com/open-orchestra/open-orchestra-migration-bundle/blob/ef9210bb14eb3715df2b43775a63086db5a64964/MigrationBundle/Migrations/Version20170307181737.php#L275-L294 |
11,120 | eureka-framework/Eurekon | Eurekon.php | Eurekon.help | protected function help()
{
$style = new Style(' *** RUN - HELP ***');
Out::std($style->color('fg', Style::COLOR_GREEN)->get());
Out::std('');
$help = new Help('...', true);
$help->addArgument('', 'color', 'Activate colors (do not activate when redirect output in log file, c... | php | protected function help()
{
$style = new Style(' *** RUN - HELP ***');
Out::std($style->color('fg', Style::COLOR_GREEN)->get());
Out::std('');
$help = new Help('...', true);
$help->addArgument('', 'color', 'Activate colors (do not activate when redirect output in log file, c... | [
"protected",
"function",
"help",
"(",
")",
"{",
"$",
"style",
"=",
"new",
"Style",
"(",
"' *** RUN - HELP ***'",
")",
";",
"Out",
"::",
"std",
"(",
"$",
"style",
"->",
"color",
"(",
"'fg'",
",",
"Style",
"::",
"COLOR_GREEN",
")",
"->",
"get",
"(",
")... | Display console lib help
@return void | [
"Display",
"console",
"lib",
"help"
] | 86f958f9458ea369894286d8cdc4fe4ded33489a | https://github.com/eureka-framework/Eurekon/blob/86f958f9458ea369894286d8cdc4fe4ded33489a/Eurekon.php#L55-L71 |
11,121 | eureka-framework/Eurekon | Eurekon.php | Eurekon.before | public function before()
{
// ~ Init timer
$this->time = - microtime(true);
// ~ Reporting all error (default: all error) !
error_reporting((int) $this->argument->get('error-reporting', null, - 1));
ini_set('display_errors', (bool) $this->argument->get('error-display', null... | php | public function before()
{
// ~ Init timer
$this->time = - microtime(true);
// ~ Reporting all error (default: all error) !
error_reporting((int) $this->argument->get('error-reporting', null, - 1));
ini_set('display_errors', (bool) $this->argument->get('error-display', null... | [
"public",
"function",
"before",
"(",
")",
"{",
"// ~ Init timer",
"$",
"this",
"->",
"time",
"=",
"-",
"microtime",
"(",
"true",
")",
";",
"// ~ Reporting all error (default: all error) !",
"error_reporting",
"(",
"(",
"int",
")",
"$",
"this",
"->",
"argument",
... | This method is executed before main method of console.
- init timer
- init error_reporting
- init time limit for script
- init verbose mode
@return void | [
"This",
"method",
"is",
"executed",
"before",
"main",
"method",
"of",
"console",
".",
"-",
"init",
"timer",
"-",
"init",
"error_reporting",
"-",
"init",
"time",
"limit",
"for",
"script",
"-",
"init",
"verbose",
"mode"
] | 86f958f9458ea369894286d8cdc4fe4ded33489a | https://github.com/eureka-framework/Eurekon/blob/86f958f9458ea369894286d8cdc4fe4ded33489a/Eurekon.php#L82-L96 |
11,122 | MarcusFulbright/represent | src/Represent/Builder/GenericRepresentationBuilder.php | GenericRepresentationBuilder.handleObject | protected function handleObject($object, $view)
{
$check = $this->trackObjectVisits($object);
if ($check instanceof \stdClass) {
return $check;
} else {
$output = new \stdClass();
$output->_hash = $check;
}
$reflection = new \Reflectio... | php | protected function handleObject($object, $view)
{
$check = $this->trackObjectVisits($object);
if ($check instanceof \stdClass) {
return $check;
} else {
$output = new \stdClass();
$output->_hash = $check;
}
$reflection = new \Reflectio... | [
"protected",
"function",
"handleObject",
"(",
"$",
"object",
",",
"$",
"view",
")",
"{",
"$",
"check",
"=",
"$",
"this",
"->",
"trackObjectVisits",
"(",
"$",
"object",
")",
";",
"if",
"(",
"$",
"check",
"instanceof",
"\\",
"stdClass",
")",
"{",
"return... | Used to handle representing objects
@param $object
@param $view
@return \stdClass | [
"Used",
"to",
"handle",
"representing",
"objects"
] | f7b624f473a3247a29f05c4a694d04bba4038e59 | https://github.com/MarcusFulbright/represent/blob/f7b624f473a3247a29f05c4a694d04bba4038e59/src/Represent/Builder/GenericRepresentationBuilder.php#L45-L65 |
11,123 | gismo-framework/ExpressionLanguage | TokenStream.php | TokenStream.expect | public function expect($type, $value = null, $message = null)
{
$token = $this->current;
if (!$token->test($type, $value)) {
throw new SyntaxError(sprintf('%sUnexpected token "%s" of value "%s" ("%s" expected%s)', $message ? $message.'. ' : '', $token->type, $token->value, $type, $value ... | php | public function expect($type, $value = null, $message = null)
{
$token = $this->current;
if (!$token->test($type, $value)) {
throw new SyntaxError(sprintf('%sUnexpected token "%s" of value "%s" ("%s" expected%s)', $message ? $message.'. ' : '', $token->type, $token->value, $type, $value ... | [
"public",
"function",
"expect",
"(",
"$",
"type",
",",
"$",
"value",
"=",
"null",
",",
"$",
"message",
"=",
"null",
")",
"{",
"$",
"token",
"=",
"$",
"this",
"->",
"current",
";",
"if",
"(",
"!",
"$",
"token",
"->",
"test",
"(",
"$",
"type",
",... | Tests a token.
@param array|int $type The type to test
@param string|null $value The token value
@param string|null $message The syntax error message | [
"Tests",
"a",
"token",
"."
] | ceb176416dc3669aa269e8f93b7232a94c221167 | https://github.com/gismo-framework/ExpressionLanguage/blob/ceb176416dc3669aa269e8f93b7232a94c221167/TokenStream.php#L68-L75 |
11,124 | shov/wpci-core | Http/RouterStore.php | RouterStore.removeByKey | public function removeByKey(string $key): bool
{
if (isset($this->routes[$key])) {
unset($this->routes[$key]);
return true;
}
return false;
} | php | public function removeByKey(string $key): bool
{
if (isset($this->routes[$key])) {
unset($this->routes[$key]);
return true;
}
return false;
} | [
"public",
"function",
"removeByKey",
"(",
"string",
"$",
"key",
")",
":",
"bool",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"routes",
"[",
"$",
"key",
"]",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"routes",
"[",
"$",
"key",
"]",
"... | Remove route using the key
@param string $key
@return bool, will return true if remove rout successfully | [
"Remove",
"route",
"using",
"the",
"key"
] | e31084cbc2f310882df2b9b0548330ea5fdb4f26 | https://github.com/shov/wpci-core/blob/e31084cbc2f310882df2b9b0548330ea5fdb4f26/Http/RouterStore.php#L47-L54 |
11,125 | shov/wpci-core | Http/RouterStore.php | RouterStore.makeBinding | public function makeBinding()
{
$this->sortByConditionPriority();
foreach ($this->routes as $route) {
/** @var RouteConditionInterface $condition */
$condition = $route['condition'];
/** @var Action $action */
$action = $route['action'];
... | php | public function makeBinding()
{
$this->sortByConditionPriority();
foreach ($this->routes as $route) {
/** @var RouteConditionInterface $condition */
$condition = $route['condition'];
/** @var Action $action */
$action = $route['action'];
... | [
"public",
"function",
"makeBinding",
"(",
")",
"{",
"$",
"this",
"->",
"sortByConditionPriority",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"routes",
"as",
"$",
"route",
")",
"{",
"/** @var RouteConditionInterface $condition */",
"$",
"condition",
"=",
... | Bind all routes' condition-action couples | [
"Bind",
"all",
"routes",
"condition",
"-",
"action",
"couples"
] | e31084cbc2f310882df2b9b0548330ea5fdb4f26 | https://github.com/shov/wpci-core/blob/e31084cbc2f310882df2b9b0548330ea5fdb4f26/Http/RouterStore.php#L59-L72 |
11,126 | shov/wpci-core | Http/RouterStore.php | RouterStore.sortByConditionPriority | protected function sortByConditionPriority()
{
//Split
$wpQueryRoutes = [];
$otherRoutes = [];
foreach ($this->routes as $key => $curRoute)
{
if($curRoute['condition'] instanceof WpQueryCondition) {
if(!is_numeric($key)) {
$wpQ... | php | protected function sortByConditionPriority()
{
//Split
$wpQueryRoutes = [];
$otherRoutes = [];
foreach ($this->routes as $key => $curRoute)
{
if($curRoute['condition'] instanceof WpQueryCondition) {
if(!is_numeric($key)) {
$wpQ... | [
"protected",
"function",
"sortByConditionPriority",
"(",
")",
"{",
"//Split",
"$",
"wpQueryRoutes",
"=",
"[",
"]",
";",
"$",
"otherRoutes",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"routes",
"as",
"$",
"key",
"=>",
"$",
"curRoute",
")",
"... | Sort routes by priority | [
"Sort",
"routes",
"by",
"priority"
] | e31084cbc2f310882df2b9b0548330ea5fdb4f26 | https://github.com/shov/wpci-core/blob/e31084cbc2f310882df2b9b0548330ea5fdb4f26/Http/RouterStore.php#L77-L134 |
11,127 | lhs168/fasim | src/Fasim/Core/Input.php | Input.string | public function string($index = '', $isTrim = true) {
$value = '';
if (isset($_POST[$index])) {
$value = $_POST[$index];
} else if (isset($_GET[$index])) {
$value = $_GET[$index];
}
return $isTrim ? trim($value) : $value;
} | php | public function string($index = '', $isTrim = true) {
$value = '';
if (isset($_POST[$index])) {
$value = $_POST[$index];
} else if (isset($_GET[$index])) {
$value = $_GET[$index];
}
return $isTrim ? trim($value) : $value;
} | [
"public",
"function",
"string",
"(",
"$",
"index",
"=",
"''",
",",
"$",
"isTrim",
"=",
"true",
")",
"{",
"$",
"value",
"=",
"''",
";",
"if",
"(",
"isset",
"(",
"$",
"_POST",
"[",
"$",
"index",
"]",
")",
")",
"{",
"$",
"value",
"=",
"$",
"_POS... | Fetch an item from either the GET array or the POST
@access public
@param
string The index key
@param
bool isTrim
@return string | [
"Fetch",
"an",
"item",
"from",
"either",
"the",
"GET",
"array",
"or",
"the",
"POST"
] | df31e249593380421785f0be342cfb92cbb1d1d7 | https://github.com/lhs168/fasim/blob/df31e249593380421785f0be342cfb92cbb1d1d7/src/Fasim/Core/Input.php#L154-L162 |
11,128 | lhs168/fasim | src/Fasim/Core/Input.php | Input.intval | function intval($index = '', $default = 0) {
$value = $default;
if (isset($_POST[$index])) {
$value = $_POST[$index];
} else if (isset($_GET[$index])) {
$value = $_GET[$index];
}
return intval($value);
} | php | function intval($index = '', $default = 0) {
$value = $default;
if (isset($_POST[$index])) {
$value = $_POST[$index];
} else if (isset($_GET[$index])) {
$value = $_GET[$index];
}
return intval($value);
} | [
"function",
"intval",
"(",
"$",
"index",
"=",
"''",
",",
"$",
"default",
"=",
"0",
")",
"{",
"$",
"value",
"=",
"$",
"default",
";",
"if",
"(",
"isset",
"(",
"$",
"_POST",
"[",
"$",
"index",
"]",
")",
")",
"{",
"$",
"value",
"=",
"$",
"_POST"... | Fetch an item from either the GET array or the POST and covert into int
@access public
@param
string The index key
@param
int default value
@return int | [
"Fetch",
"an",
"item",
"from",
"either",
"the",
"GET",
"array",
"or",
"the",
"POST",
"and",
"covert",
"into",
"int"
] | df31e249593380421785f0be342cfb92cbb1d1d7 | https://github.com/lhs168/fasim/blob/df31e249593380421785f0be342cfb92cbb1d1d7/src/Fasim/Core/Input.php#L176-L184 |
11,129 | lhs168/fasim | src/Fasim/Core/Input.php | Input.floatval | public function floatval($index = '', $default = 0) {
$value = $default;
if (isset($_POST[$index])) {
$value = $_POST[$index];
} else if (isset($_GET[$index])) {
$value = $_GET[$index];
}
return floatval($value);
} | php | public function floatval($index = '', $default = 0) {
$value = $default;
if (isset($_POST[$index])) {
$value = $_POST[$index];
} else if (isset($_GET[$index])) {
$value = $_GET[$index];
}
return floatval($value);
} | [
"public",
"function",
"floatval",
"(",
"$",
"index",
"=",
"''",
",",
"$",
"default",
"=",
"0",
")",
"{",
"$",
"value",
"=",
"$",
"default",
";",
"if",
"(",
"isset",
"(",
"$",
"_POST",
"[",
"$",
"index",
"]",
")",
")",
"{",
"$",
"value",
"=",
... | Fetch an item from either the GET array or the POST and covert into float
@access public
@param
string The index key
@param
int default value
@return int | [
"Fetch",
"an",
"item",
"from",
"either",
"the",
"GET",
"array",
"or",
"the",
"POST",
"and",
"covert",
"into",
"float"
] | df31e249593380421785f0be342cfb92cbb1d1d7 | https://github.com/lhs168/fasim/blob/df31e249593380421785f0be342cfb92cbb1d1d7/src/Fasim/Core/Input.php#L196-L204 |
11,130 | lhs168/fasim | src/Fasim/Core/Input.php | Input.doubleval | public function doubleval($index = '', $default = 0) {
$value = $default;
if (isset($_POST[$index])) {
$value = $_POST[$index];
} else if (isset($_GET[$index])) {
$value = $_GET[$index];
}
return doubleval($value);
} | php | public function doubleval($index = '', $default = 0) {
$value = $default;
if (isset($_POST[$index])) {
$value = $_POST[$index];
} else if (isset($_GET[$index])) {
$value = $_GET[$index];
}
return doubleval($value);
} | [
"public",
"function",
"doubleval",
"(",
"$",
"index",
"=",
"''",
",",
"$",
"default",
"=",
"0",
")",
"{",
"$",
"value",
"=",
"$",
"default",
";",
"if",
"(",
"isset",
"(",
"$",
"_POST",
"[",
"$",
"index",
"]",
")",
")",
"{",
"$",
"value",
"=",
... | Fetch an item from either the GET array or the POST and covert into double
@access public
@param
string The index key
@param
int default value
@return int | [
"Fetch",
"an",
"item",
"from",
"either",
"the",
"GET",
"array",
"or",
"the",
"POST",
"and",
"covert",
"into",
"double"
] | df31e249593380421785f0be342cfb92cbb1d1d7 | https://github.com/lhs168/fasim/blob/df31e249593380421785f0be342cfb92cbb1d1d7/src/Fasim/Core/Input.php#L216-L224 |
11,131 | lhs168/fasim | src/Fasim/Core/Input.php | Input.ipAddress | function ipAddress() {
if ($this->_ipAddress !== FALSE) {
return $this->_ipAddress;
}
$proxyIps = Cfg::get('proxy_ips');
if ($proxyIps != '' && $_SERVER['HTTP_X_FORWARDED_FOR'] && $_SERVER['REMOTE_ADDR']) {
$proxies = preg_split('/[\s,]/', $proxyIps, -1, PREG_SPLIT_NO_EMPTY);
$proxies = is_array($pr... | php | function ipAddress() {
if ($this->_ipAddress !== FALSE) {
return $this->_ipAddress;
}
$proxyIps = Cfg::get('proxy_ips');
if ($proxyIps != '' && $_SERVER['HTTP_X_FORWARDED_FOR'] && $_SERVER['REMOTE_ADDR']) {
$proxies = preg_split('/[\s,]/', $proxyIps, -1, PREG_SPLIT_NO_EMPTY);
$proxies = is_array($pr... | [
"function",
"ipAddress",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_ipAddress",
"!==",
"FALSE",
")",
"{",
"return",
"$",
"this",
"->",
"_ipAddress",
";",
"}",
"$",
"proxyIps",
"=",
"Cfg",
"::",
"get",
"(",
"'proxy_ips'",
")",
";",
"if",
"(",
"$... | Fetch the IP Address
@access public
@return string | [
"Fetch",
"the",
"IP",
"Address"
] | df31e249593380421785f0be342cfb92cbb1d1d7 | https://github.com/lhs168/fasim/blob/df31e249593380421785f0be342cfb92cbb1d1d7/src/Fasim/Core/Input.php#L265-L301 |
11,132 | lhs168/fasim | src/Fasim/Core/Input.php | Input._clean_input_data | private function _clean_input_data($str) {
if (is_array($str)) {
$new_array = array();
foreach ($str as $key => $val) {
$new_array[$this->_clean_input_keys($key)] = $this->_clean_input_data($val);
}
return $new_array;
}
/*
* We strip slashes if magic quotes is on to keep things consistent
... | php | private function _clean_input_data($str) {
if (is_array($str)) {
$new_array = array();
foreach ($str as $key => $val) {
$new_array[$this->_clean_input_keys($key)] = $this->_clean_input_data($val);
}
return $new_array;
}
/*
* We strip slashes if magic quotes is on to keep things consistent
... | [
"private",
"function",
"_clean_input_data",
"(",
"$",
"str",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"str",
")",
")",
"{",
"$",
"new_array",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"str",
"as",
"$",
"key",
"=>",
"$",
"val",
")",
"{",... | Clean Input Data
This is a helper function. It escapes data and
standardizes newline characters to \n
@access private
@param
string
@return string | [
"Clean",
"Input",
"Data"
] | df31e249593380421785f0be342cfb92cbb1d1d7 | https://github.com/lhs168/fasim/blob/df31e249593380421785f0be342cfb92cbb1d1d7/src/Fasim/Core/Input.php#L423-L457 |
11,133 | railsphp/framework | src/Rails/ActionView/Helper/Methods/FormTrait.php | FormTrait.objectName | public function objectName($object)
{
$names = explode('\\', get_class($object));
# TODO: Simple underscore
return $this->getService('inflector')->underscore(end($names));
} | php | public function objectName($object)
{
$names = explode('\\', get_class($object));
# TODO: Simple underscore
return $this->getService('inflector')->underscore(end($names));
} | [
"public",
"function",
"objectName",
"(",
"$",
"object",
")",
"{",
"$",
"names",
"=",
"explode",
"(",
"'\\\\'",
",",
"get_class",
"(",
"$",
"object",
")",
")",
";",
"# TODO: Simple underscore",
"return",
"$",
"this",
"->",
"getService",
"(",
"'inflector'",
... | Returns the underscored version of the class name of an object.
If the class name has namespaces, they are removed.
This method is intended to be used only by the system. It is
public because it's also used by other classes.
@param object $object
@return string | [
"Returns",
"the",
"underscored",
"version",
"of",
"the",
"class",
"name",
"of",
"an",
"object",
".",
"If",
"the",
"class",
"name",
"has",
"namespaces",
"they",
"are",
"removed",
".",
"This",
"method",
"is",
"intended",
"to",
"be",
"used",
"only",
"by",
"... | 2ac9d3e493035dcc68f3c3812423327127327cd5 | https://github.com/railsphp/framework/blob/2ac9d3e493035dcc68f3c3812423327127327cd5/src/Rails/ActionView/Helper/Methods/FormTrait.php#L332-L337 |
11,134 | pingpong-labs/validator | Validator.php | Validator.validate | public function validate(array $data = null)
{
$data = $data ?: $this->getInput();
$this->validation = $this->validator->make($data, $this->rules(), $this->messages());
if ($this->validation->fails())
{
$this->failed();
return false;
}
retu... | php | public function validate(array $data = null)
{
$data = $data ?: $this->getInput();
$this->validation = $this->validator->make($data, $this->rules(), $this->messages());
if ($this->validation->fails())
{
$this->failed();
return false;
}
retu... | [
"public",
"function",
"validate",
"(",
"array",
"$",
"data",
"=",
"null",
")",
"{",
"$",
"data",
"=",
"$",
"data",
"?",
":",
"$",
"this",
"->",
"getInput",
"(",
")",
";",
"$",
"this",
"->",
"validation",
"=",
"$",
"this",
"->",
"validator",
"->",
... | Validate the given data.
@param array $data
@return bool
@throws ValidationException | [
"Validate",
"the",
"given",
"data",
"."
] | dc9c03949ad4c4f682643a55f7b61a36704ff944 | https://github.com/pingpong-labs/validator/blob/dc9c03949ad4c4f682643a55f7b61a36704ff944/Validator.php#L79-L93 |
11,135 | kapitchi/kap-security | src/KapSecurity/Controller/OAuthController.php | OAuthController.getOAuth2Request | protected function getOAuth2Request($params = null)
{
$zf2Request = $this->getRequest();
$headers = $zf2Request->getHeaders();
// Marshal content type, so we can seed it into the $_SERVER array
$contentType = '';
if ($headers->has('Content-Type')) {
$contentTy... | php | protected function getOAuth2Request($params = null)
{
$zf2Request = $this->getRequest();
$headers = $zf2Request->getHeaders();
// Marshal content type, so we can seed it into the $_SERVER array
$contentType = '';
if ($headers->has('Content-Type')) {
$contentTy... | [
"protected",
"function",
"getOAuth2Request",
"(",
"$",
"params",
"=",
"null",
")",
"{",
"$",
"zf2Request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"$",
"headers",
"=",
"$",
"zf2Request",
"->",
"getHeaders",
"(",
")",
";",
"// Marshal content t... | Create an OAuth2 request based on the ZF2 request object
Marshals:
- query string
- body parameters, via content negotiation
- "server", specifically the request method and content type
- raw content
- headers
This ensures that JSON requests providing credentials for OAuth2
verification/validation can be processed.
... | [
"Create",
"an",
"OAuth2",
"request",
"based",
"on",
"the",
"ZF2",
"request",
"object"
] | aa97a913c28254d79d8664d3c1b677bb10ba9849 | https://github.com/kapitchi/kap-security/blob/aa97a913c28254d79d8664d3c1b677bb10ba9849/src/KapSecurity/Controller/OAuthController.php#L258-L300 |
11,136 | kapitchi/kap-security | src/KapSecurity/Controller/OAuthController.php | OAuthController.setHttpResponse | private function setHttpResponse(OAuth2Response $response)
{
$httpResponse = $this->getResponse();
$httpResponse->setStatusCode($response->getStatusCode());
$headers = $httpResponse->getHeaders();
$headers->addHeaders($response->getHttpHeaders());
$headers->addHeaderLine('Co... | php | private function setHttpResponse(OAuth2Response $response)
{
$httpResponse = $this->getResponse();
$httpResponse->setStatusCode($response->getStatusCode());
$headers = $httpResponse->getHeaders();
$headers->addHeaders($response->getHttpHeaders());
$headers->addHeaderLine('Co... | [
"private",
"function",
"setHttpResponse",
"(",
"OAuth2Response",
"$",
"response",
")",
"{",
"$",
"httpResponse",
"=",
"$",
"this",
"->",
"getResponse",
"(",
")",
";",
"$",
"httpResponse",
"->",
"setStatusCode",
"(",
"$",
"response",
"->",
"getStatusCode",
"(",... | Convert the OAuth2 response to a \Zend\Http\Response
@param $response OAuth2Response
@return \Zend\Http\Response | [
"Convert",
"the",
"OAuth2",
"response",
"to",
"a",
"\\",
"Zend",
"\\",
"Http",
"\\",
"Response"
] | aa97a913c28254d79d8664d3c1b677bb10ba9849 | https://github.com/kapitchi/kap-security/blob/aa97a913c28254d79d8664d3c1b677bb10ba9849/src/KapSecurity/Controller/OAuthController.php#L308-L319 |
11,137 | bytic/database | src/Query/Insert.php | Insert.parseData | protected function parseData()
{
$values = [];
foreach ($this->parts['data'] as $key => $data) {
foreach ($data as $value) {
if (!is_array($value)) {
$value = [$value];
}
foreach ($value as $insertValue) {
... | php | protected function parseData()
{
$values = [];
foreach ($this->parts['data'] as $key => $data) {
foreach ($data as $value) {
if (!is_array($value)) {
$value = [$value];
}
foreach ($value as $insertValue) {
... | [
"protected",
"function",
"parseData",
"(",
")",
"{",
"$",
"values",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"parts",
"[",
"'data'",
"]",
"as",
"$",
"key",
"=>",
"$",
"data",
")",
"{",
"foreach",
"(",
"$",
"data",
"as",
"$",
"value"... | Parses INSERT data
@return string | [
"Parses",
"INSERT",
"data"
] | 186a7f1ae4fe2d8fa79acc34c06cfacd91488fa4 | https://github.com/bytic/database/blob/186a7f1ae4fe2d8fa79acc34c06cfacd91488fa4/src/Query/Insert.php#L68-L87 |
11,138 | webservices-nl/utils | src/JsonUtils.php | JsonUtils.decode | public static function decode($json, $assoc = false, $options = 0)
{
if (!is_string($json)) {
throw new \InvalidArgumentException('Argument json is not a string');
}
$result = json_decode($json, (bool) $assoc, 512, (int) $options);
if ($result === null) {
thro... | php | public static function decode($json, $assoc = false, $options = 0)
{
if (!is_string($json)) {
throw new \InvalidArgumentException('Argument json is not a string');
}
$result = json_decode($json, (bool) $assoc, 512, (int) $options);
if ($result === null) {
thro... | [
"public",
"static",
"function",
"decode",
"(",
"$",
"json",
",",
"$",
"assoc",
"=",
"false",
",",
"$",
"options",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"json",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",... | Decode a JSON string into a php representation.
@param string $json string to convert
@param bool $assoc return as associative array
@param int $options JSON options
@throws \InvalidArgumentException
@throws \RuntimeException
@return mixed | [
"Decode",
"a",
"JSON",
"string",
"into",
"a",
"php",
"representation",
"."
] | 052f41ff725808b19d529e640f890ce7c863e100 | https://github.com/webservices-nl/utils/blob/052f41ff725808b19d529e640f890ce7c863e100/src/JsonUtils.php#L39-L50 |
11,139 | webservices-nl/utils | src/JsonUtils.php | JsonUtils.encode | public static function encode($value, $options = 0)
{
$result = json_encode($value, (int) $options);
// @codeCoverageIgnoreStart
if ($result === false) {
throw new \RuntimeException(static::$errorMessages[json_last_error()]);
}
// @codeCoverageIgnoreEnd
r... | php | public static function encode($value, $options = 0)
{
$result = json_encode($value, (int) $options);
// @codeCoverageIgnoreStart
if ($result === false) {
throw new \RuntimeException(static::$errorMessages[json_last_error()]);
}
// @codeCoverageIgnoreEnd
r... | [
"public",
"static",
"function",
"encode",
"(",
"$",
"value",
",",
"$",
"options",
"=",
"0",
")",
"{",
"$",
"result",
"=",
"json_encode",
"(",
"$",
"value",
",",
"(",
"int",
")",
"$",
"options",
")",
";",
"// @codeCoverageIgnoreStart",
"if",
"(",
"$",
... | Encode a PHP value into a JSON representation.
@param mixed $value
@param int $options [optional]
@throws \RuntimeException
@return string
@link http://php.net/manual/en/function.json-encode.php | [
"Encode",
"a",
"PHP",
"value",
"into",
"a",
"JSON",
"representation",
"."
] | 052f41ff725808b19d529e640f890ce7c863e100 | https://github.com/webservices-nl/utils/blob/052f41ff725808b19d529e640f890ce7c863e100/src/JsonUtils.php#L64-L74 |
11,140 | slickframework/mvc | src/Controller/EntityViewMethods.php | EntityViewMethods.getMissingEntityMessage | protected function getMissingEntityMessage($entityId)
{
$singleName = $this->getEntityNameSingular();
$message = "The {$singleName} with ID %s was not found.";
return sprintf($this->translate($message), $entityId);
} | php | protected function getMissingEntityMessage($entityId)
{
$singleName = $this->getEntityNameSingular();
$message = "The {$singleName} with ID %s was not found.";
return sprintf($this->translate($message), $entityId);
} | [
"protected",
"function",
"getMissingEntityMessage",
"(",
"$",
"entityId",
")",
"{",
"$",
"singleName",
"=",
"$",
"this",
"->",
"getEntityNameSingular",
"(",
")",
";",
"$",
"message",
"=",
"\"The {$singleName} with ID %s was not found.\"",
";",
"return",
"sprintf",
"... | Get missing entity warning message
@param mixed $entityId
@return string | [
"Get",
"missing",
"entity",
"warning",
"message"
] | 91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab | https://github.com/slickframework/mvc/blob/91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab/src/Controller/EntityViewMethods.php#L41-L46 |
11,141 | slickframework/mvc | src/Controller/EntityViewMethods.php | EntityViewMethods.show | public function show($entityId = 0)
{
$entityId = StaticFilter::filter('text', $entityId);
$entity = null;
try {
$entity = $this->getEntity($entityId);
$this->set($this->getEntityNameSingular(), $entity);
} catch (EntityNotFoundException $caught) {
... | php | public function show($entityId = 0)
{
$entityId = StaticFilter::filter('text', $entityId);
$entity = null;
try {
$entity = $this->getEntity($entityId);
$this->set($this->getEntityNameSingular(), $entity);
} catch (EntityNotFoundException $caught) {
... | [
"public",
"function",
"show",
"(",
"$",
"entityId",
"=",
"0",
")",
"{",
"$",
"entityId",
"=",
"StaticFilter",
"::",
"filter",
"(",
"'text'",
",",
"$",
"entityId",
")",
";",
"$",
"entity",
"=",
"null",
";",
"try",
"{",
"$",
"entity",
"=",
"$",
"this... | Handles the request to view an entity
@param int $entityId
@return null|EntityInterface | [
"Handles",
"the",
"request",
"to",
"view",
"an",
"entity"
] | 91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab | https://github.com/slickframework/mvc/blob/91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab/src/Controller/EntityViewMethods.php#L65-L80 |
11,142 | Silvestra/Silvestra | src/Silvestra/Bundle/FrontendBundle/Controller/FrontendController.php | FrontendController.generateUrl | protected function generateUrl($name, $parameters = array(), $referenceType = RouterInterface::ABSOLUTE_PATH)
{
return $this->router->generate($name, $parameters, $referenceType);
} | php | protected function generateUrl($name, $parameters = array(), $referenceType = RouterInterface::ABSOLUTE_PATH)
{
return $this->router->generate($name, $parameters, $referenceType);
} | [
"protected",
"function",
"generateUrl",
"(",
"$",
"name",
",",
"$",
"parameters",
"=",
"array",
"(",
")",
",",
"$",
"referenceType",
"=",
"RouterInterface",
"::",
"ABSOLUTE_PATH",
")",
"{",
"return",
"$",
"this",
"->",
"router",
"->",
"generate",
"(",
"$",... | Generate url.
@param string $name
@param array $parameters
@param bool $referenceType
@return string | [
"Generate",
"url",
"."
] | b7367601b01495ae3c492b42042f804dee13ab06 | https://github.com/Silvestra/Silvestra/blob/b7367601b01495ae3c492b42042f804dee13ab06/src/Silvestra/Bundle/FrontendBundle/Controller/FrontendController.php#L132-L135 |
11,143 | tekkla/core-http | Core/Http/Cookie/CookieHandler.php | CookieHandler.send | public function send()
{
/* @var $cookie \Core\Http\Cookie\CookieInterface */
foreach ($this->cookies as $cookie) {
setcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpire(), $cookie->getPath(), $cookie->getDomain(), $cookie->getSecure(), $cookie->getHttponly());
}
... | php | public function send()
{
/* @var $cookie \Core\Http\Cookie\CookieInterface */
foreach ($this->cookies as $cookie) {
setcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpire(), $cookie->getPath(), $cookie->getDomain(), $cookie->getSecure(), $cookie->getHttponly());
}
... | [
"public",
"function",
"send",
"(",
")",
"{",
"/* @var $cookie \\Core\\Http\\Cookie\\CookieInterface */",
"foreach",
"(",
"$",
"this",
"->",
"cookies",
"as",
"$",
"cookie",
")",
"{",
"setcookie",
"(",
"$",
"cookie",
"->",
"getName",
"(",
")",
",",
"$",
"cookie"... | Send all cookies to the browser
@return boolean | [
"Send",
"all",
"cookies",
"to",
"the",
"browser"
] | 00d386eee1acadbce13010aab77b89848ed6cc7f | https://github.com/tekkla/core-http/blob/00d386eee1acadbce13010aab77b89848ed6cc7f/Core/Http/Cookie/CookieHandler.php#L21-L27 |
11,144 | tekkla/core-http | Core/Http/Cookie/CookieHandler.php | CookieHandler.& | public function &createCookie(string $name)
{
$cookie = new Cookie();
$cookie->setName($name);
$this->addCookie($cookie);
return $cookie;
} | php | public function &createCookie(string $name)
{
$cookie = new Cookie();
$cookie->setName($name);
$this->addCookie($cookie);
return $cookie;
} | [
"public",
"function",
"&",
"createCookie",
"(",
"string",
"$",
"name",
")",
"{",
"$",
"cookie",
"=",
"new",
"Cookie",
"(",
")",
";",
"$",
"cookie",
"->",
"setName",
"(",
"$",
"name",
")",
";",
"$",
"this",
"->",
"addCookie",
"(",
"$",
"cookie",
")"... | Creates a cookie object, adds it to the cookies stack and returns an reference to this cookie
@param string $name
Name of cookie to create
@return \Core\Http\Cookie\CookieInterface | [
"Creates",
"a",
"cookie",
"object",
"adds",
"it",
"to",
"the",
"cookies",
"stack",
"and",
"returns",
"an",
"reference",
"to",
"this",
"cookie"
] | 00d386eee1acadbce13010aab77b89848ed6cc7f | https://github.com/tekkla/core-http/blob/00d386eee1acadbce13010aab77b89848ed6cc7f/Core/Http/Cookie/CookieHandler.php#L37-L45 |
11,145 | jagilpe/entity-list-bundle | EntityList/ColumnBuilder.php | ColumnBuilder.setHeader | public function setHeader(HeaderElementInterface $header, $options = array())
{
$this->listColumn->setHeader($header, $options);
return $this;
} | php | public function setHeader(HeaderElementInterface $header, $options = array())
{
$this->listColumn->setHeader($header, $options);
return $this;
} | [
"public",
"function",
"setHeader",
"(",
"HeaderElementInterface",
"$",
"header",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"listColumn",
"->",
"setHeader",
"(",
"$",
"header",
",",
"$",
"options",
")",
";",
"return",
"$",
... | Adds header definition to the column
@param \Jagilpe\EntityListBundle\EntityList\Header\HeaderElementInterface $column
@return ColumnBuilderInterface | [
"Adds",
"header",
"definition",
"to",
"the",
"column"
] | 54331a4de7e7916894fb4a7a3156d8e7c1b0e0dc | https://github.com/jagilpe/entity-list-bundle/blob/54331a4de7e7916894fb4a7a3156d8e7c1b0e0dc/EntityList/ColumnBuilder.php#L46-L50 |
11,146 | jagilpe/entity-list-bundle | EntityList/ColumnBuilder.php | ColumnBuilder.setCell | public function setCell(CellInterface $cell, $options = array())
{
$this->listColumn->setCell($cell, $options);
return $this;
} | php | public function setCell(CellInterface $cell, $options = array())
{
$this->listColumn->setCell($cell, $options);
return $this;
} | [
"public",
"function",
"setCell",
"(",
"CellInterface",
"$",
"cell",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"listColumn",
"->",
"setCell",
"(",
"$",
"cell",
",",
"$",
"options",
")",
";",
"return",
"$",
"this",
";",
... | Adds cell definition to the column
@param \Jagilpe\EntityListBundle\EntityList\Cell\CellInterface $column
@return ColumnBuilderInterface | [
"Adds",
"cell",
"definition",
"to",
"the",
"column"
] | 54331a4de7e7916894fb4a7a3156d8e7c1b0e0dc | https://github.com/jagilpe/entity-list-bundle/blob/54331a4de7e7916894fb4a7a3156d8e7c1b0e0dc/EntityList/ColumnBuilder.php#L59-L63 |
11,147 | tweedegolf/generator | src/TweedeGolf/Generator/Console/GenerateCommand.php | GenerateCommand.showGeneratorHelp | protected function showGeneratorHelp(GeneratorInterface $generator, OutputInterface $output)
{
$definition = new InputDefinition($generator->getDefinition());
$output->writeln("<comment>Generator:</comment> <info>{$generator->getName()}</info>");
$output->writeln(" {$generator->getDescripti... | php | protected function showGeneratorHelp(GeneratorInterface $generator, OutputInterface $output)
{
$definition = new InputDefinition($generator->getDefinition());
$output->writeln("<comment>Generator:</comment> <info>{$generator->getName()}</info>");
$output->writeln(" {$generator->getDescripti... | [
"protected",
"function",
"showGeneratorHelp",
"(",
"GeneratorInterface",
"$",
"generator",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"definition",
"=",
"new",
"InputDefinition",
"(",
"$",
"generator",
"->",
"getDefinition",
"(",
")",
")",
";",
"$",
... | Show the help for a single generator.
@param GeneratorInterface $generator
@param OutputInterface $output | [
"Show",
"the",
"help",
"for",
"a",
"single",
"generator",
"."
] | f931d659ddf6a531ebf00bbfc11d417c527cd21b | https://github.com/tweedegolf/generator/blob/f931d659ddf6a531ebf00bbfc11d417c527cd21b/src/TweedeGolf/Generator/Console/GenerateCommand.php#L140-L154 |
11,148 | tweedegolf/generator | src/TweedeGolf/Generator/Console/GenerateCommand.php | GenerateCommand.showGeneratorList | protected function showGeneratorList(OutputInterface $output)
{
$output->writeln("<comment>Available generators:</comment>");
$helpCommand = "<info>{$this->getName()} help [generator]</info>";
$output->writeln("Use {$helpCommand} for more information on each generator.");
$rows = []... | php | protected function showGeneratorList(OutputInterface $output)
{
$output->writeln("<comment>Available generators:</comment>");
$helpCommand = "<info>{$this->getName()} help [generator]</info>";
$output->writeln("Use {$helpCommand} for more information on each generator.");
$rows = []... | [
"protected",
"function",
"showGeneratorList",
"(",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"output",
"->",
"writeln",
"(",
"\"<comment>Available generators:</comment>\"",
")",
";",
"$",
"helpCommand",
"=",
"\"<info>{$this->getName()} help [generator]</info>\"",
";"... | Show the list of generators available.
@param OutputInterface $output | [
"Show",
"the",
"list",
"of",
"generators",
"available",
"."
] | f931d659ddf6a531ebf00bbfc11d417c527cd21b | https://github.com/tweedegolf/generator/blob/f931d659ddf6a531ebf00bbfc11d417c527cd21b/src/TweedeGolf/Generator/Console/GenerateCommand.php#L160-L179 |
11,149 | jannisfink/yarf | src/page/error/ErrorPage.php | ErrorPage.html | public function html(WebException $exception) {
$message = $exception->getMessage();
$statusCode = $exception->getStatusCode();
$details = $exception->getDetails() === null ? "" : $exception->getDetails();
return "
<!DOCTYPE html>
<html>
<head><title>$message</title></head>
<... | php | public function html(WebException $exception) {
$message = $exception->getMessage();
$statusCode = $exception->getStatusCode();
$details = $exception->getDetails() === null ? "" : $exception->getDetails();
return "
<!DOCTYPE html>
<html>
<head><title>$message</title></head>
<... | [
"public",
"function",
"html",
"(",
"WebException",
"$",
"exception",
")",
"{",
"$",
"message",
"=",
"$",
"exception",
"->",
"getMessage",
"(",
")",
";",
"$",
"statusCode",
"=",
"$",
"exception",
"->",
"getStatusCode",
"(",
")",
";",
"$",
"details",
"=",
... | Returns a html view for the thrown exception
@param WebException $exception the exception thrown and cause for this page to be shown
@return string html representation of the given exception | [
"Returns",
"a",
"html",
"view",
"for",
"the",
"thrown",
"exception"
] | 91237dc0f3b724abaaba490f5171f181a92e939f | https://github.com/jannisfink/yarf/blob/91237dc0f3b724abaaba490f5171f181a92e939f/src/page/error/ErrorPage.php#L35-L49 |
11,150 | reddogs-at/reddogs-test-aura-di | src/ContainerAwareTrait.php | ContainerAwareTrait.getContainerConfigObjects | private function getContainerConfigObjects() : array
{
$config = (new ConfigAggregator($this->getConfigProviders()))->getMergedConfig();
$containerConfigs = [];
foreach ($this->getContainerConfigs() as $containerConfig)
{
$containerConfigs[] = new $containerConfig($confi... | php | private function getContainerConfigObjects() : array
{
$config = (new ConfigAggregator($this->getConfigProviders()))->getMergedConfig();
$containerConfigs = [];
foreach ($this->getContainerConfigs() as $containerConfig)
{
$containerConfigs[] = new $containerConfig($confi... | [
"private",
"function",
"getContainerConfigObjects",
"(",
")",
":",
"array",
"{",
"$",
"config",
"=",
"(",
"new",
"ConfigAggregator",
"(",
"$",
"this",
"->",
"getConfigProviders",
"(",
")",
")",
")",
"->",
"getMergedConfig",
"(",
")",
";",
"$",
"containerConf... | Get container config objects
@return array | [
"Get",
"container",
"config",
"objects"
] | be82cea6943c61cc90e00589f7fc36d3a9f3487d | https://github.com/reddogs-at/reddogs-test-aura-di/blob/be82cea6943c61cc90e00589f7fc36d3a9f3487d/src/ContainerAwareTrait.php#L113-L123 |
11,151 | mijohansen/php-gae-util | src/Files.php | Files.downloadToTempfile | static function downloadToTempfile($url) {
$download_path = Files::getTempFilename();
$fp = fopen($download_path, 'w+');
fwrite($fp, file_get_contents($url));
fclose($fp);
return $download_path;
} | php | static function downloadToTempfile($url) {
$download_path = Files::getTempFilename();
$fp = fopen($download_path, 'w+');
fwrite($fp, file_get_contents($url));
fclose($fp);
return $download_path;
} | [
"static",
"function",
"downloadToTempfile",
"(",
"$",
"url",
")",
"{",
"$",
"download_path",
"=",
"Files",
"::",
"getTempFilename",
"(",
")",
";",
"$",
"fp",
"=",
"fopen",
"(",
"$",
"download_path",
",",
"'w+'",
")",
";",
"fwrite",
"(",
"$",
"fp",
",",... | Downloads file and returns the temporary filename.
@param $url
@return bool|string | [
"Downloads",
"file",
"and",
"returns",
"the",
"temporary",
"filename",
"."
] | dfa7a1a4d61aa435351d6a5b1b120c0e23d81dde | https://github.com/mijohansen/php-gae-util/blob/dfa7a1a4d61aa435351d6a5b1b120c0e23d81dde/src/Files.php#L21-L27 |
11,152 | mijohansen/php-gae-util | src/Files.php | Files.getStorageObject | static function getStorageObject($filename) {
$scheme = parse_url($filename, PHP_URL_SCHEME);
$bucket = parse_url($filename, PHP_URL_HOST);
$path = parse_url($filename, PHP_URL_PATH);
$object_name = trim($path, "/");
if ($scheme == "gs") {
$client = self::getStorageCl... | php | static function getStorageObject($filename) {
$scheme = parse_url($filename, PHP_URL_SCHEME);
$bucket = parse_url($filename, PHP_URL_HOST);
$path = parse_url($filename, PHP_URL_PATH);
$object_name = trim($path, "/");
if ($scheme == "gs") {
$client = self::getStorageCl... | [
"static",
"function",
"getStorageObject",
"(",
"$",
"filename",
")",
"{",
"$",
"scheme",
"=",
"parse_url",
"(",
"$",
"filename",
",",
"PHP_URL_SCHEME",
")",
";",
"$",
"bucket",
"=",
"parse_url",
"(",
"$",
"filename",
",",
"PHP_URL_HOST",
")",
";",
"$",
"... | Objects are the individual pieces of data that you store in Google Cloud Storage.
This function let you fetch object from Cloud Storage from the devserver.
@param $filename
@return bool|\Google\Cloud\Storage\StorageObject | [
"Objects",
"are",
"the",
"individual",
"pieces",
"of",
"data",
"that",
"you",
"store",
"in",
"Google",
"Cloud",
"Storage",
".",
"This",
"function",
"let",
"you",
"fetch",
"object",
"from",
"Cloud",
"Storage",
"from",
"the",
"devserver",
"."
] | dfa7a1a4d61aa435351d6a5b1b120c0e23d81dde | https://github.com/mijohansen/php-gae-util/blob/dfa7a1a4d61aa435351d6a5b1b120c0e23d81dde/src/Files.php#L61-L75 |
11,153 | themichaelhall/datatypes | src/IPAddress.php | IPAddress.toInteger | public function toInteger(): int
{
return ($this->myOctets[0] << 24) + ($this->myOctets[1] << 16) + ($this->myOctets[2] << 8) + $this->myOctets[3];
} | php | public function toInteger(): int
{
return ($this->myOctets[0] << 24) + ($this->myOctets[1] << 16) + ($this->myOctets[2] << 8) + $this->myOctets[3];
} | [
"public",
"function",
"toInteger",
"(",
")",
":",
"int",
"{",
"return",
"(",
"$",
"this",
"->",
"myOctets",
"[",
"0",
"]",
"<<",
"24",
")",
"+",
"(",
"$",
"this",
"->",
"myOctets",
"[",
"1",
"]",
"<<",
"16",
")",
"+",
"(",
"$",
"this",
"->",
... | Returns the IP address as an integer.
@since 1.2.0
@return int The IP address as an integer. | [
"Returns",
"the",
"IP",
"address",
"as",
"an",
"integer",
"."
] | c738fdf4ffca2e613badcb3011dbd5268e4309d8 | https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/IPAddress.php#L54-L57 |
11,154 | themichaelhall/datatypes | src/IPAddress.php | IPAddress.withMask | public function withMask(IPAddressInterface $mask): IPAddressInterface
{
$octets = $this->getParts();
$maskOctets = $mask->getParts();
for ($i = 0; $i < 4; $i++) {
$octets[$i] = $octets[$i] & $maskOctets[$i];
}
return new self($octets);
} | php | public function withMask(IPAddressInterface $mask): IPAddressInterface
{
$octets = $this->getParts();
$maskOctets = $mask->getParts();
for ($i = 0; $i < 4; $i++) {
$octets[$i] = $octets[$i] & $maskOctets[$i];
}
return new self($octets);
} | [
"public",
"function",
"withMask",
"(",
"IPAddressInterface",
"$",
"mask",
")",
":",
"IPAddressInterface",
"{",
"$",
"octets",
"=",
"$",
"this",
"->",
"getParts",
"(",
")",
";",
"$",
"maskOctets",
"=",
"$",
"mask",
"->",
"getParts",
"(",
")",
";",
"for",
... | Returns a copy of the IP address instance masked with the specified mask.
@since 1.0.0
@param IPAddressInterface $mask The mask.
@return IPAddressInterface The IP address instance. | [
"Returns",
"a",
"copy",
"of",
"the",
"IP",
"address",
"instance",
"masked",
"with",
"the",
"specified",
"mask",
"."
] | c738fdf4ffca2e613badcb3011dbd5268e4309d8 | https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/IPAddress.php#L68-L78 |
11,155 | themichaelhall/datatypes | src/IPAddress.php | IPAddress.fromParts | public static function fromParts(array $octets): IPAddressInterface
{
if (!self::myValidateOctets($octets, $error)) {
throw new IPAddressInvalidArgumentException('Octets are invalid: ' . $error);
}
return new self($octets);
} | php | public static function fromParts(array $octets): IPAddressInterface
{
if (!self::myValidateOctets($octets, $error)) {
throw new IPAddressInvalidArgumentException('Octets are invalid: ' . $error);
}
return new self($octets);
} | [
"public",
"static",
"function",
"fromParts",
"(",
"array",
"$",
"octets",
")",
":",
"IPAddressInterface",
"{",
"if",
"(",
"!",
"self",
"::",
"myValidateOctets",
"(",
"$",
"octets",
",",
"$",
"error",
")",
")",
"{",
"throw",
"new",
"IPAddressInvalidArgumentEx... | Creates an IP address from octets.
@since 1.0.0
@param int[] $octets The octets.
@throws \InvalidArgumentException If the octets parameter is not an array of integers.
@throws IPAddressInvalidArgumentException If the $octets parameter is not a valid array of octets.
@return IPAddressInterface The IP address... | [
"Creates",
"an",
"IP",
"address",
"from",
"octets",
"."
] | c738fdf4ffca2e613badcb3011dbd5268e4309d8 | https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/IPAddress.php#L123-L130 |
11,156 | themichaelhall/datatypes | src/IPAddress.php | IPAddress.myParse | private static function myParse(string $ipAddress, ?array &$octets = null, ?string &$error = null): bool
{
if ($ipAddress === '') {
$error = 'IP address "' . $ipAddress . '" is empty.';
return false;
}
$ipAddressParts = explode('.', $ipAddress);
if (count($... | php | private static function myParse(string $ipAddress, ?array &$octets = null, ?string &$error = null): bool
{
if ($ipAddress === '') {
$error = 'IP address "' . $ipAddress . '" is empty.';
return false;
}
$ipAddressParts = explode('.', $ipAddress);
if (count($... | [
"private",
"static",
"function",
"myParse",
"(",
"string",
"$",
"ipAddress",
",",
"?",
"array",
"&",
"$",
"octets",
"=",
"null",
",",
"?",
"string",
"&",
"$",
"error",
"=",
"null",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"ipAddress",
"===",
"''",
")... | Tries to parse an IP address and returns the result or error text.
@param string $ipAddress The IP address.
@param int[]|null $octets The octets if parsing was successful, undefined otherwise.
@param string|null $error The error text if parsing was not successful, undefined otherwise.
@return bool True i... | [
"Tries",
"to",
"parse",
"an",
"IP",
"address",
"and",
"returns",
"the",
"result",
"or",
"error",
"text",
"."
] | c738fdf4ffca2e613badcb3011dbd5268e4309d8 | https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/IPAddress.php#L203-L233 |
11,157 | themichaelhall/datatypes | src/IPAddress.php | IPAddress.myValidateIpAddressPart | private static function myValidateIpAddressPart(string $ipAddressPart, ?int &$octet, ?string &$error): bool
{
if ($ipAddressPart === '') {
$error = 'Octet "' . $ipAddressPart . '" is empty.';
return false;
}
if (preg_match('/[^0-9]/', $ipAddressPart, $matches)) {
... | php | private static function myValidateIpAddressPart(string $ipAddressPart, ?int &$octet, ?string &$error): bool
{
if ($ipAddressPart === '') {
$error = 'Octet "' . $ipAddressPart . '" is empty.';
return false;
}
if (preg_match('/[^0-9]/', $ipAddressPart, $matches)) {
... | [
"private",
"static",
"function",
"myValidateIpAddressPart",
"(",
"string",
"$",
"ipAddressPart",
",",
"?",
"int",
"&",
"$",
"octet",
",",
"?",
"string",
"&",
"$",
"error",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"ipAddressPart",
"===",
"''",
")",
"{",
"... | Validates an IP address part.
@param string $ipAddressPart The IP address part.
@param int|null $octet The resulting octet.
@param string|null $error The error text if validation was not successful, undefined otherwise.
@return bool True if validation was successful, false otherwise. | [
"Validates",
"an",
"IP",
"address",
"part",
"."
] | c738fdf4ffca2e613badcb3011dbd5268e4309d8 | https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/IPAddress.php#L244-L265 |
11,158 | themichaelhall/datatypes | src/IPAddress.php | IPAddress.myValidateOctets | private static function myValidateOctets(array $octets, ?string &$error): bool
{
if (count($octets) !== 4) {
$error = 'IP address must consist of four octets.';
return false;
}
foreach ($octets as $octet) {
if (!is_int($octet)) {
throw ne... | php | private static function myValidateOctets(array $octets, ?string &$error): bool
{
if (count($octets) !== 4) {
$error = 'IP address must consist of four octets.';
return false;
}
foreach ($octets as $octet) {
if (!is_int($octet)) {
throw ne... | [
"private",
"static",
"function",
"myValidateOctets",
"(",
"array",
"$",
"octets",
",",
"?",
"string",
"&",
"$",
"error",
")",
":",
"bool",
"{",
"if",
"(",
"count",
"(",
"$",
"octets",
")",
"!==",
"4",
")",
"{",
"$",
"error",
"=",
"'IP address must cons... | Validates an array of octets.
@param int[] $octets The array of octets.
@param string|null $error The error text if validation was not successful, undefined otherwise.
@throws \InvalidArgumentException If the octets parameter is not an array of integers.
@return bool True if validation was successful, false o... | [
"Validates",
"an",
"array",
"of",
"octets",
"."
] | c738fdf4ffca2e613badcb3011dbd5268e4309d8 | https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/IPAddress.php#L277-L296 |
11,159 | themichaelhall/datatypes | src/IPAddress.php | IPAddress.myValidateOctet | private static function myValidateOctet(int $octet, ?string &$error): bool
{
if ($octet < 0) {
$error = 'Octet ' . $octet . ' is out of range: Minimum value for an octet is 0.';
return false;
}
if ($octet > 255) {
$error = 'Octet ' . $octet . ' is out of... | php | private static function myValidateOctet(int $octet, ?string &$error): bool
{
if ($octet < 0) {
$error = 'Octet ' . $octet . ' is out of range: Minimum value for an octet is 0.';
return false;
}
if ($octet > 255) {
$error = 'Octet ' . $octet . ' is out of... | [
"private",
"static",
"function",
"myValidateOctet",
"(",
"int",
"$",
"octet",
",",
"?",
"string",
"&",
"$",
"error",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"octet",
"<",
"0",
")",
"{",
"$",
"error",
"=",
"'Octet '",
".",
"$",
"octet",
".",
"' is ou... | Validates an octet.
@param int $octet The octet.
@param string|null $error The error text if validation was not successful, undefined otherwise.
@return bool True if validation was successful, false otherwise. | [
"Validates",
"an",
"octet",
"."
] | c738fdf4ffca2e613badcb3011dbd5268e4309d8 | https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/IPAddress.php#L306-L321 |
11,160 | cobonto/module | src/Commands/NewCommand.php | NewCommand.makeYml | protected function makeYml($path,$inputAuthor,$inputName)
{
$data = [
'name'=>$inputName,
'author'=>$inputAuthor,
'version'=>'1.0',
];
$yml = Yaml::dump($data);
$this->files->put(dirname($path).'/module.yml',$yml);
} | php | protected function makeYml($path,$inputAuthor,$inputName)
{
$data = [
'name'=>$inputName,
'author'=>$inputAuthor,
'version'=>'1.0',
];
$yml = Yaml::dump($data);
$this->files->put(dirname($path).'/module.yml',$yml);
} | [
"protected",
"function",
"makeYml",
"(",
"$",
"path",
",",
"$",
"inputAuthor",
",",
"$",
"inputName",
")",
"{",
"$",
"data",
"=",
"[",
"'name'",
"=>",
"$",
"inputName",
",",
"'author'",
"=>",
"$",
"inputAuthor",
",",
"'version'",
"=>",
"'1.0'",
",",
"]... | create yml file info about module
@param $path
@param $inputAuthor
@param $inputName | [
"create",
"yml",
"file",
"info",
"about",
"module"
] | 0978b5305c3d6f13ef7e0e5297855bd09eee6b76 | https://github.com/cobonto/module/blob/0978b5305c3d6f13ef7e0e5297855bd09eee6b76/src/Commands/NewCommand.php#L129-L139 |
11,161 | CatLabInteractive/Neuron | src/Neuron/Collections/Collection.php | Collection.peek | public function peek()
{
if (isset ($this->data[$this->position + 1]))
{
return $this->data[$this->position + 1];
}
return null;
} | php | public function peek()
{
if (isset ($this->data[$this->position + 1]))
{
return $this->data[$this->position + 1];
}
return null;
} | [
"public",
"function",
"peek",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"$",
"this",
"->",
"position",
"+",
"1",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"data",
"[",
"$",
"this",
"->",
"position",
"+",
"1"... | Return the next element without increasing position.
@return mixed|null | [
"Return",
"the",
"next",
"element",
"without",
"increasing",
"position",
"."
] | 67dca5349891e23b31a96dcdead893b9491a1b8b | https://github.com/CatLabInteractive/Neuron/blob/67dca5349891e23b31a96dcdead893b9491a1b8b/src/Neuron/Collections/Collection.php#L191-L198 |
11,162 | CatLabInteractive/Neuron | src/Neuron/Collections/Collection.php | Collection.remove | public function remove ($entry) {
foreach ($this->data as $k => $v) {
if ($v === $entry) {
$associative = $this->isAssociative ();
unset ($this->data[$k]);
if ($associative) {
$this->data = array_values ($this->data);
}
return true;
}
}
return false;
} | php | public function remove ($entry) {
foreach ($this->data as $k => $v) {
if ($v === $entry) {
$associative = $this->isAssociative ();
unset ($this->data[$k]);
if ($associative) {
$this->data = array_values ($this->data);
}
return true;
}
}
return false;
} | [
"public",
"function",
"remove",
"(",
"$",
"entry",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"data",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"v",
"===",
"$",
"entry",
")",
"{",
"$",
"associative",
"=",
"$",
"this",
"->",
... | Remove an element from the collection.
@param $entry
@return bool | [
"Remove",
"an",
"element",
"from",
"the",
"collection",
"."
] | 67dca5349891e23b31a96dcdead893b9491a1b8b | https://github.com/CatLabInteractive/Neuron/blob/67dca5349891e23b31a96dcdead893b9491a1b8b/src/Neuron/Collections/Collection.php#L214-L229 |
11,163 | CatLabInteractive/Neuron | src/Neuron/Collections/Collection.php | Collection.first | public function first ()
{
if (!is_array($this->data)) return $this->data;
if (!count($this->data)) return null;
reset($this->data);
return $this->data[key($this->data)];
} | php | public function first ()
{
if (!is_array($this->data)) return $this->data;
if (!count($this->data)) return null;
reset($this->data);
return $this->data[key($this->data)];
} | [
"public",
"function",
"first",
"(",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"this",
"->",
"data",
")",
")",
"return",
"$",
"this",
"->",
"data",
";",
"if",
"(",
"!",
"count",
"(",
"$",
"this",
"->",
"data",
")",
")",
"return",
"null",
"... | Return the very first element. | [
"Return",
"the",
"very",
"first",
"element",
"."
] | 67dca5349891e23b31a96dcdead893b9491a1b8b | https://github.com/CatLabInteractive/Neuron/blob/67dca5349891e23b31a96dcdead893b9491a1b8b/src/Neuron/Collections/Collection.php#L234-L240 |
11,164 | CatLabInteractive/Neuron | src/Neuron/Collections/Collection.php | Collection.last | public function last ()
{
if (!is_array($this->data)) return $this->data;
if (!count($this->data)) return null;
end($this->data);
return $this->data[key($this->data)];
} | php | public function last ()
{
if (!is_array($this->data)) return $this->data;
if (!count($this->data)) return null;
end($this->data);
return $this->data[key($this->data)];
} | [
"public",
"function",
"last",
"(",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"this",
"->",
"data",
")",
")",
"return",
"$",
"this",
"->",
"data",
";",
"if",
"(",
"!",
"count",
"(",
"$",
"this",
"->",
"data",
")",
")",
"return",
"null",
";... | Return the very last element. | [
"Return",
"the",
"very",
"last",
"element",
"."
] | 67dca5349891e23b31a96dcdead893b9491a1b8b | https://github.com/CatLabInteractive/Neuron/blob/67dca5349891e23b31a96dcdead893b9491a1b8b/src/Neuron/Collections/Collection.php#L245-L251 |
11,165 | vinala/kernel | src/Access/Url.php | Url.root | public static function root()
{
$url = request('REQUEST_URI', '', 'server');
$root = request('DOCUMENT_ROOT', '', 'server');
$scheme = request('REQUEST_SCHEME', '', 'server');
$server = request('SERVER_NAME', '', 'server');
$url = substr($url, 1);
$parts = explode('... | php | public static function root()
{
$url = request('REQUEST_URI', '', 'server');
$root = request('DOCUMENT_ROOT', '', 'server');
$scheme = request('REQUEST_SCHEME', '', 'server');
$server = request('SERVER_NAME', '', 'server');
$url = substr($url, 1);
$parts = explode('... | [
"public",
"static",
"function",
"root",
"(",
")",
"{",
"$",
"url",
"=",
"request",
"(",
"'REQUEST_URI'",
",",
"''",
",",
"'server'",
")",
";",
"$",
"root",
"=",
"request",
"(",
"'DOCUMENT_ROOT'",
",",
"''",
",",
"'server'",
")",
";",
"$",
"scheme",
"... | Get the route url of the app.
@return string | [
"Get",
"the",
"route",
"url",
"of",
"the",
"app",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Access/Url.php#L44-L66 |
11,166 | niconoe-/asserts | src/Asserts/Categories/AssertBooleanTrait.php | AssertBooleanTrait.assertTrue | public static function assertTrue($condition, Throwable $exception): bool
{
static::makeAssertion(true === $condition, $exception);
return true;
} | php | public static function assertTrue($condition, Throwable $exception): bool
{
static::makeAssertion(true === $condition, $exception);
return true;
} | [
"public",
"static",
"function",
"assertTrue",
"(",
"$",
"condition",
",",
"Throwable",
"$",
"exception",
")",
":",
"bool",
"{",
"static",
"::",
"makeAssertion",
"(",
"true",
"===",
"$",
"condition",
",",
"$",
"exception",
")",
";",
"return",
"true",
";",
... | Asserts that the given condition is strictly true.
@param mixed $condition The condition to assert that must be strictly true.
@param Throwable $exception The exception to throw if the assertion fails.
@return bool | [
"Asserts",
"that",
"the",
"given",
"condition",
"is",
"strictly",
"true",
"."
] | a33dd3fb8983ae6965533c8ff4ff8380367b561d | https://github.com/niconoe-/asserts/blob/a33dd3fb8983ae6965533c8ff4ff8380367b561d/src/Asserts/Categories/AssertBooleanTrait.php#L39-L43 |
11,167 | niconoe-/asserts | src/Asserts/Categories/AssertBooleanTrait.php | AssertBooleanTrait.assertNotTrue | public static function assertNotTrue($condition, Throwable $exception): bool
{
static::makeAssertion(true !== $condition, $exception);
return false;
} | php | public static function assertNotTrue($condition, Throwable $exception): bool
{
static::makeAssertion(true !== $condition, $exception);
return false;
} | [
"public",
"static",
"function",
"assertNotTrue",
"(",
"$",
"condition",
",",
"Throwable",
"$",
"exception",
")",
":",
"bool",
"{",
"static",
"::",
"makeAssertion",
"(",
"true",
"!==",
"$",
"condition",
",",
"$",
"exception",
")",
";",
"return",
"false",
";... | Asserts that the given condition is strictly not true.
@param mixed $condition The condition to assert that must be strictly not true.
@param Throwable $exception The exception to throw if the assertion fails.
@return bool | [
"Asserts",
"that",
"the",
"given",
"condition",
"is",
"strictly",
"not",
"true",
"."
] | a33dd3fb8983ae6965533c8ff4ff8380367b561d | https://github.com/niconoe-/asserts/blob/a33dd3fb8983ae6965533c8ff4ff8380367b561d/src/Asserts/Categories/AssertBooleanTrait.php#L52-L56 |
11,168 | niconoe-/asserts | src/Asserts/Categories/AssertBooleanTrait.php | AssertBooleanTrait.assertFalse | public static function assertFalse($condition, Throwable $exception): bool
{
static::makeAssertion(false === $condition, $exception);
return false;
} | php | public static function assertFalse($condition, Throwable $exception): bool
{
static::makeAssertion(false === $condition, $exception);
return false;
} | [
"public",
"static",
"function",
"assertFalse",
"(",
"$",
"condition",
",",
"Throwable",
"$",
"exception",
")",
":",
"bool",
"{",
"static",
"::",
"makeAssertion",
"(",
"false",
"===",
"$",
"condition",
",",
"$",
"exception",
")",
";",
"return",
"false",
";"... | Asserts that the given condition is strictly false.
@param mixed $condition The condition to assert that must be strictly false.
@param Throwable $exception The exception to throw if the assertion fails.
@return bool | [
"Asserts",
"that",
"the",
"given",
"condition",
"is",
"strictly",
"false",
"."
] | a33dd3fb8983ae6965533c8ff4ff8380367b561d | https://github.com/niconoe-/asserts/blob/a33dd3fb8983ae6965533c8ff4ff8380367b561d/src/Asserts/Categories/AssertBooleanTrait.php#L78-L82 |
11,169 | niconoe-/asserts | src/Asserts/Categories/AssertBooleanTrait.php | AssertBooleanTrait.assertNotFalse | public static function assertNotFalse($condition, Throwable $exception): bool
{
static::makeAssertion(false !== $condition, $exception);
return true;
} | php | public static function assertNotFalse($condition, Throwable $exception): bool
{
static::makeAssertion(false !== $condition, $exception);
return true;
} | [
"public",
"static",
"function",
"assertNotFalse",
"(",
"$",
"condition",
",",
"Throwable",
"$",
"exception",
")",
":",
"bool",
"{",
"static",
"::",
"makeAssertion",
"(",
"false",
"!==",
"$",
"condition",
",",
"$",
"exception",
")",
";",
"return",
"true",
"... | Asserts that the given condition is strictly not false.
@param mixed $condition The condition to assert that must be strictly not false.
@param Throwable $exception The exception to throw if the assertion fails.
@return bool | [
"Asserts",
"that",
"the",
"given",
"condition",
"is",
"strictly",
"not",
"false",
"."
] | a33dd3fb8983ae6965533c8ff4ff8380367b561d | https://github.com/niconoe-/asserts/blob/a33dd3fb8983ae6965533c8ff4ff8380367b561d/src/Asserts/Categories/AssertBooleanTrait.php#L91-L95 |
11,170 | remote-office/libx | src/Net/Rest/Pool.php | Pool.getInstance | public static function getInstance($label = 'default')
{
$instance = null;
if(!isset(self::$instances[$label]))
{
// Create new Client
$client = new Client();
// Save the instance
self::$instances[$label] = $client;
}
$instance = self::$instan... | php | public static function getInstance($label = 'default')
{
$instance = null;
if(!isset(self::$instances[$label]))
{
// Create new Client
$client = new Client();
// Save the instance
self::$instances[$label] = $client;
}
$instance = self::$instan... | [
"public",
"static",
"function",
"getInstance",
"(",
"$",
"label",
"=",
"'default'",
")",
"{",
"$",
"instance",
"=",
"null",
";",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"instances",
"[",
"$",
"label",
"]",
")",
")",
"{",
"// Create new Client"... | Return an instance of a LibX\Net\Rest\Client with a specific label
@param string $label
@return \LibX\Net\Rest\Client | [
"Return",
"an",
"instance",
"of",
"a",
"LibX",
"\\",
"Net",
"\\",
"Rest",
"\\",
"Client",
"with",
"a",
"specific",
"label"
] | 8baeaae99a6110e7c588bc0388df89a0dc0768b5 | https://github.com/remote-office/libx/blob/8baeaae99a6110e7c588bc0388df89a0dc0768b5/src/Net/Rest/Pool.php#L23-L39 |
11,171 | staccatocode/listable | src/ListBuilder.php | ListBuilder.mergeOptions | protected function mergeOptions()
{
$options = $this->getOptions();
$sorter = $options['sorter'];
$sorterNames = $this->getSorterParams();
$this->setFilters($this->listRequest->getFilters(
$this->getName(),
$this->getFilterSource()
));
$reque... | php | protected function mergeOptions()
{
$options = $this->getOptions();
$sorter = $options['sorter'];
$sorterNames = $this->getSorterParams();
$this->setFilters($this->listRequest->getFilters(
$this->getName(),
$this->getFilterSource()
));
$reque... | [
"protected",
"function",
"mergeOptions",
"(",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"getOptions",
"(",
")",
";",
"$",
"sorter",
"=",
"$",
"options",
"[",
"'sorter'",
"]",
";",
"$",
"sorterNames",
"=",
"$",
"this",
"->",
"getSorterParams",
"... | Merge filters and sorter options from
builder and list request.
@return self | [
"Merge",
"filters",
"and",
"sorter",
"options",
"from",
"builder",
"and",
"list",
"request",
"."
] | 9e97ff44e7d2af59f5a46c8e0faa29880545a40b | https://github.com/staccatocode/listable/blob/9e97ff44e7d2af59f5a46c8e0faa29880545a40b/src/ListBuilder.php#L83-L110 |
11,172 | granam/string | Granam/String/StringTools.php | StringTools.camelCaseToSnakeCase | public static function camelCaseToSnakeCase($value): string
{
$value = ToString::toString($value);
$parts = \preg_split('~([[:upper:]][[:lower:]]+|[^[:upper:]]*[[:lower:]]+)~u', $value, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
$underscored = \preg_replace('~_{2,}~', '_', \implode... | php | public static function camelCaseToSnakeCase($value): string
{
$value = ToString::toString($value);
$parts = \preg_split('~([[:upper:]][[:lower:]]+|[^[:upper:]]*[[:lower:]]+)~u', $value, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
$underscored = \preg_replace('~_{2,}~', '_', \implode... | [
"public",
"static",
"function",
"camelCaseToSnakeCase",
"(",
"$",
"value",
")",
":",
"string",
"{",
"$",
"value",
"=",
"ToString",
"::",
"toString",
"(",
"$",
"value",
")",
";",
"$",
"parts",
"=",
"\\",
"preg_split",
"(",
"'~([[:upper:]][[:lower:]]+|[^[:upper:... | Converts 'OnceUponATime' to 'once_upon_a_time'
@param string|StringInterface $value
@return string
@throws \Granam\Scalar\Tools\Exceptions\WrongParameterType | [
"Converts",
"OnceUponATime",
"to",
"once_upon_a_time"
] | 7c07fd71fd3e250681c14b340190936d985c2d55 | https://github.com/granam/string/blob/7c07fd71fd3e250681c14b340190936d985c2d55/Granam/String/StringTools.php#L96-L103 |
11,173 | granam/string | Granam/String/StringTools.php | StringTools.stripUtf8Bom | public static function stripUtf8Bom($string): string
{
$string = ToString::toString($string);
if (\substr_compare($string, "\xEF\xBB\xBF", 0, 3) !== 0) {
return $string;
}
$withoutBom = \substr($string, 3);
if ($withoutBom === false) {
throw new Except... | php | public static function stripUtf8Bom($string): string
{
$string = ToString::toString($string);
if (\substr_compare($string, "\xEF\xBB\xBF", 0, 3) !== 0) {
return $string;
}
$withoutBom = \substr($string, 3);
if ($withoutBom === false) {
throw new Except... | [
"public",
"static",
"function",
"stripUtf8Bom",
"(",
"$",
"string",
")",
":",
"string",
"{",
"$",
"string",
"=",
"ToString",
"::",
"toString",
"(",
"$",
"string",
")",
";",
"if",
"(",
"\\",
"substr_compare",
"(",
"$",
"string",
",",
"\"\\xEF\\xBB\\xBF\"",
... | This method originates from Dropbox,
@link http://dropbox.github.io/dropbox-sdk-php/api-docs/v1.1.x/source-class-Dropbox.Util.html#14-32
If the given string begins with the UTF-8 BOM (byte order mark), remove it and
return whatever is left. Otherwise, return the original string untouched.
Though it's not recommended... | [
"This",
"method",
"originates",
"from",
"Dropbox"
] | 7c07fd71fd3e250681c14b340190936d985c2d55 | https://github.com/granam/string/blob/7c07fd71fd3e250681c14b340190936d985c2d55/Granam/String/StringTools.php#L242-L254 |
11,174 | vitodtagliente/pure-template | ViewExtendEngine.php | ViewExtendEngine.extend_view | private function extend_view($text, $params = array())
{
// se presente, procedi con l'estensione
if(strpos($text, '@extends(') !== false)
{
// extract the template name
$pieces = explode('@extends(', $text);
$pieces = explode(')', $pieces[1]);
if(count($pieces) <= 0)
return $text;
$parent... | php | private function extend_view($text, $params = array())
{
// se presente, procedi con l'estensione
if(strpos($text, '@extends(') !== false)
{
// extract the template name
$pieces = explode('@extends(', $text);
$pieces = explode(')', $pieces[1]);
if(count($pieces) <= 0)
return $text;
$parent... | [
"private",
"function",
"extend_view",
"(",
"$",
"text",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"// se presente, procedi con l'estensione",
"if",
"(",
"strpos",
"(",
"$",
"text",
",",
"'@extends('",
")",
"!==",
"false",
")",
"{",
"// extract th... | estendi questo template | [
"estendi",
"questo",
"template"
] | d3f3e38d7e425a5f9f6e17df405037f6001ff3e9 | https://github.com/vitodtagliente/pure-template/blob/d3f3e38d7e425a5f9f6e17df405037f6001ff3e9/ViewExtendEngine.php#L75-L98 |
11,175 | varyandeveloper/vs-general | src/Observer/StandardSplSubjectTrait.php | StandardSplSubjectTrait.attach | public function attach(\SplObserver $observer): void
{
$id = spl_object_hash($observer);
$this->_observers[$id] = $observer;
} | php | public function attach(\SplObserver $observer): void
{
$id = spl_object_hash($observer);
$this->_observers[$id] = $observer;
} | [
"public",
"function",
"attach",
"(",
"\\",
"SplObserver",
"$",
"observer",
")",
":",
"void",
"{",
"$",
"id",
"=",
"spl_object_hash",
"(",
"$",
"observer",
")",
";",
"$",
"this",
"->",
"_observers",
"[",
"$",
"id",
"]",
"=",
"$",
"observer",
";",
"}"
... | Attaches an SplObserver to
the ExceptionHandler to be notified
when an uncaught Exception is thrown.
@param \SplObserver $observer
@return void | [
"Attaches",
"an",
"SplObserver",
"to",
"the",
"ExceptionHandler",
"to",
"be",
"notified",
"when",
"an",
"uncaught",
"Exception",
"is",
"thrown",
"."
] | e7269b52ed6c68f3fc47cb151b35849220e685a3 | https://github.com/varyandeveloper/vs-general/blob/e7269b52ed6c68f3fc47cb151b35849220e685a3/src/Observer/StandardSplSubjectTrait.php#L24-L28 |
11,176 | varyandeveloper/vs-general | src/Observer/StandardSplSubjectTrait.php | StandardSplSubjectTrait.detach | public function detach(\SplObserver $observer): void
{
$id = spl_object_hash($observer);
unset($this->_observers[$id]);
} | php | public function detach(\SplObserver $observer): void
{
$id = spl_object_hash($observer);
unset($this->_observers[$id]);
} | [
"public",
"function",
"detach",
"(",
"\\",
"SplObserver",
"$",
"observer",
")",
":",
"void",
"{",
"$",
"id",
"=",
"spl_object_hash",
"(",
"$",
"observer",
")",
";",
"unset",
"(",
"$",
"this",
"->",
"_observers",
"[",
"$",
"id",
"]",
")",
";",
"}"
] | Detaches the SplObserver from the
ExceptionHandler, so it will no longer
be notified when an uncaught Exception is thrown.
@param \SplObserver $observer
@return void | [
"Detaches",
"the",
"SplObserver",
"from",
"the",
"ExceptionHandler",
"so",
"it",
"will",
"no",
"longer",
"be",
"notified",
"when",
"an",
"uncaught",
"Exception",
"is",
"thrown",
"."
] | e7269b52ed6c68f3fc47cb151b35849220e685a3 | https://github.com/varyandeveloper/vs-general/blob/e7269b52ed6c68f3fc47cb151b35849220e685a3/src/Observer/StandardSplSubjectTrait.php#L38-L42 |
11,177 | xmmedia/XMSecurityBundle | Listener/RegistrationListener.php | RegistrationListener.emailOnRegistration | public function emailOnRegistration(FilterUserResponseEvent $event)
{
$template = '@XMSecurity/Mail/user_registered.html.twig';
$mailParams = [
'user' => $event->getUser(),
];
$this->mailManager->getSender()
->setTemplate($template, $mailParams)
-... | php | public function emailOnRegistration(FilterUserResponseEvent $event)
{
$template = '@XMSecurity/Mail/user_registered.html.twig';
$mailParams = [
'user' => $event->getUser(),
];
$this->mailManager->getSender()
->setTemplate($template, $mailParams)
-... | [
"public",
"function",
"emailOnRegistration",
"(",
"FilterUserResponseEvent",
"$",
"event",
")",
"{",
"$",
"template",
"=",
"'@XMSecurity/Mail/user_registered.html.twig'",
";",
"$",
"mailParams",
"=",
"[",
"'user'",
"=>",
"$",
"event",
"->",
"getUser",
"(",
")",
",... | Emails the admin regarding the registration.
@param FilterUserResponseEvent $event | [
"Emails",
"the",
"admin",
"regarding",
"the",
"registration",
"."
] | ee71a1bb4fe038e5a08e44f73247c4e03631a840 | https://github.com/xmmedia/XMSecurityBundle/blob/ee71a1bb4fe038e5a08e44f73247c4e03631a840/Listener/RegistrationListener.php#L75-L85 |
11,178 | CampaignChain/operation-facebook | Validator/PublishStatusValidator.php | PublishStatusValidator.isExecutableByLocation | public function isExecutableByLocation($content, \DateTime $startDate)
{
$endDateInterval = clone $startDate;
$endDateInterval->modify('+'.$this->maxDuplicateInterval);
/*
* If message contains no links, find out whether it has been posted before.
*/
if($this->must... | php | public function isExecutableByLocation($content, \DateTime $startDate)
{
$endDateInterval = clone $startDate;
$endDateInterval->modify('+'.$this->maxDuplicateInterval);
/*
* If message contains no links, find out whether it has been posted before.
*/
if($this->must... | [
"public",
"function",
"isExecutableByLocation",
"(",
"$",
"content",
",",
"\\",
"DateTime",
"$",
"startDate",
")",
"{",
"$",
"endDateInterval",
"=",
"clone",
"$",
"startDate",
";",
"$",
"endDateInterval",
"->",
"modify",
"(",
"'+'",
".",
"$",
"this",
"->",
... | If the Activity is supposed to be executed now, we check whether there's
an identical post within the past 24 hours.
If it is a scheduled Activity, we check whether the are Activities
scheduled in the same Facebook Location within 24 hours prior or after
the new scheduled Activity contain the same text.
For now, this... | [
"If",
"the",
"Activity",
"is",
"supposed",
"to",
"be",
"executed",
"now",
"we",
"check",
"whether",
"there",
"s",
"an",
"identical",
"post",
"within",
"the",
"past",
"24",
"hours",
"."
] | 8a23bd1918d2829f05c1063ae93f4e68fc6c22e0 | https://github.com/CampaignChain/operation-facebook/blob/8a23bd1918d2829f05c1063ae93f4e68fc6c22e0/Validator/PublishStatusValidator.php#L97-L169 |
11,179 | konservs/brilliant.framework | libraries/Users/Social/abstractadapter.php | BSocialAbstractAdapter.getSocialId | public function getSocialId(){
$result = null;
if(isset($this->userInfo[$this->socialFieldsMap['socialId']])) {
$result = $this->userInfo[$this->socialFieldsMap['socialId']];
}
return $result;
} | php | public function getSocialId(){
$result = null;
if(isset($this->userInfo[$this->socialFieldsMap['socialId']])) {
$result = $this->userInfo[$this->socialFieldsMap['socialId']];
}
return $result;
} | [
"public",
"function",
"getSocialId",
"(",
")",
"{",
"$",
"result",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"userInfo",
"[",
"$",
"this",
"->",
"socialFieldsMap",
"[",
"'socialId'",
"]",
"]",
")",
")",
"{",
"$",
"result",
"=",
... | Get user social id or null if it is not set
@return string|null | [
"Get",
"user",
"social",
"id",
"or",
"null",
"if",
"it",
"is",
"not",
"set"
] | 95f03f1917f746fee98bea8a906ba0588c87762d | https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/Users/Social/abstractadapter.php#L89-L95 |
11,180 | konservs/brilliant.framework | libraries/Users/Social/abstractadapter.php | BSocialAbstractAdapter.getEmail | public function getEmail(){
$result = null;
if (isset($this->userInfo[$this->socialFieldsMap['email']])) {
$result = $this->userInfo[$this->socialFieldsMap['email']];
}
return $result;
} | php | public function getEmail(){
$result = null;
if (isset($this->userInfo[$this->socialFieldsMap['email']])) {
$result = $this->userInfo[$this->socialFieldsMap['email']];
}
return $result;
} | [
"public",
"function",
"getEmail",
"(",
")",
"{",
"$",
"result",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"userInfo",
"[",
"$",
"this",
"->",
"socialFieldsMap",
"[",
"'email'",
"]",
"]",
")",
")",
"{",
"$",
"result",
"=",
"$",
... | Get user email or null if it is not set
@return string|null | [
"Get",
"user",
"email",
"or",
"null",
"if",
"it",
"is",
"not",
"set"
] | 95f03f1917f746fee98bea8a906ba0588c87762d | https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/Users/Social/abstractadapter.php#L101-L107 |
11,181 | konservs/brilliant.framework | libraries/Users/Social/abstractadapter.php | BSocialAbstractAdapter.getSocialPage | public function getSocialPage(){
$result = null;
if (isset($this->userInfo[$this->socialFieldsMap['socialPage']])) {
$result = $this->userInfo[$this->socialFieldsMap['socialPage']];
}
return $result;
} | php | public function getSocialPage(){
$result = null;
if (isset($this->userInfo[$this->socialFieldsMap['socialPage']])) {
$result = $this->userInfo[$this->socialFieldsMap['socialPage']];
}
return $result;
} | [
"public",
"function",
"getSocialPage",
"(",
")",
"{",
"$",
"result",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"userInfo",
"[",
"$",
"this",
"->",
"socialFieldsMap",
"[",
"'socialPage'",
"]",
"]",
")",
")",
"{",
"$",
"result",
"="... | Get user social page url or null if it is not set
@return string|null | [
"Get",
"user",
"social",
"page",
"url",
"or",
"null",
"if",
"it",
"is",
"not",
"set"
] | 95f03f1917f746fee98bea8a906ba0588c87762d | https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/Users/Social/abstractadapter.php#L124-L130 |
11,182 | konservs/brilliant.framework | libraries/Users/Social/abstractadapter.php | BSocialAbstractAdapter.getBirthday | public function getBirthday(){
$result = null;
if (isset($this->userInfo[$this->socialFieldsMap['birthday']])) {
$result = date('d.m.Y', strtotime($this->userInfo[$this->socialFieldsMap['birthday']]));
}
return $result;
} | php | public function getBirthday(){
$result = null;
if (isset($this->userInfo[$this->socialFieldsMap['birthday']])) {
$result = date('d.m.Y', strtotime($this->userInfo[$this->socialFieldsMap['birthday']]));
}
return $result;
} | [
"public",
"function",
"getBirthday",
"(",
")",
"{",
"$",
"result",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"userInfo",
"[",
"$",
"this",
"->",
"socialFieldsMap",
"[",
"'birthday'",
"]",
"]",
")",
")",
"{",
"$",
"result",
"=",
... | Get user birthday in format dd.mm.YYYY or null if it is not set
@return string|null | [
"Get",
"user",
"birthday",
"in",
"format",
"dd",
".",
"mm",
".",
"YYYY",
"or",
"null",
"if",
"it",
"is",
"not",
"set"
] | 95f03f1917f746fee98bea8a906ba0588c87762d | https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/Users/Social/abstractadapter.php#L161-L167 |
11,183 | konservs/brilliant.framework | libraries/Users/Social/abstractadapter.php | BSocialAbstractAdapter.getBirthdayObject | public function getBirthdayObject(){
$birthday=$this->getBirthday();
if(empty($birthday)){
return NULL;
}
$birthday=new DateTime($birthday);
return $birthday;
} | php | public function getBirthdayObject(){
$birthday=$this->getBirthday();
if(empty($birthday)){
return NULL;
}
$birthday=new DateTime($birthday);
return $birthday;
} | [
"public",
"function",
"getBirthdayObject",
"(",
")",
"{",
"$",
"birthday",
"=",
"$",
"this",
"->",
"getBirthday",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"birthday",
")",
")",
"{",
"return",
"NULL",
";",
"}",
"$",
"birthday",
"=",
"new",
"DateTi... | Get user birthday DateTime object | [
"Get",
"user",
"birthday",
"DateTime",
"object"
] | 95f03f1917f746fee98bea8a906ba0588c87762d | https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/Users/Social/abstractadapter.php#L171-L178 |
11,184 | konservs/brilliant.framework | libraries/Users/Social/abstractadapter.php | BSocialAbstractAdapter.post | protected function post($url, $params, $parse = true){
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, 1);
// curl_setopt($curl, CURLOPT_POSTFIELDS, urldecode(http_build_query($params)));
// curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($params));
curl_se... | php | protected function post($url, $params, $parse = true){
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, 1);
// curl_setopt($curl, CURLOPT_POSTFIELDS, urldecode(http_build_query($params)));
// curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($params));
curl_se... | [
"protected",
"function",
"post",
"(",
"$",
"url",
",",
"$",
"params",
",",
"$",
"parse",
"=",
"true",
")",
"{",
"$",
"curl",
"=",
"curl_init",
"(",
")",
";",
"curl_setopt",
"(",
"$",
"curl",
",",
"CURLOPT_URL",
",",
"$",
"url",
")",
";",
"curl_seto... | Make post request and return result
@param string $url
@param string $params
@param bool $parse
@return array|string | [
"Make",
"post",
"request",
"and",
"return",
"result"
] | 95f03f1917f746fee98bea8a906ba0588c87762d | https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/Users/Social/abstractadapter.php#L207-L222 |
11,185 | konservs/brilliant.framework | libraries/Users/Social/abstractadapter.php | BSocialAbstractAdapter.get | protected function get($url, $params, $parse = true){
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url . '?' . urldecode(http_build_query($params)));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($curl);
curl_close($curl);
... | php | protected function get($url, $params, $parse = true){
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url . '?' . urldecode(http_build_query($params)));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($curl);
curl_close($curl);
... | [
"protected",
"function",
"get",
"(",
"$",
"url",
",",
"$",
"params",
",",
"$",
"parse",
"=",
"true",
")",
"{",
"$",
"curl",
"=",
"curl_init",
"(",
")",
";",
"curl_setopt",
"(",
"$",
"curl",
",",
"CURLOPT_URL",
",",
"$",
"url",
".",
"'?'",
".",
"u... | Make get request and return result
@param $url
@param $params
@param bool $parse
@return mixed | [
"Make",
"get",
"request",
"and",
"return",
"result"
] | 95f03f1917f746fee98bea8a906ba0588c87762d | https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/Users/Social/abstractadapter.php#L231-L243 |
11,186 | WellCommerce/Form | DataMapper/RequestDataMapper.php | RequestDataMapper.mapRequestDataToElementCollection | protected function mapRequestDataToElementCollection($data, ElementCollection $children)
{
$children->forAll(function (ElementInterface $element) use ($data) {
$propertyPath = $this->getPropertyPathAsIndex($element);
if (array_key_exists($element->getName(), $data)) {
... | php | protected function mapRequestDataToElementCollection($data, ElementCollection $children)
{
$children->forAll(function (ElementInterface $element) use ($data) {
$propertyPath = $this->getPropertyPathAsIndex($element);
if (array_key_exists($element->getName(), $data)) {
... | [
"protected",
"function",
"mapRequestDataToElementCollection",
"(",
"$",
"data",
",",
"ElementCollection",
"$",
"children",
")",
"{",
"$",
"children",
"->",
"forAll",
"(",
"function",
"(",
"ElementInterface",
"$",
"element",
")",
"use",
"(",
"$",
"data",
")",
"... | Recursively maps data to children
@param mixed $data
@param ElementCollection $children | [
"Recursively",
"maps",
"data",
"to",
"children"
] | dad15dbdcf1d13f927fa86f5198bcb6abed1974a | https://github.com/WellCommerce/Form/blob/dad15dbdcf1d13f927fa86f5198bcb6abed1974a/DataMapper/RequestDataMapper.php#L58-L67 |
11,187 | SymBB/symbb | src/Symbb/Core/UserBundle/GravatarApi.php | GravatarApi.getUrl | public function getUrl($email, $size = null, $rating = null, $default = null, $secure = null)
{
$hash = md5(strtolower(trim($email)));
return $this->getUrlForHash($hash, $size, $rating, $default, $secure);
} | php | public function getUrl($email, $size = null, $rating = null, $default = null, $secure = null)
{
$hash = md5(strtolower(trim($email)));
return $this->getUrlForHash($hash, $size, $rating, $default, $secure);
} | [
"public",
"function",
"getUrl",
"(",
"$",
"email",
",",
"$",
"size",
"=",
"null",
",",
"$",
"rating",
"=",
"null",
",",
"$",
"default",
"=",
"null",
",",
"$",
"secure",
"=",
"null",
")",
"{",
"$",
"hash",
"=",
"md5",
"(",
"strtolower",
"(",
"trim... | Returns a url for a gravatar.
@param string $email
@param integer $size
@param string $rating
@param string $default
@param Boolean $secure
@return string | [
"Returns",
"a",
"url",
"for",
"a",
"gravatar",
"."
] | be25357502e6a51016fa0b128a46c2dc87fa8fb2 | https://github.com/SymBB/symbb/blob/be25357502e6a51016fa0b128a46c2dc87fa8fb2/src/Symbb/Core/UserBundle/GravatarApi.php#L45-L50 |
11,188 | SymBB/symbb | src/Symbb/Core/UserBundle/GravatarApi.php | GravatarApi.getUrlForHash | public function getUrlForHash($hash, $size = null, $rating = null, $default = null, $secure = null)
{
$map = array(
's' => $size ?: $this->defaults['size'],
'r' => $rating ?: $this->defaults['rating'],
'd' => $default ?: $this->defaults['default'],
);
if ... | php | public function getUrlForHash($hash, $size = null, $rating = null, $default = null, $secure = null)
{
$map = array(
's' => $size ?: $this->defaults['size'],
'r' => $rating ?: $this->defaults['rating'],
'd' => $default ?: $this->defaults['default'],
);
if ... | [
"public",
"function",
"getUrlForHash",
"(",
"$",
"hash",
",",
"$",
"size",
"=",
"null",
",",
"$",
"rating",
"=",
"null",
",",
"$",
"default",
"=",
"null",
",",
"$",
"secure",
"=",
"null",
")",
"{",
"$",
"map",
"=",
"array",
"(",
"'s'",
"=>",
"$",... | Returns a url for a gravatar for the given hash.
@param string $hash
@param integer $size
@param string $rating
@param string $default
@param Boolean $secure
@return string | [
"Returns",
"a",
"url",
"for",
"a",
"gravatar",
"for",
"the",
"given",
"hash",
"."
] | be25357502e6a51016fa0b128a46c2dc87fa8fb2 | https://github.com/SymBB/symbb/blob/be25357502e6a51016fa0b128a46c2dc87fa8fb2/src/Symbb/Core/UserBundle/GravatarApi.php#L62-L75 |
11,189 | mickrip/fwoot-core | src/Fw/Autoload.php | Autoload.add_path | static function add_path($prefix)
{
spl_autoload_register(
function ($cn) use ($prefix) {
$className = ltrim($cn, '\\');
$fileName = '';
if ($lastNsPos = strrpos($className, '\\')) {
$namespace = substr($className, 0, $lastNsPos);
$className = substr($className, $lastNsPos + 1);
$fileN... | php | static function add_path($prefix)
{
spl_autoload_register(
function ($cn) use ($prefix) {
$className = ltrim($cn, '\\');
$fileName = '';
if ($lastNsPos = strrpos($className, '\\')) {
$namespace = substr($className, 0, $lastNsPos);
$className = substr($className, $lastNsPos + 1);
$fileN... | [
"static",
"function",
"add_path",
"(",
"$",
"prefix",
")",
"{",
"spl_autoload_register",
"(",
"function",
"(",
"$",
"cn",
")",
"use",
"(",
"$",
"prefix",
")",
"{",
"$",
"className",
"=",
"ltrim",
"(",
"$",
"cn",
",",
"'\\\\'",
")",
";",
"$",
"fileNam... | Adds path to the autoload register
Example:
\Fw\Autoload::add_path("/var/www/website/classes");
@param $prefix | [
"Adds",
"path",
"to",
"the",
"autoload",
"register"
] | 10fae2ee4b2c85454bc91067f0f9adeef64fdd4d | https://github.com/mickrip/fwoot-core/blob/10fae2ee4b2c85454bc91067f0f9adeef64fdd4d/src/Fw/Autoload.php#L24-L48 |
11,190 | tsufeki/kayo-json-mapper | src/Tsufeki/KayoJsonMapper/Mapper.php | Mapper.dump | public function dump($value)
{
$context = $this->contextFactory->createDumpContext();
return $this->dumper->dump($value, $context);
} | php | public function dump($value)
{
$context = $this->contextFactory->createDumpContext();
return $this->dumper->dump($value, $context);
} | [
"public",
"function",
"dump",
"(",
"$",
"value",
")",
"{",
"$",
"context",
"=",
"$",
"this",
"->",
"contextFactory",
"->",
"createDumpContext",
"(",
")",
";",
"return",
"$",
"this",
"->",
"dumper",
"->",
"dump",
"(",
"$",
"value",
",",
"$",
"context",
... | Dump value to a respresentation suitable for `json_encode`.
@param mixed $value
@return mixed
@throws Exception\InfiniteRecursionException
@throws Exception\MetadataException
@throws Exception\UnsupportedTypeException | [
"Dump",
"value",
"to",
"a",
"respresentation",
"suitable",
"for",
"json_encode",
"."
] | e1ef374883fb97ebc7c2c4e0a6699b89e0ab6c01 | https://github.com/tsufeki/kayo-json-mapper/blob/e1ef374883fb97ebc7c2c4e0a6699b89e0ab6c01/src/Tsufeki/KayoJsonMapper/Mapper.php#L109-L114 |
11,191 | SymBB/symbb | src/Symbb/Core/UserBundle/Manager/GroupManager.php | GroupManager.update | public function update(GroupInterface $group)
{
$this->em->persist($group);
$this->em->flush();
return true;
} | php | public function update(GroupInterface $group)
{
$this->em->persist($group);
$this->em->flush();
return true;
} | [
"public",
"function",
"update",
"(",
"GroupInterface",
"$",
"group",
")",
"{",
"$",
"this",
"->",
"em",
"->",
"persist",
"(",
"$",
"group",
")",
";",
"$",
"this",
"->",
"em",
"->",
"flush",
"(",
")",
";",
"return",
"true",
";",
"}"
] | update the given group
@param \Symbb\Core\UserBundle\Entity\GroupInterface $group | [
"update",
"the",
"given",
"group"
] | be25357502e6a51016fa0b128a46c2dc87fa8fb2 | https://github.com/SymBB/symbb/blob/be25357502e6a51016fa0b128a46c2dc87fa8fb2/src/Symbb/Core/UserBundle/Manager/GroupManager.php#L38-L44 |
11,192 | SymBB/symbb | src/Symbb/Core/UserBundle/Manager/GroupManager.php | GroupManager.remove | public function remove(GroupInterface $group)
{
$this->em->remove($group);
$this->em->flush();
return true;
} | php | public function remove(GroupInterface $group)
{
$this->em->remove($group);
$this->em->flush();
return true;
} | [
"public",
"function",
"remove",
"(",
"GroupInterface",
"$",
"group",
")",
"{",
"$",
"this",
"->",
"em",
"->",
"remove",
"(",
"$",
"group",
")",
";",
"$",
"this",
"->",
"em",
"->",
"flush",
"(",
")",
";",
"return",
"true",
";",
"}"
] | remove the given group
@param \Symbb\Core\UserBundle\Entity\GroupInterface $user | [
"remove",
"the",
"given",
"group"
] | be25357502e6a51016fa0b128a46c2dc87fa8fb2 | https://github.com/SymBB/symbb/blob/be25357502e6a51016fa0b128a46c2dc87fa8fb2/src/Symbb/Core/UserBundle/Manager/GroupManager.php#L50-L56 |
11,193 | poliander/rio | src/Rio/AbstractEntity.php | AbstractEntity.set | protected function set($name, $value)
{
if ($this->modified === null && $this->uid !== null) {
$this->load();
}
$value = $this->validate($name, $value);
if ($this->properties[$name]['value'] !== $value) {
$this->properties[$name]['value'] = $value;
... | php | protected function set($name, $value)
{
if ($this->modified === null && $this->uid !== null) {
$this->load();
}
$value = $this->validate($name, $value);
if ($this->properties[$name]['value'] !== $value) {
$this->properties[$name]['value'] = $value;
... | [
"protected",
"function",
"set",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"modified",
"===",
"null",
"&&",
"$",
"this",
"->",
"uid",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"load",
"(",
")",
";",
"}",
"$",... | Validate and set property value
@param string $name
@param mixed $value
@return self
@throws \Rio\Exception | [
"Validate",
"and",
"set",
"property",
"value"
] | d760ea6f0b93b88d5ca0b004a800d22359653321 | https://github.com/poliander/rio/blob/d760ea6f0b93b88d5ca0b004a800d22359653321/src/Rio/AbstractEntity.php#L121-L135 |
11,194 | poliander/rio | src/Rio/AbstractEntity.php | AbstractEntity.get | protected function get($name)
{
if ($this->modified === null) {
$this->load();
}
if (false === array_key_exists($name, $this->properties)) {
throw new Exception('Unknown property "' . $name . '"');
}
return $this->resolve($this->properties[$name], $n... | php | protected function get($name)
{
if ($this->modified === null) {
$this->load();
}
if (false === array_key_exists($name, $this->properties)) {
throw new Exception('Unknown property "' . $name . '"');
}
return $this->resolve($this->properties[$name], $n... | [
"protected",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"modified",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"load",
"(",
")",
";",
"}",
"if",
"(",
"false",
"===",
"array_key_exists",
"(",
"$",
"name",
",",
"$... | Get value of given property
@param string $name
@throws \Rio\Exception
@return mixed | [
"Get",
"value",
"of",
"given",
"property"
] | d760ea6f0b93b88d5ca0b004a800d22359653321 | https://github.com/poliander/rio/blob/d760ea6f0b93b88d5ca0b004a800d22359653321/src/Rio/AbstractEntity.php#L144-L155 |
11,195 | poliander/rio | src/Rio/AbstractEntity.php | AbstractEntity.load | protected function load()
{
if ($this->uid === null) {
throw new Exception('Entity "'. CamelCase::to($this->table) . '" not initialized');
}
$statement = $this->adapter->getDriver()->query(
sprintf(
"SELECT t0.* FROM `{$this->table}` AS t0 WHERE t0.`%... | php | protected function load()
{
if ($this->uid === null) {
throw new Exception('Entity "'. CamelCase::to($this->table) . '" not initialized');
}
$statement = $this->adapter->getDriver()->query(
sprintf(
"SELECT t0.* FROM `{$this->table}` AS t0 WHERE t0.`%... | [
"protected",
"function",
"load",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"uid",
"===",
"null",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Entity \"'",
".",
"CamelCase",
"::",
"to",
"(",
"$",
"this",
"->",
"table",
")",
".",
"'\" not initialized... | Load entity by primary key
@throws \Rio\Exception
@return self | [
"Load",
"entity",
"by",
"primary",
"key"
] | d760ea6f0b93b88d5ca0b004a800d22359653321 | https://github.com/poliander/rio/blob/d760ea6f0b93b88d5ca0b004a800d22359653321/src/Rio/AbstractEntity.php#L206-L227 |
11,196 | poliander/rio | src/Rio/AbstractEntity.php | AbstractEntity.parameters | protected function parameters()
{
$index = 0;
$parameters = [
'p' => [],
'c' => []
];
foreach ($this->properties as $name => $property) {
if ($name !== $this->primary && false === isset($property['column'])) {
$index++;
... | php | protected function parameters()
{
$index = 0;
$parameters = [
'p' => [],
'c' => []
];
foreach ($this->properties as $name => $property) {
if ($name !== $this->primary && false === isset($property['column'])) {
$index++;
... | [
"protected",
"function",
"parameters",
"(",
")",
"{",
"$",
"index",
"=",
"0",
";",
"$",
"parameters",
"=",
"[",
"'p'",
"=>",
"[",
"]",
",",
"'c'",
"=>",
"[",
"]",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"properties",
"as",
"$",
"name",
"=>",... | Create prepared statement parameters
@return array | [
"Create",
"prepared",
"statement",
"parameters"
] | d760ea6f0b93b88d5ca0b004a800d22359653321 | https://github.com/poliander/rio/blob/d760ea6f0b93b88d5ca0b004a800d22359653321/src/Rio/AbstractEntity.php#L234-L252 |
11,197 | thienhungho/yii2-term-management | src/modules/TermManage/controllers/TermTypeController.php | TermTypeController.actionIndex | public function actionIndex()
{
$searchModel = new TermTypeSearch();
$dataProvider = $searchModel->search(request()->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
} | php | public function actionIndex()
{
$searchModel = new TermTypeSearch();
$dataProvider = $searchModel->search(request()->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
} | [
"public",
"function",
"actionIndex",
"(",
")",
"{",
"$",
"searchModel",
"=",
"new",
"TermTypeSearch",
"(",
")",
";",
"$",
"dataProvider",
"=",
"$",
"searchModel",
"->",
"search",
"(",
"request",
"(",
")",
"->",
"queryParams",
")",
";",
"return",
"$",
"th... | Lists all TermType models.
@return mixed | [
"Lists",
"all",
"TermType",
"models",
"."
] | 9bbc4f4de3837f30e8f968f7d9b6f8d892610270 | https://github.com/thienhungho/yii2-term-management/blob/9bbc4f4de3837f30e8f968f7d9b6f8d892610270/src/modules/TermManage/controllers/TermTypeController.php#L32-L41 |
11,198 | thienhungho/yii2-term-management | src/modules/TermManage/controllers/TermTypeController.php | TermTypeController.findModel | protected function findModel($id)
{
if (($model = TermType::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException(t('app', 'The requested page does not exist.'));
}
} | php | protected function findModel($id)
{
if (($model = TermType::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException(t('app', 'The requested page does not exist.'));
}
} | [
"protected",
"function",
"findModel",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"(",
"$",
"model",
"=",
"TermType",
"::",
"findOne",
"(",
"$",
"id",
")",
")",
"!==",
"null",
")",
"{",
"return",
"$",
"model",
";",
"}",
"else",
"{",
"throw",
"new",
"Not... | Finds the TermType model based on its primary key value.
If the model is not found, a 404 HTTP exception will be thrown.
@param integer $id
@return TermType the loaded model
@throws NotFoundHttpException if the model cannot be found | [
"Finds",
"the",
"TermType",
"model",
"based",
"on",
"its",
"primary",
"key",
"value",
".",
"If",
"the",
"model",
"is",
"not",
"found",
"a",
"404",
"HTTP",
"exception",
"will",
"be",
"thrown",
"."
] | 9bbc4f4de3837f30e8f968f7d9b6f8d892610270 | https://github.com/thienhungho/yii2-term-management/blob/9bbc4f4de3837f30e8f968f7d9b6f8d892610270/src/modules/TermManage/controllers/TermTypeController.php#L237-L244 |
11,199 | FrenzelGmbH/appcommon | components/DbFixtureManager.php | DbFixtureManager.getDbConnection | public function getDbConnection()
{
if (is_string($this->db)) {
$this->db = Yii::$app->get($this->db);
}
if (!$this->db instanceof Connection) {
throw new Exception("The 'db' option must refer to the application component ID of a DB connection.");
}
return $this->db;
} | php | public function getDbConnection()
{
if (is_string($this->db)) {
$this->db = Yii::$app->get($this->db);
}
if (!$this->db instanceof Connection) {
throw new Exception("The 'db' option must refer to the application component ID of a DB connection.");
}
return $this->db;
} | [
"public",
"function",
"getDbConnection",
"(",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"this",
"->",
"db",
")",
")",
"{",
"$",
"this",
"->",
"db",
"=",
"Yii",
"::",
"$",
"app",
"->",
"get",
"(",
"$",
"this",
"->",
"db",
")",
";",
"}",
"if",
... | Returns the database connection used to load fixtures.
@throws Exception if {@link db} application component is invalid
@return DbConnection the database connection | [
"Returns",
"the",
"database",
"connection",
"used",
"to",
"load",
"fixtures",
"."
] | d6d137b4c92b53832ce4b2e517644ed9fb545b7a | https://github.com/FrenzelGmbH/appcommon/blob/d6d137b4c92b53832ce4b2e517644ed9fb545b7a/components/DbFixtureManager.php#L107-L116 |
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.