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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
20,400 | expectation-php/expect | src/FailedMessage.php | FailedMessage.appendText | public function appendText($value)
{
$text = $this->stringify($value);
$this->message = $this->message . $text;
return $this;
} | php | public function appendText($value)
{
$text = $this->stringify($value);
$this->message = $this->message . $text;
return $this;
} | [
"public",
"function",
"appendText",
"(",
"$",
"value",
")",
"{",
"$",
"text",
"=",
"$",
"this",
"->",
"stringify",
"(",
"$",
"value",
")",
";",
"$",
"this",
"->",
"message",
"=",
"$",
"this",
"->",
"message",
".",
"$",
"text",
";",
"return",
"$",
... | Append the text to the last.
@param mixed $value
@return $this | [
"Append",
"the",
"text",
"to",
"the",
"last",
"."
] | 1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139 | https://github.com/expectation-php/expect/blob/1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139/src/FailedMessage.php#L41-L47 |
20,401 | expectation-php/expect | src/FailedMessage.php | FailedMessage.appendSpace | public function appendSpace($length)
{
$paddingLength = (int) $length;
$this->message = $this->message . str_pad('', $paddingLength, ' ');
return $this;
} | php | public function appendSpace($length)
{
$paddingLength = (int) $length;
$this->message = $this->message . str_pad('', $paddingLength, ' ');
return $this;
} | [
"public",
"function",
"appendSpace",
"(",
"$",
"length",
")",
"{",
"$",
"paddingLength",
"=",
"(",
"int",
")",
"$",
"length",
";",
"$",
"this",
"->",
"message",
"=",
"$",
"this",
"->",
"message",
".",
"str_pad",
"(",
"''",
",",
"$",
"paddingLength",
... | Append the length space.
@param int $length
@return $this | [
"Append",
"the",
"length",
"space",
"."
] | 1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139 | https://github.com/expectation-php/expect/blob/1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139/src/FailedMessage.php#L56-L62 |
20,402 | expectation-php/expect | src/FailedMessage.php | FailedMessage.appendValue | public function appendValue($value)
{
$appendValue = $this->formatValue($value);
$this->message = $this->message . $appendValue;
return $this;
} | php | public function appendValue($value)
{
$appendValue = $this->formatValue($value);
$this->message = $this->message . $appendValue;
return $this;
} | [
"public",
"function",
"appendValue",
"(",
"$",
"value",
")",
"{",
"$",
"appendValue",
"=",
"$",
"this",
"->",
"formatValue",
"(",
"$",
"value",
")",
";",
"$",
"this",
"->",
"message",
"=",
"$",
"this",
"->",
"message",
".",
"$",
"appendValue",
";",
"... | Append the value to the last.
@param mixed $value
@return $this | [
"Append",
"the",
"value",
"to",
"the",
"last",
"."
] | 1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139 | https://github.com/expectation-php/expect/blob/1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139/src/FailedMessage.php#L71-L77 |
20,403 | expectation-php/expect | src/FailedMessage.php | FailedMessage.appendValues | public function appendValues(array $values)
{
$appendValues = [];
foreach ($values as $value) {
$appendValues[] = $this->formatValue($value);
}
$this->message = $this->message . implode(', ', $appendValues);
return $this;
} | php | public function appendValues(array $values)
{
$appendValues = [];
foreach ($values as $value) {
$appendValues[] = $this->formatValue($value);
}
$this->message = $this->message . implode(', ', $appendValues);
return $this;
} | [
"public",
"function",
"appendValues",
"(",
"array",
"$",
"values",
")",
"{",
"$",
"appendValues",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"values",
"as",
"$",
"value",
")",
"{",
"$",
"appendValues",
"[",
"]",
"=",
"$",
"this",
"->",
"formatValue",
"... | Append the values to the last.
@param array $values
@return $this | [
"Append",
"the",
"values",
"to",
"the",
"last",
"."
] | 1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139 | https://github.com/expectation-php/expect/blob/1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139/src/FailedMessage.php#L86-L97 |
20,404 | tttptd/laravel-responder | src/Http/ResponseBuilder.php | ResponseBuilder.respond | public function respond(int $statusCode = null, array $headers = []):JsonResponse
{
if (! is_null($statusCode)) {
$this->setStatus($statusCode);
}
$data = $this->toArray();
$data = $this->includeStatusCode($data);
$data = $this->includeSuccessFlag($data);
... | php | public function respond(int $statusCode = null, array $headers = []):JsonResponse
{
if (! is_null($statusCode)) {
$this->setStatus($statusCode);
}
$data = $this->toArray();
$data = $this->includeStatusCode($data);
$data = $this->includeSuccessFlag($data);
... | [
"public",
"function",
"respond",
"(",
"int",
"$",
"statusCode",
"=",
"null",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
")",
":",
"JsonResponse",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"statusCode",
")",
")",
"{",
"$",
"this",
"->",
"setStatus",... | Serialize the data and wrap it in a JSON response object.
@param int|null $statusCode
@param array $headers
@return \Illuminate\Http\JsonResponse | [
"Serialize",
"the",
"data",
"and",
"wrap",
"it",
"in",
"a",
"JSON",
"response",
"object",
"."
] | 0e4a32701f0de755c1f1af458045829e1bd6caf6 | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/Http/ResponseBuilder.php#L67-L78 |
20,405 | yosymfony/ConfigServiceProvider | src/Yosymfony/Silex/ConfigServiceProvider/Config.php | Config.load | public function load($resource, $type = null)
{
$repository = $this->delegatingLoader->load($resource, $type);
if(!$repository instanceof ConfigRepositoryInterface)
{
throw new \UnexpectedValueException('The loader must return a repository instance');
}
... | php | public function load($resource, $type = null)
{
$repository = $this->delegatingLoader->load($resource, $type);
if(!$repository instanceof ConfigRepositoryInterface)
{
throw new \UnexpectedValueException('The loader must return a repository instance');
}
... | [
"public",
"function",
"load",
"(",
"$",
"resource",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"repository",
"=",
"$",
"this",
"->",
"delegatingLoader",
"->",
"load",
"(",
"$",
"resource",
",",
"$",
"type",
")",
";",
"if",
"(",
"!",
"$",
"reposi... | Loads a resource like file or inline configuration
@param string $resource A resource
@param string $type The resource type. Don't set this argument in files case.
@return ConfigRepositoryInterface
@throws Symfony\Component\Config\Exception\FileLoaderLoadException If the loader not found.
@throws \UnexpectedValu... | [
"Loads",
"a",
"resource",
"like",
"file",
"or",
"inline",
"configuration"
] | f6cb9a9fc707b6c92e0d03201e5ecc17eaee3114 | https://github.com/yosymfony/ConfigServiceProvider/blob/f6cb9a9fc707b6c92e0d03201e5ecc17eaee3114/src/Yosymfony/Silex/ConfigServiceProvider/Config.php#L60-L70 |
20,406 | antaresproject/notifications | src/Widgets/NotificationSender/NotificationsWidget.php | NotificationsWidget.routes | public static function routes()
{
$area = area();
Route::post($area . '/notifications/notifications', NotificationController::class . '@index');
Route::post($area . '/notifications/widgets/send', NotificationController::class . '@send');
} | php | public static function routes()
{
$area = area();
Route::post($area . '/notifications/notifications', NotificationController::class . '@index');
Route::post($area . '/notifications/widgets/send', NotificationController::class . '@send');
} | [
"public",
"static",
"function",
"routes",
"(",
")",
"{",
"$",
"area",
"=",
"area",
"(",
")",
";",
"Route",
"::",
"post",
"(",
"$",
"area",
".",
"'/notifications/notifications'",
",",
"NotificationController",
"::",
"class",
".",
"'@index'",
")",
";",
"Rout... | Widgets routes implementations
@return void | [
"Widgets",
"routes",
"implementations"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Widgets/NotificationSender/NotificationsWidget.php#L85-L90 |
20,407 | antaresproject/notifications | src/Widgets/NotificationSender/NotificationsWidget.php | NotificationsWidget.render | public function render()
{
app('antares.asset')->container('antares/foundation::application')->add('webpack_forms_basic', '/webpack/forms_basic.js', ['app_cache']);
publish('notifications', ['js/notification-widget.js']);
return view('antares/notifications::widgets.send_notification', ['for... | php | public function render()
{
app('antares.asset')->container('antares/foundation::application')->add('webpack_forms_basic', '/webpack/forms_basic.js', ['app_cache']);
publish('notifications', ['js/notification-widget.js']);
return view('antares/notifications::widgets.send_notification', ['for... | [
"public",
"function",
"render",
"(",
")",
"{",
"app",
"(",
"'antares.asset'",
")",
"->",
"container",
"(",
"'antares/foundation::application'",
")",
"->",
"add",
"(",
"'webpack_forms_basic'",
",",
"'/webpack/forms_basic.js'",
",",
"[",
"'app_cache'",
"]",
")",
";"... | Renders widget content
@return \Illuminate\View\View | [
"Renders",
"widget",
"content"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Widgets/NotificationSender/NotificationsWidget.php#L97-L103 |
20,408 | heidelpay/PhpDoc | src/phpDocumentor/Compiler/Pass/ExampleTagsEnricher.php | ExampleTagsEnricher.replaceInlineExamples | protected function replaceInlineExamples(DescriptorAbstract $element)
{
$description = $element->getDescription();
$matches = array();
if (! $description
|| ! preg_match_all('/\{@example\s(.+?)\}/', $description, $matches)
|| count($matches[0]) < 1
) {
... | php | protected function replaceInlineExamples(DescriptorAbstract $element)
{
$description = $element->getDescription();
$matches = array();
if (! $description
|| ! preg_match_all('/\{@example\s(.+?)\}/', $description, $matches)
|| count($matches[0]) < 1
) {
... | [
"protected",
"function",
"replaceInlineExamples",
"(",
"DescriptorAbstract",
"$",
"element",
")",
"{",
"$",
"description",
"=",
"$",
"element",
"->",
"getDescription",
"(",
")",
";",
"$",
"matches",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"$",
"descri... | Replaces the example tags in the description with the contents of the found example.
@param DescriptorAbstract $element
@return string | [
"Replaces",
"the",
"example",
"tags",
"in",
"the",
"description",
"with",
"the",
"contents",
"of",
"the",
"found",
"example",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Compiler/Pass/ExampleTagsEnricher.php#L69-L101 |
20,409 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/common_sql_reader.php | ezcDbSchemaCommonSqlReader.processSchema | protected function processSchema( array $tables )
{
$schemaDefinition = array();
array_walk( $tables, create_function( '&$item,$key', '$item = $item[0];' ) );
// strip out the prefix and only return tables with the prefix set.
$prefix = ezcDbSchema::$options->tableNamePrefix;
... | php | protected function processSchema( array $tables )
{
$schemaDefinition = array();
array_walk( $tables, create_function( '&$item,$key', '$item = $item[0];' ) );
// strip out the prefix and only return tables with the prefix set.
$prefix = ezcDbSchema::$options->tableNamePrefix;
... | [
"protected",
"function",
"processSchema",
"(",
"array",
"$",
"tables",
")",
"{",
"$",
"schemaDefinition",
"=",
"array",
"(",
")",
";",
"array_walk",
"(",
"$",
"tables",
",",
"create_function",
"(",
"'&$item,$key'",
",",
"'$item = $item[0];'",
")",
")",
";",
... | Loops over all the table names in the array and extracts schema
information.
This method extracts information about a database's schema from the
database itself and returns this schema as an ezcDbSchema object.
@param array(string) $tables
@return ezcDbSchema | [
"Loops",
"over",
"all",
"the",
"table",
"names",
"in",
"the",
"array",
"and",
"extracts",
"schema",
"information",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/common_sql_reader.php#L58-L83 |
20,410 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/common_sql_reader.php | ezcDbSchemaCommonSqlReader.lowercase | protected function lowercase( array $source )
{
$result = array();
foreach ($source as $key => $value )
$result[strtolower($key)] = $value;
return $result;
} | php | protected function lowercase( array $source )
{
$result = array();
foreach ($source as $key => $value )
$result[strtolower($key)] = $value;
return $result;
} | [
"protected",
"function",
"lowercase",
"(",
"array",
"$",
"source",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"source",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"$",
"result",
"[",
"strtolower",
"(",
"$",
"key",
")... | Lowercase all array keys to conform default Database behaviour
@param array(string=>mixed) $source
@return array | [
"Lowercase",
"all",
"array",
"keys",
"to",
"conform",
"default",
"Database",
"behaviour"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/common_sql_reader.php#L91-L99 |
20,411 | sabre-io/cs | lib/PublicVisibility.php | PublicVisibility.applyAttribs | private function applyAttribs(Tokens $tokens, $index, array $attribs)
{
$toInsert = [];
foreach ($attribs as $attrib) {
if (null !== $attrib && '' !== $attrib->getContent()) {
$toInsert[] = $attrib;
$toInsert[] = new Token([T_WHITESPACE, ' ']);
... | php | private function applyAttribs(Tokens $tokens, $index, array $attribs)
{
$toInsert = [];
foreach ($attribs as $attrib) {
if (null !== $attrib && '' !== $attrib->getContent()) {
$toInsert[] = $attrib;
$toInsert[] = new Token([T_WHITESPACE, ' ']);
... | [
"private",
"function",
"applyAttribs",
"(",
"Tokens",
"$",
"tokens",
",",
"$",
"index",
",",
"array",
"$",
"attribs",
")",
"{",
"$",
"toInsert",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"attribs",
"as",
"$",
"attrib",
")",
"{",
"if",
"(",
"null",
"... | Apply token attributes.
Token at given index is prepended by attributes.
@param Tokens $tokens Tokens collection
@param int $index token index
@param array $attribs array of token attributes | [
"Apply",
"token",
"attributes",
"."
] | a4c57e213bf3f5e7d6b29a2f70d1ca4b0dce6d86 | https://github.com/sabre-io/cs/blob/a4c57e213bf3f5e7d6b29a2f70d1ca4b0dce6d86/lib/PublicVisibility.php#L84-L98 |
20,412 | sabre-io/cs | lib/PublicVisibility.php | PublicVisibility.grabAttribsBeforeMethodToken | private function grabAttribsBeforeMethodToken(Tokens $tokens, $index)
{
static $tokenAttribsMap = [
T_PRIVATE => 'visibility',
T_PROTECTED => 'visibility',
T_PUBLIC => null, // destroy T_PUBLIC token. This is literally the only change from the original
T_... | php | private function grabAttribsBeforeMethodToken(Tokens $tokens, $index)
{
static $tokenAttribsMap = [
T_PRIVATE => 'visibility',
T_PROTECTED => 'visibility',
T_PUBLIC => null, // destroy T_PUBLIC token. This is literally the only change from the original
T_... | [
"private",
"function",
"grabAttribsBeforeMethodToken",
"(",
"Tokens",
"$",
"tokens",
",",
"$",
"index",
")",
"{",
"static",
"$",
"tokenAttribsMap",
"=",
"[",
"T_PRIVATE",
"=>",
"'visibility'",
",",
"T_PROTECTED",
"=>",
"'visibility'",
",",
"T_PUBLIC",
"=>",
"nul... | Grab attributes before method token at given index.
It's a shorthand for grabAttribsBeforeToken method.
@param Tokens $tokens Tokens collection
@param int $index token index
@return array array of grabbed attributes | [
"Grab",
"attributes",
"before",
"method",
"token",
"at",
"given",
"index",
"."
] | a4c57e213bf3f5e7d6b29a2f70d1ca4b0dce6d86 | https://github.com/sabre-io/cs/blob/a4c57e213bf3f5e7d6b29a2f70d1ca4b0dce6d86/lib/PublicVisibility.php#L110-L132 |
20,413 | sabre-io/cs | lib/PublicVisibility.php | PublicVisibility.grabAttribsBeforePropertyToken | private function grabAttribsBeforePropertyToken(Tokens $tokens, $index)
{
static $tokenAttribsMap = [
T_VAR => null, // destroy T_VAR token!
T_PRIVATE => 'visibility',
T_PROTECTED => 'visibility',
T_PUBLIC => 'visibility',
T_STATIC =>... | php | private function grabAttribsBeforePropertyToken(Tokens $tokens, $index)
{
static $tokenAttribsMap = [
T_VAR => null, // destroy T_VAR token!
T_PRIVATE => 'visibility',
T_PROTECTED => 'visibility',
T_PUBLIC => 'visibility',
T_STATIC =>... | [
"private",
"function",
"grabAttribsBeforePropertyToken",
"(",
"Tokens",
"$",
"tokens",
",",
"$",
"index",
")",
"{",
"static",
"$",
"tokenAttribsMap",
"=",
"[",
"T_VAR",
"=>",
"null",
",",
"// destroy T_VAR token!",
"T_PRIVATE",
"=>",
"'visibility'",
",",
"T_PROTEC... | Grab attributes before property token at given index.
It's a shorthand for grabAttribsBeforeToken method.
@param Tokens $tokens Tokens collection
@param int $index token index
@return array array of grabbed attributes | [
"Grab",
"attributes",
"before",
"property",
"token",
"at",
"given",
"index",
"."
] | a4c57e213bf3f5e7d6b29a2f70d1ca4b0dce6d86 | https://github.com/sabre-io/cs/blob/a4c57e213bf3f5e7d6b29a2f70d1ca4b0dce6d86/lib/PublicVisibility.php#L144-L170 |
20,414 | sabre-io/cs | lib/PublicVisibility.php | PublicVisibility.grabAttribsBeforeToken | private function grabAttribsBeforeToken(Tokens $tokens, $index, array $tokenAttribsMap, array $attribs)
{
while (true) {
$token = $tokens[--$index];
if (!$token->isArray()) {
if ($token->equalsAny(['{', '}', '(', ')'])) {
break;
}
... | php | private function grabAttribsBeforeToken(Tokens $tokens, $index, array $tokenAttribsMap, array $attribs)
{
while (true) {
$token = $tokens[--$index];
if (!$token->isArray()) {
if ($token->equalsAny(['{', '}', '(', ')'])) {
break;
}
... | [
"private",
"function",
"grabAttribsBeforeToken",
"(",
"Tokens",
"$",
"tokens",
",",
"$",
"index",
",",
"array",
"$",
"tokenAttribsMap",
",",
"array",
"$",
"attribs",
")",
"{",
"while",
"(",
"true",
")",
"{",
"$",
"token",
"=",
"$",
"tokens",
"[",
"--",
... | Grab attributes before token at given index.
Grabbed attributes are cleared by overriding them with empty string and should be manually applied with applyTokenAttribs method.
@param Tokens $tokens Tokens collection
@param int $index token index
@param array $tokenAttribsMap token to attribute n... | [
"Grab",
"attributes",
"before",
"token",
"at",
"given",
"index",
"."
] | a4c57e213bf3f5e7d6b29a2f70d1ca4b0dce6d86 | https://github.com/sabre-io/cs/blob/a4c57e213bf3f5e7d6b29a2f70d1ca4b0dce6d86/lib/PublicVisibility.php#L184-L219 |
20,415 | Laralum/Permissions | src/Controllers/PermissionController.php | PermissionController.confirmDelete | public function confirmDelete(Permission $permission)
{
$this->authorize('delete', Permission::class);
return view('laralum::pages.confirmation', [
'method' => 'DELETE',
'action' => route('laralum::permissions.destroy', ['permission' => $permission->id]),
]);
} | php | public function confirmDelete(Permission $permission)
{
$this->authorize('delete', Permission::class);
return view('laralum::pages.confirmation', [
'method' => 'DELETE',
'action' => route('laralum::permissions.destroy', ['permission' => $permission->id]),
]);
} | [
"public",
"function",
"confirmDelete",
"(",
"Permission",
"$",
"permission",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"'delete'",
",",
"Permission",
"::",
"class",
")",
";",
"return",
"view",
"(",
"'laralum::pages.confirmation'",
",",
"[",
"'method'",
"=... | Displays a view to confirm delete.
@param \Laralum\Permission\Models\Permission $permission
@return \Illuminate\Http\Response | [
"Displays",
"a",
"view",
"to",
"confirm",
"delete",
"."
] | 79970ee7d1bff816ad4b9adee29067faead3f756 | https://github.com/Laralum/Permissions/blob/79970ee7d1bff816ad4b9adee29067faead3f756/src/Controllers/PermissionController.php#L116-L124 |
20,416 | hirnsturm/typo3-exceptionhandler | TYPO3/ExceptionHandler/ProductionExceptionHandler.php | ProductionExceptionHandler.sendNotificationMail | protected function sendNotificationMail($exception)
{
// Build message
$message = array();
$message[] = 'Title: ' . $this->getTitle($exception);
$message[] = 'Message: ' . PHP_EOL . $this->getMessage($exception);
$message[] = 'Server name: ' . filter_input(INPUT_SERVER, 'SERV... | php | protected function sendNotificationMail($exception)
{
// Build message
$message = array();
$message[] = 'Title: ' . $this->getTitle($exception);
$message[] = 'Message: ' . PHP_EOL . $this->getMessage($exception);
$message[] = 'Server name: ' . filter_input(INPUT_SERVER, 'SERV... | [
"protected",
"function",
"sendNotificationMail",
"(",
"$",
"exception",
")",
"{",
"// Build message",
"$",
"message",
"=",
"array",
"(",
")",
";",
"$",
"message",
"[",
"]",
"=",
"'Title: '",
".",
"$",
"this",
"->",
"getTitle",
"(",
"$",
"exception",
")",
... | Sends an exception as notification e-mail
@param $exception | [
"Sends",
"an",
"exception",
"as",
"notification",
"e",
"-",
"mail"
] | 268c3f3269d39b238d6fa1b39d8fbae3f0d5921d | https://github.com/hirnsturm/typo3-exceptionhandler/blob/268c3f3269d39b238d6fa1b39d8fbae3f0d5921d/TYPO3/ExceptionHandler/ProductionExceptionHandler.php#L33-L60 |
20,417 | nikolaposa/ZfOpenGraph | src/ZfOpenGraph/View/Helper/HeadMeta.php | HeadMeta.isValid | protected function isValid($item)
{
if ((!$item instanceof stdClass)
|| !isset($item->type)
|| !isset($item->modifiers)
) {
return false;
}
if ($this->doctypeValidationEnabled) {
if (!isset($item->content)
&& (! $this->... | php | protected function isValid($item)
{
if ((!$item instanceof stdClass)
|| !isset($item->type)
|| !isset($item->modifiers)
) {
return false;
}
if ($this->doctypeValidationEnabled) {
if (!isset($item->content)
&& (! $this->... | [
"protected",
"function",
"isValid",
"(",
"$",
"item",
")",
"{",
"if",
"(",
"(",
"!",
"$",
"item",
"instanceof",
"stdClass",
")",
"||",
"!",
"isset",
"(",
"$",
"item",
"->",
"type",
")",
"||",
"!",
"isset",
"(",
"$",
"item",
"->",
"modifiers",
")",
... | Determine if item is valid
@param mixed $item
@return bool | [
"Determine",
"if",
"item",
"is",
"valid"
] | 5e1a9b6ff8d2e149dc9d949635f39786f6acc347 | https://github.com/nikolaposa/ZfOpenGraph/blob/5e1a9b6ff8d2e149dc9d949635f39786f6acc347/src/ZfOpenGraph/View/Helper/HeadMeta.php#L52-L85 |
20,418 | josh-taylor/migrations-generator | src/Describer.php | Describer.describe | public function describe($table)
{
$schema = $this->db->connection()
->getDoctrineConnection()
->getSchemaManager();
return $this->parseSchema(
$schema->listTableColumns($table)
);
} | php | public function describe($table)
{
$schema = $this->db->connection()
->getDoctrineConnection()
->getSchemaManager();
return $this->parseSchema(
$schema->listTableColumns($table)
);
} | [
"public",
"function",
"describe",
"(",
"$",
"table",
")",
"{",
"$",
"schema",
"=",
"$",
"this",
"->",
"db",
"->",
"connection",
"(",
")",
"->",
"getDoctrineConnection",
"(",
")",
"->",
"getSchemaManager",
"(",
")",
";",
"return",
"$",
"this",
"->",
"pa... | Describe all columns in a single table
@param string $table
@return array | [
"Describe",
"all",
"columns",
"in",
"a",
"single",
"table"
] | bb6edc78773d11491881f12265a658bf058cb218 | https://github.com/josh-taylor/migrations-generator/blob/bb6edc78773d11491881f12265a658bf058cb218/src/Describer.php#L32-L41 |
20,419 | josh-taylor/migrations-generator | src/Describer.php | Describer.parseSchema | protected function parseSchema(array $columns)
{
$schema = [];
foreach ($columns as $name => $column) {
$schema[] = [
'name' => $column->getName(),
'type' => $column->getType()->getName()
];
}
return $schema;
} | php | protected function parseSchema(array $columns)
{
$schema = [];
foreach ($columns as $name => $column) {
$schema[] = [
'name' => $column->getName(),
'type' => $column->getType()->getName()
];
}
return $schema;
} | [
"protected",
"function",
"parseSchema",
"(",
"array",
"$",
"columns",
")",
"{",
"$",
"schema",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"columns",
"as",
"$",
"name",
"=>",
"$",
"column",
")",
"{",
"$",
"schema",
"[",
"]",
"=",
"[",
"'name'",
"=>",
... | Convert the DBAL schema to an assoc array.
@param array $columns
@return array | [
"Convert",
"the",
"DBAL",
"schema",
"to",
"an",
"assoc",
"array",
"."
] | bb6edc78773d11491881f12265a658bf058cb218 | https://github.com/josh-taylor/migrations-generator/blob/bb6edc78773d11491881f12265a658bf058cb218/src/Describer.php#L49-L61 |
20,420 | traderinteractive/filter-arrays-php | src/Arrays.php | Arrays.flatten | public static function flatten(array $value) : array
{
$result = [];
array_walk_recursive(
$value,
function ($item) use (&$result) {
$result[] = $item;
}
);
return $result;
} | php | public static function flatten(array $value) : array
{
$result = [];
array_walk_recursive(
$value,
function ($item) use (&$result) {
$result[] = $item;
}
);
return $result;
} | [
"public",
"static",
"function",
"flatten",
"(",
"array",
"$",
"value",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"array_walk_recursive",
"(",
"$",
"value",
",",
"function",
"(",
"$",
"item",
")",
"use",
"(",
"&",
"$",
"result",
")",
... | Given a multi-dimensional array, flatten the array to a single level.
The order of the values will be maintained, but the keys will not.
For example, given the array [[1, 2], [3, [4, 5]]], this would result in the array [1, 2, 3, 4, 5].
@param array $value The array to flatten.
@return array The single-dimension ar... | [
"Given",
"a",
"multi",
"-",
"dimensional",
"array",
"flatten",
"the",
"array",
"to",
"a",
"single",
"level",
"."
] | 8958109f3e10e6c37fcc6c7c4830d9bcba3ed222 | https://github.com/traderinteractive/filter-arrays-php/blob/8958109f3e10e6c37fcc6c7c4830d9bcba3ed222/src/Arrays.php#L76-L88 |
20,421 | fabulator/fitbit-api-base | lib/Fabulator/Fitbit/FitbitApiBase.php | FitbitApiBase.requestAccessToken | public function requestAccessToken($code, $redirectUri, $expiresIn = null, $state = null)
{
$parameters = [
'code' => $code,
'grant_type' => 'authorization_code',
'client_id' => $this->clientId,
'redirect_uri' => $redirectUri,
];
if ($expiresI... | php | public function requestAccessToken($code, $redirectUri, $expiresIn = null, $state = null)
{
$parameters = [
'code' => $code,
'grant_type' => 'authorization_code',
'client_id' => $this->clientId,
'redirect_uri' => $redirectUri,
];
if ($expiresI... | [
"public",
"function",
"requestAccessToken",
"(",
"$",
"code",
",",
"$",
"redirectUri",
",",
"$",
"expiresIn",
"=",
"null",
",",
"$",
"state",
"=",
"null",
")",
"{",
"$",
"parameters",
"=",
"[",
"'code'",
"=>",
"$",
"code",
",",
"'grant_type'",
"=>",
"'... | Request new Fitbit access token.
@param string $code code from Fitbit
@param string $redirectUri redirect uri used to get code
@param int|null $expiresIn set length of token
@param string|null $state This parameter will be added to the redirect URI exactly as your application specifies.
@return ResponseInterface respo... | [
"Request",
"new",
"Fitbit",
"access",
"token",
"."
] | c2ef868796f991586fe227a659553f304994bdd9 | https://github.com/fabulator/fitbit-api-base/blob/c2ef868796f991586fe227a659553f304994bdd9/lib/Fabulator/Fitbit/FitbitApiBase.php#L111-L129 |
20,422 | fabulator/fitbit-api-base | lib/Fabulator/Fitbit/FitbitApiBase.php | FitbitApiBase.refreshAccessToken | public function refreshAccessToken($refreshToken, $expiresIn = null)
{
$parameters = [
'grant_type' => 'refresh_token',
'refresh_token' => $refreshToken,
];
if ($expiresIn != null) {
$parameters['expires_in'] = $expiresIn;
}
return $this-... | php | public function refreshAccessToken($refreshToken, $expiresIn = null)
{
$parameters = [
'grant_type' => 'refresh_token',
'refresh_token' => $refreshToken,
];
if ($expiresIn != null) {
$parameters['expires_in'] = $expiresIn;
}
return $this-... | [
"public",
"function",
"refreshAccessToken",
"(",
"$",
"refreshToken",
",",
"$",
"expiresIn",
"=",
"null",
")",
"{",
"$",
"parameters",
"=",
"[",
"'grant_type'",
"=>",
"'refresh_token'",
",",
"'refresh_token'",
"=>",
"$",
"refreshToken",
",",
"]",
";",
"if",
... | Refresh Fitbit token.
@param string $refreshToken refresh token
@param int|null $expiresIn set length of token
@return ResponseInterface response from Fitbit API | [
"Refresh",
"Fitbit",
"token",
"."
] | c2ef868796f991586fe227a659553f304994bdd9 | https://github.com/fabulator/fitbit-api-base/blob/c2ef868796f991586fe227a659553f304994bdd9/lib/Fabulator/Fitbit/FitbitApiBase.php#L138-L150 |
20,423 | fabulator/fitbit-api-base | lib/Fabulator/Fitbit/FitbitApiBase.php | FitbitApiBase.tokenRequest | private function tokenRequest($namespace, $parameters)
{
$client = new Client([
'headers' => [
'content-type' => 'application/x-www-form-urlencoded',
'Authorization' => 'Basic '. base64_encode($this->clientId . ':' . $this->secret),
]
]);
... | php | private function tokenRequest($namespace, $parameters)
{
$client = new Client([
'headers' => [
'content-type' => 'application/x-www-form-urlencoded',
'Authorization' => 'Basic '. base64_encode($this->clientId . ':' . $this->secret),
]
]);
... | [
"private",
"function",
"tokenRequest",
"(",
"$",
"namespace",
",",
"$",
"parameters",
")",
"{",
"$",
"client",
"=",
"new",
"Client",
"(",
"[",
"'headers'",
"=>",
"[",
"'content-type'",
"=>",
"'application/x-www-form-urlencoded'",
",",
"'Authorization'",
"=>",
"'... | Request token action.
@param string $namespace namespace of request
@param array $parameters request parameters
@return ResponseInterface response from Fitbit API | [
"Request",
"token",
"action",
"."
] | c2ef868796f991586fe227a659553f304994bdd9 | https://github.com/fabulator/fitbit-api-base/blob/c2ef868796f991586fe227a659553f304994bdd9/lib/Fabulator/Fitbit/FitbitApiBase.php#L174-L184 |
20,424 | fabulator/fitbit-api-base | lib/Fabulator/Fitbit/FitbitApiBase.php | FitbitApiBase.send | public function send($url, $method = 'GET', $data = [])
{
$method = strtolower($method);
$settings = [
'headers' => array_merge([
'Authorization' => 'Bearer ' . $this->getToken(),
'Content-Type' => 'application/x-www-form-urlencoded',
], $thi... | php | public function send($url, $method = 'GET', $data = [])
{
$method = strtolower($method);
$settings = [
'headers' => array_merge([
'Authorization' => 'Bearer ' . $this->getToken(),
'Content-Type' => 'application/x-www-form-urlencoded',
], $thi... | [
"public",
"function",
"send",
"(",
"$",
"url",
",",
"$",
"method",
"=",
"'GET'",
",",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"method",
"=",
"strtolower",
"(",
"$",
"method",
")",
";",
"$",
"settings",
"=",
"[",
"'headers'",
"=>",
"array_merge",... | Send authorized request to Fitbit API.
@param string $url called url
@param string $method http method
@param array $data data in body
@return ResponseInterface response from Fitbit API | [
"Send",
"authorized",
"request",
"to",
"Fitbit",
"API",
"."
] | c2ef868796f991586fe227a659553f304994bdd9 | https://github.com/fabulator/fitbit-api-base/blob/c2ef868796f991586fe227a659553f304994bdd9/lib/Fabulator/Fitbit/FitbitApiBase.php#L239-L256 |
20,425 | Danzabar/config-builder | src/Data/Converter.php | Converter.setExtension | public function setExtension($ext)
{
$this->extension = $ext;
if(!$this->extensionMap->has($ext))
{
throw new Exceptions\InvalidExtension($ext);
}
return $this;
} | php | public function setExtension($ext)
{
$this->extension = $ext;
if(!$this->extensionMap->has($ext))
{
throw new Exceptions\InvalidExtension($ext);
}
return $this;
} | [
"public",
"function",
"setExtension",
"(",
"$",
"ext",
")",
"{",
"$",
"this",
"->",
"extension",
"=",
"$",
"ext",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"extensionMap",
"->",
"has",
"(",
"$",
"ext",
")",
")",
"{",
"throw",
"new",
"Exceptions",
"\\... | Sets the extension
@param String $ext
@return Converter
@author Dan Cox | [
"Sets",
"the",
"extension"
] | 3b237be578172c32498bbcdfb360e69a6243739d | https://github.com/Danzabar/config-builder/blob/3b237be578172c32498bbcdfb360e69a6243739d/src/Data/Converter.php#L63-L73 |
20,426 | Danzabar/config-builder | src/Data/Converter.php | Converter.process | public function process($data = '')
{
$this->data = $data;
$ext = $this->extensionMap->get($this->extension);
$arr = $ext->load($data)->toArray();
$this->paramBag = new ParamBag($arr);
return true;
} | php | public function process($data = '')
{
$this->data = $data;
$ext = $this->extensionMap->get($this->extension);
$arr = $ext->load($data)->toArray();
$this->paramBag = new ParamBag($arr);
return true;
} | [
"public",
"function",
"process",
"(",
"$",
"data",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"data",
"=",
"$",
"data",
";",
"$",
"ext",
"=",
"$",
"this",
"->",
"extensionMap",
"->",
"get",
"(",
"$",
"this",
"->",
"extension",
")",
";",
"$",
"arr",
... | Loads an extension class to convert the data to an array and pass it back as a param bag
@param String $data
@return ParamBag
@author Dan Cox | [
"Loads",
"an",
"extension",
"class",
"to",
"convert",
"the",
"data",
"to",
"an",
"array",
"and",
"pass",
"it",
"back",
"as",
"a",
"param",
"bag"
] | 3b237be578172c32498bbcdfb360e69a6243739d | https://github.com/Danzabar/config-builder/blob/3b237be578172c32498bbcdfb360e69a6243739d/src/Data/Converter.php#L82-L92 |
20,427 | Danzabar/config-builder | src/Data/Converter.php | Converter.toNative | public function toNative(ParamBag $paramBag)
{
// We can assume the extension exists, since it has already been used
$ext = $this->extensionMap->get($this->extension);
$native = $ext->load($paramBag->all())->toNative();
return $native;
} | php | public function toNative(ParamBag $paramBag)
{
// We can assume the extension exists, since it has already been used
$ext = $this->extensionMap->get($this->extension);
$native = $ext->load($paramBag->all())->toNative();
return $native;
} | [
"public",
"function",
"toNative",
"(",
"ParamBag",
"$",
"paramBag",
")",
"{",
"// We can assume the extension exists, since it has already been used",
"$",
"ext",
"=",
"$",
"this",
"->",
"extensionMap",
"->",
"get",
"(",
"$",
"this",
"->",
"extension",
")",
";",
"... | Converts the parambag instance of the native extension format
@param \Danzabar\Config\Data\ParamBag $paramBag
@return Mixed
@author Dan Cox | [
"Converts",
"the",
"parambag",
"instance",
"of",
"the",
"native",
"extension",
"format"
] | 3b237be578172c32498bbcdfb360e69a6243739d | https://github.com/Danzabar/config-builder/blob/3b237be578172c32498bbcdfb360e69a6243739d/src/Data/Converter.php#L101-L108 |
20,428 | GrupaZero/api | src/Gzero/Api/Transformer/LangTransformer.php | LangTransformer.transform | public function transform($lang)
{
$lang = $this->entityToArray(Lang::class, $lang);
return [
'code' => $lang['code'],
'i18n' => $lang['i18n'],
'isEnabled' => (bool) $lang['is_enabled'],
'isDefault' => (bool) $lang['is_default'],
];
... | php | public function transform($lang)
{
$lang = $this->entityToArray(Lang::class, $lang);
return [
'code' => $lang['code'],
'i18n' => $lang['i18n'],
'isEnabled' => (bool) $lang['is_enabled'],
'isDefault' => (bool) $lang['is_default'],
];
... | [
"public",
"function",
"transform",
"(",
"$",
"lang",
")",
"{",
"$",
"lang",
"=",
"$",
"this",
"->",
"entityToArray",
"(",
"Lang",
"::",
"class",
",",
"$",
"lang",
")",
";",
"return",
"[",
"'code'",
"=>",
"$",
"lang",
"[",
"'code'",
"]",
",",
"'i18n... | Transforms lang entity
@param Lang|array $lang Lang entity
@return array | [
"Transforms",
"lang",
"entity"
] | fc544bb6057274e9d5e7b617346c3f854ea5effd | https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Transformer/LangTransformer.php#L26-L35 |
20,429 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Scrybe/Template/Twig.php | Twig.decorate | public function decorate($contents, array $options = array())
{
return $this->getTwigEnvironment()->render(
$this->getTemplateFilename(),
array_merge(array('contents' => $contents), $options)
);
} | php | public function decorate($contents, array $options = array())
{
return $this->getTwigEnvironment()->render(
$this->getTemplateFilename(),
array_merge(array('contents' => $contents), $options)
);
} | [
"public",
"function",
"decorate",
"(",
"$",
"contents",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getTwigEnvironment",
"(",
")",
"->",
"render",
"(",
"$",
"this",
"->",
"getTemplateFilename",
"(",
")",
... | Applies the relevant template upon the given content.
This method takes the combines the template with the given contents and generates a final piece of text
from that.
The user may add additional options that are set as parameters in the template.
@param string $contents
@param string[] $options
@see getTemplate... | [
"Applies",
"the",
"relevant",
"template",
"upon",
"the",
"given",
"content",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Scrybe/Template/Twig.php#L154-L160 |
20,430 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Scrybe/Template/Twig.php | Twig.getAssets | public function getAssets()
{
$finder = new Finder();
return iterator_to_array(
$finder->files()
->in($this->path.DIRECTORY_SEPARATOR . $this->name)
->depth('> 0')
->notName('*.twig')
->sortByName()
);
} | php | public function getAssets()
{
$finder = new Finder();
return iterator_to_array(
$finder->files()
->in($this->path.DIRECTORY_SEPARATOR . $this->name)
->depth('> 0')
->notName('*.twig')
->sortByName()
);
} | [
"public",
"function",
"getAssets",
"(",
")",
"{",
"$",
"finder",
"=",
"new",
"Finder",
"(",
")",
";",
"return",
"iterator_to_array",
"(",
"$",
"finder",
"->",
"files",
"(",
")",
"->",
"in",
"(",
"$",
"this",
"->",
"path",
".",
"DIRECTORY_SEPARATOR",
".... | Returns a list of files that need to be copied to the destination location.
Examples of assets can be:
* CSS files
* Javascript files
* Images
Assets for this template engine means every file that is contained in a subfolder of the template folder and
does not end with the extension twig.
Thus every file in the roo... | [
"Returns",
"a",
"list",
"of",
"files",
"that",
"need",
"to",
"be",
"copied",
"to",
"the",
"destination",
"location",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Scrybe/Template/Twig.php#L179-L190 |
20,431 | jasny/codeception-module | src/Connector.php | Connector.setBaseRequest | public function setBaseRequest(ServerRequestInterface $request)
{
if ($request instanceof GlobalEnvironmentInterface && $request->isStale()) {
throw new \RuntimeException("Unable to set base request: ServerRequest is stale");
}
$this->baseRequest = $request;
} | php | public function setBaseRequest(ServerRequestInterface $request)
{
if ($request instanceof GlobalEnvironmentInterface && $request->isStale()) {
throw new \RuntimeException("Unable to set base request: ServerRequest is stale");
}
$this->baseRequest = $request;
} | [
"public",
"function",
"setBaseRequest",
"(",
"ServerRequestInterface",
"$",
"request",
")",
"{",
"if",
"(",
"$",
"request",
"instanceof",
"GlobalEnvironmentInterface",
"&&",
"$",
"request",
"->",
"isStale",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeExcep... | Set the base request
@param ServerRequestInterface $request | [
"Set",
"the",
"base",
"request"
] | 5c2b12e4ab291f26424fda9fbf1618c818bc8d6e | https://github.com/jasny/codeception-module/blob/5c2b12e4ab291f26424fda9fbf1618c818bc8d6e/src/Connector.php#L77-L84 |
20,432 | jasny/codeception-module | src/Connector.php | Connector.getBaseRequest | public function getBaseRequest()
{
if (!isset($this->baseRequest)) {
$this->baseRequest = new ServerRequest();
}
$request = $this->baseRequest;
if ($request instanceof GlobalEnvironmentInterface && $request->isStale() === false) {
$request = ... | php | public function getBaseRequest()
{
if (!isset($this->baseRequest)) {
$this->baseRequest = new ServerRequest();
}
$request = $this->baseRequest;
if ($request instanceof GlobalEnvironmentInterface && $request->isStale() === false) {
$request = ... | [
"public",
"function",
"getBaseRequest",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"baseRequest",
")",
")",
"{",
"$",
"this",
"->",
"baseRequest",
"=",
"new",
"ServerRequest",
"(",
")",
";",
"}",
"$",
"request",
"=",
"$",
"this",... | Get the base request
@return ServerRequestInterface | [
"Get",
"the",
"base",
"request"
] | 5c2b12e4ab291f26424fda9fbf1618c818bc8d6e | https://github.com/jasny/codeception-module/blob/5c2b12e4ab291f26424fda9fbf1618c818bc8d6e/src/Connector.php#L91-L104 |
20,433 | jasny/codeception-module | src/Connector.php | Connector.setBaseResponse | public function setBaseResponse(ResponseInterface $response)
{
if ($response instanceof GlobalEnvironmentInterface && $response->isStale()) {
throw new \RuntimeException("Unable to set base response: Response is stale");
}
$this->baseResponse = $response;
} | php | public function setBaseResponse(ResponseInterface $response)
{
if ($response instanceof GlobalEnvironmentInterface && $response->isStale()) {
throw new \RuntimeException("Unable to set base response: Response is stale");
}
$this->baseResponse = $response;
} | [
"public",
"function",
"setBaseResponse",
"(",
"ResponseInterface",
"$",
"response",
")",
"{",
"if",
"(",
"$",
"response",
"instanceof",
"GlobalEnvironmentInterface",
"&&",
"$",
"response",
"->",
"isStale",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeExcept... | Set the base response
@param ResponseInterface $response | [
"Set",
"the",
"base",
"response"
] | 5c2b12e4ab291f26424fda9fbf1618c818bc8d6e | https://github.com/jasny/codeception-module/blob/5c2b12e4ab291f26424fda9fbf1618c818bc8d6e/src/Connector.php#L112-L119 |
20,434 | jasny/codeception-module | src/Connector.php | Connector.getBaseResponse | public function getBaseResponse()
{
if (!isset($this->baseResponse)) {
$this->baseResponse = new Response();
}
$response = $this->baseResponse;
if ($response instanceof GlobalEnvironmentInterface && $response->isStale() === false) {
$response... | php | public function getBaseResponse()
{
if (!isset($this->baseResponse)) {
$this->baseResponse = new Response();
}
$response = $this->baseResponse;
if ($response instanceof GlobalEnvironmentInterface && $response->isStale() === false) {
$response... | [
"public",
"function",
"getBaseResponse",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"baseResponse",
")",
")",
"{",
"$",
"this",
"->",
"baseResponse",
"=",
"new",
"Response",
"(",
")",
";",
"}",
"$",
"response",
"=",
"$",
"this",
... | Get the base response
@return ResponseInterface | [
"Get",
"the",
"base",
"response"
] | 5c2b12e4ab291f26424fda9fbf1618c818bc8d6e | https://github.com/jasny/codeception-module/blob/5c2b12e4ab291f26424fda9fbf1618c818bc8d6e/src/Connector.php#L126-L139 |
20,435 | jasny/codeception-module | src/Connector.php | Connector.resetOutput | protected function resetOutput()
{
if ($this->baseResponse instanceof GlobalEnvironmentInterface) {
$this->baseResponse = $this->baseResponse->revive();
}
// Clear output buffer
if (isset($this->baseResponse) && $this->baseResponse->getBody() instanceof OutputBuf... | php | protected function resetOutput()
{
if ($this->baseResponse instanceof GlobalEnvironmentInterface) {
$this->baseResponse = $this->baseResponse->revive();
}
// Clear output buffer
if (isset($this->baseResponse) && $this->baseResponse->getBody() instanceof OutputBuf... | [
"protected",
"function",
"resetOutput",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"baseResponse",
"instanceof",
"GlobalEnvironmentInterface",
")",
"{",
"$",
"this",
"->",
"baseResponse",
"=",
"$",
"this",
"->",
"baseResponse",
"->",
"revive",
"(",
")",
";... | Reset the response | [
"Reset",
"the",
"response"
] | 5c2b12e4ab291f26424fda9fbf1618c818bc8d6e | https://github.com/jasny/codeception-module/blob/5c2b12e4ab291f26424fda9fbf1618c818bc8d6e/src/Connector.php#L155-L165 |
20,436 | Eresus/EresusCMS | src/core/framework/core/WWW/HTTP/HttpMessage.php | HttpMessage.setHttpVersion | public function setHttpVersion($version)
{
// Version validation pattern
$pattern = '~^1\.[01]$~';
if (! preg_match($pattern, $version))
return false;
$this->httpVersion = $version;
return true;
} | php | public function setHttpVersion($version)
{
// Version validation pattern
$pattern = '~^1\.[01]$~';
if (! preg_match($pattern, $version))
return false;
$this->httpVersion = $version;
return true;
} | [
"public",
"function",
"setHttpVersion",
"(",
"$",
"version",
")",
"{",
"// Version validation pattern",
"$",
"pattern",
"=",
"'~^1\\.[01]$~'",
";",
"if",
"(",
"!",
"preg_match",
"(",
"$",
"pattern",
",",
"$",
"version",
")",
")",
"return",
"false",
";",
"$",... | Set the HTTP Protocol version of the Message
@param string $version
@return bool Returns TRUE on success, or FALSE if supplied version is out of range (1.0/1.1) | [
"Set",
"the",
"HTTP",
"Protocol",
"version",
"of",
"the",
"Message"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/WWW/HTTP/HttpMessage.php#L167-L177 |
20,437 | Eresus/EresusCMS | src/core/framework/core/WWW/HTTP/HttpMessage.php | HttpMessage.setRequestMethod | public function setRequestMethod($method)
{
if ($this->getType() !== self::TYPE_REQUEST)
return false;
$method = strtoupper($method);
$REQUEST_METHODS = array('OPTIONS', 'GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'TRACE');
if (!in_array($method, $REQUEST_METHODS))
... | php | public function setRequestMethod($method)
{
if ($this->getType() !== self::TYPE_REQUEST)
return false;
$method = strtoupper($method);
$REQUEST_METHODS = array('OPTIONS', 'GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'TRACE');
if (!in_array($method, $REQUEST_METHODS))
... | [
"public",
"function",
"setRequestMethod",
"(",
"$",
"method",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getType",
"(",
")",
"!==",
"self",
"::",
"TYPE_REQUEST",
")",
"return",
"false",
";",
"$",
"method",
"=",
"strtoupper",
"(",
"$",
"method",
")",
";",... | Set the Request Method of the HTTP Message
@param string $method The request method name.
{@link http://tools.ietf.org/html/rfc2068#section-5.1.1 See RFC2068 section 5.1.1}
for list of acceptable methods
@return bool TRUE on success, or FALSE if the message is not of type
HttpMessage::TYPE_REQUEST or an invalid requ... | [
"Set",
"the",
"Request",
"Method",
"of",
"the",
"HTTP",
"Message"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/WWW/HTTP/HttpMessage.php#L200-L213 |
20,438 | GrupaZero/api | src/Gzero/Api/Transformer/OptionCategoryTransformer.php | OptionCategoryTransformer.transform | public function transform($option)
{
$options = $this->entityToArray(OptionCategory::class, $option);
$data = ['data' => []];
foreach ($options as $option) {
$data['data'][] = [
'key' => $option,
];
}
return $data;
} | php | public function transform($option)
{
$options = $this->entityToArray(OptionCategory::class, $option);
$data = ['data' => []];
foreach ($options as $option) {
$data['data'][] = [
'key' => $option,
];
}
return $data;
} | [
"public",
"function",
"transform",
"(",
"$",
"option",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"entityToArray",
"(",
"OptionCategory",
"::",
"class",
",",
"$",
"option",
")",
";",
"$",
"data",
"=",
"[",
"'data'",
"=>",
"[",
"]",
"]",
";",
... | Transforms option category entity
@param array $option OptionCategory entity
@return array | [
"Transforms",
"option",
"category",
"entity"
] | fc544bb6057274e9d5e7b617346c3f854ea5effd | https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Transformer/OptionCategoryTransformer.php#L26-L37 |
20,439 | hametuha/wpametu | src/WPametu/API/QueryHighJack.php | QueryHighJack.query_vars | public function query_vars( array $vars ){
if( !empty($this->query_var) ){
foreach( $this->query_var as $var ){
if( false === array_search($var, $vars) ){
$vars[] = $var;
}
}
}
return $vars;
} | php | public function query_vars( array $vars ){
if( !empty($this->query_var) ){
foreach( $this->query_var as $var ){
if( false === array_search($var, $vars) ){
$vars[] = $var;
}
}
}
return $vars;
} | [
"public",
"function",
"query_vars",
"(",
"array",
"$",
"vars",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"query_var",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"query_var",
"as",
"$",
"var",
")",
"{",
"if",
"(",
"false",
... | Add query var filter
@param array $vars
@return array | [
"Add",
"query",
"var",
"filter"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/API/QueryHighJack.php#L54-L63 |
20,440 | hametuha/wpametu | src/WPametu/API/QueryHighJack.php | QueryHighJack.rewrite_rules_array | public function rewrite_rules_array( array $rules ){
if( !empty($this->rewrites) ){
$rules = array_merge($this->rewrites, $rules);
}
return $rules;
} | php | public function rewrite_rules_array( array $rules ){
if( !empty($this->rewrites) ){
$rules = array_merge($this->rewrites, $rules);
}
return $rules;
} | [
"public",
"function",
"rewrite_rules_array",
"(",
"array",
"$",
"rules",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"rewrites",
")",
")",
"{",
"$",
"rules",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"rewrites",
",",
"$",
"rules",
")... | Register rewrite rules
@param array $rules
@return array | [
"Register",
"rewrite",
"rules"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/API/QueryHighJack.php#L71-L76 |
20,441 | hametuha/wpametu | src/WPametu/API/QueryHighJack.php | QueryHighJack.detect_title | final public function detect_title( \WP_Query &$wp_query ){
if( $wp_query->is_main_query() && $this->is_valid_query($wp_query) ){
add_filter('wp_title', [$this, 'wp_title'], 10, 3);
}
} | php | final public function detect_title( \WP_Query &$wp_query ){
if( $wp_query->is_main_query() && $this->is_valid_query($wp_query) ){
add_filter('wp_title', [$this, 'wp_title'], 10, 3);
}
} | [
"final",
"public",
"function",
"detect_title",
"(",
"\\",
"WP_Query",
"&",
"$",
"wp_query",
")",
"{",
"if",
"(",
"$",
"wp_query",
"->",
"is_main_query",
"(",
")",
"&&",
"$",
"this",
"->",
"is_valid_query",
"(",
"$",
"wp_query",
")",
")",
"{",
"add_filter... | Add wp_title filter if required
@param \WP_Query $wp_query | [
"Add",
"wp_title",
"filter",
"if",
"required"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/API/QueryHighJack.php#L83-L87 |
20,442 | hametuha/wpametu | src/WPametu/API/QueryHighJack.php | QueryHighJack.add_meta_query | protected function add_meta_query( \WP_Query &$wp_query, array $meta_query ){
$old_query = (array) $wp_query->get('meta_query');
array_push($old_query, $meta_query);
$wp_query->set('meta_query', $old_query);
} | php | protected function add_meta_query( \WP_Query &$wp_query, array $meta_query ){
$old_query = (array) $wp_query->get('meta_query');
array_push($old_query, $meta_query);
$wp_query->set('meta_query', $old_query);
} | [
"protected",
"function",
"add_meta_query",
"(",
"\\",
"WP_Query",
"&",
"$",
"wp_query",
",",
"array",
"$",
"meta_query",
")",
"{",
"$",
"old_query",
"=",
"(",
"array",
")",
"$",
"wp_query",
"->",
"get",
"(",
"'meta_query'",
")",
";",
"array_push",
"(",
"... | Add meta query
@param \WP_Query $wp_query
@param array $meta_query | [
"Add",
"meta",
"query"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/API/QueryHighJack.php#L226-L230 |
20,443 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Data.php | Dwoo_Data.clear | public function clear($name = null)
{
if ($name === null) {
$this->data = array();
} elseif (is_array($name)) {
foreach ($name as $index)
unset($this->data[$index]);
} else {
unset($this->data[$name]);
}
} | php | public function clear($name = null)
{
if ($name === null) {
$this->data = array();
} elseif (is_array($name)) {
foreach ($name as $index)
unset($this->data[$index]);
} else {
unset($this->data[$name]);
}
} | [
"public",
"function",
"clear",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"name",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"data",
"=",
"array",
"(",
")",
";",
"}",
"elseif",
"(",
"is_array",
"(",
"$",
"name",
")",
")",
"{",
... | clears a the entire data or only the given key
@param array|string $name clears only one value if you give a name, multiple values if
you give an array of names, or the entire data if left null | [
"clears",
"a",
"the",
"entire",
"data",
"or",
"only",
"the",
"given",
"key"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Data.php#L43-L53 |
20,444 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Data.php | Dwoo_Data.assign | public function assign($name, $val = null)
{
if (is_array($name)) {
reset($name);
while (list($k,$v) = each($name))
$this->data[$k] = $v;
} else {
$this->data[$name] = $val;
}
} | php | public function assign($name, $val = null)
{
if (is_array($name)) {
reset($name);
while (list($k,$v) = each($name))
$this->data[$k] = $v;
} else {
$this->data[$name] = $val;
}
} | [
"public",
"function",
"assign",
"(",
"$",
"name",
",",
"$",
"val",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"name",
")",
")",
"{",
"reset",
"(",
"$",
"name",
")",
";",
"while",
"(",
"list",
"(",
"$",
"k",
",",
"$",
"v",
")",
... | assigns a value or an array of values to the data object
@param array|string $name an associative array of multiple (index=>value) or a string
that is the index to use, i.e. a value assigned to "foo" will be
accessible in the template through {$foo}
@param mixed $val the value to assign, or null if $name was an array | [
"assigns",
"a",
"value",
"or",
"an",
"array",
"of",
"values",
"to",
"the",
"data",
"object"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Data.php#L89-L98 |
20,445 | kusanagi/katana-sdk-php7 | src/Api/Factory/ServiceApiFactory.php | ServiceApiFactory.build | public function build(
$action,
array $data,
CliInput $input,
Mapping $mapping
) {
$context = new ZMQContext();
$socket = new ZMQSocket($context, ZMQ::SOCKET_REQ);
$socket->setSockOpt(ZMQ::SOCKOPT_LINGER, 0);
if ($input->getMapping() === 'compact') {
... | php | public function build(
$action,
array $data,
CliInput $input,
Mapping $mapping
) {
$context = new ZMQContext();
$socket = new ZMQSocket($context, ZMQ::SOCKET_REQ);
$socket->setSockOpt(ZMQ::SOCKOPT_LINGER, 0);
if ($input->getMapping() === 'compact') {
... | [
"public",
"function",
"build",
"(",
"$",
"action",
",",
"array",
"$",
"data",
",",
"CliInput",
"$",
"input",
",",
"Mapping",
"$",
"mapping",
")",
"{",
"$",
"context",
"=",
"new",
"ZMQContext",
"(",
")",
";",
"$",
"socket",
"=",
"new",
"ZMQSocket",
"(... | Build an Action Api class instance
@param string $action
@param array $data
@param CliInput $input
@param Mapping $mapping
@return ActionApi | [
"Build",
"an",
"Action",
"Api",
"class",
"instance"
] | 91e7860a1852c3ce79a7034f8c36f41840e69e1f | https://github.com/kusanagi/katana-sdk-php7/blob/91e7860a1852c3ce79a7034f8c36f41840e69e1f/src/Api/Factory/ServiceApiFactory.php#L47-L90 |
20,446 | artscorestudio/document-bundle | Repository/PostRepository.php | PostRepository.getLastVersion | public function getLastVersion($post_id)
{
$qb = $this->createQueryBuilder('p');
$qb->where('p.original=:post_id')
->orderBy('p.createdAt', 'DESC')
->setParameter(':post_id', $post_id);
$result = $qb->getQuery()->setMaxResults(1)->getResult(Query::HYDRATE_OBJECT);
if ( is_null($result) ) {
$q... | php | public function getLastVersion($post_id)
{
$qb = $this->createQueryBuilder('p');
$qb->where('p.original=:post_id')
->orderBy('p.createdAt', 'DESC')
->setParameter(':post_id', $post_id);
$result = $qb->getQuery()->setMaxResults(1)->getResult(Query::HYDRATE_OBJECT);
if ( is_null($result) ) {
$q... | [
"public",
"function",
"getLastVersion",
"(",
"$",
"post_id",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"'p'",
")",
";",
"$",
"qb",
"->",
"where",
"(",
"'p.original=:post_id'",
")",
"->",
"orderBy",
"(",
"'p.createdAt'",
",",
... | Get last version for a post
@param integer $id AsfDocumentBundle:Page ID | [
"Get",
"last",
"version",
"for",
"a",
"post"
] | 3aceab0f75de8f7dd0fad0d0db83d7940bf565c8 | https://github.com/artscorestudio/document-bundle/blob/3aceab0f75de8f7dd0fad0d0db83d7940bf565c8/Repository/PostRepository.php#L29-L47 |
20,447 | artscorestudio/document-bundle | Repository/PostRepository.php | PostRepository.getAllLastVersion | public function getAllLastVersion()
{
$qb = $this->createQueryBuilder('p');
$qb->where('p.original IS NULL AND p.state=:state')
->setParameter(':state', DocumentModel::STATE_PUBLISHED);
$result = $qb->getQuery()->getResult();
$return = array();
foreach($result as $original) {
$return[] = $this->getL... | php | public function getAllLastVersion()
{
$qb = $this->createQueryBuilder('p');
$qb->where('p.original IS NULL AND p.state=:state')
->setParameter(':state', DocumentModel::STATE_PUBLISHED);
$result = $qb->getQuery()->getResult();
$return = array();
foreach($result as $original) {
$return[] = $this->getL... | [
"public",
"function",
"getAllLastVersion",
"(",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"'p'",
")",
";",
"$",
"qb",
"->",
"where",
"(",
"'p.original IS NULL AND p.state=:state'",
")",
"->",
"setParameter",
"(",
"':state'",
",",
... | Get all posts in their last version | [
"Get",
"all",
"posts",
"in",
"their",
"last",
"version"
] | 3aceab0f75de8f7dd0fad0d0db83d7940bf565c8 | https://github.com/artscorestudio/document-bundle/blob/3aceab0f75de8f7dd0fad0d0db83d7940bf565c8/Repository/PostRepository.php#L52-L64 |
20,448 | WasabiLib/Mail | src/Mail.php | Mail.attachFiles | private function attachFiles(){
if (count($this->attachments) === 0) {
return;
}
// Get old message parts
$mimeMessage = $this->message->getBody();
if (is_string($mimeMessage)) {
$originalBodyPart = new Mime\Part($mimeMessage);
$originalBodyPar... | php | private function attachFiles(){
if (count($this->attachments) === 0) {
return;
}
// Get old message parts
$mimeMessage = $this->message->getBody();
if (is_string($mimeMessage)) {
$originalBodyPart = new Mime\Part($mimeMessage);
$originalBodyPar... | [
"private",
"function",
"attachFiles",
"(",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"attachments",
")",
"===",
"0",
")",
"{",
"return",
";",
"}",
"// Get old message parts",
"$",
"mimeMessage",
"=",
"$",
"this",
"->",
"message",
"->",
"getBo... | Attaches files to the message if any | [
"Attaches",
"files",
"to",
"the",
"message",
"if",
"any"
] | 5e6a1de480d500e380e5ecfbf633d40f87e9c8e9 | https://github.com/WasabiLib/Mail/blob/5e6a1de480d500e380e5ecfbf633d40f87e9c8e9/src/Mail.php#L234-L270 |
20,449 | barrelstrength/craftnet-php | src/CraftnetClient.php | CraftnetClient.post | public function post($endpoint, array $options = [])
{
$jsonValues = [];
if (isset($options['json'])) {
$jsonValues = $options['json'];
}
return $this->httpClient->request('POST', 'https://api.craftcms.com/v1/'.$endpoint, [
'auth' => $this->setAuth(),
... | php | public function post($endpoint, array $options = [])
{
$jsonValues = [];
if (isset($options['json'])) {
$jsonValues = $options['json'];
}
return $this->httpClient->request('POST', 'https://api.craftcms.com/v1/'.$endpoint, [
'auth' => $this->setAuth(),
... | [
"public",
"function",
"post",
"(",
"$",
"endpoint",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"jsonValues",
"=",
"[",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"'json'",
"]",
")",
")",
"{",
"$",
"jsonValues",
"=",
... | Sends a POST request to the Craftnet API
@param $endpoint
@param array $options
@return mixed|\Psr\Http\Message\ResponseInterface
@throws \GuzzleHttp\Exception\GuzzleException | [
"Sends",
"a",
"POST",
"request",
"to",
"the",
"Craftnet",
"API"
] | 90c9767b6bef6078bc062b3bfcdde38b24c843fc | https://github.com/barrelstrength/craftnet-php/blob/90c9767b6bef6078bc062b3bfcdde38b24c843fc/src/CraftnetClient.php#L98-L110 |
20,450 | petrica/php-statsd-system | Config/ConfigLoader.php | ConfigLoader.load | public function load()
{
if (file_exists($this->filepath) && ($contents = file_get_contents($this->filepath))) {
$yaml = new Parser();
$config = $yaml->parse($contents);
if (null === $config) {
$config = array();
}
$processor = ne... | php | public function load()
{
if (file_exists($this->filepath) && ($contents = file_get_contents($this->filepath))) {
$yaml = new Parser();
$config = $yaml->parse($contents);
if (null === $config) {
$config = array();
}
$processor = ne... | [
"public",
"function",
"load",
"(",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"this",
"->",
"filepath",
")",
"&&",
"(",
"$",
"contents",
"=",
"file_get_contents",
"(",
"$",
"this",
"->",
"filepath",
")",
")",
")",
"{",
"$",
"yaml",
"=",
"new",
"... | Process configuration and make sure the configuration format is as expected
@return array | [
"Process",
"configuration",
"and",
"make",
"sure",
"the",
"configuration",
"format",
"is",
"as",
"expected"
] | c476be3514a631a605737888bb8f6eb096789c9d | https://github.com/petrica/php-statsd-system/blob/c476be3514a631a605737888bb8f6eb096789c9d/Config/ConfigLoader.php#L36-L66 |
20,451 | oroinc/OroLayoutComponent | Util/BlockUtils.php | BlockUtils.registerPlugin | public static function registerPlugin(BlockView $view, $pluginName)
{
$optionsArray = $view->vars['block_prefixes'];
array_splice(
$optionsArray,
-1,
1,
[$pluginName, end($optionsArray)]
);
$view->vars['block_prefixes'] = $optionsArray;... | php | public static function registerPlugin(BlockView $view, $pluginName)
{
$optionsArray = $view->vars['block_prefixes'];
array_splice(
$optionsArray,
-1,
1,
[$pluginName, end($optionsArray)]
);
$view->vars['block_prefixes'] = $optionsArray;... | [
"public",
"static",
"function",
"registerPlugin",
"(",
"BlockView",
"$",
"view",
",",
"$",
"pluginName",
")",
"{",
"$",
"optionsArray",
"=",
"$",
"view",
"->",
"vars",
"[",
"'block_prefixes'",
"]",
";",
"array_splice",
"(",
"$",
"optionsArray",
",",
"-",
"... | Registers the plugin for the block type.
You can use this method to add the additional block prefix that allow you
to create an additional template for existing block type.
IMPORTANT: This method should be called in finishView of your block type extension
because the 'block_prefixes' array is not filled in buildView y... | [
"Registers",
"the",
"plugin",
"for",
"the",
"block",
"type",
".",
"You",
"can",
"use",
"this",
"method",
"to",
"add",
"the",
"additional",
"block",
"prefix",
"that",
"allow",
"you",
"to",
"create",
"an",
"additional",
"template",
"for",
"existing",
"block",
... | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Util/BlockUtils.php#L22-L32 |
20,452 | oroinc/OroLayoutComponent | Util/BlockUtils.php | BlockUtils.normalizeTransValue | public static function normalizeTransValue($text, $parameters = null)
{
if (is_string($text) && !empty($text)) {
$text = ['label' => $text];
}
if (!empty($parameters) && is_array($text) && !isset($text['parameters'])) {
$text['parameters'] = $parameters;
}
... | php | public static function normalizeTransValue($text, $parameters = null)
{
if (is_string($text) && !empty($text)) {
$text = ['label' => $text];
}
if (!empty($parameters) && is_array($text) && !isset($text['parameters'])) {
$text['parameters'] = $parameters;
}
... | [
"public",
"static",
"function",
"normalizeTransValue",
"(",
"$",
"text",
",",
"$",
"parameters",
"=",
"null",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"text",
")",
"&&",
"!",
"empty",
"(",
"$",
"text",
")",
")",
"{",
"$",
"text",
"=",
"[",
"'lab... | Normalizes the given value to the format that can be translated by a renderer.
@param string|array $text The text to be translated
@param array|null $parameters The parameters
@return array | [
"Normalizes",
"the",
"given",
"value",
"to",
"the",
"format",
"that",
"can",
"be",
"translated",
"by",
"a",
"renderer",
"."
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Util/BlockUtils.php#L42-L52 |
20,453 | oroinc/OroLayoutComponent | Util/BlockUtils.php | BlockUtils.processUrl | public static function processUrl(BlockView $view, Options $options, $required = false, $prefix = null)
{
$pathName = null !== $prefix ? $prefix . '_path' : 'path';
$routeName = null !== $prefix ? $prefix . '_route_name' : 'route_name';
if ($options->isExistsAndNotEmpty($pathName)) {
... | php | public static function processUrl(BlockView $view, Options $options, $required = false, $prefix = null)
{
$pathName = null !== $prefix ? $prefix . '_path' : 'path';
$routeName = null !== $prefix ? $prefix . '_route_name' : 'route_name';
if ($options->isExistsAndNotEmpty($pathName)) {
... | [
"public",
"static",
"function",
"processUrl",
"(",
"BlockView",
"$",
"view",
",",
"Options",
"$",
"options",
",",
"$",
"required",
"=",
"false",
",",
"$",
"prefix",
"=",
"null",
")",
"{",
"$",
"pathName",
"=",
"null",
"!==",
"$",
"prefix",
"?",
"$",
... | Gets the url related options and pass them to the block view.
@param BlockView $view The block view
@param Options $options The block options
@param boolean $required Specifies whether the url related options are mandatory
@param string|null $prefix The prefix for the url related options
@SuppressWar... | [
"Gets",
"the",
"url",
"related",
"options",
"and",
"pass",
"them",
"to",
"the",
"block",
"view",
"."
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Util/BlockUtils.php#L64-L82 |
20,454 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.removePreProcessor | public function removePreProcessor($callback)
{
if (($index = array_search($callback, $this->processors['pre'], true)) !== false) {
unset($this->processors['pre'][$index]);
} elseif (($index = array_search('Dwoo_Processor_'.str_replace('Dwoo_Processor_', '', $callback), $this->processors['pre'], true)) !== fals... | php | public function removePreProcessor($callback)
{
if (($index = array_search($callback, $this->processors['pre'], true)) !== false) {
unset($this->processors['pre'][$index]);
} elseif (($index = array_search('Dwoo_Processor_'.str_replace('Dwoo_Processor_', '', $callback), $this->processors['pre'], true)) !== fals... | [
"public",
"function",
"removePreProcessor",
"(",
"$",
"callback",
")",
"{",
"if",
"(",
"(",
"$",
"index",
"=",
"array_search",
"(",
"$",
"callback",
",",
"$",
"this",
"->",
"processors",
"[",
"'pre'",
"]",
",",
"true",
")",
")",
"!==",
"false",
")",
... | removes a preprocessor from the compiler
@param mixed $callback either a valid callback to the preprocessor or a simple name if it was autoloaded | [
"removes",
"a",
"preprocessor",
"from",
"the",
"compiler"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L380-L395 |
20,455 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.addPostProcessor | public function addPostProcessor($callback, $autoload = false)
{
if ($autoload) {
$name = str_replace('Dwoo_Processor_', '', $callback);
$class = 'Dwoo_Processor_'.$name;
if (class_exists($class, false)) {
$callback = array(new $class($this), 'process');
} elseif (function_exists($class)) {
$cal... | php | public function addPostProcessor($callback, $autoload = false)
{
if ($autoload) {
$name = str_replace('Dwoo_Processor_', '', $callback);
$class = 'Dwoo_Processor_'.$name;
if (class_exists($class, false)) {
$callback = array(new $class($this), 'process');
} elseif (function_exists($class)) {
$cal... | [
"public",
"function",
"addPostProcessor",
"(",
"$",
"callback",
",",
"$",
"autoload",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"autoload",
")",
"{",
"$",
"name",
"=",
"str_replace",
"(",
"'Dwoo_Processor_'",
",",
"''",
",",
"$",
"callback",
")",
";",
"$... | adds a postprocessor to the compiler, it will be called
before the template is compiled
@param mixed $callback either a valid callback to the postprocessor or a simple name if the autoload is set to true
@param bool $autoload if set to true, the postprocessor is auto-loaded from one of the plugin directories, else you... | [
"adds",
"a",
"postprocessor",
"to",
"the",
"compiler",
"it",
"will",
"be",
"called",
"before",
"the",
"template",
"is",
"compiled"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L404-L422 |
20,456 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.loadProcessor | protected function loadProcessor($class, $name)
{
if (!class_exists($class, false) && !function_exists($class)) {
try {
$this->dwoo->getLoader()->loadPlugin($name);
} catch (Dwoo_Exception $e) {
throw new Dwoo_Exception('Processor '.$name.' could not be found in your plugin directories, please ensure i... | php | protected function loadProcessor($class, $name)
{
if (!class_exists($class, false) && !function_exists($class)) {
try {
$this->dwoo->getLoader()->loadPlugin($name);
} catch (Dwoo_Exception $e) {
throw new Dwoo_Exception('Processor '.$name.' could not be found in your plugin directories, please ensure i... | [
"protected",
"function",
"loadProcessor",
"(",
"$",
"class",
",",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"class",
",",
"false",
")",
"&&",
"!",
"function_exists",
"(",
"$",
"class",
")",
")",
"{",
"try",
"{",
"$",
"this",
... | internal function to autoload processors at runtime if required
@param string $class the class/function name
@param string $name the plugin name (without Dwoo_Plugin_ prefix) | [
"internal",
"function",
"to",
"autoload",
"processors",
"at",
"runtime",
"if",
"required"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L452-L471 |
20,457 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.resolveSubTemplateDependencies | protected function resolveSubTemplateDependencies($function)
{
$body = $this->templatePlugins[$function]['body'];
foreach ($this->templatePlugins as $func => $attr) {
if ($func !== $function && !isset($attr['called']) && strpos($body, 'Dwoo_Plugin_'.$func) !== false) {
$this->templatePlugins[$func]['called'... | php | protected function resolveSubTemplateDependencies($function)
{
$body = $this->templatePlugins[$function]['body'];
foreach ($this->templatePlugins as $func => $attr) {
if ($func !== $function && !isset($attr['called']) && strpos($body, 'Dwoo_Plugin_'.$func) !== false) {
$this->templatePlugins[$func]['called'... | [
"protected",
"function",
"resolveSubTemplateDependencies",
"(",
"$",
"function",
")",
"{",
"$",
"body",
"=",
"$",
"this",
"->",
"templatePlugins",
"[",
"$",
"function",
"]",
"[",
"'body'",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"templatePlugins",
"as",... | checks what sub-templates are used in every sub-template so that we're sure they are all compiled
@param string $function the sub-template name | [
"checks",
"what",
"sub",
"-",
"templates",
"are",
"used",
"in",
"every",
"sub",
"-",
"template",
"so",
"that",
"we",
"re",
"sure",
"they",
"are",
"all",
"compiled"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L916-L926 |
20,458 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.setScope | public function setScope($scope, $absolute = false)
{
$old = $this->scopeTree;
if ($scope===null) {
unset($this->scope);
$this->scope = null;
}
if (is_array($scope)===false) {
$scope = explode('.', $scope);
}
if ($absolute===true) {
$this->scope =& $this->data;
$this->scopeTree = array();... | php | public function setScope($scope, $absolute = false)
{
$old = $this->scopeTree;
if ($scope===null) {
unset($this->scope);
$this->scope = null;
}
if (is_array($scope)===false) {
$scope = explode('.', $scope);
}
if ($absolute===true) {
$this->scope =& $this->data;
$this->scopeTree = array();... | [
"public",
"function",
"setScope",
"(",
"$",
"scope",
",",
"$",
"absolute",
"=",
"false",
")",
"{",
"$",
"old",
"=",
"$",
"this",
"->",
"scopeTree",
";",
"if",
"(",
"$",
"scope",
"===",
"null",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"scope",
"... | sets the scope
set to null if the scope becomes "unstable" (i.e. too variable or unknown) so that
variables are compiled in a more evaluative way than just $this->scope['key']
@param mixed $scope a string i.e. "level1.level2" or an array i.e. array("level1", "level2")
@param bool $absolute if true, the scope is set f... | [
"sets",
"the",
"scope"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L964-L1004 |
20,459 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.addBlock | public function addBlock($type, array $params, $paramtype)
{
$class = 'Dwoo_Plugin_'.$type;
if (class_exists($class, false) === false) {
$this->dwoo->getLoader()->loadPlugin($type);
}
$params = $this->mapParams($params, array($class, 'init'), $paramtype);
$this->stack[] = array('type' => $type, 'params'... | php | public function addBlock($type, array $params, $paramtype)
{
$class = 'Dwoo_Plugin_'.$type;
if (class_exists($class, false) === false) {
$this->dwoo->getLoader()->loadPlugin($type);
}
$params = $this->mapParams($params, array($class, 'init'), $paramtype);
$this->stack[] = array('type' => $type, 'params'... | [
"public",
"function",
"addBlock",
"(",
"$",
"type",
",",
"array",
"$",
"params",
",",
"$",
"paramtype",
")",
"{",
"$",
"class",
"=",
"'Dwoo_Plugin_'",
".",
"$",
"type",
";",
"if",
"(",
"class_exists",
"(",
"$",
"class",
",",
"false",
")",
"===",
"fal... | adds a block to the top of the block stack
@param string $type block type (name)
@param array $params the parameters array
@param int $paramtype the parameters type (see mapParams), 0, 1 or 2
@return string the preProcessing() method's output | [
"adds",
"a",
"block",
"to",
"the",
"top",
"of",
"the",
"block",
"stack"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L1014-L1026 |
20,460 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.injectBlock | public function injectBlock($type, array $params)
{
$class = 'Dwoo_Plugin_'.$type;
if (class_exists($class, false) === false) {
$this->dwoo->getLoader()->loadPlugin($type);
}
$this->stack[] = array('type' => $type, 'params' => $params, 'custom' => false, 'class' => $class, 'buffer' => null);
$this->curBlo... | php | public function injectBlock($type, array $params)
{
$class = 'Dwoo_Plugin_'.$type;
if (class_exists($class, false) === false) {
$this->dwoo->getLoader()->loadPlugin($type);
}
$this->stack[] = array('type' => $type, 'params' => $params, 'custom' => false, 'class' => $class, 'buffer' => null);
$this->curBlo... | [
"public",
"function",
"injectBlock",
"(",
"$",
"type",
",",
"array",
"$",
"params",
")",
"{",
"$",
"class",
"=",
"'Dwoo_Plugin_'",
".",
"$",
"type",
";",
"if",
"(",
"class_exists",
"(",
"$",
"class",
",",
"false",
")",
"===",
"false",
")",
"{",
"$",
... | injects a block at the top of the plugin stack without calling its preProcessing method
used by {else} blocks to re-add themselves after having closed everything up to their parent
@param string $type block type (name)
@param array $params parameters array | [
"injects",
"a",
"block",
"at",
"the",
"top",
"of",
"the",
"plugin",
"stack",
"without",
"calling",
"its",
"preProcessing",
"method"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L1060-L1068 |
20,461 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.removeBlock | public function removeBlock($type)
{
$output = '';
$pluginType = $this->getPluginType($type);
if ($pluginType & Dwoo::SMARTY_BLOCK) {
$type = 'smartyinterface';
}
while (true) {
while ($top = array_pop($this->stack)) {
if ($top['custom']) {
$class = $top['class'];
} else {
$class = '... | php | public function removeBlock($type)
{
$output = '';
$pluginType = $this->getPluginType($type);
if ($pluginType & Dwoo::SMARTY_BLOCK) {
$type = 'smartyinterface';
}
while (true) {
while ($top = array_pop($this->stack)) {
if ($top['custom']) {
$class = $top['class'];
} else {
$class = '... | [
"public",
"function",
"removeBlock",
"(",
"$",
"type",
")",
"{",
"$",
"output",
"=",
"''",
";",
"$",
"pluginType",
"=",
"$",
"this",
"->",
"getPluginType",
"(",
"$",
"type",
")",
";",
"if",
"(",
"$",
"pluginType",
"&",
"Dwoo",
"::",
"SMARTY_BLOCK",
"... | removes the closest-to-top block of the given type and all other
blocks encountered while going down the block stack
@param string $type block type (name)
@return string the output of all postProcessing() method's return values of the closed blocks | [
"removes",
"the",
"closest",
"-",
"to",
"-",
"top",
"block",
"of",
"the",
"given",
"type",
"and",
"all",
"other",
"blocks",
"encountered",
"while",
"going",
"down",
"the",
"block",
"stack"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L1077-L1111 |
20,462 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.& | public function &findBlock($type, $closeAlong = false)
{
if ($closeAlong===true) {
while ($b = end($this->stack)) {
if ($b['type']===$type) {
return $this->stack[key($this->stack)];
}
$this->push($this->removeTopBlock(), 0);
}
} else {
end($this->stack);
while ($b = current($this->stac... | php | public function &findBlock($type, $closeAlong = false)
{
if ($closeAlong===true) {
while ($b = end($this->stack)) {
if ($b['type']===$type) {
return $this->stack[key($this->stack)];
}
$this->push($this->removeTopBlock(), 0);
}
} else {
end($this->stack);
while ($b = current($this->stac... | [
"public",
"function",
"&",
"findBlock",
"(",
"$",
"type",
",",
"$",
"closeAlong",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"closeAlong",
"===",
"true",
")",
"{",
"while",
"(",
"$",
"b",
"=",
"end",
"(",
"$",
"this",
"->",
"stack",
")",
")",
"{",
... | returns a reference to the first block of the given type encountered and
optionally closes all blocks until it finds it
this is mainly used by {else} plugins to close everything that was opened
between their parent and themselves
@param string $type the block type (name)
@param bool $closeAlong whether to close all b... | [
"returns",
"a",
"reference",
"to",
"the",
"first",
"block",
"of",
"the",
"given",
"type",
"encountered",
"and",
"optionally",
"closes",
"all",
"blocks",
"until",
"it",
"finds",
"it"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L1125-L1145 |
20,463 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.replaceStringVars | protected function replaceStringVars($string, $first, $curBlock='')
{
$pos = 0;
if ($this->debug) echo 'STRING VAR REPLACEMENT : '.$string.'<br>';
// replace vars
while (($pos = strpos($string, '$', $pos)) !== false) {
$prev = substr($string, $pos-1, 1);
if ($prev === '\\') {
$pos++;
continue;
... | php | protected function replaceStringVars($string, $first, $curBlock='')
{
$pos = 0;
if ($this->debug) echo 'STRING VAR REPLACEMENT : '.$string.'<br>';
// replace vars
while (($pos = strpos($string, '$', $pos)) !== false) {
$prev = substr($string, $pos-1, 1);
if ($prev === '\\') {
$pos++;
continue;
... | [
"protected",
"function",
"replaceStringVars",
"(",
"$",
"string",
",",
"$",
"first",
",",
"$",
"curBlock",
"=",
"''",
")",
"{",
"$",
"pos",
"=",
"0",
";",
"if",
"(",
"$",
"this",
"->",
"debug",
")",
"echo",
"'STRING VAR REPLACEMENT : '",
".",
"$",
"str... | replaces variables within a parsed string
@param string $string the parsed string
@param string $first the first character parsed in the string, which is the string delimiter (' or ")
@param string $curBlock the current parser-block being processed
@return string the original string with variables replaced | [
"replaces",
"variables",
"within",
"a",
"parsed",
"string"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L2545-L2580 |
20,464 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/mail.php | ezcMail.generateHeaders | public function generateHeaders()
{
// set our headers first.
if ( $this->from !== null )
{
$this->setHeader( "From", ezcMailTools::composeEmailAddress( $this->from ) );
}
if ( $this->to !== null )
{
$this->setHeader( "To", ezcMailTools::compo... | php | public function generateHeaders()
{
// set our headers first.
if ( $this->from !== null )
{
$this->setHeader( "From", ezcMailTools::composeEmailAddress( $this->from ) );
}
if ( $this->to !== null )
{
$this->setHeader( "To", ezcMailTools::compo... | [
"public",
"function",
"generateHeaders",
"(",
")",
"{",
"// set our headers first.",
"if",
"(",
"$",
"this",
"->",
"from",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"setHeader",
"(",
"\"From\"",
",",
"ezcMailTools",
"::",
"composeEmailAddress",
"(",
"$",
"... | Returns the generated headers for the mail.
This method is called automatically when the mail message is built.
You can re-implement this method in subclasses if you wish to set
different mail headers than ezcMail.
@return string | [
"Returns",
"the",
"generated",
"headers",
"for",
"the",
"mail",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/mail.php#L342-L384 |
20,465 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/mail.php | ezcMail.fetchParts | public function fetchParts( $filter = null, $includeDigests = false )
{
$context = new ezcMailPartWalkContext( array( __CLASS__, 'collectPart' ) );
$context->includeDigests = $includeDigests;
$context->filter = $filter;
$context->level = 0;
$this->walkParts( $context, $this )... | php | public function fetchParts( $filter = null, $includeDigests = false )
{
$context = new ezcMailPartWalkContext( array( __CLASS__, 'collectPart' ) );
$context->includeDigests = $includeDigests;
$context->filter = $filter;
$context->level = 0;
$this->walkParts( $context, $this )... | [
"public",
"function",
"fetchParts",
"(",
"$",
"filter",
"=",
"null",
",",
"$",
"includeDigests",
"=",
"false",
")",
"{",
"$",
"context",
"=",
"new",
"ezcMailPartWalkContext",
"(",
"array",
"(",
"__CLASS__",
",",
"'collectPart'",
")",
")",
";",
"$",
"contex... | Returns an array of mail parts from the current mail.
The array returned contains objects of classes:
- ezcMailText
- ezcMailFile
- ezcMailRfc822Digest
If the method is called with $includeDigests as true, then the returned
array will not contain ezcMailRfc822Digest objects, but instead the mail
parts inside the diges... | [
"Returns",
"an",
"array",
"of",
"mail",
"parts",
"from",
"the",
"current",
"mail",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/mail.php#L420-L428 |
20,466 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/mail.php | ezcMail.walkParts | public function walkParts( ezcMailPartWalkContext $context, ezcMailPart $mail )
{
$className = get_class( $mail );
$context->level++;
switch ( $className )
{
case 'ezcMail':
case 'ezcMailComposer':
if ( $mail->body !== null )
{
... | php | public function walkParts( ezcMailPartWalkContext $context, ezcMailPart $mail )
{
$className = get_class( $mail );
$context->level++;
switch ( $className )
{
case 'ezcMail':
case 'ezcMailComposer':
if ( $mail->body !== null )
{
... | [
"public",
"function",
"walkParts",
"(",
"ezcMailPartWalkContext",
"$",
"context",
",",
"ezcMailPart",
"$",
"mail",
")",
"{",
"$",
"className",
"=",
"get_class",
"(",
"$",
"mail",
")",
";",
"$",
"context",
"->",
"level",
"++",
";",
"switch",
"(",
"$",
"cl... | Walks recursively through the mail parts in the specified mail object.
$context is an object of class ezcMailPartWalkContext, which must contain
a valid callback function name to be applied to all mail parts. You can use
the collectPart() method, or create your own callback function which can
for example save the mail... | [
"Walks",
"recursively",
"through",
"the",
"mail",
"parts",
"in",
"the",
"specified",
"mail",
"object",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/mail.php#L460-L532 |
20,467 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/multipart_parser.php | ezcMailMultipartParser.parseBody | public function parseBody( $origLine )
{
if ( $this->parserState == self::PARSE_STATE_POST_LAST )
{
return;
}
$line = rtrim( $origLine, "\r\n" );
// check if we hit any of the boundaries
$newPart = false;
$endOfMultipart = false;
if ( str... | php | public function parseBody( $origLine )
{
if ( $this->parserState == self::PARSE_STATE_POST_LAST )
{
return;
}
$line = rtrim( $origLine, "\r\n" );
// check if we hit any of the boundaries
$newPart = false;
$endOfMultipart = false;
if ( str... | [
"public",
"function",
"parseBody",
"(",
"$",
"origLine",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"parserState",
"==",
"self",
"::",
"PARSE_STATE_POST_LAST",
")",
"{",
"return",
";",
"}",
"$",
"line",
"=",
"rtrim",
"(",
"$",
"origLine",
",",
"\"\\r\\n\"",... | Parses a multipart body.
@throws ezcBaseFileNotFoundException
if a neccessary temporary file could not be opened.
@param string $origLine | [
"Parses",
"a",
"multipart",
"body",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/multipart_parser.php#L106-L185 |
20,468 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/multipart_parser.php | ezcMailMultipartParser.finish | public function finish()
{
if ( $this->parserState != self::PARSE_STATE_POST_LAST )
{
// this should never happen
// let's give the last parser a chance to clean up after himself
if ( $this->currentPartParser !== null )
{
$part = $this-... | php | public function finish()
{
if ( $this->parserState != self::PARSE_STATE_POST_LAST )
{
// this should never happen
// let's give the last parser a chance to clean up after himself
if ( $this->currentPartParser !== null )
{
$part = $this-... | [
"public",
"function",
"finish",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"parserState",
"!=",
"self",
"::",
"PARSE_STATE_POST_LAST",
")",
"{",
"// this should never happen",
"// let's give the last parser a chance to clean up after himself",
"if",
"(",
"$",
"this",
... | Completes the parsing of the multipart and returns the corresponding part.
This method should not be overriden. Use finishMultipart() instead.
@return ezcMailMultipart | [
"Completes",
"the",
"parsing",
"of",
"the",
"multipart",
"and",
"returns",
"the",
"corresponding",
"part",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/multipart_parser.php#L194-L211 |
20,469 | antaresproject/notifications | src/Contents.php | Contents.find | public function find(string $operation, string $locale)
{
$model = $this->notifications->first(function ($value) use($operation, $locale) {
return $value->code === $locale && ($value->title === $operation || $value->name === $operation);
});
return $model ? $model->content : fal... | php | public function find(string $operation, string $locale)
{
$model = $this->notifications->first(function ($value) use($operation, $locale) {
return $value->code === $locale && ($value->title === $operation || $value->name === $operation);
});
return $model ? $model->content : fal... | [
"public",
"function",
"find",
"(",
"string",
"$",
"operation",
",",
"string",
"$",
"locale",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"notifications",
"->",
"first",
"(",
"function",
"(",
"$",
"value",
")",
"use",
"(",
"$",
"operation",
",",
"... | Finds notification content by title and locale.
@param string $operation
@param string $locale
@return bool | [
"Finds",
"notification",
"content",
"by",
"title",
"and",
"locale",
"."
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Contents.php#L64-L71 |
20,470 | sciactive/nymph-server | src/Drivers/PostgreSQLDriver.php | PostgreSQLDriver.connect | public function connect() {
// Check that the PostgreSQL extension is installed.
if (!is_callable('pg_connect')) {
throw new Exceptions\UnableToConnectException(
'PostgreSQL PHP extension is not available. It probably has not '.
'been installed. Please install and configure it in order... | php | public function connect() {
// Check that the PostgreSQL extension is installed.
if (!is_callable('pg_connect')) {
throw new Exceptions\UnableToConnectException(
'PostgreSQL PHP extension is not available. It probably has not '.
'been installed. Please install and configure it in order... | [
"public",
"function",
"connect",
"(",
")",
"{",
"// Check that the PostgreSQL extension is installed.",
"if",
"(",
"!",
"is_callable",
"(",
"'pg_connect'",
")",
")",
"{",
"throw",
"new",
"Exceptions",
"\\",
"UnableToConnectException",
"(",
"'PostgreSQL PHP extension is no... | Connect to the PostgreSQL database.
@return bool Whether this instance is connected to a PostgreSQL database
after the method has run. | [
"Connect",
"to",
"the",
"PostgreSQL",
"database",
"."
] | 3c18dbf45c2750d07c798e14534dba87387beeba | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Drivers/PostgreSQLDriver.php#L54-L117 |
20,471 | sciactive/nymph-server | src/Drivers/PostgreSQLDriver.php | PostgreSQLDriver.disconnect | public function disconnect() {
if ($this->connected) {
if (is_resource($this->link)) {
pg_close($this->link);
}
$this->connected = false;
}
return $this->connected;
} | php | public function disconnect() {
if ($this->connected) {
if (is_resource($this->link)) {
pg_close($this->link);
}
$this->connected = false;
}
return $this->connected;
} | [
"public",
"function",
"disconnect",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"connected",
")",
"{",
"if",
"(",
"is_resource",
"(",
"$",
"this",
"->",
"link",
")",
")",
"{",
"pg_close",
"(",
"$",
"this",
"->",
"link",
")",
";",
"}",
"$",
"this... | Disconnect from the PostgreSQL database.
@return bool Whether this instance is connected to a PostgreSQL database
after the method has run. | [
"Disconnect",
"from",
"the",
"PostgreSQL",
"database",
"."
] | 3c18dbf45c2750d07c798e14534dba87387beeba | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Drivers/PostgreSQLDriver.php#L125-L133 |
20,472 | mikebarlow/html-helper | src/Services/CometPHP/Assets.php | Assets.getAsset | protected function getAsset($assetData)
{
try {
$Comet = \CometPHP\Comet::getInstance();
} catch (\CometPHP\Exceptions\CometNotBooted $e) {
return null;
}
if (! is_array($assetData)) {
$assetData = [$assetData];
}
$asset = $Comet[... | php | protected function getAsset($assetData)
{
try {
$Comet = \CometPHP\Comet::getInstance();
} catch (\CometPHP\Exceptions\CometNotBooted $e) {
return null;
}
if (! is_array($assetData)) {
$assetData = [$assetData];
}
$asset = $Comet[... | [
"protected",
"function",
"getAsset",
"(",
"$",
"assetData",
")",
"{",
"try",
"{",
"$",
"Comet",
"=",
"\\",
"CometPHP",
"\\",
"Comet",
"::",
"getInstance",
"(",
")",
";",
"}",
"catch",
"(",
"\\",
"CometPHP",
"\\",
"Exceptions",
"\\",
"CometNotBooted",
"$"... | base function to return assets
@param mixed asset path data received from the image method
@return string url to pass to img or css | [
"base",
"function",
"to",
"return",
"assets"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Services/CometPHP/Assets.php#L13-L31 |
20,473 | alevilar/ristorantino-vendor | Product/Model/Categoria.php | Categoria.array_listado | function array_listado($categoria_id = 1){
$array_categoria = array();
$array_final = array();
$this->recursive = 1;
$this->id = $categoria_id;
// $this->contain(array(
// 'Producto',
// 'Sabor',
// ... | php | function array_listado($categoria_id = 1){
$array_categoria = array();
$array_final = array();
$this->recursive = 1;
$this->id = $categoria_id;
// $this->contain(array(
// 'Producto',
// 'Sabor',
// ... | [
"function",
"array_listado",
"(",
"$",
"categoria_id",
"=",
"1",
")",
"{",
"$",
"array_categoria",
"=",
"array",
"(",
")",
";",
"$",
"array_final",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"recursive",
"=",
"1",
";",
"$",
"this",
"->",
"id",
... | Me devuelve un array lindo con sub arrays para cada subarbol
@param $categoria_id de donde yovoy a leer los hijos
@return unknown_type | [
"Me",
"devuelve",
"un",
"array",
"lindo",
"con",
"sub",
"arrays",
"para",
"cada",
"subarbol"
] | 6b91a1e20cc0ba09a1968d77e3de6512cfa2d966 | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Product/Model/Categoria.php#L59-L90 |
20,474 | rhosocial/yii2-user | web/admin/controllers/UserController.php | UserController.initMessages | protected function initMessages()
{
if (!is_string($this->registerSuccessMessage)) {
$this->registerSuccessMessage = Yii::t('user' ,'User Registered.');
}
if (!is_string($this->registerFailedMessage)) {
$this->registerFailedMessage = Yii::t('user', 'Register Failed.')... | php | protected function initMessages()
{
if (!is_string($this->registerSuccessMessage)) {
$this->registerSuccessMessage = Yii::t('user' ,'User Registered.');
}
if (!is_string($this->registerFailedMessage)) {
$this->registerFailedMessage = Yii::t('user', 'Register Failed.')... | [
"protected",
"function",
"initMessages",
"(",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"this",
"->",
"registerSuccessMessage",
")",
")",
"{",
"$",
"this",
"->",
"registerSuccessMessage",
"=",
"Yii",
"::",
"t",
"(",
"'user'",
",",
"'User Registered.'"... | Initialize messages. | [
"Initialize",
"messages",
"."
] | 96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc | https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/web/admin/controllers/UserController.php#L58-L78 |
20,475 | rhosocial/yii2-user | web/admin/controllers/UserController.php | UserController.actionDeregister | public function actionDeregister($id)
{
$id = (int)$id;
if (Yii::$app->user->identity->getID() == $id) {
throw new ForbiddenHttpException(Yii::t('user', 'You cannot deregister yourself.'));
}
$user = $this->getUser($id);
try {
$result = $user->deregist... | php | public function actionDeregister($id)
{
$id = (int)$id;
if (Yii::$app->user->identity->getID() == $id) {
throw new ForbiddenHttpException(Yii::t('user', 'You cannot deregister yourself.'));
}
$user = $this->getUser($id);
try {
$result = $user->deregist... | [
"public",
"function",
"actionDeregister",
"(",
"$",
"id",
")",
"{",
"$",
"id",
"=",
"(",
"int",
")",
"$",
"id",
";",
"if",
"(",
"Yii",
"::",
"$",
"app",
"->",
"user",
"->",
"identity",
"->",
"getID",
"(",
")",
"==",
"$",
"id",
")",
"{",
"throw"... | Deregister User.
@param string $id User ID.
@return string
@throws ServerErrorHttpException
@throws ForbiddenHttpException | [
"Deregister",
"User",
"."
] | 96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc | https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/web/admin/controllers/UserController.php#L216-L237 |
20,476 | gregoryv/php-logger | src/ConsoleWriter.php | ConsoleWriter.swrite | public function swrite($severity, $message='')
{
if($severity <= LOG_ERR) {
fwrite(STDERR, $message . "\n");
} else {
fwrite(STDOUT, $message . "\n");
}
} | php | public function swrite($severity, $message='')
{
if($severity <= LOG_ERR) {
fwrite(STDERR, $message . "\n");
} else {
fwrite(STDOUT, $message . "\n");
}
} | [
"public",
"function",
"swrite",
"(",
"$",
"severity",
",",
"$",
"message",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"severity",
"<=",
"LOG_ERR",
")",
"{",
"fwrite",
"(",
"STDERR",
",",
"$",
"message",
".",
"\"\\n\"",
")",
";",
"}",
"else",
"{",
"fwrite... | If severity is equal or lower than LOG_ERR then the message is written
to STDERR, otherwise STDOUT is used. | [
"If",
"severity",
"is",
"equal",
"or",
"lower",
"than",
"LOG_ERR",
"then",
"the",
"message",
"is",
"written",
"to",
"STDERR",
"otherwise",
"STDOUT",
"is",
"used",
"."
] | 0f8ffc360a0233531a9775359929af8876997862 | https://github.com/gregoryv/php-logger/blob/0f8ffc360a0233531a9775359929af8876997862/src/ConsoleWriter.php#L17-L24 |
20,477 | mothership-ec/composer | src/Composer/Package/Version/VersionSelector.php | VersionSelector.findBestCandidate | public function findBestCandidate($packageName, $targetPackageVersion = null)
{
$constraint = $targetPackageVersion ? $this->getParser()->parseConstraints($targetPackageVersion) : null;
$candidates = $this->pool->whatProvides(strtolower($packageName), $constraint, true);
if (!$candidates) {... | php | public function findBestCandidate($packageName, $targetPackageVersion = null)
{
$constraint = $targetPackageVersion ? $this->getParser()->parseConstraints($targetPackageVersion) : null;
$candidates = $this->pool->whatProvides(strtolower($packageName), $constraint, true);
if (!$candidates) {... | [
"public",
"function",
"findBestCandidate",
"(",
"$",
"packageName",
",",
"$",
"targetPackageVersion",
"=",
"null",
")",
"{",
"$",
"constraint",
"=",
"$",
"targetPackageVersion",
"?",
"$",
"this",
"->",
"getParser",
"(",
")",
"->",
"parseConstraints",
"(",
"$",... | Given a package name and optional version, returns the latest PackageInterface
that matches.
@param string $packageName
@param string $targetPackageVersion
@return PackageInterface|bool | [
"Given",
"a",
"package",
"name",
"and",
"optional",
"version",
"returns",
"the",
"latest",
"PackageInterface",
"that",
"matches",
"."
] | fa6ad031a939d8d33b211e428fdbdd28cfce238c | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Package/Version/VersionSelector.php#L45-L63 |
20,478 | j-d/draggy | src/Draggy/Autocode/Project.php | Project.getActualAttributeName | public function getActualAttributeName(Entity $entity, $name, $hint = '', $force = false)
{
if ($entity->hasAttributeByName($name) || $force) {
if (!$entity->hasAttributeByName($name . $hint)) {
return [$name, $hint];
}
$append = 1;
while ($e... | php | public function getActualAttributeName(Entity $entity, $name, $hint = '', $force = false)
{
if ($entity->hasAttributeByName($name) || $force) {
if (!$entity->hasAttributeByName($name . $hint)) {
return [$name, $hint];
}
$append = 1;
while ($e... | [
"public",
"function",
"getActualAttributeName",
"(",
"Entity",
"$",
"entity",
",",
"$",
"name",
",",
"$",
"hint",
"=",
"''",
",",
"$",
"force",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"entity",
"->",
"hasAttributeByName",
"(",
"$",
"name",
")",
"||",
... | Sometimes the automatic name cannot be used because the entity already has an attribute with that name or because is linked many times.
This method gives an actual final name that will be unique.
@param Entity $entity
@param string $name
@param string $hint
@param boolean $force If it should force the use of the hi... | [
"Sometimes",
"the",
"automatic",
"name",
"cannot",
"be",
"used",
"because",
"the",
"entity",
"already",
"has",
"an",
"attribute",
"with",
"that",
"name",
"or",
"because",
"is",
"linked",
"many",
"times",
".",
"This",
"method",
"gives",
"an",
"actual",
"final... | 97ffc66e1aacb5f685d7aac5251c4abb8888d4bb | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Project.php#L1171-L1188 |
20,479 | j-d/draggy | src/Draggy/Autocode/Project.php | Project.getModelFiles | public function getModelFiles($path)
{
$fileCollection = new FileCollection();
$namespacePath = str_replace('\\', '/', $path . $this->getNamespace() . '/');
$targetPath = $namespacePath;
foreach ($this->getEntities() as $entity) {
if ($entity->getRenderizable()) {
... | php | public function getModelFiles($path)
{
$fileCollection = new FileCollection();
$namespacePath = str_replace('\\', '/', $path . $this->getNamespace() . '/');
$targetPath = $namespacePath;
foreach ($this->getEntities() as $entity) {
if ($entity->getRenderizable()) {
... | [
"public",
"function",
"getModelFiles",
"(",
"$",
"path",
")",
"{",
"$",
"fileCollection",
"=",
"new",
"FileCollection",
"(",
")",
";",
"$",
"namespacePath",
"=",
"str_replace",
"(",
"'\\\\'",
",",
"'/'",
",",
"$",
"path",
".",
"$",
"this",
"->",
"getName... | Returns a collection of files
@param string $path The path where they would be saved
@return FileCollection | [
"Returns",
"a",
"collection",
"of",
"files"
] | 97ffc66e1aacb5f685d7aac5251c4abb8888d4bb | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Project.php#L1238-L1275 |
20,480 | j-d/draggy | src/Draggy/Autocode/Project.php | Project.singlelise | public static function singlelise($string)
{
$rules = [
'ies' => 'y',
'ves' => 'f',
's' => '',
];
foreach ($rules as $ending => $replacement) {
if ($ending === substr($string, -strlen($ending))) {
return substr($string, 0, -s... | php | public static function singlelise($string)
{
$rules = [
'ies' => 'y',
'ves' => 'f',
's' => '',
];
foreach ($rules as $ending => $replacement) {
if ($ending === substr($string, -strlen($ending))) {
return substr($string, 0, -s... | [
"public",
"static",
"function",
"singlelise",
"(",
"$",
"string",
")",
"{",
"$",
"rules",
"=",
"[",
"'ies'",
"=>",
"'y'",
",",
"'ves'",
"=>",
"'f'",
",",
"'s'",
"=>",
"''",
",",
"]",
";",
"foreach",
"(",
"$",
"rules",
"as",
"$",
"ending",
"=>",
"... | Get the plural name from a singular
@param string $string
@return string | [
"Get",
"the",
"plural",
"name",
"from",
"a",
"singular"
] | 97ffc66e1aacb5f685d7aac5251c4abb8888d4bb | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Project.php#L1370-L1385 |
20,481 | adrenalinkin/config-helper | Extension/AbstractExtension.php | AbstractExtension.getConfigurationsFromFile | protected function getConfigurationsFromFile($fileName, ContainerBuilder $container, $merge = true)
{
$configs = [];
/** @var \Symfony\Component\Finder\SplFileInfo $file */
foreach ($this->getFinder($fileName, $container) as $file) {
$currentConfiguration = Yaml::parse($file->ge... | php | protected function getConfigurationsFromFile($fileName, ContainerBuilder $container, $merge = true)
{
$configs = [];
/** @var \Symfony\Component\Finder\SplFileInfo $file */
foreach ($this->getFinder($fileName, $container) as $file) {
$currentConfiguration = Yaml::parse($file->ge... | [
"protected",
"function",
"getConfigurationsFromFile",
"(",
"$",
"fileName",
",",
"ContainerBuilder",
"$",
"container",
",",
"$",
"merge",
"=",
"true",
")",
"{",
"$",
"configs",
"=",
"[",
"]",
";",
"/** @var \\Symfony\\Component\\Finder\\SplFileInfo $file */",
"foreach... | Returns all configurations registered in the specific yaml file.
@param string $fileName Name of the file with extension
@param ContainerBuilder $container Container builder
@param bool $merge Merge configuration recursively or just stack
@return array | [
"Returns",
"all",
"configurations",
"registered",
"in",
"the",
"specific",
"yaml",
"file",
"."
] | 97dfdb81aa2ed1878e411f76e0d723003b80062b | https://github.com/adrenalinkin/config-helper/blob/97dfdb81aa2ed1878e411f76e0d723003b80062b/Extension/AbstractExtension.php#L40-L62 |
20,482 | adrenalinkin/config-helper | Extension/AbstractExtension.php | AbstractExtension.getFinder | private function getFinder($fileName, ContainerBuilder $container)
{
$finder = (new Finder())->files()->name($fileName);
$resourcesDir = 'Resources'.DIRECTORY_SEPARATOR.'config';
if (self::$directoriesCache) {
return $finder->in(self::$directoriesCache);
}
... | php | private function getFinder($fileName, ContainerBuilder $container)
{
$finder = (new Finder())->files()->name($fileName);
$resourcesDir = 'Resources'.DIRECTORY_SEPARATOR.'config';
if (self::$directoriesCache) {
return $finder->in(self::$directoriesCache);
}
... | [
"private",
"function",
"getFinder",
"(",
"$",
"fileName",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"finder",
"=",
"(",
"new",
"Finder",
"(",
")",
")",
"->",
"files",
"(",
")",
"->",
"name",
"(",
"$",
"fileName",
")",
";",
"$",
"resou... | Build and return finder
@param string $fileName
@param ContainerBuilder $container
@return Finder | [
"Build",
"and",
"return",
"finder"
] | 97dfdb81aa2ed1878e411f76e0d723003b80062b | https://github.com/adrenalinkin/config-helper/blob/97dfdb81aa2ed1878e411f76e0d723003b80062b/Extension/AbstractExtension.php#L72-L101 |
20,483 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query.php | ezcQuery.getPrefixedTableNames | protected function getPrefixedTableNames($tableNames)
{
if ($this->db->options && $this->db->options->tableNamePrefix)
{
switch (true)
{
case is_string($tableNames):
$tableNames = $this->db->options->tableNamePrefix . $tableNames;
break;
case is_array($tableNames)... | php | protected function getPrefixedTableNames($tableNames)
{
if ($this->db->options && $this->db->options->tableNamePrefix)
{
switch (true)
{
case is_string($tableNames):
$tableNames = $this->db->options->tableNamePrefix . $tableNames;
break;
case is_array($tableNames)... | [
"protected",
"function",
"getPrefixedTableNames",
"(",
"$",
"tableNames",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"db",
"->",
"options",
"&&",
"$",
"this",
"->",
"db",
"->",
"options",
"->",
"tableNamePrefix",
")",
"{",
"switch",
"(",
"true",
")",
"{",
... | Returns prefixed table names if "tableNamePrefix" option not empty
otherwise return untouched names
@param array|string $tableNames
@return array|string | [
"Returns",
"prefixed",
"table",
"names",
"if",
"tableNamePrefix",
"option",
"not",
"empty",
"otherwise",
"return",
"untouched",
"names"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query.php#L290-L308 |
20,484 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query.php | ezcQuery.prepare | public function prepare()
{
$stmt = $this->db->prepare( $this->getQuery() );
$this->doBind( $stmt );
return $stmt;
} | php | public function prepare()
{
$stmt = $this->db->prepare( $this->getQuery() );
$this->doBind( $stmt );
return $stmt;
} | [
"public",
"function",
"prepare",
"(",
")",
"{",
"$",
"stmt",
"=",
"$",
"this",
"->",
"db",
"->",
"prepare",
"(",
"$",
"this",
"->",
"getQuery",
"(",
")",
")",
";",
"$",
"this",
"->",
"doBind",
"(",
"$",
"stmt",
")",
";",
"return",
"$",
"stmt",
... | Returns a prepared statement from this query which can be used for execution.
The returned object is a PDOStatement for which you can find extensive
documentation in the PHP manual:
{@link http://php.net/pdostatement-bindcolumn}
prepare() automatically calls doBind() on the statement.
@return PDOStatement | [
"Returns",
"a",
"prepared",
"statement",
"from",
"this",
"query",
"which",
"can",
"be",
"used",
"for",
"execution",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query.php#L459-L464 |
20,485 | mothership-ec/composer | src/Composer/DependencyResolver/Request.php | Request.fix | public function fix($packageName, LinkConstraintInterface $constraint = null)
{
$this->addJob($packageName, 'install', $constraint, true);
} | php | public function fix($packageName, LinkConstraintInterface $constraint = null)
{
$this->addJob($packageName, 'install', $constraint, true);
} | [
"public",
"function",
"fix",
"(",
"$",
"packageName",
",",
"LinkConstraintInterface",
"$",
"constraint",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"addJob",
"(",
"$",
"packageName",
",",
"'install'",
",",
"$",
"constraint",
",",
"true",
")",
";",
"}"
] | Mark an existing package as being installed and having to remain installed
These jobs will not be tempered with by the solver | [
"Mark",
"an",
"existing",
"package",
"as",
"being",
"installed",
"and",
"having",
"to",
"remain",
"installed"
] | fa6ad031a939d8d33b211e428fdbdd28cfce238c | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/DependencyResolver/Request.php#L49-L52 |
20,486 | hametuha/wpametu | src/WPametu/API/Ajax/AjaxBase.php | AjaxBase.ajax_url | protected function ajax_url(){
$url = admin_url('admin-ajax.php');
if( is_ssl() ){
$url = str_replace('http://', 'https://', $url);
}else{
$url = str_replace('https://', 'http://', $url);
}
return $url;
} | php | protected function ajax_url(){
$url = admin_url('admin-ajax.php');
if( is_ssl() ){
$url = str_replace('http://', 'https://', $url);
}else{
$url = str_replace('https://', 'http://', $url);
}
return $url;
} | [
"protected",
"function",
"ajax_url",
"(",
")",
"{",
"$",
"url",
"=",
"admin_url",
"(",
"'admin-ajax.php'",
")",
";",
"if",
"(",
"is_ssl",
"(",
")",
")",
"{",
"$",
"url",
"=",
"str_replace",
"(",
"'http://'",
",",
"'https://'",
",",
"$",
"url",
")",
"... | Returns Ajax endpoint
@return string | [
"Returns",
"Ajax",
"endpoint"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/API/Ajax/AjaxBase.php#L141-L149 |
20,487 | rhosocial/yii2-user | forms/RegisterForm.php | RegisterForm.register | public function register()
{
if ($this->validate()) {
$class = $this->userClass;
$user = new $class(['password' => $this->password]);
/* @var $user User */
$profile = $user->createProfile(['nickname' => $this->nickname, 'first_name' => $this->first_name, 'last... | php | public function register()
{
if ($this->validate()) {
$class = $this->userClass;
$user = new $class(['password' => $this->password]);
/* @var $user User */
$profile = $user->createProfile(['nickname' => $this->nickname, 'first_name' => $this->first_name, 'last... | [
"public",
"function",
"register",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"validate",
"(",
")",
")",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"userClass",
";",
"$",
"user",
"=",
"new",
"$",
"class",
"(",
"[",
"'password'",
"=>",
"$",
"this... | Register user with current model.
@return bool | [
"Register",
"user",
"with",
"current",
"model",
"."
] | 96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc | https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/forms/RegisterForm.php#L128-L147 |
20,488 | oroinc/OroLayoutComponent | Extension/Theme/PathProvider/ThemePathProvider.php | ThemePathProvider.getThemesHierarchy | protected function getThemesHierarchy($themeName)
{
$hierarchy = [];
while (null !== $themeName) {
$theme = $this->themeManager->getTheme($themeName);
$hierarchy[] = $theme;
$themeName = $theme->getParentTheme();
}
return array_reverse($hierar... | php | protected function getThemesHierarchy($themeName)
{
$hierarchy = [];
while (null !== $themeName) {
$theme = $this->themeManager->getTheme($themeName);
$hierarchy[] = $theme;
$themeName = $theme->getParentTheme();
}
return array_reverse($hierar... | [
"protected",
"function",
"getThemesHierarchy",
"(",
"$",
"themeName",
")",
"{",
"$",
"hierarchy",
"=",
"[",
"]",
";",
"while",
"(",
"null",
"!==",
"$",
"themeName",
")",
"{",
"$",
"theme",
"=",
"$",
"this",
"->",
"themeManager",
"->",
"getTheme",
"(",
... | Returns theme inheritance hierarchy with root theme as first item
@param string $themeName
@return Theme[] | [
"Returns",
"theme",
"inheritance",
"hierarchy",
"with",
"root",
"theme",
"as",
"first",
"item"
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/Theme/PathProvider/ThemePathProvider.php#L84-L96 |
20,489 | husccexo/php-handlersocket-core | src/HSCore/Driver.php | Driver.send | public function send($command)
{
$string = $command;
$timer = microtime(true);
while ($string) {
$bytes = fwrite($this->socket, $string);
if ($bytes === false) {
$this->close();
throw new HSException('Cannot write to socket');
... | php | public function send($command)
{
$string = $command;
$timer = microtime(true);
while ($string) {
$bytes = fwrite($this->socket, $string);
if ($bytes === false) {
$this->close();
throw new HSException('Cannot write to socket');
... | [
"public",
"function",
"send",
"(",
"$",
"command",
")",
"{",
"$",
"string",
"=",
"$",
"command",
";",
"$",
"timer",
"=",
"microtime",
"(",
"true",
")",
";",
"while",
"(",
"$",
"string",
")",
"{",
"$",
"bytes",
"=",
"fwrite",
"(",
"$",
"this",
"->... | Send string command to server
@param string $command
@return string
@throws HSException | [
"Send",
"string",
"command",
"to",
"server"
] | aaeeece9c90a89bbc861a6fe390bc0c892496bf0 | https://github.com/husccexo/php-handlersocket-core/blob/aaeeece9c90a89bbc861a6fe390bc0c892496bf0/src/HSCore/Driver.php#L78-L106 |
20,490 | husccexo/php-handlersocket-core | src/HSCore/Driver.php | Driver.encode | public static function encode($string)
{
return is_null($string) ? self::NULL : strtr($string, self::$encodeMap);
} | php | public static function encode($string)
{
return is_null($string) ? self::NULL : strtr($string, self::$encodeMap);
} | [
"public",
"static",
"function",
"encode",
"(",
"$",
"string",
")",
"{",
"return",
"is_null",
"(",
"$",
"string",
")",
"?",
"self",
"::",
"NULL",
":",
"strtr",
"(",
"$",
"string",
",",
"self",
"::",
"$",
"encodeMap",
")",
";",
"}"
] | Encode string for sending to server
@param $string
@return string | [
"Encode",
"string",
"for",
"sending",
"to",
"server"
] | aaeeece9c90a89bbc861a6fe390bc0c892496bf0 | https://github.com/husccexo/php-handlersocket-core/blob/aaeeece9c90a89bbc861a6fe390bc0c892496bf0/src/HSCore/Driver.php#L126-L129 |
20,491 | husccexo/php-handlersocket-core | src/HSCore/Driver.php | Driver.decode | public static function decode($string)
{
return ($string === self::NULL) ? null : strtr($string, self::$decodeMap);
} | php | public static function decode($string)
{
return ($string === self::NULL) ? null : strtr($string, self::$decodeMap);
} | [
"public",
"static",
"function",
"decode",
"(",
"$",
"string",
")",
"{",
"return",
"(",
"$",
"string",
"===",
"self",
"::",
"NULL",
")",
"?",
"null",
":",
"strtr",
"(",
"$",
"string",
",",
"self",
"::",
"$",
"decodeMap",
")",
";",
"}"
] | Decode string from server
@param $string
@return null|string | [
"Decode",
"string",
"from",
"server"
] | aaeeece9c90a89bbc861a6fe390bc0c892496bf0 | https://github.com/husccexo/php-handlersocket-core/blob/aaeeece9c90a89bbc861a6fe390bc0c892496bf0/src/HSCore/Driver.php#L138-L141 |
20,492 | husccexo/php-handlersocket-core | src/HSCore/Driver.php | Driver.open | public function open()
{
$this->socket = stream_socket_client('tcp://'.$this->address, $errc, $errs, STREAM_CLIENT_CONNECT);
if (!$this->socket) {
throw new HSException('Connection to '.$this->address.' failed');
}
} | php | public function open()
{
$this->socket = stream_socket_client('tcp://'.$this->address, $errc, $errs, STREAM_CLIENT_CONNECT);
if (!$this->socket) {
throw new HSException('Connection to '.$this->address.' failed');
}
} | [
"public",
"function",
"open",
"(",
")",
"{",
"$",
"this",
"->",
"socket",
"=",
"stream_socket_client",
"(",
"'tcp://'",
".",
"$",
"this",
"->",
"address",
",",
"$",
"errc",
",",
"$",
"errs",
",",
"STREAM_CLIENT_CONNECT",
")",
";",
"if",
"(",
"!",
"$",
... | Open Handler Socket
@throwsHSrException | [
"Open",
"Handler",
"Socket"
] | aaeeece9c90a89bbc861a6fe390bc0c892496bf0 | https://github.com/husccexo/php-handlersocket-core/blob/aaeeece9c90a89bbc861a6fe390bc0c892496bf0/src/HSCore/Driver.php#L149-L156 |
20,493 | husccexo/php-handlersocket-core | src/HSCore/Driver.php | Driver.receive | private function receive()
{
$timer = microtime(true);
$str = fgets($this->socket);
if ($str === false) {
$this->close();
throw new HSException('Cannot read from socket');
}
$this->logs[] = [
'type' => 'receive',
'time' => m... | php | private function receive()
{
$timer = microtime(true);
$str = fgets($this->socket);
if ($str === false) {
$this->close();
throw new HSException('Cannot read from socket');
}
$this->logs[] = [
'type' => 'receive',
'time' => m... | [
"private",
"function",
"receive",
"(",
")",
"{",
"$",
"timer",
"=",
"microtime",
"(",
"true",
")",
";",
"$",
"str",
"=",
"fgets",
"(",
"$",
"this",
"->",
"socket",
")",
";",
"if",
"(",
"$",
"str",
"===",
"false",
")",
"{",
"$",
"this",
"->",
"c... | Receive one string from server.
String haven't trailing \n
@return string
@throws HSException | [
"Receive",
"one",
"string",
"from",
"server",
".",
"String",
"haven",
"t",
"trailing",
"\\",
"n"
] | aaeeece9c90a89bbc861a6fe390bc0c892496bf0 | https://github.com/husccexo/php-handlersocket-core/blob/aaeeece9c90a89bbc861a6fe390bc0c892496bf0/src/HSCore/Driver.php#L203-L222 |
20,494 | bytic/framework | src/Mvc/Sections/Section.php | Section.compilePath | public function compilePath($path = false)
{
$currentBasePath = $this->getManager()->getCurrent()->getPath();
$path = str_replace($currentBasePath, $this->getPath(), $path);
return $path;
} | php | public function compilePath($path = false)
{
$currentBasePath = $this->getManager()->getCurrent()->getPath();
$path = str_replace($currentBasePath, $this->getPath(), $path);
return $path;
} | [
"public",
"function",
"compilePath",
"(",
"$",
"path",
"=",
"false",
")",
"{",
"$",
"currentBasePath",
"=",
"$",
"this",
"->",
"getManager",
"(",
")",
"->",
"getCurrent",
"(",
")",
"->",
"getPath",
"(",
")",
";",
"$",
"path",
"=",
"str_replace",
"(",
... | Compile path for this section from a given path of current section
@param bool $path
@return string | [
"Compile",
"path",
"for",
"this",
"section",
"from",
"a",
"given",
"path",
"of",
"current",
"section"
] | 36b4a761f4b64899f3841b0f6c8eb92887e91677 | https://github.com/bytic/framework/blob/36b4a761f4b64899f3841b0f6c8eb92887e91677/src/Mvc/Sections/Section.php#L73-L78 |
20,495 | ShaoZeMing/laravel-merchant | src/Auth/Permission.php | Permission.check | public static function check($permission)
{
if (static::isAdministrator()) {
return true;
}
if (is_array($permission)) {
collect($permission)->each(function ($permission) {
call_user_func([Permission::class, 'check'], $permission);
});
... | php | public static function check($permission)
{
if (static::isAdministrator()) {
return true;
}
if (is_array($permission)) {
collect($permission)->each(function ($permission) {
call_user_func([Permission::class, 'check'], $permission);
});
... | [
"public",
"static",
"function",
"check",
"(",
"$",
"permission",
")",
"{",
"if",
"(",
"static",
"::",
"isAdministrator",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"is_array",
"(",
"$",
"permission",
")",
")",
"{",
"collect",
"(",
"$"... | Check permission.
@param $permission
@return true | [
"Check",
"permission",
"."
] | 20801b1735e7832a6e58b37c2c391328f8d626fa | https://github.com/ShaoZeMing/laravel-merchant/blob/20801b1735e7832a6e58b37c2c391328f8d626fa/src/Auth/Permission.php#L18-L35 |
20,496 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/plain.php | ezcCacheStorageApcPlain.fetchData | protected function fetchData( $identifier, $object = false )
{
$data = $this->backend->fetch( $identifier );
if ( is_object( $data ) && $object === false )
{
return $data->data;
}
if ( is_object( $data ) && $object !== false )
{
return $data;
... | php | protected function fetchData( $identifier, $object = false )
{
$data = $this->backend->fetch( $identifier );
if ( is_object( $data ) && $object === false )
{
return $data->data;
}
if ( is_object( $data ) && $object !== false )
{
return $data;
... | [
"protected",
"function",
"fetchData",
"(",
"$",
"identifier",
",",
"$",
"object",
"=",
"false",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"backend",
"->",
"fetch",
"(",
"$",
"identifier",
")",
";",
"if",
"(",
"is_object",
"(",
"$",
"data",
")",
... | Fetches data from the cache.
@param string $identifier The file to fetch data from
@param bool $object return the object and not the clean data
@return mixed The fetched data or false on failure | [
"Fetches",
"data",
"from",
"the",
"cache",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/plain.php#L30-L45 |
20,497 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/plain.php | ezcCacheStorageApcPlain.prepareData | protected function prepareData( $data )
{
if ( is_resource( $data ) )
{
throw new ezcCacheInvalidDataException( gettype( $data ), array( 'simple', 'array', 'object' ) );
}
return new ezcCacheStorageMemoryDataStruct( $data, $this->properties['location'] );
} | php | protected function prepareData( $data )
{
if ( is_resource( $data ) )
{
throw new ezcCacheInvalidDataException( gettype( $data ), array( 'simple', 'array', 'object' ) );
}
return new ezcCacheStorageMemoryDataStruct( $data, $this->properties['location'] );
} | [
"protected",
"function",
"prepareData",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"is_resource",
"(",
"$",
"data",
")",
")",
"{",
"throw",
"new",
"ezcCacheInvalidDataException",
"(",
"gettype",
"(",
"$",
"data",
")",
",",
"array",
"(",
"'simple'",
",",
"'ar... | Wraps the data in an ezcCacheStorageMemoryDataStruct structure in order
to store it.
@throws ezcCacheInvalidDataException
If the data submitted can not be handled by this storage (resource).
@param mixed $data Simple type or array
@return ezcCacheStorageMemoryDataStruct Prepared data | [
"Wraps",
"the",
"data",
"in",
"an",
"ezcCacheStorageMemoryDataStruct",
"structure",
"in",
"order",
"to",
"store",
"it",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/plain.php#L57-L64 |
20,498 | bradcornford/Alerter | src/Cornford/Alerter/AlertDisplay.php | AlertDisplay.findDisplayViewFile | protected function findDisplayViewFile()
{
foreach($this->getDirectoryIterator() as $file) {
$name = $file->getFilename();
if ($this->isDisplayViewFile($name)) {
return $file->getPathname();
}
}
throw new AlertDisplayViewException('Could ... | php | protected function findDisplayViewFile()
{
foreach($this->getDirectoryIterator() as $file) {
$name = $file->getFilename();
if ($this->isDisplayViewFile($name)) {
return $file->getPathname();
}
}
throw new AlertDisplayViewException('Could ... | [
"protected",
"function",
"findDisplayViewFile",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getDirectoryIterator",
"(",
")",
"as",
"$",
"file",
")",
"{",
"$",
"name",
"=",
"$",
"file",
"->",
"getFilename",
"(",
")",
";",
"if",
"(",
"$",
"this",
... | Track down the display view file.
@return string
@throws \Cornford\Alerter\Exceptions\AlertDisplayViewException | [
"Track",
"down",
"the",
"display",
"view",
"file",
"."
] | 6533fe7afb9d1bae553385d3e687a24bda6a1333 | https://github.com/bradcornford/Alerter/blob/6533fe7afb9d1bae553385d3e687a24bda6a1333/src/Cornford/Alerter/AlertDisplay.php#L85-L96 |
20,499 | Innmind/neo4j-dbal | src/Transactions.php | Transactions.open | public function open(): Transaction
{
$response = ($this->fulfill)(
new Request(
Url::fromString('/db/data/transaction'),
Method::post(),
new ProtocolVersion(1, 1),
$this->headers,
$this->body
)
)... | php | public function open(): Transaction
{
$response = ($this->fulfill)(
new Request(
Url::fromString('/db/data/transaction'),
Method::post(),
new ProtocolVersion(1, 1),
$this->headers,
$this->body
)
)... | [
"public",
"function",
"open",
"(",
")",
":",
"Transaction",
"{",
"$",
"response",
"=",
"(",
"$",
"this",
"->",
"fulfill",
")",
"(",
"new",
"Request",
"(",
"Url",
"::",
"fromString",
"(",
"'/db/data/transaction'",
")",
",",
"Method",
"::",
"post",
"(",
... | Open a new transaction
@return Transaction | [
"Open",
"a",
"new",
"transaction"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Transactions.php#L66-L93 |
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.