id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
233,900 | Cocolabs-SAS/CocoricoSwiftReaderBundle | DTO/MessageListDTO.php | MessageListDTO.fill | public function fill(Finder $files)
{
/** @var SplFileInfo $file */
foreach ($files as $file) {
preg_match("/(\d+)_([^']+)_([^']+).json/", $file->getFilename(), $matches);
array_push(
$this->messages,
array(
'date' => (new... | php | public function fill(Finder $files)
{
/** @var SplFileInfo $file */
foreach ($files as $file) {
preg_match("/(\d+)_([^']+)_([^']+).json/", $file->getFilename(), $matches);
array_push(
$this->messages,
array(
'date' => (new... | [
"public",
"function",
"fill",
"(",
"Finder",
"$",
"files",
")",
"{",
"/** @var SplFileInfo $file */",
"foreach",
"(",
"$",
"files",
"as",
"$",
"file",
")",
"{",
"preg_match",
"(",
"\"/(\\d+)_([^']+)_([^']+).json/\"",
",",
"$",
"file",
"->",
"getFilename",
"(",
... | MessageListDTO constructor.
@param Finder $files | [
"MessageListDTO",
"constructor",
"."
] | ba3df4ccef1bd473e67121112f6a5d7ce0b369aa | https://github.com/Cocolabs-SAS/CocoricoSwiftReaderBundle/blob/ba3df4ccef1bd473e67121112f6a5d7ce0b369aa/DTO/MessageListDTO.php#L26-L42 |
233,901 | wardrobecms/core-archived | src/Wardrobe/Core/Controllers/Api/DropzoneController.php | DropzoneController.postImage | public function postImage()
{
$file = Input::file('file');
$imageDir = Config::get('core::wardrobe.image_dir');
$destinationPath = public_path(). "/{$imageDir}/";
$filename = $file->getClientOriginalName();
$resizeEnabled = Config::get('core::wardrobe.image_resize.enabled');
if ($resizeEnabled)
{
$... | php | public function postImage()
{
$file = Input::file('file');
$imageDir = Config::get('core::wardrobe.image_dir');
$destinationPath = public_path(). "/{$imageDir}/";
$filename = $file->getClientOriginalName();
$resizeEnabled = Config::get('core::wardrobe.image_resize.enabled');
if ($resizeEnabled)
{
$... | [
"public",
"function",
"postImage",
"(",
")",
"{",
"$",
"file",
"=",
"Input",
"::",
"file",
"(",
"'file'",
")",
";",
"$",
"imageDir",
"=",
"Config",
"::",
"get",
"(",
"'core::wardrobe.image_dir'",
")",
";",
"$",
"destinationPath",
"=",
"public_path",
"(",
... | Post an image from the admin
@return Json | [
"Post",
"an",
"image",
"from",
"the",
"admin"
] | 5c0836ea2e6885a428c852dc392073f2a2541c71 | https://github.com/wardrobecms/core-archived/blob/5c0836ea2e6885a428c852dc392073f2a2541c71/src/Wardrobe/Core/Controllers/Api/DropzoneController.php#L67-L94 |
233,902 | scherersoftware/cake-model-history | src/Model/Behavior/HistorizableBehavior.php | HistorizableBehavior._extractDirtyFields | protected function _extractDirtyFields(EntityInterface $entity): array
{
$dirtyFields = [];
$fields = array_keys($entity->toArray());
$dirtyFields = $entity->extract($fields, true);
unset($dirtyFields['modified']);
return array_keys($dirtyFields);
} | php | protected function _extractDirtyFields(EntityInterface $entity): array
{
$dirtyFields = [];
$fields = array_keys($entity->toArray());
$dirtyFields = $entity->extract($fields, true);
unset($dirtyFields['modified']);
return array_keys($dirtyFields);
} | [
"protected",
"function",
"_extractDirtyFields",
"(",
"EntityInterface",
"$",
"entity",
")",
":",
"array",
"{",
"$",
"dirtyFields",
"=",
"[",
"]",
";",
"$",
"fields",
"=",
"array_keys",
"(",
"$",
"entity",
"->",
"toArray",
"(",
")",
")",
";",
"$",
"dirtyF... | Extract dirty fields of given entity
@return array | [
"Extract",
"dirty",
"fields",
"of",
"given",
"entity"
] | 4dceac1cc7db0e6d443750dd9d76b960df385931 | https://github.com/scherersoftware/cake-model-history/blob/4dceac1cc7db0e6d443750dd9d76b960df385931/src/Model/Behavior/HistorizableBehavior.php#L211-L219 |
233,903 | scherersoftware/cake-model-history | src/Model/Behavior/HistorizableBehavior.php | HistorizableBehavior._applySaveHash | protected function _applySaveHash(EntityInterface $entity, string $saveHash): bool
{
$output = [];
if (defined('PHPUNIT_TESTSUITE')) {
$associations = [
'article',
'article.article'
];
} else {
$associations = $this->getAsso... | php | protected function _applySaveHash(EntityInterface $entity, string $saveHash): bool
{
$output = [];
if (defined('PHPUNIT_TESTSUITE')) {
$associations = [
'article',
'article.article'
];
} else {
$associations = $this->getAsso... | [
"protected",
"function",
"_applySaveHash",
"(",
"EntityInterface",
"$",
"entity",
",",
"string",
"$",
"saveHash",
")",
":",
"bool",
"{",
"$",
"output",
"=",
"[",
"]",
";",
"if",
"(",
"defined",
"(",
"'PHPUNIT_TESTSUITE'",
")",
")",
"{",
"$",
"associations"... | Apply save hash to entity
@param EntityInterface $entity Entity look for associated dirty fields
@param string $saveHash Hash to identify save process
@return bool | [
"Apply",
"save",
"hash",
"to",
"entity"
] | 4dceac1cc7db0e6d443750dd9d76b960df385931 | https://github.com/scherersoftware/cake-model-history/blob/4dceac1cc7db0e6d443750dd9d76b960df385931/src/Model/Behavior/HistorizableBehavior.php#L228-L256 |
233,904 | scherersoftware/cake-model-history | src/Model/Behavior/HistorizableBehavior.php | HistorizableBehavior._recursivelyExtractObject | protected function _recursivelyExtractObject(string $path, EntityInterface $object): ?EntityInterface
{
if (stripos($path, '.') !== false) {
$split = explode('.', $path);
$path = array_shift($split);
if (count($split) > 0 && $object->{$path} !== null) {
r... | php | protected function _recursivelyExtractObject(string $path, EntityInterface $object): ?EntityInterface
{
if (stripos($path, '.') !== false) {
$split = explode('.', $path);
$path = array_shift($split);
if (count($split) > 0 && $object->{$path} !== null) {
r... | [
"protected",
"function",
"_recursivelyExtractObject",
"(",
"string",
"$",
"path",
",",
"EntityInterface",
"$",
"object",
")",
":",
"?",
"EntityInterface",
"{",
"if",
"(",
"stripos",
"(",
"$",
"path",
",",
"'.'",
")",
"!==",
"false",
")",
"{",
"$",
"split",... | Recursively find object based on given dot-seperated string representing object properties.
@param string $path String path
@param EntityInterface $object Object to use
@return null|object | [
"Recursively",
"find",
"object",
"based",
"on",
"given",
"dot",
"-",
"seperated",
"string",
"representing",
"object",
"properties",
"."
] | 4dceac1cc7db0e6d443750dd9d76b960df385931 | https://github.com/scherersoftware/cake-model-history/blob/4dceac1cc7db0e6d443750dd9d76b960df385931/src/Model/Behavior/HistorizableBehavior.php#L265-L279 |
233,905 | scherersoftware/cake-model-history | src/Model/Behavior/HistorizableBehavior.php | HistorizableBehavior.addCommentToHistory | public function addCommentToHistory(EntityInterface $entity, string $comment, string $userId = null): ModelHistory
{
if (!$userId) {
$userId = $this->_getUserId();
}
return $this->ModelHistory->addComment($entity, $comment, $userId);
} | php | public function addCommentToHistory(EntityInterface $entity, string $comment, string $userId = null): ModelHistory
{
if (!$userId) {
$userId = $this->_getUserId();
}
return $this->ModelHistory->addComment($entity, $comment, $userId);
} | [
"public",
"function",
"addCommentToHistory",
"(",
"EntityInterface",
"$",
"entity",
",",
"string",
"$",
"comment",
",",
"string",
"$",
"userId",
"=",
"null",
")",
":",
"ModelHistory",
"{",
"if",
"(",
"!",
"$",
"userId",
")",
"{",
"$",
"userId",
"=",
"$",... | Adds a comment to the model's history
@param EntityInterface $entity Entity to add the comment to
@param string $comment Comment
@param string $userId Commenting User
@return ModelHistory | [
"Adds",
"a",
"comment",
"to",
"the",
"model",
"s",
"history"
] | 4dceac1cc7db0e6d443750dd9d76b960df385931 | https://github.com/scherersoftware/cake-model-history/blob/4dceac1cc7db0e6d443750dd9d76b960df385931/src/Model/Behavior/HistorizableBehavior.php#L324-L331 |
233,906 | scherersoftware/cake-model-history | src/Model/Behavior/HistorizableBehavior.php | HistorizableBehavior._getUserId | protected function _getUserId(): ?string
{
$userId = null;
$callback = $this->config('userIdCallback');
if (is_callable($callback)) {
$userId = $callback();
}
return $userId;
} | php | protected function _getUserId(): ?string
{
$userId = null;
$callback = $this->config('userIdCallback');
if (is_callable($callback)) {
$userId = $callback();
}
return $userId;
} | [
"protected",
"function",
"_getUserId",
"(",
")",
":",
"?",
"string",
"{",
"$",
"userId",
"=",
"null",
";",
"$",
"callback",
"=",
"$",
"this",
"->",
"config",
"(",
"'userIdCallback'",
")",
";",
"if",
"(",
"is_callable",
"(",
"$",
"callback",
")",
")",
... | Tries to get a userId to use in the history from the given configuration
@return string|null | [
"Tries",
"to",
"get",
"a",
"userId",
"to",
"use",
"in",
"the",
"history",
"from",
"the",
"given",
"configuration"
] | 4dceac1cc7db0e6d443750dd9d76b960df385931 | https://github.com/scherersoftware/cake-model-history/blob/4dceac1cc7db0e6d443750dd9d76b960df385931/src/Model/Behavior/HistorizableBehavior.php#L338-L347 |
233,907 | scherersoftware/cake-model-history | src/Model/Behavior/HistorizableBehavior.php | HistorizableBehavior.getUserNameFields | public function getUserNameFields(bool $withoutModel = false): array
{
$userNameFields = $this->config('userNameFields');
if ($withoutModel) {
foreach ($userNameFields as $key => $value) {
$exploded = explode('.', $value);
if (count($exploded) === 2) {
... | php | public function getUserNameFields(bool $withoutModel = false): array
{
$userNameFields = $this->config('userNameFields');
if ($withoutModel) {
foreach ($userNameFields as $key => $value) {
$exploded = explode('.', $value);
if (count($exploded) === 2) {
... | [
"public",
"function",
"getUserNameFields",
"(",
"bool",
"$",
"withoutModel",
"=",
"false",
")",
":",
"array",
"{",
"$",
"userNameFields",
"=",
"$",
"this",
"->",
"config",
"(",
"'userNameFields'",
")",
";",
"if",
"(",
"$",
"withoutModel",
")",
"{",
"foreac... | Get the user fields
@param bool $withoutModel set to true to only get the field names without model name
@return array | [
"Get",
"the",
"user",
"fields"
] | 4dceac1cc7db0e6d443750dd9d76b960df385931 | https://github.com/scherersoftware/cake-model-history/blob/4dceac1cc7db0e6d443750dd9d76b960df385931/src/Model/Behavior/HistorizableBehavior.php#L413-L426 |
233,908 | scherersoftware/cake-model-history | src/Model/Behavior/HistorizableBehavior.php | HistorizableBehavior.getTranslatedFields | public function getTranslatedFields(): array
{
return Hash::apply($this->config('fields'), '{*}[searchable=true]', function ($array) {
$formatted = [];
foreach ($array as $data) {
$formatted[$data['name']] = $data['translation'];
}
return Hash... | php | public function getTranslatedFields(): array
{
return Hash::apply($this->config('fields'), '{*}[searchable=true]', function ($array) {
$formatted = [];
foreach ($array as $data) {
$formatted[$data['name']] = $data['translation'];
}
return Hash... | [
"public",
"function",
"getTranslatedFields",
"(",
")",
":",
"array",
"{",
"return",
"Hash",
"::",
"apply",
"(",
"$",
"this",
"->",
"config",
"(",
"'fields'",
")",
",",
"'{*}[searchable=true]'",
",",
"function",
"(",
"$",
"array",
")",
"{",
"$",
"formatted"... | Get translated fields
@return array | [
"Get",
"translated",
"fields"
] | 4dceac1cc7db0e6d443750dd9d76b960df385931 | https://github.com/scherersoftware/cake-model-history/blob/4dceac1cc7db0e6d443750dd9d76b960df385931/src/Model/Behavior/HistorizableBehavior.php#L467-L477 |
233,909 | scherersoftware/cake-model-history | src/Model/Behavior/HistorizableBehavior.php | HistorizableBehavior.getSaveableFields | public function getSaveableFields(): array
{
return Hash::apply($this->config('fields'), '{*}[saveable=true]', function ($array) {
$formatted = [];
foreach ($array as $data) {
$formatted[$data['name']] = $data;
}
return $formatted;
});... | php | public function getSaveableFields(): array
{
return Hash::apply($this->config('fields'), '{*}[saveable=true]', function ($array) {
$formatted = [];
foreach ($array as $data) {
$formatted[$data['name']] = $data;
}
return $formatted;
});... | [
"public",
"function",
"getSaveableFields",
"(",
")",
":",
"array",
"{",
"return",
"Hash",
"::",
"apply",
"(",
"$",
"this",
"->",
"config",
"(",
"'fields'",
")",
",",
"'{*}[saveable=true]'",
",",
"function",
"(",
"$",
"array",
")",
"{",
"$",
"formatted",
... | Get saveable fields
@return array | [
"Get",
"saveable",
"fields"
] | 4dceac1cc7db0e6d443750dd9d76b960df385931 | https://github.com/scherersoftware/cake-model-history/blob/4dceac1cc7db0e6d443750dd9d76b960df385931/src/Model/Behavior/HistorizableBehavior.php#L484-L494 |
233,910 | fab2s/NodalFlow | src/Flows/FlowRegistry.php | FlowRegistry.load | public function load(FlowInterface $flow, array $entry)
{
$this->registerFlow($flow);
$flowId = $flow->getId();
static::$registry[$flowId] = $entry;
foreach ($flow->getNodes() as $node) {
$this->registerNode($node);
}
return $this;
... | php | public function load(FlowInterface $flow, array $entry)
{
$this->registerFlow($flow);
$flowId = $flow->getId();
static::$registry[$flowId] = $entry;
foreach ($flow->getNodes() as $node) {
$this->registerNode($node);
}
return $this;
... | [
"public",
"function",
"load",
"(",
"FlowInterface",
"$",
"flow",
",",
"array",
"$",
"entry",
")",
"{",
"$",
"this",
"->",
"registerFlow",
"(",
"$",
"flow",
")",
";",
"$",
"flowId",
"=",
"$",
"flow",
"->",
"getId",
"(",
")",
";",
"static",
"::",
"$"... | Used upon FlowMap un-serialization
@param FlowInterface $flow
@param array $entry
@throws NodalFlowException
@return $this | [
"Used",
"upon",
"FlowMap",
"un",
"-",
"serialization"
] | da5d458ffea3e6e954d7ee734f938f4be5e46728 | https://github.com/fab2s/NodalFlow/blob/da5d458ffea3e6e954d7ee734f938f4be5e46728/src/Flows/FlowRegistry.php#L57-L68 |
233,911 | matrozov/yii2-couchbase | src/QueryBuilder.php | QueryBuilder.insert | public function insert($bucketName, $data)
{
$bucketName = $this->db->quoteBucketName($bucketName);
$data = Json::encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT);
return "INSERT INTO $bucketName (KEY, VALUE) VALUES (UUID(), $data) " . $this->buildRet... | php | public function insert($bucketName, $data)
{
$bucketName = $this->db->quoteBucketName($bucketName);
$data = Json::encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT);
return "INSERT INTO $bucketName (KEY, VALUE) VALUES (UUID(), $data) " . $this->buildRet... | [
"public",
"function",
"insert",
"(",
"$",
"bucketName",
",",
"$",
"data",
")",
"{",
"$",
"bucketName",
"=",
"$",
"this",
"->",
"db",
"->",
"quoteBucketName",
"(",
"$",
"bucketName",
")",
";",
"$",
"data",
"=",
"Json",
"::",
"encode",
"(",
"$",
"data"... | Creates an INSERT SQL statement.
For example,
```php
$sql = $queryBuilder->insert('user', [
'name' => 'Sam',
'age' => 30,
], $params);
```
The method will properly escape the bucket and column names.
@param string $bucketName the bucket that new rows will be inserted into.
@param array $data the column data (name =>... | [
"Creates",
"an",
"INSERT",
"SQL",
"statement",
".",
"For",
"example"
] | 07c2e9d18cb90f873c0d88dcacf6bb532e9d648c | https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/QueryBuilder.php#L163-L169 |
233,912 | matrozov/yii2-couchbase | src/QueryBuilder.php | QueryBuilder.upsert | public function upsert($bucketName, $id, $data)
{
$bucketName = $this->db->quoteBucketName($bucketName);
$id = $this->db->quoteValue($id);
$data = Json::encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT);
return "UPSERT INTO $bucketName ... | php | public function upsert($bucketName, $id, $data)
{
$bucketName = $this->db->quoteBucketName($bucketName);
$id = $this->db->quoteValue($id);
$data = Json::encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT);
return "UPSERT INTO $bucketName ... | [
"public",
"function",
"upsert",
"(",
"$",
"bucketName",
",",
"$",
"id",
",",
"$",
"data",
")",
"{",
"$",
"bucketName",
"=",
"$",
"this",
"->",
"db",
"->",
"quoteBucketName",
"(",
"$",
"bucketName",
")",
";",
"$",
"id",
"=",
"$",
"this",
"->",
"db",... | Creates an UPSERT SQL statement.
For example,
```php
$sql = $queryBuilder->upsert('user', 'my-id', [
'name' => 'Sam',
'age' => 30,
], $params);
```
The method will properly escape the bucket and column names.
@param string $bucketName the bucket that new rows will be inserted into.
@param string $id the document id.... | [
"Creates",
"an",
"UPSERT",
"SQL",
"statement",
".",
"For",
"example"
] | 07c2e9d18cb90f873c0d88dcacf6bb532e9d648c | https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/QueryBuilder.php#L277-L284 |
233,913 | matrozov/yii2-couchbase | src/QueryBuilder.php | QueryBuilder.buildIndex | public function buildIndex($bucketName, $indexNames)
{
$indexNames = is_array($indexNames) ? $indexNames : [$indexNames];
foreach ($indexNames as $i => $indexName) {
$indexNames[$i] = $this->db->quoteColumnName($indexName);
}
return 'BUILD INDEX ' . $this->db->quoteBuck... | php | public function buildIndex($bucketName, $indexNames)
{
$indexNames = is_array($indexNames) ? $indexNames : [$indexNames];
foreach ($indexNames as $i => $indexName) {
$indexNames[$i] = $this->db->quoteColumnName($indexName);
}
return 'BUILD INDEX ' . $this->db->quoteBuck... | [
"public",
"function",
"buildIndex",
"(",
"$",
"bucketName",
",",
"$",
"indexNames",
")",
"{",
"$",
"indexNames",
"=",
"is_array",
"(",
"$",
"indexNames",
")",
"?",
"$",
"indexNames",
":",
"[",
"$",
"indexNames",
"]",
";",
"foreach",
"(",
"$",
"indexNames... | Builds a SQL statement for build index.
@param string $bucketName
@param string|string[] $indexNames names of index
@return string the BUILD INDEX SQL | [
"Builds",
"a",
"SQL",
"statement",
"for",
"build",
"index",
"."
] | 07c2e9d18cb90f873c0d88dcacf6bb532e9d648c | https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/QueryBuilder.php#L350-L359 |
233,914 | matrozov/yii2-couchbase | src/QueryBuilder.php | QueryBuilder.createPrimaryIndex | public function createPrimaryIndex($bucketName, $indexName = null, $options = [])
{
$bucketName = $this->db->quoteBucketName($bucketName);
if ($indexName) {
$indexName = $this->db->quoteBucketName($indexName);
}
$sql = "CREATE PRIMARY INDEX $indexName ON $bucketName";
... | php | public function createPrimaryIndex($bucketName, $indexName = null, $options = [])
{
$bucketName = $this->db->quoteBucketName($bucketName);
if ($indexName) {
$indexName = $this->db->quoteBucketName($indexName);
}
$sql = "CREATE PRIMARY INDEX $indexName ON $bucketName";
... | [
"public",
"function",
"createPrimaryIndex",
"(",
"$",
"bucketName",
",",
"$",
"indexName",
"=",
"null",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"bucketName",
"=",
"$",
"this",
"->",
"db",
"->",
"quoteBucketName",
"(",
"$",
"bucketName",
")",
... | Builds a SQL statement for creating a new primary index.
@param string $bucketName
@param string|null $indexName name of primary index (optional)
@param array $options
@return string the CREATE PRIMARY INDEX SQL | [
"Builds",
"a",
"SQL",
"statement",
"for",
"creating",
"a",
"new",
"primary",
"index",
"."
] | 07c2e9d18cb90f873c0d88dcacf6bb532e9d648c | https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/QueryBuilder.php#L370-L385 |
233,915 | matrozov/yii2-couchbase | src/QueryBuilder.php | QueryBuilder.createIndex | public function createIndex($bucketName, $indexName, $columns, $condition = null, &$params = [], $options = [])
{
$bucketName = $this->db->quoteBucketName($bucketName);
$indexName = $this->db->quoteBucketName($indexName);
foreach ($columns as $i => $column) {
if ($column instan... | php | public function createIndex($bucketName, $indexName, $columns, $condition = null, &$params = [], $options = [])
{
$bucketName = $this->db->quoteBucketName($bucketName);
$indexName = $this->db->quoteBucketName($indexName);
foreach ($columns as $i => $column) {
if ($column instan... | [
"public",
"function",
"createIndex",
"(",
"$",
"bucketName",
",",
"$",
"indexName",
",",
"$",
"columns",
",",
"$",
"condition",
"=",
"null",
",",
"&",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"bucketName",
"=... | Builds a SQL statement for creating a new index.
@param string $bucketName
@param string $indexName
@param array $columns
@param array|null $condition
@param array $params
@param array $options
@return string the CREATE INDEX SQL
@throws Exception | [
"Builds",
"a",
"SQL",
"statement",
"for",
"creating",
"a",
"new",
"index",
"."
] | 07c2e9d18cb90f873c0d88dcacf6bb532e9d648c | https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/QueryBuilder.php#L414-L435 |
233,916 | matrozov/yii2-couchbase | src/QueryBuilder.php | QueryBuilder.dropIndex | public function dropIndex($bucketName, $indexName)
{
$bucketName = $this->db->quoteBucketName($bucketName);
$indexName = $this->db->quoteColumnName($indexName);
return "DROP INDEX $bucketName.$indexName";
} | php | public function dropIndex($bucketName, $indexName)
{
$bucketName = $this->db->quoteBucketName($bucketName);
$indexName = $this->db->quoteColumnName($indexName);
return "DROP INDEX $bucketName.$indexName";
} | [
"public",
"function",
"dropIndex",
"(",
"$",
"bucketName",
",",
"$",
"indexName",
")",
"{",
"$",
"bucketName",
"=",
"$",
"this",
"->",
"db",
"->",
"quoteBucketName",
"(",
"$",
"bucketName",
")",
";",
"$",
"indexName",
"=",
"$",
"this",
"->",
"db",
"->"... | Builds a SQL statement for dropping an index.
@param string $bucketName
@param string $indexName
@return string the DROP INDEX SQL | [
"Builds",
"a",
"SQL",
"statement",
"for",
"dropping",
"an",
"index",
"."
] | 07c2e9d18cb90f873c0d88dcacf6bb532e9d648c | https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/QueryBuilder.php#L445-L451 |
233,917 | matrozov/yii2-couchbase | src/QueryBuilder.php | QueryBuilder.quoteBucketName | private function quoteBucketName($bucketName, &$params)
{
if (!is_array($bucketName)) {
return $this->db->quoteBucketName($bucketName);
}
foreach ($bucketName as $i => $bucket) {
if ($bucket instanceof Query) {
list($sql, $params) = $this->build($buck... | php | private function quoteBucketName($bucketName, &$params)
{
if (!is_array($bucketName)) {
return $this->db->quoteBucketName($bucketName);
}
foreach ($bucketName as $i => $bucket) {
if ($bucket instanceof Query) {
list($sql, $params) = $this->build($buck... | [
"private",
"function",
"quoteBucketName",
"(",
"$",
"bucketName",
",",
"&",
"$",
"params",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"bucketName",
")",
")",
"{",
"return",
"$",
"this",
"->",
"db",
"->",
"quoteBucketName",
"(",
"$",
"bucketName",
... | Quotes bucket names passed
@param array|string $bucketName
@param array $params
@return array|string
@throws Exception | [
"Quotes",
"bucket",
"names",
"passed"
] | 07c2e9d18cb90f873c0d88dcacf6bb532e9d648c | https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/QueryBuilder.php#L607-L637 |
233,918 | matrozov/yii2-couchbase | src/QueryBuilder.php | QueryBuilder.buildCondition | public function buildCondition($condition, &$params)
{
if ($condition instanceof Expression) {
foreach ($condition->params as $n => $v) {
$params[$n] = $v;
}
return $condition->expression;
}
elseif (!is_array($condition)) {
ret... | php | public function buildCondition($condition, &$params)
{
if ($condition instanceof Expression) {
foreach ($condition->params as $n => $v) {
$params[$n] = $v;
}
return $condition->expression;
}
elseif (!is_array($condition)) {
ret... | [
"public",
"function",
"buildCondition",
"(",
"$",
"condition",
",",
"&",
"$",
"params",
")",
"{",
"if",
"(",
"$",
"condition",
"instanceof",
"Expression",
")",
"{",
"foreach",
"(",
"$",
"condition",
"->",
"params",
"as",
"$",
"n",
"=>",
"$",
"v",
")",
... | Parses the condition specification and generates the corresponding SQL expression.
@param string|array|Expression $condition the condition specification. Please refer to [[Query::where()]]
on how to specify a condition.
@param array $params the binding parameters to be populated
@return string th... | [
"Parses",
"the",
"condition",
"specification",
"and",
"generates",
"the",
"corresponding",
"SQL",
"expression",
"."
] | 07c2e9d18cb90f873c0d88dcacf6bb532e9d648c | https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/QueryBuilder.php#L822-L855 |
233,919 | matrozov/yii2-couchbase | src/QueryBuilder.php | QueryBuilder.buildCompositeInCondition | protected function buildCompositeInCondition($operator, $columns, $values, &$params)
{
$vss = [];
foreach ($values as $value) {
$vs = [];
foreach ($columns as $column) {
if (isset($value[$column])) {
$phName = self::PARAM_PREFIX . count($... | php | protected function buildCompositeInCondition($operator, $columns, $values, &$params)
{
$vss = [];
foreach ($values as $value) {
$vs = [];
foreach ($columns as $column) {
if (isset($value[$column])) {
$phName = self::PARAM_PREFIX . count($... | [
"protected",
"function",
"buildCompositeInCondition",
"(",
"$",
"operator",
",",
"$",
"columns",
",",
"$",
"values",
",",
"&",
"$",
"params",
")",
"{",
"$",
"vss",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"values",
"as",
"$",
"value",
")",
"{",
"$",
... | Builds SQL for IN condition
@param string $operator
@param array|\Traversable $columns
@param array $values
@param array $params
@return string SQL | [
"Builds",
"SQL",
"for",
"IN",
"condition"
] | 07c2e9d18cb90f873c0d88dcacf6bb532e9d648c | https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/QueryBuilder.php#L1143-L1175 |
233,920 | baleen/migrations | src/Service/Runner/MigrationRunner.php | MigrationRunner.run | public function run(DeltaInterface $version, OptionsInterface $options)
{
if (!$this->shouldMigrate($version, $options)) {
if ($options->isExceptionOnSkip()) {
throw new RunnerException(sprintf(
'Cowardly refusing to run %s() on a delta that is already "%s" (I... | php | public function run(DeltaInterface $version, OptionsInterface $options)
{
if (!$this->shouldMigrate($version, $options)) {
if ($options->isExceptionOnSkip()) {
throw new RunnerException(sprintf(
'Cowardly refusing to run %s() on a delta that is already "%s" (I... | [
"public",
"function",
"run",
"(",
"DeltaInterface",
"$",
"version",
",",
"OptionsInterface",
"$",
"options",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"shouldMigrate",
"(",
"$",
"version",
",",
"$",
"options",
")",
")",
"{",
"if",
"(",
"$",
"options... | Runs a single version using the specified options
@param DeltaInterface $version
@param OptionsInterface $options
@return false|MigrateAfterEvent
@throws RunnerException | [
"Runs",
"a",
"single",
"version",
"using",
"the",
"specified",
"options"
] | cfc8c439858cf4f0d4119af9eb67de493da8d95c | https://github.com/baleen/migrations/blob/cfc8c439858cf4f0d4119af9eb67de493da8d95c/src/Service/Runner/MigrationRunner.php#L76-L101 |
233,921 | baleen/migrations | src/Service/Runner/MigrationRunner.php | MigrationRunner.shouldMigrate | protected function shouldMigrate(DeltaInterface $version, OptionsInterface $options)
{
return $options->isForced()
|| ($options->getDirection()->isUp() ^ $version->isMigrated()); // direction is opposite to state
} | php | protected function shouldMigrate(DeltaInterface $version, OptionsInterface $options)
{
return $options->isForced()
|| ($options->getDirection()->isUp() ^ $version->isMigrated()); // direction is opposite to state
} | [
"protected",
"function",
"shouldMigrate",
"(",
"DeltaInterface",
"$",
"version",
",",
"OptionsInterface",
"$",
"options",
")",
"{",
"return",
"$",
"options",
"->",
"isForced",
"(",
")",
"||",
"(",
"$",
"options",
"->",
"getDirection",
"(",
")",
"->",
"isUp",... | Returns true if the operation is forced, or if the direction is the opposite to the state of the migration.
@param DeltaInterface $version
@param OptionsInterface $options
@return bool | [
"Returns",
"true",
"if",
"the",
"operation",
"is",
"forced",
"or",
"if",
"the",
"direction",
"is",
"the",
"opposite",
"to",
"the",
"state",
"of",
"the",
"migration",
"."
] | cfc8c439858cf4f0d4119af9eb67de493da8d95c | https://github.com/baleen/migrations/blob/cfc8c439858cf4f0d4119af9eb67de493da8d95c/src/Service/Runner/MigrationRunner.php#L111-L115 |
233,922 | scherersoftware/cake-model-history | src/View/Helper/ModelHistoryHelper.php | ModelHistoryHelper.modelHistoryArea | public function modelHistoryArea(EntityInterface $entity, array $options = []): string
{
$options = Hash::merge([
'showCommentBox' => false,
'showFilterBox' => false,
'columnClass' => 'col-md-12',
'includeAssociated' => false
], $options);
$pa... | php | public function modelHistoryArea(EntityInterface $entity, array $options = []): string
{
$options = Hash::merge([
'showCommentBox' => false,
'showFilterBox' => false,
'columnClass' => 'col-md-12',
'includeAssociated' => false
], $options);
$pa... | [
"public",
"function",
"modelHistoryArea",
"(",
"EntityInterface",
"$",
"entity",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"string",
"{",
"$",
"options",
"=",
"Hash",
"::",
"merge",
"(",
"[",
"'showCommentBox'",
"=>",
"false",
",",
"'showFilte... | Render the model history area where needed
@param \Cake\Datasource\EntityInterface $entity One historizable entity
@param array $options options array | [
"Render",
"the",
"model",
"history",
"area",
"where",
"needed"
] | 4dceac1cc7db0e6d443750dd9d76b960df385931 | https://github.com/scherersoftware/cake-model-history/blob/4dceac1cc7db0e6d443750dd9d76b960df385931/src/View/Helper/ModelHistoryHelper.php#L31-L69 |
233,923 | scherersoftware/cake-model-history | src/View/Helper/ModelHistoryHelper.php | ModelHistoryHelper.actionClass | public function actionClass(string $action): string
{
switch ($action) {
case ModelHistory::ACTION_CREATE:
$class = 'success';
break;
case ModelHistory::ACTION_DELETE:
$class = 'danger';
break;
case ModelHist... | php | public function actionClass(string $action): string
{
switch ($action) {
case ModelHistory::ACTION_CREATE:
$class = 'success';
break;
case ModelHistory::ACTION_DELETE:
$class = 'danger';
break;
case ModelHist... | [
"public",
"function",
"actionClass",
"(",
"string",
"$",
"action",
")",
":",
"string",
"{",
"switch",
"(",
"$",
"action",
")",
"{",
"case",
"ModelHistory",
"::",
"ACTION_CREATE",
":",
"$",
"class",
"=",
"'success'",
";",
"break",
";",
"case",
"ModelHistory... | Convert action to bootstrap class
@param string $action History Action
@return string | [
"Convert",
"action",
"to",
"bootstrap",
"class"
] | 4dceac1cc7db0e6d443750dd9d76b960df385931 | https://github.com/scherersoftware/cake-model-history/blob/4dceac1cc7db0e6d443750dd9d76b960df385931/src/View/Helper/ModelHistoryHelper.php#L77-L96 |
233,924 | scherersoftware/cake-model-history | src/View/Helper/ModelHistoryHelper.php | ModelHistoryHelper.historyText | public function historyText(ModelHistory $history): string
{
$action = '';
switch ($history->action) {
case ModelHistory::ACTION_CREATE:
$action = __d('model_history', 'created');
break;
case ModelHistory::ACTION_UPDATE:
$action... | php | public function historyText(ModelHistory $history): string
{
$action = '';
switch ($history->action) {
case ModelHistory::ACTION_CREATE:
$action = __d('model_history', 'created');
break;
case ModelHistory::ACTION_UPDATE:
$action... | [
"public",
"function",
"historyText",
"(",
"ModelHistory",
"$",
"history",
")",
":",
"string",
"{",
"$",
"action",
"=",
"''",
";",
"switch",
"(",
"$",
"history",
"->",
"action",
")",
"{",
"case",
"ModelHistory",
"::",
"ACTION_CREATE",
":",
"$",
"action",
... | Returns the text displayed in the widget
@param ModelHistory $history one ModelHistory entity
@return string | [
"Returns",
"the",
"text",
"displayed",
"in",
"the",
"widget"
] | 4dceac1cc7db0e6d443750dd9d76b960df385931 | https://github.com/scherersoftware/cake-model-history/blob/4dceac1cc7db0e6d443750dd9d76b960df385931/src/View/Helper/ModelHistoryHelper.php#L104-L132 |
233,925 | scherersoftware/cake-model-history | src/View/Helper/ModelHistoryHelper.php | ModelHistoryHelper.historyBadge | public function historyBadge(ModelHistory $history): string
{
$action = '';
switch ($history->action) {
case ModelHistory::ACTION_UPDATE:
$icon = 'refresh';
break;
case ModelHistory::ACTION_DELETE:
$icon = 'minus-circle';
... | php | public function historyBadge(ModelHistory $history): string
{
$action = '';
switch ($history->action) {
case ModelHistory::ACTION_UPDATE:
$icon = 'refresh';
break;
case ModelHistory::ACTION_DELETE:
$icon = 'minus-circle';
... | [
"public",
"function",
"historyBadge",
"(",
"ModelHistory",
"$",
"history",
")",
":",
"string",
"{",
"$",
"action",
"=",
"''",
";",
"switch",
"(",
"$",
"history",
"->",
"action",
")",
"{",
"case",
"ModelHistory",
"::",
"ACTION_UPDATE",
":",
"$",
"icon",
"... | Returns the badge displayed in the widget
@param ModelHistory $history one ModelHistory entity
@return string | [
"Returns",
"the",
"badge",
"displayed",
"in",
"the",
"widget"
] | 4dceac1cc7db0e6d443750dd9d76b960df385931 | https://github.com/scherersoftware/cake-model-history/blob/4dceac1cc7db0e6d443750dd9d76b960df385931/src/View/Helper/ModelHistoryHelper.php#L140-L160 |
233,926 | scherersoftware/cake-model-history | src/View/Helper/ModelHistoryHelper.php | ModelHistoryHelper.getLocalizedFieldnames | public function getLocalizedFieldnames(ModelHistory $historyEntry): string
{
$fields = join(', ', array_map(function ($value) use ($historyEntry) {
if (!is_string($value)) {
return $value;
}
// Get pre configured translations and return it if found
... | php | public function getLocalizedFieldnames(ModelHistory $historyEntry): string
{
$fields = join(', ', array_map(function ($value) use ($historyEntry) {
if (!is_string($value)) {
return $value;
}
// Get pre configured translations and return it if found
... | [
"public",
"function",
"getLocalizedFieldnames",
"(",
"ModelHistory",
"$",
"historyEntry",
")",
":",
"string",
"{",
"$",
"fields",
"=",
"join",
"(",
"', '",
",",
"array_map",
"(",
"function",
"(",
"$",
"value",
")",
"use",
"(",
"$",
"historyEntry",
")",
"{"... | Retrieve field names as localized, comma seperated string.
@param ModelHistory $historyEntry A History entry
@return string | [
"Retrieve",
"field",
"names",
"as",
"localized",
"comma",
"seperated",
"string",
"."
] | 4dceac1cc7db0e6d443750dd9d76b960df385931 | https://github.com/scherersoftware/cake-model-history/blob/4dceac1cc7db0e6d443750dd9d76b960df385931/src/View/Helper/ModelHistoryHelper.php#L168-L199 |
233,927 | scherersoftware/cake-model-history | src/View/Helper/ModelHistoryHelper.php | ModelHistoryHelper.getLocalizedSlug | public function getLocalizedSlug(ModelHistory $historyEntry): string
{
$slug = $historyEntry->context_slug;
if (!empty($historyEntry->context) && !empty($historyEntry->context['namespace'])) {
$class = new $historyEntry->context['namespace'];
if (method_exists($class, 'typeDe... | php | public function getLocalizedSlug(ModelHistory $historyEntry): string
{
$slug = $historyEntry->context_slug;
if (!empty($historyEntry->context) && !empty($historyEntry->context['namespace'])) {
$class = new $historyEntry->context['namespace'];
if (method_exists($class, 'typeDe... | [
"public",
"function",
"getLocalizedSlug",
"(",
"ModelHistory",
"$",
"historyEntry",
")",
":",
"string",
"{",
"$",
"slug",
"=",
"$",
"historyEntry",
"->",
"context_slug",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"historyEntry",
"->",
"context",
")",
"&&",
"!... | Retrieve localized slug, when translation is available in type descriptions.
@param ModelHistory $historyEntry HistoryEntry entity to get data from
@return string | [
"Retrieve",
"localized",
"slug",
"when",
"translation",
"is",
"available",
"in",
"type",
"descriptions",
"."
] | 4dceac1cc7db0e6d443750dd9d76b960df385931 | https://github.com/scherersoftware/cake-model-history/blob/4dceac1cc7db0e6d443750dd9d76b960df385931/src/View/Helper/ModelHistoryHelper.php#L207-L221 |
233,928 | matrozov/yii2-couchbase | src/Migration.php | Migration.createBucket | public function createBucket($bucketName, $options = [])
{
$this->beginProfile($token = " > create bucket $bucketName ...");
$this->db->createBucket($bucketName, $options);
$this->endProfile($token);
} | php | public function createBucket($bucketName, $options = [])
{
$this->beginProfile($token = " > create bucket $bucketName ...");
$this->db->createBucket($bucketName, $options);
$this->endProfile($token);
} | [
"public",
"function",
"createBucket",
"(",
"$",
"bucketName",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"beginProfile",
"(",
"$",
"token",
"=",
"\" > create bucket $bucketName ...\"",
")",
";",
"$",
"this",
"->",
"db",
"->",
"crea... | Creates new bucket with the specified options.
@param string $bucketName name of the bucket
@param array $options bucket options in format: "name" => "value"
@throws Exception
@throws \yii\base\InvalidConfigException | [
"Creates",
"new",
"bucket",
"with",
"the",
"specified",
"options",
"."
] | 07c2e9d18cb90f873c0d88dcacf6bb532e9d648c | https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/Migration.php#L63-L70 |
233,929 | matrozov/yii2-couchbase | src/Migration.php | Migration.dropBucket | public function dropBucket($bucketName)
{
$this->beginProfile($token = " > drop bucket $bucketName ...");
$this->db->getBucket($bucketName)->drop();
$this->endProfile($token);
} | php | public function dropBucket($bucketName)
{
$this->beginProfile($token = " > drop bucket $bucketName ...");
$this->db->getBucket($bucketName)->drop();
$this->endProfile($token);
} | [
"public",
"function",
"dropBucket",
"(",
"$",
"bucketName",
")",
"{",
"$",
"this",
"->",
"beginProfile",
"(",
"$",
"token",
"=",
"\" > drop bucket $bucketName ...\"",
")",
";",
"$",
"this",
"->",
"db",
"->",
"getBucket",
"(",
"$",
"bucketName",
")",
"->",... | Drops existing bucket.
@param string $bucketName name of the bucket
@throws Exception
@throws \yii\base\InvalidConfigException | [
"Drops",
"existing",
"bucket",
"."
] | 07c2e9d18cb90f873c0d88dcacf6bb532e9d648c | https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/Migration.php#L80-L87 |
233,930 | matrozov/yii2-couchbase | src/Migration.php | Migration.insert | public function insert($bucketName, $data)
{
$this->beginProfile($token = " > insert into $bucketName ...");
$result = $this->db->insert($bucketName, $data);
$this->endProfile($token);
return $result;
} | php | public function insert($bucketName, $data)
{
$this->beginProfile($token = " > insert into $bucketName ...");
$result = $this->db->insert($bucketName, $data);
$this->endProfile($token);
return $result;
} | [
"public",
"function",
"insert",
"(",
"$",
"bucketName",
",",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"beginProfile",
"(",
"$",
"token",
"=",
"\" > insert into $bucketName ...\"",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"db",
"->",
"insert",
... | Insert record.
@param string $bucketName the bucket that new rows will be inserted into.
@param array $data the column data (name => value) to be inserted into the bucket or instance
@return int|false inserted id
@throws Exception
@throws \yii\base\InvalidConfigException | [
"Insert",
"record",
"."
] | 07c2e9d18cb90f873c0d88dcacf6bb532e9d648c | https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/Migration.php#L99-L108 |
233,931 | matrozov/yii2-couchbase | src/Migration.php | Migration.batchInsert | public function batchInsert($bucketName, $rows)
{
$this->beginProfile($token = " > batch insert into $bucketName ...");
$result = $this->db->batchInsert($bucketName, $rows);
$this->endProfile($token);
return $result;
} | php | public function batchInsert($bucketName, $rows)
{
$this->beginProfile($token = " > batch insert into $bucketName ...");
$result = $this->db->batchInsert($bucketName, $rows);
$this->endProfile($token);
return $result;
} | [
"public",
"function",
"batchInsert",
"(",
"$",
"bucketName",
",",
"$",
"rows",
")",
"{",
"$",
"this",
"->",
"beginProfile",
"(",
"$",
"token",
"=",
"\" > batch insert into $bucketName ...\"",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"db",
"->",
... | Batch insert record.
@param string $bucketName the bucket that new rows will be inserted into.
@param array $rows the rows to be batch inserted into the bucket
@return int[]|false inserted ids
@throws Exception
@throws \yii\base\InvalidConfigException | [
"Batch",
"insert",
"record",
"."
] | 07c2e9d18cb90f873c0d88dcacf6bb532e9d648c | https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/Migration.php#L120-L129 |
233,932 | matrozov/yii2-couchbase | src/Migration.php | Migration.buildIndex | public function buildIndex($bucketName, $indexNames)
{
$this->beginProfile($token = " > build index $bucketName ...");
$result = $this->db->buildIndex($bucketName, $indexNames);
$this->endProfile($token);
return $result;
} | php | public function buildIndex($bucketName, $indexNames)
{
$this->beginProfile($token = " > build index $bucketName ...");
$result = $this->db->buildIndex($bucketName, $indexNames);
$this->endProfile($token);
return $result;
} | [
"public",
"function",
"buildIndex",
"(",
"$",
"bucketName",
",",
"$",
"indexNames",
")",
"{",
"$",
"this",
"->",
"beginProfile",
"(",
"$",
"token",
"=",
"\" > build index $bucketName ...\"",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"db",
"->",
"... | Build index.
@param string $bucketName
@param string|string[] $indexNames names of index
@return bool
@throws Exception
@throws \yii\base\InvalidConfigException | [
"Build",
"index",
"."
] | 07c2e9d18cb90f873c0d88dcacf6bb532e9d648c | https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/Migration.php#L210-L219 |
233,933 | baleen/migrations | src/Migration/Repository/AggregateMigrationRepository.php | AggregateMigrationRepository.addRepositories | public function addRepositories($repositories)
{
if (!is_array($repositories) && (!is_object($repositories) || !$repositories instanceof \Traversable)) {
throw new InvalidArgumentException(sprintf(
'Invalid argument provided for $repositories, expecting either an array or Travers... | php | public function addRepositories($repositories)
{
if (!is_array($repositories) && (!is_object($repositories) || !$repositories instanceof \Traversable)) {
throw new InvalidArgumentException(sprintf(
'Invalid argument provided for $repositories, expecting either an array or Travers... | [
"public",
"function",
"addRepositories",
"(",
"$",
"repositories",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"repositories",
")",
"&&",
"(",
"!",
"is_object",
"(",
"$",
"repositories",
")",
"||",
"!",
"$",
"repositories",
"instanceof",
"\\",
"Travers... | Adds a set of repositories to the stack
@param $repositories
@throws InvalidArgumentException | [
"Adds",
"a",
"set",
"of",
"repositories",
"to",
"the",
"stack"
] | cfc8c439858cf4f0d4119af9eb67de493da8d95c | https://github.com/baleen/migrations/blob/cfc8c439858cf4f0d4119af9eb67de493da8d95c/src/Migration/Repository/AggregateMigrationRepository.php#L60-L72 |
233,934 | baleen/migrations | src/Migration/Repository/AggregateMigrationRepository.php | AggregateMigrationRepository.setRepositories | public function setRepositories($repositories)
{
if (!is_array($repositories) && (!is_object($repositories) || !$repositories instanceof \Traversable)) {
throw new InvalidArgumentException(sprintf(
'Invalid argument provided for $repositories, expecting either an array or Travers... | php | public function setRepositories($repositories)
{
if (!is_array($repositories) && (!is_object($repositories) || !$repositories instanceof \Traversable)) {
throw new InvalidArgumentException(sprintf(
'Invalid argument provided for $repositories, expecting either an array or Travers... | [
"public",
"function",
"setRepositories",
"(",
"$",
"repositories",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"repositories",
")",
"&&",
"(",
"!",
"is_object",
"(",
"$",
"repositories",
")",
"||",
"!",
"$",
"repositories",
"instanceof",
"\\",
"Travers... | Resets the stack to the specified repositories
@param array|\Traversable $repositories
@throws InvalidArgumentException | [
"Resets",
"the",
"stack",
"to",
"the",
"specified",
"repositories"
] | cfc8c439858cf4f0d4119af9eb67de493da8d95c | https://github.com/baleen/migrations/blob/cfc8c439858cf4f0d4119af9eb67de493da8d95c/src/Migration/Repository/AggregateMigrationRepository.php#L90-L101 |
233,935 | baleen/migrations | src/Migration/Repository/AggregateMigrationRepository.php | AggregateMigrationRepository.fetchAll | public function fetchAll()
{
$collection = new Collection();
foreach ($this->getRepositories() as $repo) {
/** @var MigrationRepositoryInterface $repo */
$versions = $repo->fetchAll();
$collection->merge($versions);
}
return $collection;
} | php | public function fetchAll()
{
$collection = new Collection();
foreach ($this->getRepositories() as $repo) {
/** @var MigrationRepositoryInterface $repo */
$versions = $repo->fetchAll();
$collection->merge($versions);
}
return $collection;
} | [
"public",
"function",
"fetchAll",
"(",
")",
"{",
"$",
"collection",
"=",
"new",
"Collection",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getRepositories",
"(",
")",
"as",
"$",
"repo",
")",
"{",
"/** @var MigrationRepositoryInterface $repo */",
"$",
"... | Fetches all versions available to all repositories in the stack and returns them as a Linked collection.
The returned collection contains versions groups sequentially into groups that correspond to each sub-repository.
Each of those groups is sorted with the repository's own comparator. Therefore, its strongly recomme... | [
"Fetches",
"all",
"versions",
"available",
"to",
"all",
"repositories",
"in",
"the",
"stack",
"and",
"returns",
"them",
"as",
"a",
"Linked",
"collection",
"."
] | cfc8c439858cf4f0d4119af9eb67de493da8d95c | https://github.com/baleen/migrations/blob/cfc8c439858cf4f0d4119af9eb67de493da8d95c/src/Migration/Repository/AggregateMigrationRepository.php#L112-L122 |
233,936 | baleen/migrations | src/Migration/Repository/AggregateMigrationRepository.php | AggregateMigrationRepository.setMigrationFactory | public function setMigrationFactory(FactoryInterface $factory)
{
foreach ($this->getRepositories() as $repo) {
$repo->setMigrationFactory($factory);
}
} | php | public function setMigrationFactory(FactoryInterface $factory)
{
foreach ($this->getRepositories() as $repo) {
$repo->setMigrationFactory($factory);
}
} | [
"public",
"function",
"setMigrationFactory",
"(",
"FactoryInterface",
"$",
"factory",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getRepositories",
"(",
")",
"as",
"$",
"repo",
")",
"{",
"$",
"repo",
"->",
"setMigrationFactory",
"(",
"$",
"factory",
")",
... | Sets the migration factory for ALL repositories in the stack.
@param FactoryInterface $factory | [
"Sets",
"the",
"migration",
"factory",
"for",
"ALL",
"repositories",
"in",
"the",
"stack",
"."
] | cfc8c439858cf4f0d4119af9eb67de493da8d95c | https://github.com/baleen/migrations/blob/cfc8c439858cf4f0d4119af9eb67de493da8d95c/src/Migration/Repository/AggregateMigrationRepository.php#L129-L134 |
233,937 | budde377/Part | lib/model/page/DefaultPageLibraryImpl.php | DefaultPageLibraryImpl.getPage | public function getPage($id)
{
return isset($this->pages[$id])?$this->pages[$id]:null;
} | php | public function getPage($id)
{
return isset($this->pages[$id])?$this->pages[$id]:null;
} | [
"public",
"function",
"getPage",
"(",
"$",
"id",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"pages",
"[",
"$",
"id",
"]",
")",
"?",
"$",
"this",
"->",
"pages",
"[",
"$",
"id",
"]",
":",
"null",
";",
"}"
] | Will return a default page given an ID
@param string $id The id
@return Page | null Instance matching the ID or NULL on no such page | [
"Will",
"return",
"a",
"default",
"page",
"given",
"an",
"ID"
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/model/page/DefaultPageLibraryImpl.php#L112-L115 |
233,938 | budde377/Part | lib/log/LoggerImpl.php | LoggerImpl.listLog | public function listLog($level = Logger::LOG_LEVEL_ALL, $includeContext = true, $time = 0)
{
$list = $this->logFile->listLog($level, $time);
$result = [];
foreach ($list as $entry) {
if (isset($entry['dumpfile'])) {
if ($includeContext) {
/** ... | php | public function listLog($level = Logger::LOG_LEVEL_ALL, $includeContext = true, $time = 0)
{
$list = $this->logFile->listLog($level, $time);
$result = [];
foreach ($list as $entry) {
if (isset($entry['dumpfile'])) {
if ($includeContext) {
/** ... | [
"public",
"function",
"listLog",
"(",
"$",
"level",
"=",
"Logger",
"::",
"LOG_LEVEL_ALL",
",",
"$",
"includeContext",
"=",
"true",
",",
"$",
"time",
"=",
"0",
")",
"{",
"$",
"list",
"=",
"$",
"this",
"->",
"logFile",
"->",
"listLog",
"(",
"$",
"level... | Use boolean or to combine which loglevels you whish to list.
@param int $level
@param bool $includeContext If false context will not be included in result.
@param int $time The earliest returned entry will be after this value
@return mixed | [
"Use",
"boolean",
"or",
"to",
"combine",
"which",
"loglevels",
"you",
"whish",
"to",
"list",
"."
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/log/LoggerImpl.php#L165-L188 |
233,939 | budde377/Part | lib/log/LoggerImpl.php | LoggerImpl.getContextAt | public function getContextAt($time)
{
$l = $this->listLog(Logger::LOG_LEVEL_ALL, true, $time);
if(!count($l) || $l[0]["time"] != $time){
return null;
}
return $l[0]["context"];
} | php | public function getContextAt($time)
{
$l = $this->listLog(Logger::LOG_LEVEL_ALL, true, $time);
if(!count($l) || $l[0]["time"] != $time){
return null;
}
return $l[0]["context"];
} | [
"public",
"function",
"getContextAt",
"(",
"$",
"time",
")",
"{",
"$",
"l",
"=",
"$",
"this",
"->",
"listLog",
"(",
"Logger",
"::",
"LOG_LEVEL_ALL",
",",
"true",
",",
"$",
"time",
")",
";",
"if",
"(",
"!",
"count",
"(",
"$",
"l",
")",
"||",
"$",
... | Returns the context corresponding to the line given.
@param int $time
@return array | [
"Returns",
"the",
"context",
"corresponding",
"to",
"the",
"line",
"given",
"."
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/log/LoggerImpl.php#L195-L204 |
233,940 | yeephp/yeephp | Yee/Http/Request.php | Request.get | public function get($key = null, $default = null)
{
if (!isset($this->env['yee.request.query_hash'])) {
$output = array();
if (function_exists('mb_parse_str') && !isset($this->env['yee.tests.ignore_multibyte'])) {
mb_parse_str($this->env['QUERY_STRING'], $output);
... | php | public function get($key = null, $default = null)
{
if (!isset($this->env['yee.request.query_hash'])) {
$output = array();
if (function_exists('mb_parse_str') && !isset($this->env['yee.tests.ignore_multibyte'])) {
mb_parse_str($this->env['QUERY_STRING'], $output);
... | [
"public",
"function",
"get",
"(",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"env",
"[",
"'yee.request.query_hash'",
"]",
")",
")",
"{",
"$",
"output",
"=",
"array",
"(",
... | Fetch GET data
This method returns a key-value array of data sent in the HTTP request query string, or
the value of the array key if requested; if the array key does not exist, NULL is returned.
@param string $key
@param mixed $default Default return value when key does not exist
@return array|... | [
"Fetch",
"GET",
"data"
] | 6107f60ceaf0811a6550872bd669580ac282cb1f | https://github.com/yeephp/yeephp/blob/6107f60ceaf0811a6550872bd669580ac282cb1f/Yee/Http/Request.php#L217-L237 |
233,941 | yeephp/yeephp | Yee/Http/Request.php | Request.post | public function post($key = null, $default = null)
{
if (!isset($this->env['yee.input'])) {
throw new \RuntimeException('Missing Yee.input in environment variables');
}
if (!isset($this->env['yee.request.form_hash'])) {
$this->env['yee.request.form_hash'] = array();
... | php | public function post($key = null, $default = null)
{
if (!isset($this->env['yee.input'])) {
throw new \RuntimeException('Missing Yee.input in environment variables');
}
if (!isset($this->env['yee.request.form_hash'])) {
$this->env['yee.request.form_hash'] = array();
... | [
"public",
"function",
"post",
"(",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"env",
"[",
"'yee.input'",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
... | Fetch POST data
This method returns a key-value array of data sent in the HTTP request body, or
the value of a hash key if requested; if the array key does not exist, NULL is returned.
@param string $key
@param mixed $default Default return value when key does not exist
@return array|mixed|null... | [
"Fetch",
"POST",
"data"
] | 6107f60ceaf0811a6550872bd669580ac282cb1f | https://github.com/yeephp/yeephp/blob/6107f60ceaf0811a6550872bd669580ac282cb1f/Yee/Http/Request.php#L250-L278 |
233,942 | budde377/Part | lib/model/user/UserPrivilegesImpl.php | UserPrivilegesImpl.addRootPrivileges | public function addRootPrivileges()
{
if ($this->addRootPrivilegeStatement == null) {
$this->addRootPrivilegeStatement = $this->connection->prepare("
INSERT INTO UserPrivileges (username, rootPrivileges, sitePrivileges, pageId) VALUES (?,1,0,NULL)");
}
$this->addRoo... | php | public function addRootPrivileges()
{
if ($this->addRootPrivilegeStatement == null) {
$this->addRootPrivilegeStatement = $this->connection->prepare("
INSERT INTO UserPrivileges (username, rootPrivileges, sitePrivileges, pageId) VALUES (?,1,0,NULL)");
}
$this->addRoo... | [
"public",
"function",
"addRootPrivileges",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"addRootPrivilegeStatement",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"addRootPrivilegeStatement",
"=",
"$",
"this",
"->",
"connection",
"->",
"prepare",
"(",
"\"\n ... | Will add root privileges
@return void | [
"Will",
"add",
"root",
"privileges"
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/model/user/UserPrivilegesImpl.php#L49-L57 |
233,943 | budde377/Part | lib/model/user/UserPrivilegesImpl.php | UserPrivilegesImpl.addSitePrivileges | public function addSitePrivileges()
{
if ($this->addSitePrivilegeStatement == null) {
$this->addSitePrivilegeStatement = $this->connection->prepare("
INSERT INTO UserPrivileges (username, rootPrivileges, sitePrivileges, pageId) VALUES (?,0,1,NULL)");
}
$this->addSit... | php | public function addSitePrivileges()
{
if ($this->addSitePrivilegeStatement == null) {
$this->addSitePrivilegeStatement = $this->connection->prepare("
INSERT INTO UserPrivileges (username, rootPrivileges, sitePrivileges, pageId) VALUES (?,0,1,NULL)");
}
$this->addSit... | [
"public",
"function",
"addSitePrivileges",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"addSitePrivilegeStatement",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"addSitePrivilegeStatement",
"=",
"$",
"this",
"->",
"connection",
"->",
"prepare",
"(",
"\"\n ... | Will add Site privileges
@return void | [
"Will",
"add",
"Site",
"privileges"
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/model/user/UserPrivilegesImpl.php#L63-L71 |
233,944 | budde377/Part | lib/model/user/UserPrivilegesImpl.php | UserPrivilegesImpl.addPagePrivileges | public function addPagePrivileges(Page $page)
{
if ($this->addPagePrivilegeStatement == null) {
$this->addPagePrivilegeStatement = $this->connection->prepare("
INSERT INTO UserPrivileges (username, rootPrivileges, sitePrivileges, pageId) VALUES (?,0,0,?)");
}
$succe... | php | public function addPagePrivileges(Page $page)
{
if ($this->addPagePrivilegeStatement == null) {
$this->addPagePrivilegeStatement = $this->connection->prepare("
INSERT INTO UserPrivileges (username, rootPrivileges, sitePrivileges, pageId) VALUES (?,0,0,?)");
}
$succe... | [
"public",
"function",
"addPagePrivileges",
"(",
"Page",
"$",
"page",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"addPagePrivilegeStatement",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"addPagePrivilegeStatement",
"=",
"$",
"this",
"->",
"connection",
"->",
"pre... | Will add privileges to given page
@param Page $page
@return void | [
"Will",
"add",
"privileges",
"to",
"given",
"page"
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/model/user/UserPrivilegesImpl.php#L78-L93 |
233,945 | budde377/Part | lib/model/user/UserPrivilegesImpl.php | UserPrivilegesImpl.revokeRootPrivileges | public function revokeRootPrivileges()
{
if ($this->revokeRootStatement == null) {
$this->revokeRootStatement =
$this->connection->prepare("DELETE FROM UserPrivileges WHERE username = ? AND rootPrivileges = 1");
$u = $this->user->getUsername();
$this->revo... | php | public function revokeRootPrivileges()
{
if ($this->revokeRootStatement == null) {
$this->revokeRootStatement =
$this->connection->prepare("DELETE FROM UserPrivileges WHERE username = ? AND rootPrivileges = 1");
$u = $this->user->getUsername();
$this->revo... | [
"public",
"function",
"revokeRootPrivileges",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"revokeRootStatement",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"revokeRootStatement",
"=",
"$",
"this",
"->",
"connection",
"->",
"prepare",
"(",
"\"DELETE FROM UserP... | Will revoke Root privileges
@return void | [
"Will",
"revoke",
"Root",
"privileges"
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/model/user/UserPrivilegesImpl.php#L127-L137 |
233,946 | budde377/Part | lib/model/user/UserPrivilegesImpl.php | UserPrivilegesImpl.revokeSitePrivileges | public function revokeSitePrivileges()
{
if ($this->revokeSiteStatement == null) {
$this->revokeSiteStatement =
$this->connection->prepare("DELETE FROM UserPrivileges WHERE username = ? AND sitePrivileges = 1");
$u = $this->user->getUsername();
$this->revo... | php | public function revokeSitePrivileges()
{
if ($this->revokeSiteStatement == null) {
$this->revokeSiteStatement =
$this->connection->prepare("DELETE FROM UserPrivileges WHERE username = ? AND sitePrivileges = 1");
$u = $this->user->getUsername();
$this->revo... | [
"public",
"function",
"revokeSitePrivileges",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"revokeSiteStatement",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"revokeSiteStatement",
"=",
"$",
"this",
"->",
"connection",
"->",
"prepare",
"(",
"\"DELETE FROM UserP... | Will revoke Site privileges
@return void | [
"Will",
"revoke",
"Site",
"privileges"
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/model/user/UserPrivilegesImpl.php#L143-L153 |
233,947 | budde377/Part | lib/model/user/UserPrivilegesImpl.php | UserPrivilegesImpl.revokePagePrivileges | public function revokePagePrivileges(Page $page)
{
if ($this->revokePageStatement == null) {
$this->revokePageStatement =
$this->connection->prepare("DELETE FROM UserPrivileges WHERE username = ? AND pageId = ?");
}
$this->revokePageStatement->execute(array($this-... | php | public function revokePagePrivileges(Page $page)
{
if ($this->revokePageStatement == null) {
$this->revokePageStatement =
$this->connection->prepare("DELETE FROM UserPrivileges WHERE username = ? AND pageId = ?");
}
$this->revokePageStatement->execute(array($this-... | [
"public",
"function",
"revokePagePrivileges",
"(",
"Page",
"$",
"page",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"revokePageStatement",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"revokePageStatement",
"=",
"$",
"this",
"->",
"connection",
"->",
"prepare",
... | Will revoke privileges from given Page
@param Page $page
@return void | [
"Will",
"revoke",
"privileges",
"from",
"given",
"Page"
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/model/user/UserPrivilegesImpl.php#L160-L168 |
233,948 | budde377/Part | lib/model/user/UserPrivilegesImpl.php | UserPrivilegesImpl.revokeAllPrivileges | public function revokeAllPrivileges()
{
if ($this->revokeAllStatement == null) {
$this->revokeAllStatement =
$this->connection->prepare("DELETE FROM UserPrivileges WHERE username = ?");
$u = $this->user->getUsername();
$this->revokeAllStatement->bindParam(... | php | public function revokeAllPrivileges()
{
if ($this->revokeAllStatement == null) {
$this->revokeAllStatement =
$this->connection->prepare("DELETE FROM UserPrivileges WHERE username = ?");
$u = $this->user->getUsername();
$this->revokeAllStatement->bindParam(... | [
"public",
"function",
"revokeAllPrivileges",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"revokeAllStatement",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"revokeAllStatement",
"=",
"$",
"this",
"->",
"connection",
"->",
"prepare",
"(",
"\"DELETE FROM UserPriv... | This will revoke all privileges
@return void | [
"This",
"will",
"revoke",
"all",
"privileges"
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/model/user/UserPrivilegesImpl.php#L174-L185 |
233,949 | budde377/Part | lib/model/user/UserPrivilegesImpl.php | UserPrivilegesImpl.listPagePrivileges | public function listPagePrivileges(PageOrder $pageOrder = null)
{
$this->initialize();
if ($this->hasRootPrivileges() || $this->hasSitePrivileges()) {
return array();
}
$returnArray = array();
foreach ($this->pagePrivilege as $key => $val) {
if ($page... | php | public function listPagePrivileges(PageOrder $pageOrder = null)
{
$this->initialize();
if ($this->hasRootPrivileges() || $this->hasSitePrivileges()) {
return array();
}
$returnArray = array();
foreach ($this->pagePrivilege as $key => $val) {
if ($page... | [
"public",
"function",
"listPagePrivileges",
"(",
"PageOrder",
"$",
"pageOrder",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"initialize",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"hasRootPrivileges",
"(",
")",
"||",
"$",
"this",
"->",
"hasSitePrivileges"... | Will return an array of strings containing the sites that are under the users control.
If the user has site or root privileges an empty array is returned.
If the user has no privileges an empty array is returned.
@param PageOrder $pageOrder If order is given it will return array containing instances from the PageOrder... | [
"Will",
"return",
"an",
"array",
"of",
"strings",
"containing",
"the",
"sites",
"that",
"are",
"under",
"the",
"users",
"control",
".",
"If",
"the",
"user",
"has",
"site",
"or",
"root",
"privileges",
"an",
"empty",
"array",
"is",
"returned",
".",
"If",
"... | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/model/user/UserPrivilegesImpl.php#L212-L228 |
233,950 | fab2s/NodalFlow | src/NodalFlow.php | NodalFlow.add | public function add(NodeInterface $node)
{
if ($node instanceof BranchNodeInterface) {
// this node is a branch
$childFlow = $node->getPayload();
$this->branchFlowCheck($childFlow);
$childFlow->setParent($this);
}
$node->setCarrier($this);
... | php | public function add(NodeInterface $node)
{
if ($node instanceof BranchNodeInterface) {
// this node is a branch
$childFlow = $node->getPayload();
$this->branchFlowCheck($childFlow);
$childFlow->setParent($this);
}
$node->setCarrier($this);
... | [
"public",
"function",
"add",
"(",
"NodeInterface",
"$",
"node",
")",
"{",
"if",
"(",
"$",
"node",
"instanceof",
"BranchNodeInterface",
")",
"{",
"// this node is a branch",
"$",
"childFlow",
"=",
"$",
"node",
"->",
"getPayload",
"(",
")",
";",
"$",
"this",
... | Adds a Node to the flow
@param NodeInterface $node
@throws NodalFlowException
@return $this | [
"Adds",
"a",
"Node",
"to",
"the",
"flow"
] | da5d458ffea3e6e954d7ee734f938f4be5e46728 | https://github.com/fab2s/NodalFlow/blob/da5d458ffea3e6e954d7ee734f938f4be5e46728/src/NodalFlow.php#L61-L78 |
233,951 | fab2s/NodalFlow | src/NodalFlow.php | NodalFlow.addPayload | public function addPayload(callable $payload, $isAReturningVal, $isATraversable = false)
{
$node = PayloadNodeFactory::create($payload, $isAReturningVal, $isATraversable);
$this->add($node);
return $this;
} | php | public function addPayload(callable $payload, $isAReturningVal, $isATraversable = false)
{
$node = PayloadNodeFactory::create($payload, $isAReturningVal, $isATraversable);
$this->add($node);
return $this;
} | [
"public",
"function",
"addPayload",
"(",
"callable",
"$",
"payload",
",",
"$",
"isAReturningVal",
",",
"$",
"isATraversable",
"=",
"false",
")",
"{",
"$",
"node",
"=",
"PayloadNodeFactory",
"::",
"create",
"(",
"$",
"payload",
",",
"$",
"isAReturningVal",
",... | Adds a Payload Node to the Flow
@param callable $payload
@param mixed $isAReturningVal
@param mixed $isATraversable
@throws NodalFlowException
@return $this | [
"Adds",
"a",
"Payload",
"Node",
"to",
"the",
"Flow"
] | da5d458ffea3e6e954d7ee734f938f4be5e46728 | https://github.com/fab2s/NodalFlow/blob/da5d458ffea3e6e954d7ee734f938f4be5e46728/src/NodalFlow.php#L91-L98 |
233,952 | fab2s/NodalFlow | src/NodalFlow.php | NodalFlow.replace | public function replace($nodeIdx, NodeInterface $node)
{
if (!isset($this->nodes[$nodeIdx])) {
throw new NodalFlowException('Argument 1 should be a valid index in nodes', 1, null, [
'nodeIdx' => $nodeIdx,
'node' => get_class($node),
]);
}
... | php | public function replace($nodeIdx, NodeInterface $node)
{
if (!isset($this->nodes[$nodeIdx])) {
throw new NodalFlowException('Argument 1 should be a valid index in nodes', 1, null, [
'nodeIdx' => $nodeIdx,
'node' => get_class($node),
]);
}
... | [
"public",
"function",
"replace",
"(",
"$",
"nodeIdx",
",",
"NodeInterface",
"$",
"node",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"nodes",
"[",
"$",
"nodeIdx",
"]",
")",
")",
"{",
"throw",
"new",
"NodalFlowException",
"(",
"'Argument ... | Replaces a node with another one
@param int $nodeIdx
@param NodeInterface $node
@throws NodalFlowException
@return $this | [
"Replaces",
"a",
"node",
"with",
"another",
"one"
] | da5d458ffea3e6e954d7ee734f938f4be5e46728 | https://github.com/fab2s/NodalFlow/blob/da5d458ffea3e6e954d7ee734f938f4be5e46728/src/NodalFlow.php#L110-L124 |
233,953 | fab2s/NodalFlow | src/NodalFlow.php | NodalFlow.exec | public function exec($param = null)
{
try {
$result = $this->rewind()
->flowStart()
->recurse($param);
// set flowStatus to make sure that we have the proper
// value in flowEnd even when overridden without (or when
// improper... | php | public function exec($param = null)
{
try {
$result = $this->rewind()
->flowStart()
->recurse($param);
// set flowStatus to make sure that we have the proper
// value in flowEnd even when overridden without (or when
// improper... | [
"public",
"function",
"exec",
"(",
"$",
"param",
"=",
"null",
")",
"{",
"try",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"rewind",
"(",
")",
"->",
"flowStart",
"(",
")",
"->",
"recurse",
"(",
"$",
"param",
")",
";",
"// set flowStatus to make sure th... | Execute the flow
@param null|mixed $param The eventual init argument to the first node
or, in case of a branch, the last relevant
argument from upstream Flow
@throws NodalFlowException
@return mixed the last result of the
last returning value node | [
"Execute",
"the",
"flow"
] | da5d458ffea3e6e954d7ee734f938f4be5e46728 | https://github.com/fab2s/NodalFlow/blob/da5d458ffea3e6e954d7ee734f938f4be5e46728/src/NodalFlow.php#L161-L189 |
233,954 | fab2s/NodalFlow | src/NodalFlow.php | NodalFlow.rewind | public function rewind()
{
$this->nodeCount = count($this->nodes);
$this->lastIdx = $this->nodeCount - 1;
$this->break = false;
$this->continue = false;
$this->interruptNodeId = null;
return $this;
} | php | public function rewind()
{
$this->nodeCount = count($this->nodes);
$this->lastIdx = $this->nodeCount - 1;
$this->break = false;
$this->continue = false;
$this->interruptNodeId = null;
return $this;
} | [
"public",
"function",
"rewind",
"(",
")",
"{",
"$",
"this",
"->",
"nodeCount",
"=",
"count",
"(",
"$",
"this",
"->",
"nodes",
")",
";",
"$",
"this",
"->",
"lastIdx",
"=",
"$",
"this",
"->",
"nodeCount",
"-",
"1",
";",
"$",
"this",
"->",
"break",
... | Rewinds the Flow
@return $this | [
"Rewinds",
"the",
"Flow"
] | da5d458ffea3e6e954d7ee734f938f4be5e46728 | https://github.com/fab2s/NodalFlow/blob/da5d458ffea3e6e954d7ee734f938f4be5e46728/src/NodalFlow.php#L196-L205 |
233,955 | fab2s/NodalFlow | src/NodalFlow.php | NodalFlow.flowStart | protected function flowStart()
{
$this->flowMap->incrementFlow('num_exec')->flowStart();
$this->listActiveEvent(!$this->hasParent())->triggerEvent(FlowEvent::FLOW_START);
// flow started status kicks in after Event start to hint eventual children
// this way, root flow is only runnin... | php | protected function flowStart()
{
$this->flowMap->incrementFlow('num_exec')->flowStart();
$this->listActiveEvent(!$this->hasParent())->triggerEvent(FlowEvent::FLOW_START);
// flow started status kicks in after Event start to hint eventual children
// this way, root flow is only runnin... | [
"protected",
"function",
"flowStart",
"(",
")",
"{",
"$",
"this",
"->",
"flowMap",
"->",
"incrementFlow",
"(",
"'num_exec'",
")",
"->",
"flowStart",
"(",
")",
";",
"$",
"this",
"->",
"listActiveEvent",
"(",
"!",
"$",
"this",
"->",
"hasParent",
"(",
")",
... | Triggered just before the flow starts
@throws NodalFlowException
@return $this | [
"Triggered",
"just",
"before",
"the",
"flow",
"starts"
] | da5d458ffea3e6e954d7ee734f938f4be5e46728 | https://github.com/fab2s/NodalFlow/blob/da5d458ffea3e6e954d7ee734f938f4be5e46728/src/NodalFlow.php#L235-L245 |
233,956 | fab2s/NodalFlow | src/NodalFlow.php | NodalFlow.recurse | protected function recurse($param = null, $nodeIdx = 0)
{
while ($nodeIdx <= $this->lastIdx) {
$node = $this->nodes[$nodeIdx];
$this->nodeIdx = $nodeIdx;
$nodeStats = &$this->flowMap->getNodeStat($node->getId());
$returnVal = $node->isReturnin... | php | protected function recurse($param = null, $nodeIdx = 0)
{
while ($nodeIdx <= $this->lastIdx) {
$node = $this->nodes[$nodeIdx];
$this->nodeIdx = $nodeIdx;
$nodeStats = &$this->flowMap->getNodeStat($node->getId());
$returnVal = $node->isReturnin... | [
"protected",
"function",
"recurse",
"(",
"$",
"param",
"=",
"null",
",",
"$",
"nodeIdx",
"=",
"0",
")",
"{",
"while",
"(",
"$",
"nodeIdx",
"<=",
"$",
"this",
"->",
"lastIdx",
")",
"{",
"$",
"node",
"=",
"$",
"this",
"->",
"nodes",
"[",
"$",
"node... | Recurse over nodes which may as well be Flows and Traversable ...
Welcome to the abysses of recursion or iter-recursion ^^
`recurse` perform kind of an hybrid recursion as the Flow
is effectively iterating and recurring over its Nodes,
which may as well be seen as over itself
Iterating tends to limit the amount of re... | [
"Recurse",
"over",
"nodes",
"which",
"may",
"as",
"well",
"be",
"Flows",
"and",
"Traversable",
"...",
"Welcome",
"to",
"the",
"abysses",
"of",
"recursion",
"or",
"iter",
"-",
"recursion",
"^^"
] | da5d458ffea3e6e954d7ee734f938f4be5e46728 | https://github.com/fab2s/NodalFlow/blob/da5d458ffea3e6e954d7ee734f938f4be5e46728/src/NodalFlow.php#L290-L369 |
233,957 | skrz/meta | gen-src/Google/Protobuf/Compiler/CodeGeneratorResponse/Meta/FileMeta.php | FileMeta.create | public static function create()
{
switch (func_num_args()) {
case 0:
return new File();
case 1:
return new File(func_get_arg(0));
case 2:
return new File(func_get_arg(0), func_get_arg(1));
case 3:
return new File(func_get_arg(0), func_get_arg(1), func_get_arg(2));
case 4:
return ne... | php | public static function create()
{
switch (func_num_args()) {
case 0:
return new File();
case 1:
return new File(func_get_arg(0));
case 2:
return new File(func_get_arg(0), func_get_arg(1));
case 3:
return new File(func_get_arg(0), func_get_arg(1), func_get_arg(2));
case 4:
return ne... | [
"public",
"static",
"function",
"create",
"(",
")",
"{",
"switch",
"(",
"func_num_args",
"(",
")",
")",
"{",
"case",
"0",
":",
"return",
"new",
"File",
"(",
")",
";",
"case",
"1",
":",
"return",
"new",
"File",
"(",
"func_get_arg",
"(",
"0",
")",
")... | Creates new instance of \Google\Protobuf\Compiler\CodeGeneratorResponse\File
@throws \InvalidArgumentException
@return File | [
"Creates",
"new",
"instance",
"of",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Compiler",
"\\",
"CodeGeneratorResponse",
"\\",
"File"
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Compiler/CodeGeneratorResponse/Meta/FileMeta.php#L59-L83 |
233,958 | skrz/meta | gen-src/Google/Protobuf/Compiler/CodeGeneratorResponse/Meta/FileMeta.php | FileMeta.reset | public static function reset($object)
{
if (!($object instanceof File)) {
throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\Compiler\CodeGeneratorResponse\File.');
}
$object->name = NULL;
$object->insertionPoint = NULL;
$object->content = NULL;
} | php | public static function reset($object)
{
if (!($object instanceof File)) {
throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\Compiler\CodeGeneratorResponse\File.');
}
$object->name = NULL;
$object->insertionPoint = NULL;
$object->content = NULL;
} | [
"public",
"static",
"function",
"reset",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"object",
"instanceof",
"File",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'You have to pass object of class Google\\Protobuf\\Compiler\\Code... | Resets properties of \Google\Protobuf\Compiler\CodeGeneratorResponse\File to default values
@param File $object
@throws \InvalidArgumentException
@return void | [
"Resets",
"properties",
"of",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Compiler",
"\\",
"CodeGeneratorResponse",
"\\",
"File",
"to",
"default",
"values"
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Compiler/CodeGeneratorResponse/Meta/FileMeta.php#L96-L104 |
233,959 | skrz/meta | gen-src/Google/Protobuf/Compiler/CodeGeneratorResponse/Meta/FileMeta.php | FileMeta.hash | public static function hash($object, $algoOrCtx = 'md5', $raw = FALSE)
{
if (is_string($algoOrCtx)) {
$ctx = hash_init($algoOrCtx);
} else {
$ctx = $algoOrCtx;
}
if (isset($object->name)) {
hash_update($ctx, 'name');
hash_update($ctx, (string)$object->name);
}
if (isset($object->insertionPoin... | php | public static function hash($object, $algoOrCtx = 'md5', $raw = FALSE)
{
if (is_string($algoOrCtx)) {
$ctx = hash_init($algoOrCtx);
} else {
$ctx = $algoOrCtx;
}
if (isset($object->name)) {
hash_update($ctx, 'name');
hash_update($ctx, (string)$object->name);
}
if (isset($object->insertionPoin... | [
"public",
"static",
"function",
"hash",
"(",
"$",
"object",
",",
"$",
"algoOrCtx",
"=",
"'md5'",
",",
"$",
"raw",
"=",
"FALSE",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"algoOrCtx",
")",
")",
"{",
"$",
"ctx",
"=",
"hash_init",
"(",
"$",
"algoOrC... | Computes hash of \Google\Protobuf\Compiler\CodeGeneratorResponse\File
@param object $object
@param string|resource $algoOrCtx
@param bool $raw
@return string|void | [
"Computes",
"hash",
"of",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Compiler",
"\\",
"CodeGeneratorResponse",
"\\",
"File"
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Compiler/CodeGeneratorResponse/Meta/FileMeta.php#L116-L144 |
233,960 | skrz/meta | gen-src/Google/Protobuf/Compiler/CodeGeneratorResponse/Meta/FileMeta.php | FileMeta.toProtobuf | public static function toProtobuf($object, $filter = NULL)
{
$output = '';
if (isset($object->name) && ($filter === null || isset($filter['name']))) {
$output .= "\x0a";
$output .= Binary::encodeVarint(strlen($object->name));
$output .= $object->name;
}
if (isset($object->insertionPoint) && ($filter... | php | public static function toProtobuf($object, $filter = NULL)
{
$output = '';
if (isset($object->name) && ($filter === null || isset($filter['name']))) {
$output .= "\x0a";
$output .= Binary::encodeVarint(strlen($object->name));
$output .= $object->name;
}
if (isset($object->insertionPoint) && ($filter... | [
"public",
"static",
"function",
"toProtobuf",
"(",
"$",
"object",
",",
"$",
"filter",
"=",
"NULL",
")",
"{",
"$",
"output",
"=",
"''",
";",
"if",
"(",
"isset",
"(",
"$",
"object",
"->",
"name",
")",
"&&",
"(",
"$",
"filter",
"===",
"null",
"||",
... | Serialized \Google\Protobuf\Compiler\CodeGeneratorResponse\File to Protocol Buffers message.
@param File $object
@param array $filter
@throws \Exception
@return string | [
"Serialized",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Compiler",
"\\",
"CodeGeneratorResponse",
"\\",
"File",
"to",
"Protocol",
"Buffers",
"message",
"."
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Compiler/CodeGeneratorResponse/Meta/FileMeta.php#L253-L276 |
233,961 | skrz/meta | gen-src/Google/Protobuf/Meta/FileDescriptorProtoMeta.php | FileDescriptorProtoMeta.create | public static function create()
{
switch (func_num_args()) {
case 0:
return new FileDescriptorProto();
case 1:
return new FileDescriptorProto(func_get_arg(0));
case 2:
return new FileDescriptorProto(func_get_arg(0), func_get_arg(1));
case 3:
return new FileDescriptorProto(func_get_arg(0),... | php | public static function create()
{
switch (func_num_args()) {
case 0:
return new FileDescriptorProto();
case 1:
return new FileDescriptorProto(func_get_arg(0));
case 2:
return new FileDescriptorProto(func_get_arg(0), func_get_arg(1));
case 3:
return new FileDescriptorProto(func_get_arg(0),... | [
"public",
"static",
"function",
"create",
"(",
")",
"{",
"switch",
"(",
"func_num_args",
"(",
")",
")",
"{",
"case",
"0",
":",
"return",
"new",
"FileDescriptorProto",
"(",
")",
";",
"case",
"1",
":",
"return",
"new",
"FileDescriptorProto",
"(",
"func_get_a... | Creates new instance of \Google\Protobuf\FileDescriptorProto
@throws \InvalidArgumentException
@return FileDescriptorProto | [
"Creates",
"new",
"instance",
"of",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"FileDescriptorProto"
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Meta/FileDescriptorProtoMeta.php#L68-L92 |
233,962 | skrz/meta | gen-src/Google/Protobuf/Meta/FileDescriptorProtoMeta.php | FileDescriptorProtoMeta.reset | public static function reset($object)
{
if (!($object instanceof FileDescriptorProto)) {
throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\FileDescriptorProto.');
}
$object->name = NULL;
$object->package = NULL;
$object->dependency = NULL;
$object->publicDependency = ... | php | public static function reset($object)
{
if (!($object instanceof FileDescriptorProto)) {
throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\FileDescriptorProto.');
}
$object->name = NULL;
$object->package = NULL;
$object->dependency = NULL;
$object->publicDependency = ... | [
"public",
"static",
"function",
"reset",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"object",
"instanceof",
"FileDescriptorProto",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'You have to pass object of class Google\\Protobuf\... | Resets properties of \Google\Protobuf\FileDescriptorProto to default values
@param FileDescriptorProto $object
@throws \InvalidArgumentException
@return void | [
"Resets",
"properties",
"of",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"FileDescriptorProto",
"to",
"default",
"values"
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Meta/FileDescriptorProtoMeta.php#L105-L122 |
233,963 | comodojo/xmlrpc | src/Comodojo/Xmlrpc/XmlrpcEncoder.php | XmlrpcEncoder.setValueType | final public function setValueType(&$value, $type) {
if ( empty($value) || !in_array(strtolower($type), array("base64", "datetime", "cdata")) ) throw new XmlrpcException("Invalid value type");
$this->special_types[$value] = strtolower($type);
return $this;
} | php | final public function setValueType(&$value, $type) {
if ( empty($value) || !in_array(strtolower($type), array("base64", "datetime", "cdata")) ) throw new XmlrpcException("Invalid value type");
$this->special_types[$value] = strtolower($type);
return $this;
} | [
"final",
"public",
"function",
"setValueType",
"(",
"&",
"$",
"value",
",",
"$",
"type",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"value",
")",
"||",
"!",
"in_array",
"(",
"strtolower",
"(",
"$",
"type",
")",
",",
"array",
"(",
"\"base64\"",
",",
"\... | Handle base64 and datetime values
@param mixed $value The referenced value
@param string $type The type of value
@return \Comodojo\Xmlrpc\XmlrpcEncoder | [
"Handle",
"base64",
"and",
"datetime",
"values"
] | 2257167ce94ab657608c2062d485896f95f935a3 | https://github.com/comodojo/xmlrpc/blob/2257167ce94ab657608c2062d485896f95f935a3/src/Comodojo/Xmlrpc/XmlrpcEncoder.php#L96-L104 |
233,964 | comodojo/xmlrpc | src/Comodojo/Xmlrpc/XmlrpcEncoder.php | XmlrpcEncoder.encodeResponse | public function encodeResponse($data) {
$xml = new XMLWriter();
$xml->openMemory();
$xml->setIndent(false);
$xml->startDocument('1.0', $this->encoding);
$xml->startElement("methodResponse");
$xml->startElement("params");
$xml->startElement("pa... | php | public function encodeResponse($data) {
$xml = new XMLWriter();
$xml->openMemory();
$xml->setIndent(false);
$xml->startDocument('1.0', $this->encoding);
$xml->startElement("methodResponse");
$xml->startElement("params");
$xml->startElement("pa... | [
"public",
"function",
"encodeResponse",
"(",
"$",
"data",
")",
"{",
"$",
"xml",
"=",
"new",
"XMLWriter",
"(",
")",
";",
"$",
"xml",
"->",
"openMemory",
"(",
")",
";",
"$",
"xml",
"->",
"setIndent",
"(",
"false",
")",
";",
"$",
"xml",
"->",
"startDo... | Encode an xmlrpc response
It expects a scalar, array or NULL as $data and will try to encode it as a valid xmlrpc response.
@param mixed $data
@return string xmlrpc formatted response
@throws \Comodojo\Exception\XmlrpcException
@throws \Exception | [
"Encode",
"an",
"xmlrpc",
"response"
] | 2257167ce94ab657608c2062d485896f95f935a3 | https://github.com/comodojo/xmlrpc/blob/2257167ce94ab657608c2062d485896f95f935a3/src/Comodojo/Xmlrpc/XmlrpcEncoder.php#L133-L177 |
233,965 | comodojo/xmlrpc | src/Comodojo/Xmlrpc/XmlrpcEncoder.php | XmlrpcEncoder.encodeCall | public function encodeCall($method, $data = array()) {
$xml = new XMLWriter();
$xml->openMemory();
$xml->setIndent(false);
$xml->startDocument('1.0', $this->encoding);
$xml->startElement("methodCall");
$xml->writeElement("methodName", trim($method));
... | php | public function encodeCall($method, $data = array()) {
$xml = new XMLWriter();
$xml->openMemory();
$xml->setIndent(false);
$xml->startDocument('1.0', $this->encoding);
$xml->startElement("methodCall");
$xml->writeElement("methodName", trim($method));
... | [
"public",
"function",
"encodeCall",
"(",
"$",
"method",
",",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"$",
"xml",
"=",
"new",
"XMLWriter",
"(",
")",
";",
"$",
"xml",
"->",
"openMemory",
"(",
")",
";",
"$",
"xml",
"->",
"setIndent",
"(",
"fa... | Encode an xmlrpc call
It expects an array of values as $data and will try to encode it as a valid xmlrpc call.
@param string $method
@param array $data
@return string xmlrpc formatted call
@throws \Comodojo\Exception\XmlrpcException
@throws \Exception | [
"Encode",
"an",
"xmlrpc",
"call"
] | 2257167ce94ab657608c2062d485896f95f935a3 | https://github.com/comodojo/xmlrpc/blob/2257167ce94ab657608c2062d485896f95f935a3/src/Comodojo/Xmlrpc/XmlrpcEncoder.php#L192-L238 |
233,966 | comodojo/xmlrpc | src/Comodojo/Xmlrpc/XmlrpcEncoder.php | XmlrpcEncoder.encodeMulticall | public function encodeMulticall($data) {
$packed_requests = array();
foreach ( $data as $methodName => $params ) {
if ( is_int($methodName) && count($params) == 2 ) {
array_push($packed_requests, array(
"methodName" => $params[0],
... | php | public function encodeMulticall($data) {
$packed_requests = array();
foreach ( $data as $methodName => $params ) {
if ( is_int($methodName) && count($params) == 2 ) {
array_push($packed_requests, array(
"methodName" => $params[0],
... | [
"public",
"function",
"encodeMulticall",
"(",
"$",
"data",
")",
"{",
"$",
"packed_requests",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"methodName",
"=>",
"$",
"params",
")",
"{",
"if",
"(",
"is_int",
"(",
"$",
"methodName",
... | Encode an xmlrpc multicall
It expects in input a key->val array where key
represent the method and val the parameters.
@param array $data
@return string xmlrpc formatted call
@throws \Comodojo\Exception\XmlrpcException
@throws \Exception | [
"Encode",
"an",
"xmlrpc",
"multicall"
] | 2257167ce94ab657608c2062d485896f95f935a3 | https://github.com/comodojo/xmlrpc/blob/2257167ce94ab657608c2062d485896f95f935a3/src/Comodojo/Xmlrpc/XmlrpcEncoder.php#L253-L279 |
233,967 | comodojo/xmlrpc | src/Comodojo/Xmlrpc/XmlrpcEncoder.php | XmlrpcEncoder.encodeError | public function encodeError($error_code, $error_message) {
$payload = '<?xml version="1.0" encoding="'.$this->encoding.'"?>';
$payload .= "<methodResponse>";
$payload .= $this->encodeFault($error_code, $error_message);
$payload .= "</methodResponse>";
return $payload;
} | php | public function encodeError($error_code, $error_message) {
$payload = '<?xml version="1.0" encoding="'.$this->encoding.'"?>';
$payload .= "<methodResponse>";
$payload .= $this->encodeFault($error_code, $error_message);
$payload .= "</methodResponse>";
return $payload;
} | [
"public",
"function",
"encodeError",
"(",
"$",
"error_code",
",",
"$",
"error_message",
")",
"{",
"$",
"payload",
"=",
"'<?xml version=\"1.0\" encoding=\"'",
".",
"$",
"this",
"->",
"encoding",
".",
"'\"?>'",
";",
"$",
"payload",
".=",
"\"<methodResponse>\"",
";... | Encode an xmlrpc error
@param int $error_code
@param string $error_message
@return string xmlrpc formatted error | [
"Encode",
"an",
"xmlrpc",
"error"
] | 2257167ce94ab657608c2062d485896f95f935a3 | https://github.com/comodojo/xmlrpc/blob/2257167ce94ab657608c2062d485896f95f935a3/src/Comodojo/Xmlrpc/XmlrpcEncoder.php#L289-L298 |
233,968 | matrozov/yii2-couchbase | src/ActiveRecord.php | ActiveRecord.toArrayInternal | private function toArrayInternal($data)
{
if (is_array($data)) {
foreach ($data as $key => $value) {
if (is_array($value)) {
$data[$key] = $this->toArrayInternal($value);
}
if (is_object($value)) {
$data[$ke... | php | private function toArrayInternal($data)
{
if (is_array($data)) {
foreach ($data as $key => $value) {
if (is_array($value)) {
$data[$key] = $this->toArrayInternal($value);
}
if (is_object($value)) {
$data[$ke... | [
"private",
"function",
"toArrayInternal",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"data",
")",
")",
"{",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
"... | Converts data to array recursively, converting Couchbase JSON objects to readable values.
@param mixed $data the data to be converted into an array.
@return array the array representation of the data. | [
"Converts",
"data",
"to",
"array",
"recursively",
"converting",
"Couchbase",
"JSON",
"objects",
"to",
"readable",
"values",
"."
] | 07c2e9d18cb90f873c0d88dcacf6bb532e9d648c | https://github.com/matrozov/yii2-couchbase/blob/07c2e9d18cb90f873c0d88dcacf6bb532e9d648c/src/ActiveRecord.php#L478-L499 |
233,969 | Fuhrmann/larageo-plugin | src/Fuhrmann/LarageoPlugin/LarageoPlugin.php | LarageoPlugin.getInfo | public function getInfo($ip = null)
{
if ($ip == null) {
$ip = $this->getIpAdress();
}
$url = str_replace('{IP}', $ip, $this->api_adress);
$hex = $this->ipToHex($ip);
$me = $this;
// Check if the IP is in the cache
if (Cache::has($hex)) {
... | php | public function getInfo($ip = null)
{
if ($ip == null) {
$ip = $this->getIpAdress();
}
$url = str_replace('{IP}', $ip, $this->api_adress);
$hex = $this->ipToHex($ip);
$me = $this;
// Check if the IP is in the cache
if (Cache::has($hex)) {
... | [
"public",
"function",
"getInfo",
"(",
"$",
"ip",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"ip",
"==",
"null",
")",
"{",
"$",
"ip",
"=",
"$",
"this",
"->",
"getIpAdress",
"(",
")",
";",
"}",
"$",
"url",
"=",
"str_replace",
"(",
"'{IP}'",
",",
"$",... | Return all the information in an array.
@param $ip IP to search for
@return array Info from the IP parameter | [
"Return",
"all",
"the",
"information",
"in",
"an",
"array",
"."
] | b45374b971253aa553b4b4429581bba886237671 | https://github.com/Fuhrmann/larageo-plugin/blob/b45374b971253aa553b4b4429581bba886237671/src/Fuhrmann/LarageoPlugin/LarageoPlugin.php#L29-L51 |
233,970 | Fuhrmann/larageo-plugin | src/Fuhrmann/LarageoPlugin/LarageoPlugin.php | LarageoPlugin.getIpAdress | public function getIpAdress()
{
$ip_keys = ['HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR'];
foreach ($ip_keys as $key) {
if (array_key_exists($key, $_SERVER) === true) {
fore... | php | public function getIpAdress()
{
$ip_keys = ['HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR'];
foreach ($ip_keys as $key) {
if (array_key_exists($key, $_SERVER) === true) {
fore... | [
"public",
"function",
"getIpAdress",
"(",
")",
"{",
"$",
"ip_keys",
"=",
"[",
"'HTTP_CLIENT_IP'",
",",
"'HTTP_X_FORWARDED_FOR'",
",",
"'HTTP_X_FORWARDED'",
",",
"'HTTP_X_CLUSTER_CLIENT_IP'",
",",
"'HTTP_FORWARDED_FOR'",
",",
"'HTTP_FORWARDED'",
",",
"'REMOTE_ADDR'",
"]"... | Get the IP adress.
@link https://gist.github.com/cballou/2201933
@return bool|string | [
"Get",
"the",
"IP",
"adress",
"."
] | b45374b971253aa553b4b4429581bba886237671 | https://github.com/Fuhrmann/larageo-plugin/blob/b45374b971253aa553b4b4429581bba886237671/src/Fuhrmann/LarageoPlugin/LarageoPlugin.php#L60-L75 |
233,971 | Fuhrmann/larageo-plugin | src/Fuhrmann/LarageoPlugin/LarageoPlugin.php | LarageoPlugin.fetchInfo | public function fetchInfo($url)
{
$response = null;
if (function_exists('curl_init')) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt... | php | public function fetchInfo($url)
{
$response = null;
if (function_exists('curl_init')) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt... | [
"public",
"function",
"fetchInfo",
"(",
"$",
"url",
")",
"{",
"$",
"response",
"=",
"null",
";",
"if",
"(",
"function_exists",
"(",
"'curl_init'",
")",
")",
"{",
"$",
"ch",
"=",
"curl_init",
"(",
")",
";",
"curl_setopt",
"(",
"$",
"ch",
",",
"CURLOPT... | Fetch the info from IP using CURL or file_get_contents.
@param $url
@throws \Exception
@return mixed | [
"Fetch",
"the",
"info",
"from",
"IP",
"using",
"CURL",
"or",
"file_get_contents",
"."
] | b45374b971253aa553b4b4429581bba886237671 | https://github.com/Fuhrmann/larageo-plugin/blob/b45374b971253aa553b4b4429581bba886237671/src/Fuhrmann/LarageoPlugin/LarageoPlugin.php#L99-L128 |
233,972 | vcarreira/wordsapi | src/Word.php | Word.make | private function make($verb, $fetchDetails = null)
{
if (isset($this->cache[$verb])) {
return $this->cache[$verb];
}
$data = $this->service->fetch(
$this->word,
$verb,
is_null($fetchDetails) ? $this->prefetchDetails : (bool) $fetchDetails
... | php | private function make($verb, $fetchDetails = null)
{
if (isset($this->cache[$verb])) {
return $this->cache[$verb];
}
$data = $this->service->fetch(
$this->word,
$verb,
is_null($fetchDetails) ? $this->prefetchDetails : (bool) $fetchDetails
... | [
"private",
"function",
"make",
"(",
"$",
"verb",
",",
"$",
"fetchDetails",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"verb",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"cache",
"[",
"$",
"verb",
... | Checks if the result is cached. Otherwise
it invokes the service method to retrieve the results.
Results are cached on a word basis to optimize the number
of API calls. | [
"Checks",
"if",
"the",
"result",
"is",
"cached",
".",
"Otherwise",
"it",
"invokes",
"the",
"service",
"method",
"to",
"retrieve",
"the",
"results",
".",
"Results",
"are",
"cached",
"on",
"a",
"word",
"basis",
"to",
"optimize",
"the",
"number",
"of",
"API",... | 60ca55823ffdf8c422e6bbed614161dc8d6af394 | https://github.com/vcarreira/wordsapi/blob/60ca55823ffdf8c422e6bbed614161dc8d6af394/src/Word.php#L326-L344 |
233,973 | louvian/pururin-crawler | src/Pururin/PururinCrawler.php | PururinCrawler.getCover | private function getCover()
{
$get = new Cover($this);
$get->action();
$get->build();
$this->buildContext($this->result = $get->get(), "cover");
$this->tmpContainer['content_crawler'] = new Content($this);
$this->tmpContainer['content_crawler']->setOffsetPoint($this->offset);
} | php | private function getCover()
{
$get = new Cover($this);
$get->action();
$get->build();
$this->buildContext($this->result = $get->get(), "cover");
$this->tmpContainer['content_crawler'] = new Content($this);
$this->tmpContainer['content_crawler']->setOffsetPoint($this->offset);
} | [
"private",
"function",
"getCover",
"(",
")",
"{",
"$",
"get",
"=",
"new",
"Cover",
"(",
"$",
"this",
")",
";",
"$",
"get",
"->",
"action",
"(",
")",
";",
"$",
"get",
"->",
"build",
"(",
")",
";",
"$",
"this",
"->",
"buildContext",
"(",
"$",
"th... | Get gallery cover. | [
"Get",
"gallery",
"cover",
"."
] | 1a8e5d606fc9e0f494aaceaf192d08265e8b8d26 | https://github.com/louvian/pururin-crawler/blob/1a8e5d606fc9e0f494aaceaf192d08265e8b8d26/src/Pururin/PururinCrawler.php#L141-L149 |
233,974 | wardrobecms/core-archived | src/Wardrobe/Core/WardrobeServiceProvider.php | WardrobeServiceProvider.bindRepositories | protected function bindRepositories()
{
$this->app->singleton('Wardrobe\Core\Repositories\PostRepositoryInterface', 'Wardrobe\Core\Repositories\DbPostRepository');
$this->app->singleton('Wardrobe\Core\Repositories\UserRepositoryInterface', 'Wardrobe\Core\Repositories\DbUserRepository');
$this->app->bind(... | php | protected function bindRepositories()
{
$this->app->singleton('Wardrobe\Core\Repositories\PostRepositoryInterface', 'Wardrobe\Core\Repositories\DbPostRepository');
$this->app->singleton('Wardrobe\Core\Repositories\UserRepositoryInterface', 'Wardrobe\Core\Repositories\DbUserRepository');
$this->app->bind(... | [
"protected",
"function",
"bindRepositories",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"'Wardrobe\\Core\\Repositories\\PostRepositoryInterface'",
",",
"'Wardrobe\\Core\\Repositories\\DbPostRepository'",
")",
";",
"$",
"this",
"->",
"app",
"->",
"s... | Bind repositories.
@return void | [
"Bind",
"repositories",
"."
] | 5c0836ea2e6885a428c852dc392073f2a2541c71 | https://github.com/wardrobecms/core-archived/blob/5c0836ea2e6885a428c852dc392073f2a2541c71/src/Wardrobe/Core/WardrobeServiceProvider.php#L37-L47 |
233,975 | wardrobecms/core-archived | src/Wardrobe/Core/WardrobeServiceProvider.php | WardrobeServiceProvider.setConnection | public function setConnection()
{
$connection = Config::get('core::database.default');
if ($connection !== 'default')
{
$wardrobeConfig = Config::get('core::database.connections.'.$connection);
}
else
{
$connection = Config::get('database.default');
$wardrobeConfig = Config::get('datab... | php | public function setConnection()
{
$connection = Config::get('core::database.default');
if ($connection !== 'default')
{
$wardrobeConfig = Config::get('core::database.connections.'.$connection);
}
else
{
$connection = Config::get('database.default');
$wardrobeConfig = Config::get('datab... | [
"public",
"function",
"setConnection",
"(",
")",
"{",
"$",
"connection",
"=",
"Config",
"::",
"get",
"(",
"'core::database.default'",
")",
";",
"if",
"(",
"$",
"connection",
"!==",
"'default'",
")",
"{",
"$",
"wardrobeConfig",
"=",
"Config",
"::",
"get",
"... | Set up the db connection
@return void | [
"Set",
"up",
"the",
"db",
"connection"
] | 5c0836ea2e6885a428c852dc392073f2a2541c71 | https://github.com/wardrobecms/core-archived/blob/5c0836ea2e6885a428c852dc392073f2a2541c71/src/Wardrobe/Core/WardrobeServiceProvider.php#L91-L106 |
233,976 | skrz/meta | gen-src/Google/Protobuf/Meta/EnumDescriptorProtoMeta.php | EnumDescriptorProtoMeta.create | public static function create()
{
switch (func_num_args()) {
case 0:
return new EnumDescriptorProto();
case 1:
return new EnumDescriptorProto(func_get_arg(0));
case 2:
return new EnumDescriptorProto(func_get_arg(0), func_get_arg(1));
case 3:
return new EnumDescriptorProto(func_get_arg(0),... | php | public static function create()
{
switch (func_num_args()) {
case 0:
return new EnumDescriptorProto();
case 1:
return new EnumDescriptorProto(func_get_arg(0));
case 2:
return new EnumDescriptorProto(func_get_arg(0), func_get_arg(1));
case 3:
return new EnumDescriptorProto(func_get_arg(0),... | [
"public",
"static",
"function",
"create",
"(",
")",
"{",
"switch",
"(",
"func_num_args",
"(",
")",
")",
"{",
"case",
"0",
":",
"return",
"new",
"EnumDescriptorProto",
"(",
")",
";",
"case",
"1",
":",
"return",
"new",
"EnumDescriptorProto",
"(",
"func_get_a... | Creates new instance of \Google\Protobuf\EnumDescriptorProto
@throws \InvalidArgumentException
@return EnumDescriptorProto | [
"Creates",
"new",
"instance",
"of",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"EnumDescriptorProto"
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Meta/EnumDescriptorProtoMeta.php#L59-L83 |
233,977 | skrz/meta | gen-src/Google/Protobuf/Meta/EnumDescriptorProtoMeta.php | EnumDescriptorProtoMeta.reset | public static function reset($object)
{
if (!($object instanceof EnumDescriptorProto)) {
throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\EnumDescriptorProto.');
}
$object->name = NULL;
$object->value = NULL;
$object->options = NULL;
} | php | public static function reset($object)
{
if (!($object instanceof EnumDescriptorProto)) {
throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\EnumDescriptorProto.');
}
$object->name = NULL;
$object->value = NULL;
$object->options = NULL;
} | [
"public",
"static",
"function",
"reset",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"object",
"instanceof",
"EnumDescriptorProto",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'You have to pass object of class Google\\Protobuf\... | Resets properties of \Google\Protobuf\EnumDescriptorProto to default values
@param EnumDescriptorProto $object
@throws \InvalidArgumentException
@return void | [
"Resets",
"properties",
"of",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"EnumDescriptorProto",
"to",
"default",
"values"
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Meta/EnumDescriptorProtoMeta.php#L96-L104 |
233,978 | skrz/meta | gen-src/Google/Protobuf/Meta/EnumDescriptorProtoMeta.php | EnumDescriptorProtoMeta.hash | public static function hash($object, $algoOrCtx = 'md5', $raw = FALSE)
{
if (is_string($algoOrCtx)) {
$ctx = hash_init($algoOrCtx);
} else {
$ctx = $algoOrCtx;
}
if (isset($object->name)) {
hash_update($ctx, 'name');
hash_update($ctx, (string)$object->name);
}
if (isset($object->value)) {
... | php | public static function hash($object, $algoOrCtx = 'md5', $raw = FALSE)
{
if (is_string($algoOrCtx)) {
$ctx = hash_init($algoOrCtx);
} else {
$ctx = $algoOrCtx;
}
if (isset($object->name)) {
hash_update($ctx, 'name');
hash_update($ctx, (string)$object->name);
}
if (isset($object->value)) {
... | [
"public",
"static",
"function",
"hash",
"(",
"$",
"object",
",",
"$",
"algoOrCtx",
"=",
"'md5'",
",",
"$",
"raw",
"=",
"FALSE",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"algoOrCtx",
")",
")",
"{",
"$",
"ctx",
"=",
"hash_init",
"(",
"$",
"algoOrC... | Computes hash of \Google\Protobuf\EnumDescriptorProto
@param object $object
@param string|resource $algoOrCtx
@param bool $raw
@return string|void | [
"Computes",
"hash",
"of",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"EnumDescriptorProto"
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Meta/EnumDescriptorProtoMeta.php#L116-L146 |
233,979 | skrz/meta | gen-src/Google/Protobuf/Meta/EnumDescriptorProtoMeta.php | EnumDescriptorProtoMeta.toProtobuf | public static function toProtobuf($object, $filter = NULL)
{
$output = '';
if (isset($object->name) && ($filter === null || isset($filter['name']))) {
$output .= "\x0a";
$output .= Binary::encodeVarint(strlen($object->name));
$output .= $object->name;
}
if (isset($object->value) && ($filter === null... | php | public static function toProtobuf($object, $filter = NULL)
{
$output = '';
if (isset($object->name) && ($filter === null || isset($filter['name']))) {
$output .= "\x0a";
$output .= Binary::encodeVarint(strlen($object->name));
$output .= $object->name;
}
if (isset($object->value) && ($filter === null... | [
"public",
"static",
"function",
"toProtobuf",
"(",
"$",
"object",
",",
"$",
"filter",
"=",
"NULL",
")",
"{",
"$",
"output",
"=",
"''",
";",
"if",
"(",
"isset",
"(",
"$",
"object",
"->",
"name",
")",
"&&",
"(",
"$",
"filter",
"===",
"null",
"||",
... | Serialized \Google\Protobuf\EnumDescriptorProto to Protocol Buffers message.
@param EnumDescriptorProto $object
@param array $filter
@throws \Exception
@return string | [
"Serialized",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"EnumDescriptorProto",
"to",
"Protocol",
"Buffers",
"message",
"."
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/Meta/EnumDescriptorProtoMeta.php#L256-L283 |
233,980 | jkphl/dom-factory | src/Domfactory/Ports/Dom.php | Dom.createFromUri | public static function createFromUri($url, array $options = [])
{
return extension_loaded('curl') ?
self::createViaHttpClient($url, $options) : self::createViaStreamWrapper($url, $options);
} | php | public static function createFromUri($url, array $options = [])
{
return extension_loaded('curl') ?
self::createViaHttpClient($url, $options) : self::createViaStreamWrapper($url, $options);
} | [
"public",
"static",
"function",
"createFromUri",
"(",
"$",
"url",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"return",
"extension_loaded",
"(",
"'curl'",
")",
"?",
"self",
"::",
"createViaHttpClient",
"(",
"$",
"url",
",",
"$",
"options",
")"... | Create a DOM document from a URI
@param string $url HTTP / HTTPS URL
@param array $options Connection options
@return \DOMDocument DOM document
@api | [
"Create",
"a",
"DOM",
"document",
"from",
"a",
"URI"
] | 460595b73b214510b29f483d61358296d2825143 | https://github.com/jkphl/dom-factory/blob/460595b73b214510b29f483d61358296d2825143/src/Domfactory/Ports/Dom.php#L57-L61 |
233,981 | jkphl/dom-factory | src/Domfactory/Ports/Dom.php | Dom.createFromFile | public static function createFromFile($file)
{
// If the file is not readable
if (!is_readable($file)) {
throw new InvalidArgumentException(
sprintf(InvalidArgumentException::INVALID_FILE_STR, $file),
InvalidArgumentException::INVALID_FILE
);
... | php | public static function createFromFile($file)
{
// If the file is not readable
if (!is_readable($file)) {
throw new InvalidArgumentException(
sprintf(InvalidArgumentException::INVALID_FILE_STR, $file),
InvalidArgumentException::INVALID_FILE
);
... | [
"public",
"static",
"function",
"createFromFile",
"(",
"$",
"file",
")",
"{",
"// If the file is not readable",
"if",
"(",
"!",
"is_readable",
"(",
"$",
"file",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"InvalidArgumentExcepti... | Create a DOM document from a file
@param string $file File
@return \DOMDocument DOM document
@throws InvalidArgumentException If the file is not readable
@api | [
"Create",
"a",
"DOM",
"document",
"from",
"a",
"file"
] | 460595b73b214510b29f483d61358296d2825143 | https://github.com/jkphl/dom-factory/blob/460595b73b214510b29f483d61358296d2825143/src/Domfactory/Ports/Dom.php#L71-L82 |
233,982 | budde377/Part | lib/model/page/CurrentPageStrategyImpl.php | CurrentPageStrategyImpl.getCurrentPagePath | public function getCurrentPagePath()
{
if ($this->currentPagePath != null) {
return $this->currentPagePath;
}
$pageOrderArray = $this->pageOrder->getPageOrder();
$path = $this->GETValueOfIndexIfSetElseDefault('page', false);
if (!empty($path) && !empty($pageP... | php | public function getCurrentPagePath()
{
if ($this->currentPagePath != null) {
return $this->currentPagePath;
}
$pageOrderArray = $this->pageOrder->getPageOrder();
$path = $this->GETValueOfIndexIfSetElseDefault('page', false);
if (!empty($path) && !empty($pageP... | [
"public",
"function",
"getCurrentPagePath",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"currentPagePath",
"!=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"currentPagePath",
";",
"}",
"$",
"pageOrderArray",
"=",
"$",
"this",
"->",
"pageOrder",
"->",
... | Will return the path to the current page as an array of
Page's
@return array | [
"Will",
"return",
"the",
"path",
"to",
"the",
"current",
"page",
"as",
"an",
"array",
"of",
"Page",
"s"
] | 9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d | https://github.com/budde377/Part/blob/9ab5ce43dd809f9c563040ae0f7dcb7f56a52c5d/lib/model/page/CurrentPageStrategyImpl.php#L36-L57 |
233,983 | yeephp/yeephp | Yee/Views/Twig.php | Twig.getInstance | public function getInstance()
{
if (!$this->parserInstance) {
/**
* Check if Twig_Autoloader class exists
* otherwise include it.
*/
if (!class_exists('\Twig_Autoloader')) {
require_once $this->parserDirectory . '/Autolo... | php | public function getInstance()
{
if (!$this->parserInstance) {
/**
* Check if Twig_Autoloader class exists
* otherwise include it.
*/
if (!class_exists('\Twig_Autoloader')) {
require_once $this->parserDirectory . '/Autolo... | [
"public",
"function",
"getInstance",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"parserInstance",
")",
"{",
"/**\n * Check if Twig_Autoloader class exists\n * otherwise include it.\n */",
"if",
"(",
"!",
"class_exists",
"(",
"'\\Tw... | Creates new TwigEnvironment if it doesn't already exist, and returns it.
@return \Twig_Environment | [
"Creates",
"new",
"TwigEnvironment",
"if",
"it",
"doesn",
"t",
"already",
"exist",
"and",
"returns",
"it",
"."
] | 6107f60ceaf0811a6550872bd669580ac282cb1f | https://github.com/yeephp/yeephp/blob/6107f60ceaf0811a6550872bd669580ac282cb1f/Yee/Views/Twig.php#L109-L135 |
233,984 | joetannenbaum/phpushbullet | src/Request/PushFile.php | PushFile.getFileType | protected function getFileType($file_url)
{
$file_info = (new Client())->head($file_url);
$file_type = $file_info->getHeader('content-type');
if (is_array($file_type)) {
return reset($file_type);
}
return $file_type;
} | php | protected function getFileType($file_url)
{
$file_info = (new Client())->head($file_url);
$file_type = $file_info->getHeader('content-type');
if (is_array($file_type)) {
return reset($file_type);
}
return $file_type;
} | [
"protected",
"function",
"getFileType",
"(",
"$",
"file_url",
")",
"{",
"$",
"file_info",
"=",
"(",
"new",
"Client",
"(",
")",
")",
"->",
"head",
"(",
"$",
"file_url",
")",
";",
"$",
"file_type",
"=",
"$",
"file_info",
"->",
"getHeader",
"(",
"'content... | Get the file type based on the file url
@param string $file_url
@return string | [
"Get",
"the",
"file",
"type",
"based",
"on",
"the",
"file",
"url"
] | df138ebb3adebcddade282be478c0d2d6ebffb3e | https://github.com/joetannenbaum/phpushbullet/blob/df138ebb3adebcddade282be478c0d2d6ebffb3e/src/Request/PushFile.php#L33-L43 |
233,985 | kss-php/kss-php | lib/Modifier.php | Modifier.getExtendedClassName | public function getExtendedClassName()
{
if ($this->getExtendedClass() === null) {
return '';
}
$name = str_replace('%', ' ', $this->getExtendedClass());
$name = str_replace('.', ' ', $name);
$name = str_replace(':', ' pseudo-class-', $name);
return trim(... | php | public function getExtendedClassName()
{
if ($this->getExtendedClass() === null) {
return '';
}
$name = str_replace('%', ' ', $this->getExtendedClass());
$name = str_replace('.', ' ', $name);
$name = str_replace(':', ' pseudo-class-', $name);
return trim(... | [
"public",
"function",
"getExtendedClassName",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getExtendedClass",
"(",
")",
"===",
"null",
")",
"{",
"return",
"''",
";",
"}",
"$",
"name",
"=",
"str_replace",
"(",
"'%'",
",",
"' '",
",",
"$",
"this",
"->... | Returns the class name for the extended class
@return string | [
"Returns",
"the",
"class",
"name",
"for",
"the",
"extended",
"class"
] | 5431bfb3c3708cfedb6a95fc3413181287d1f776 | https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Modifier.php#L176-L186 |
233,986 | kss-php/kss-php | lib/Modifier.php | Modifier.getClassName | public function getClassName()
{
$name = str_replace('.', ' ', $this->name);
$name = str_replace(':', ' pseudo-class-', $name);
return trim($name);
} | php | public function getClassName()
{
$name = str_replace('.', ' ', $this->name);
$name = str_replace(':', ' pseudo-class-', $name);
return trim($name);
} | [
"public",
"function",
"getClassName",
"(",
")",
"{",
"$",
"name",
"=",
"str_replace",
"(",
"'.'",
",",
"' '",
",",
"$",
"this",
"->",
"name",
")",
";",
"$",
"name",
"=",
"str_replace",
"(",
"':'",
",",
"' pseudo-class-'",
",",
"$",
"name",
")",
";",
... | Returns the class name for the modifier
@return string | [
"Returns",
"the",
"class",
"name",
"for",
"the",
"modifier"
] | 5431bfb3c3708cfedb6a95fc3413181287d1f776 | https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Modifier.php#L193-L198 |
233,987 | kss-php/kss-php | lib/Modifier.php | Modifier.getExampleHtml | public function getExampleHtml($html = null)
{
if ($html === null) {
if ($this->getMarkup() === null) {
return '';
}
$html = $this->getMarkup();
}
if ($this->isExtender()) {
$html = str_replace('$modifierClass', '', $html);
... | php | public function getExampleHtml($html = null)
{
if ($html === null) {
if ($this->getMarkup() === null) {
return '';
}
$html = $this->getMarkup();
}
if ($this->isExtender()) {
$html = str_replace('$modifierClass', '', $html);
... | [
"public",
"function",
"getExampleHtml",
"(",
"$",
"html",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"html",
"===",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getMarkup",
"(",
")",
"===",
"null",
")",
"{",
"return",
"''",
";",
"}",
"$",
"html",... | Returns a string of specified html with inserted class names in the correct
places for modifiers and extenders.
@param string $html OPTIONAL
@return string $html | [
"Returns",
"a",
"string",
"of",
"specified",
"html",
"with",
"inserted",
"class",
"names",
"in",
"the",
"correct",
"places",
"for",
"modifiers",
"and",
"extenders",
"."
] | 5431bfb3c3708cfedb6a95fc3413181287d1f776 | https://github.com/kss-php/kss-php/blob/5431bfb3c3708cfedb6a95fc3413181287d1f776/lib/Modifier.php#L208-L235 |
233,988 | skrz/meta | gen-src/Google/Protobuf/UninterpretedOption/Meta/NamePartMeta.php | NamePartMeta.create | public static function create()
{
switch (func_num_args()) {
case 0:
return new NamePart();
case 1:
return new NamePart(func_get_arg(0));
case 2:
return new NamePart(func_get_arg(0), func_get_arg(1));
case 3:
return new NamePart(func_get_arg(0), func_get_arg(1), func_get_arg(2));
case ... | php | public static function create()
{
switch (func_num_args()) {
case 0:
return new NamePart();
case 1:
return new NamePart(func_get_arg(0));
case 2:
return new NamePart(func_get_arg(0), func_get_arg(1));
case 3:
return new NamePart(func_get_arg(0), func_get_arg(1), func_get_arg(2));
case ... | [
"public",
"static",
"function",
"create",
"(",
")",
"{",
"switch",
"(",
"func_num_args",
"(",
")",
")",
"{",
"case",
"0",
":",
"return",
"new",
"NamePart",
"(",
")",
";",
"case",
"1",
":",
"return",
"new",
"NamePart",
"(",
"func_get_arg",
"(",
"0",
"... | Creates new instance of \Google\Protobuf\UninterpretedOption\NamePart
@throws \InvalidArgumentException
@return NamePart | [
"Creates",
"new",
"instance",
"of",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"UninterpretedOption",
"\\",
"NamePart"
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/UninterpretedOption/Meta/NamePartMeta.php#L58-L82 |
233,989 | skrz/meta | gen-src/Google/Protobuf/UninterpretedOption/Meta/NamePartMeta.php | NamePartMeta.reset | public static function reset($object)
{
if (!($object instanceof NamePart)) {
throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\UninterpretedOption\NamePart.');
}
$object->namePart = NULL;
$object->isExtension = NULL;
} | php | public static function reset($object)
{
if (!($object instanceof NamePart)) {
throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\UninterpretedOption\NamePart.');
}
$object->namePart = NULL;
$object->isExtension = NULL;
} | [
"public",
"static",
"function",
"reset",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"object",
"instanceof",
"NamePart",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'You have to pass object of class Google\\Protobuf\\Uninterpre... | Resets properties of \Google\Protobuf\UninterpretedOption\NamePart to default values
@param NamePart $object
@throws \InvalidArgumentException
@return void | [
"Resets",
"properties",
"of",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"UninterpretedOption",
"\\",
"NamePart",
"to",
"default",
"values"
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/UninterpretedOption/Meta/NamePartMeta.php#L95-L102 |
233,990 | skrz/meta | gen-src/Google/Protobuf/UninterpretedOption/Meta/NamePartMeta.php | NamePartMeta.hash | public static function hash($object, $algoOrCtx = 'md5', $raw = FALSE)
{
if (is_string($algoOrCtx)) {
$ctx = hash_init($algoOrCtx);
} else {
$ctx = $algoOrCtx;
}
if (isset($object->namePart)) {
hash_update($ctx, 'namePart');
hash_update($ctx, (string)$object->namePart);
}
if (isset($object->i... | php | public static function hash($object, $algoOrCtx = 'md5', $raw = FALSE)
{
if (is_string($algoOrCtx)) {
$ctx = hash_init($algoOrCtx);
} else {
$ctx = $algoOrCtx;
}
if (isset($object->namePart)) {
hash_update($ctx, 'namePart');
hash_update($ctx, (string)$object->namePart);
}
if (isset($object->i... | [
"public",
"static",
"function",
"hash",
"(",
"$",
"object",
",",
"$",
"algoOrCtx",
"=",
"'md5'",
",",
"$",
"raw",
"=",
"FALSE",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"algoOrCtx",
")",
")",
"{",
"$",
"ctx",
"=",
"hash_init",
"(",
"$",
"algoOrC... | Computes hash of \Google\Protobuf\UninterpretedOption\NamePart
@param object $object
@param string|resource $algoOrCtx
@param bool $raw
@return string|void | [
"Computes",
"hash",
"of",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"UninterpretedOption",
"\\",
"NamePart"
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/UninterpretedOption/Meta/NamePartMeta.php#L114-L137 |
233,991 | skrz/meta | gen-src/Google/Protobuf/UninterpretedOption/Meta/NamePartMeta.php | NamePartMeta.fromProtobuf | public static function fromProtobuf($input, $object = NULL, &$start = 0, $end = NULL)
{
if ($object === null) {
$object = new NamePart();
}
if ($end === null) {
$end = strlen($input);
}
while ($start < $end) {
$tag = Binary::decodeVarint($input, $start);
$wireType = $tag & 0x7;
$number = $ta... | php | public static function fromProtobuf($input, $object = NULL, &$start = 0, $end = NULL)
{
if ($object === null) {
$object = new NamePart();
}
if ($end === null) {
$end = strlen($input);
}
while ($start < $end) {
$tag = Binary::decodeVarint($input, $start);
$wireType = $tag & 0x7;
$number = $ta... | [
"public",
"static",
"function",
"fromProtobuf",
"(",
"$",
"input",
",",
"$",
"object",
"=",
"NULL",
",",
"&",
"$",
"start",
"=",
"0",
",",
"$",
"end",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"object",
"===",
"null",
")",
"{",
"$",
"object",
"=",
... | Creates \Google\Protobuf\UninterpretedOption\NamePart object from serialized Protocol Buffers message.
@param string $input
@param NamePart $object
@param int $start
@param int $end
@throws \Exception
@return NamePart | [
"Creates",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"UninterpretedOption",
"\\",
"NamePart",
"object",
"from",
"serialized",
"Protocol",
"Buffers",
"message",
"."
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/UninterpretedOption/Meta/NamePartMeta.php#L152-L209 |
233,992 | skrz/meta | gen-src/Google/Protobuf/UninterpretedOption/Meta/NamePartMeta.php | NamePartMeta.toProtobuf | public static function toProtobuf($object, $filter = NULL)
{
$output = '';
if (isset($object->namePart) && ($filter === null || isset($filter['namePart']))) {
$output .= "\x0a";
$output .= Binary::encodeVarint(strlen($object->namePart));
$output .= $object->namePart;
}
if (isset($object->isExtension... | php | public static function toProtobuf($object, $filter = NULL)
{
$output = '';
if (isset($object->namePart) && ($filter === null || isset($filter['namePart']))) {
$output .= "\x0a";
$output .= Binary::encodeVarint(strlen($object->namePart));
$output .= $object->namePart;
}
if (isset($object->isExtension... | [
"public",
"static",
"function",
"toProtobuf",
"(",
"$",
"object",
",",
"$",
"filter",
"=",
"NULL",
")",
"{",
"$",
"output",
"=",
"''",
";",
"if",
"(",
"isset",
"(",
"$",
"object",
"->",
"namePart",
")",
"&&",
"(",
"$",
"filter",
"===",
"null",
"||"... | Serialized \Google\Protobuf\UninterpretedOption\NamePart to Protocol Buffers message.
@param NamePart $object
@param array $filter
@throws \Exception
@return string | [
"Serialized",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"UninterpretedOption",
"\\",
"NamePart",
"to",
"Protocol",
"Buffers",
"message",
"."
] | 013af6435d3885ab5b2e91fb8ebb051d0f874ab2 | https://github.com/skrz/meta/blob/013af6435d3885ab5b2e91fb8ebb051d0f874ab2/gen-src/Google/Protobuf/UninterpretedOption/Meta/NamePartMeta.php#L222-L238 |
233,993 | wardrobecms/core-archived | src/Wardrobe/Core/Repositories/DbPostRepository.php | DbPostRepository.active | public function active($per_page)
{
$per_page = is_numeric($per_page) ? $per_page : 5;
return Post::with(array('tags', 'user'))
->where('active', 1)
->where('publish_date', '<=', new DateTime)
->orderBy('publish_date', 'desc')
->paginate($per_page);
} | php | public function active($per_page)
{
$per_page = is_numeric($per_page) ? $per_page : 5;
return Post::with(array('tags', 'user'))
->where('active', 1)
->where('publish_date', '<=', new DateTime)
->orderBy('publish_date', 'desc')
->paginate($per_page);
} | [
"public",
"function",
"active",
"(",
"$",
"per_page",
")",
"{",
"$",
"per_page",
"=",
"is_numeric",
"(",
"$",
"per_page",
")",
"?",
"$",
"per_page",
":",
"5",
";",
"return",
"Post",
"::",
"with",
"(",
"array",
"(",
"'tags'",
",",
"'user'",
")",
")",
... | Get all of the active posts.
@param int $per_page
@return array | [
"Get",
"all",
"of",
"the",
"active",
"posts",
"."
] | 5c0836ea2e6885a428c852dc392073f2a2541c71 | https://github.com/wardrobecms/core-archived/blob/5c0836ea2e6885a428c852dc392073f2a2541c71/src/Wardrobe/Core/Repositories/DbPostRepository.php#L26-L35 |
233,994 | wardrobecms/core-archived | src/Wardrobe/Core/Repositories/DbPostRepository.php | DbPostRepository.findBySlug | public function findBySlug($slug)
{
return Post::with(array('tags', 'user'))
->where('active', 1)
->where('publish_date', '<=', new DateTime)
->where('slug', $slug)->first();
} | php | public function findBySlug($slug)
{
return Post::with(array('tags', 'user'))
->where('active', 1)
->where('publish_date', '<=', new DateTime)
->where('slug', $slug)->first();
} | [
"public",
"function",
"findBySlug",
"(",
"$",
"slug",
")",
"{",
"return",
"Post",
"::",
"with",
"(",
"array",
"(",
"'tags'",
",",
"'user'",
")",
")",
"->",
"where",
"(",
"'active'",
",",
"1",
")",
"->",
"where",
"(",
"'publish_date'",
",",
"'<='",
",... | Get a Post by its slug
@param string $slug
@return Post | [
"Get",
"a",
"Post",
"by",
"its",
"slug"
] | 5c0836ea2e6885a428c852dc392073f2a2541c71 | https://github.com/wardrobecms/core-archived/blob/5c0836ea2e6885a428c852dc392073f2a2541c71/src/Wardrobe/Core/Repositories/DbPostRepository.php#L54-L60 |
233,995 | wardrobecms/core-archived | src/Wardrobe/Core/Repositories/DbPostRepository.php | DbPostRepository.activeByTag | public function activeByTag($tag, $per_page)
{
$per_page = is_numeric($per_page) ? $per_page : 5;
return Post::with(array('tags', 'user'))
->select('posts.*')
->join('tags', 'posts.id', '=', 'tags.post_id')
->where('tags.tag', '=', $tag)
->orderBy('posts.publish_date', 'desc')
->where('posts.active... | php | public function activeByTag($tag, $per_page)
{
$per_page = is_numeric($per_page) ? $per_page : 5;
return Post::with(array('tags', 'user'))
->select('posts.*')
->join('tags', 'posts.id', '=', 'tags.post_id')
->where('tags.tag', '=', $tag)
->orderBy('posts.publish_date', 'desc')
->where('posts.active... | [
"public",
"function",
"activeByTag",
"(",
"$",
"tag",
",",
"$",
"per_page",
")",
"{",
"$",
"per_page",
"=",
"is_numeric",
"(",
"$",
"per_page",
")",
"?",
"$",
"per_page",
":",
"5",
";",
"return",
"Post",
"::",
"with",
"(",
"array",
"(",
"'tags'",
","... | Get all posts with a tag
@param string $tag
@param int $per_page
@return array | [
"Get",
"all",
"posts",
"with",
"a",
"tag"
] | 5c0836ea2e6885a428c852dc392073f2a2541c71 | https://github.com/wardrobecms/core-archived/blob/5c0836ea2e6885a428c852dc392073f2a2541c71/src/Wardrobe/Core/Repositories/DbPostRepository.php#L69-L82 |
233,996 | wardrobecms/core-archived | src/Wardrobe/Core/Repositories/DbPostRepository.php | DbPostRepository.search | public function search($search, $per_page)
{
$per_page = is_numeric($per_page) ? $per_page : 5;
return Post::with(array('tags', 'user'))
->select('posts.*')
->join('tags', 'posts.id', '=', 'tags.post_id')
->where(function($query) use ($search)
{
$query->orWhere('title', 'like', '%'.$search.'%')
... | php | public function search($search, $per_page)
{
$per_page = is_numeric($per_page) ? $per_page : 5;
return Post::with(array('tags', 'user'))
->select('posts.*')
->join('tags', 'posts.id', '=', 'tags.post_id')
->where(function($query) use ($search)
{
$query->orWhere('title', 'like', '%'.$search.'%')
... | [
"public",
"function",
"search",
"(",
"$",
"search",
",",
"$",
"per_page",
")",
"{",
"$",
"per_page",
"=",
"is_numeric",
"(",
"$",
"per_page",
")",
"?",
"$",
"per_page",
":",
"5",
";",
"return",
"Post",
"::",
"with",
"(",
"array",
"(",
"'tags'",
",",
... | Search all active posts
@param string $tag
@param int $per_page
@return array | [
"Search",
"all",
"active",
"posts"
] | 5c0836ea2e6885a428c852dc392073f2a2541c71 | https://github.com/wardrobecms/core-archived/blob/5c0836ea2e6885a428c852dc392073f2a2541c71/src/Wardrobe/Core/Repositories/DbPostRepository.php#L91-L109 |
233,997 | wardrobecms/core-archived | src/Wardrobe/Core/Repositories/DbPostRepository.php | DbPostRepository.facadeSearch | public function facadeSearch(array $params)
{
$search = isset($params['q']) ? $params['q'] : null;
$tag = isset($params['tag']) ? $params['tag'] : null;
$limit = isset($params['limit']) ? (int) $params['limit'] : 1;
$post = Post::with(array('tags', 'user'))
->select('posts.*')
->join('tags', 'posts.id',... | php | public function facadeSearch(array $params)
{
$search = isset($params['q']) ? $params['q'] : null;
$tag = isset($params['tag']) ? $params['tag'] : null;
$limit = isset($params['limit']) ? (int) $params['limit'] : 1;
$post = Post::with(array('tags', 'user'))
->select('posts.*')
->join('tags', 'posts.id',... | [
"public",
"function",
"facadeSearch",
"(",
"array",
"$",
"params",
")",
"{",
"$",
"search",
"=",
"isset",
"(",
"$",
"params",
"[",
"'q'",
"]",
")",
"?",
"$",
"params",
"[",
"'q'",
"]",
":",
"null",
";",
"$",
"tag",
"=",
"isset",
"(",
"$",
"params... | Search from the wardrobe facet
@param array $params
@return array | [
"Search",
"from",
"the",
"wardrobe",
"facet"
] | 5c0836ea2e6885a428c852dc392073f2a2541c71 | https://github.com/wardrobecms/core-archived/blob/5c0836ea2e6885a428c852dc392073f2a2541c71/src/Wardrobe/Core/Repositories/DbPostRepository.php#L117-L146 |
233,998 | wardrobecms/core-archived | src/Wardrobe/Core/Repositories/DbPostRepository.php | DbPostRepository.create | public function create($title, $content, $slug, array $tags, $active, $user_id, DateTime $publish_date)
{
$post = Post::create(compact('title', 'content', 'slug', 'active', 'user_id', 'publish_date'));
$post->tags()->delete();
$post->tags()->createMany($this->prepareTags($tags));
return $post;
} | php | public function create($title, $content, $slug, array $tags, $active, $user_id, DateTime $publish_date)
{
$post = Post::create(compact('title', 'content', 'slug', 'active', 'user_id', 'publish_date'));
$post->tags()->delete();
$post->tags()->createMany($this->prepareTags($tags));
return $post;
} | [
"public",
"function",
"create",
"(",
"$",
"title",
",",
"$",
"content",
",",
"$",
"slug",
",",
"array",
"$",
"tags",
",",
"$",
"active",
",",
"$",
"user_id",
",",
"DateTime",
"$",
"publish_date",
")",
"{",
"$",
"post",
"=",
"Post",
"::",
"create",
... | Create a new post.
@param string $title
@param string $content
@param string $slug
@param array $tags
@param bool $active
@param int $user_id
@param DateTime $publish_date
@return Post | [
"Create",
"a",
"new",
"post",
"."
] | 5c0836ea2e6885a428c852dc392073f2a2541c71 | https://github.com/wardrobecms/core-archived/blob/5c0836ea2e6885a428c852dc392073f2a2541c71/src/Wardrobe/Core/Repositories/DbPostRepository.php#L160-L169 |
233,999 | wardrobecms/core-archived | src/Wardrobe/Core/Repositories/DbPostRepository.php | DbPostRepository.update | public function update($id, $title, $content, $slug, array $tags, $active, $user_id, DateTime $publish_date)
{
$post = $this->find($id);
// Forget the old cache
if (Config::get('wardrobe.cache'))
{
Cache::forget('post-'.$post->id);
}
$post->fill(compact('title', 'content', 'slug', 'active', 'user_id',... | php | public function update($id, $title, $content, $slug, array $tags, $active, $user_id, DateTime $publish_date)
{
$post = $this->find($id);
// Forget the old cache
if (Config::get('wardrobe.cache'))
{
Cache::forget('post-'.$post->id);
}
$post->fill(compact('title', 'content', 'slug', 'active', 'user_id',... | [
"public",
"function",
"update",
"(",
"$",
"id",
",",
"$",
"title",
",",
"$",
"content",
",",
"$",
"slug",
",",
"array",
"$",
"tags",
",",
"$",
"active",
",",
"$",
"user_id",
",",
"DateTime",
"$",
"publish_date",
")",
"{",
"$",
"post",
"=",
"$",
"... | Update a post's title and content.
@param int $id
@param string $title
@param string $content
@param string $slug
@param array $tags
@param string $active
@param int $user_id
@param \DateTime $publish_date
@return Post | [
"Update",
"a",
"post",
"s",
"title",
"and",
"content",
"."
] | 5c0836ea2e6885a428c852dc392073f2a2541c71 | https://github.com/wardrobecms/core-archived/blob/5c0836ea2e6885a428c852dc392073f2a2541c71/src/Wardrobe/Core/Repositories/DbPostRepository.php#L185-L202 |
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.