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
234,500
silverstripe/comment-notifications
src/Extensions/CommentNotifiable.php
CommentNotifiable.notificationTemplate
public function notificationTemplate($comment, $recipient) { $template = $this->owner->config()->default_notification_template; $this->owner->invokeWithExtensions('updateNotificationTemplate', $template, $comment, $recipient); return $template; }
php
public function notificationTemplate($comment, $recipient) { $template = $this->owner->config()->default_notification_template; $this->owner->invokeWithExtensions('updateNotificationTemplate', $template, $comment, $recipient); return $template; }
[ "public", "function", "notificationTemplate", "(", "$", "comment", ",", "$", "recipient", ")", "{", "$", "template", "=", "$", "this", "->", "owner", "->", "config", "(", ")", "->", "default_notification_template", ";", "$", "this", "->", "owner", "->", "i...
Determine the template to use for this email @param Comment $comment @param Member|string $recipient @return string Template name (excluding .ss extension)
[ "Determine", "the", "template", "to", "use", "for", "this", "email" ]
e80a98630bb842146a32e88f3257231369e05ea2
https://github.com/silverstripe/comment-notifications/blob/e80a98630bb842146a32e88f3257231369e05ea2/src/Extensions/CommentNotifiable.php#L102-L109
234,501
oxygen-cms/core
src/Html/Editor/Editor.php
Editor.getCreateScript
public function getCreateScript() { static::$includeScripts = true; $text = '<script>'; $text .= 'editors = ( typeof editors != "undefined" && editors instanceof Array ) ? editors : [];'; $text .= 'editors.push({'; $text .= 'name: "' . $this->name . '",'; $text .= 'style...
php
public function getCreateScript() { static::$includeScripts = true; $text = '<script>'; $text .= 'editors = ( typeof editors != "undefined" && editors instanceof Array ) ? editors : [];'; $text .= 'editors.push({'; $text .= 'name: "' . $this->name . '",'; $text .= 'style...
[ "public", "function", "getCreateScript", "(", ")", "{", "static", "::", "$", "includeScripts", "=", "true", ";", "$", "text", "=", "'<script>'", ";", "$", "text", ".=", "'editors = ( typeof editors != \"undefined\" && editors instanceof Array ) ? editors : [];'", ";", "...
Returns the JavaScript code used to initialise a Editor for the given information. @return string
[ "Returns", "the", "JavaScript", "code", "used", "to", "initialise", "a", "Editor", "for", "the", "given", "information", "." ]
8f8349c669771d9a7a719a7b120821e06cb5a20b
https://github.com/oxygen-cms/core/blob/8f8349c669771d9a7a719a7b120821e06cb5a20b/src/Html/Editor/Editor.php#L161-L177
234,502
Superbalist/php-pubsub-http
src/HTTPPubSubAdapter.php
HTTPPubSubAdapter.post
public function post($endpoint, array $data = []) { $body = json_encode($data); $request = $this->createRequest('POST', $endpoint, $body, ['Content-Type' => 'application/json']); return $this->sendRequest($request); }
php
public function post($endpoint, array $data = []) { $body = json_encode($data); $request = $this->createRequest('POST', $endpoint, $body, ['Content-Type' => 'application/json']); return $this->sendRequest($request); }
[ "public", "function", "post", "(", "$", "endpoint", ",", "array", "$", "data", "=", "[", "]", ")", "{", "$", "body", "=", "json_encode", "(", "$", "data", ")", ";", "$", "request", "=", "$", "this", "->", "createRequest", "(", "'POST'", ",", "$", ...
Make an HTTP POST request. @param string $endpoint @param array $data @return mixed
[ "Make", "an", "HTTP", "POST", "request", "." ]
fd7e7d7a3b2bc858b79117a9fc3af2cb2e9e83f1
https://github.com/Superbalist/php-pubsub-http/blob/fd7e7d7a3b2bc858b79117a9fc3af2cb2e9e83f1/src/HTTPPubSubAdapter.php#L154-L159
234,503
netzmacht/contao-icon-wizard
src/WizardController.php
WizardController.run
public function run() { $table = \Input::get('table'); $field = \Input::get('field'); $name = \Input::get('name'); $rowId = \Input::get('id'); $dataContainer = $this->initializeDataContainer($table, $field); $this->loadRow($table, $rowId, $dataContainer); $...
php
public function run() { $table = \Input::get('table'); $field = \Input::get('field'); $name = \Input::get('name'); $rowId = \Input::get('id'); $dataContainer = $this->initializeDataContainer($table, $field); $this->loadRow($table, $rowId, $dataContainer); $...
[ "public", "function", "run", "(", ")", "{", "$", "table", "=", "\\", "Input", "::", "get", "(", "'table'", ")", ";", "$", "field", "=", "\\", "Input", "::", "get", "(", "'field'", ")", ";", "$", "name", "=", "\\", "Input", "::", "get", "(", "'n...
Run the controller. @throws \RuntimeException If an invalid call is made. @return void @SuppressWarnings(PHPMD.Superglobals)
[ "Run", "the", "controller", "." ]
d0b5dba08d8167740f5828d0ee49b11f3eb0b946
https://github.com/netzmacht/contao-icon-wizard/blob/d0b5dba08d8167740f5828d0ee49b11f3eb0b946/src/WizardController.php#L51-L70
234,504
netzmacht/contao-icon-wizard
src/WizardController.php
WizardController.initializeDataContainer
private function initializeDataContainer($table, $field) { // Define the current ID if (!defined('CURRENT_ID')) { define('CURRENT_ID', $table ? \Session::getInstance()->get('CURRENT_ID') : $field); } static::loadDataContainer($table); $this->dca = &$GLOBALS[...
php
private function initializeDataContainer($table, $field) { // Define the current ID if (!defined('CURRENT_ID')) { define('CURRENT_ID', $table ? \Session::getInstance()->get('CURRENT_ID') : $field); } static::loadDataContainer($table); $this->dca = &$GLOBALS[...
[ "private", "function", "initializeDataContainer", "(", "$", "table", ",", "$", "field", ")", "{", "// Define the current ID", "if", "(", "!", "defined", "(", "'CURRENT_ID'", ")", ")", "{", "define", "(", "'CURRENT_ID'", ",", "$", "table", "?", "\\", "Session...
Initialize the data container driver. @param string $table The table name. @param string $field The field name. @return \DataContainer @throws \RuntimeException If the field does not exists. @SuppressWarnings(PHPMD.Superglobals)
[ "Initialize", "the", "data", "container", "driver", "." ]
d0b5dba08d8167740f5828d0ee49b11f3eb0b946
https://github.com/netzmacht/contao-icon-wizard/blob/d0b5dba08d8167740f5828d0ee49b11f3eb0b946/src/WizardController.php#L113-L150
234,505
netzmacht/contao-icon-wizard
src/WizardController.php
WizardController.loadRow
private function loadRow($table, $rowId, $dataContainer) { $dataContainer->activeRecord = $this->Database ->prepare(sprintf('SELECT * FROM %s WHERE id=?', $table)) ->limit(1) ->execute($rowId); if ($dataContainer->activeRecord->numRows != 1) { throw n...
php
private function loadRow($table, $rowId, $dataContainer) { $dataContainer->activeRecord = $this->Database ->prepare(sprintf('SELECT * FROM %s WHERE id=?', $table)) ->limit(1) ->execute($rowId); if ($dataContainer->activeRecord->numRows != 1) { throw n...
[ "private", "function", "loadRow", "(", "$", "table", ",", "$", "rowId", ",", "$", "dataContainer", ")", "{", "$", "dataContainer", "->", "activeRecord", "=", "$", "this", "->", "Database", "->", "prepare", "(", "sprintf", "(", "'SELECT * FROM %s WHERE id=?'", ...
Load the data row. @param string $table The table name. @param int $rowId The row id. @param \DataContainer $dataContainer The data container. @return void @throws \RuntimeException If no data row is found.
[ "Load", "the", "data", "row", "." ]
d0b5dba08d8167740f5828d0ee49b11f3eb0b946
https://github.com/netzmacht/contao-icon-wizard/blob/d0b5dba08d8167740f5828d0ee49b11f3eb0b946/src/WizardController.php#L162-L172
234,506
netzmacht/contao-icon-wizard
src/WizardController.php
WizardController.generateIcons
private function generateIcons($field) { $icons = array(); $iconTemplate = isset($this->dca['fields'][$field]['eval']['iconTemplate']) ? $this->dca['fields'][$field]['eval']['iconTemplate'] : $GLOBALS['TL_CONFIG']['iconWizardIconTemplate']; foreach ((array) $this->d...
php
private function generateIcons($field) { $icons = array(); $iconTemplate = isset($this->dca['fields'][$field]['eval']['iconTemplate']) ? $this->dca['fields'][$field]['eval']['iconTemplate'] : $GLOBALS['TL_CONFIG']['iconWizardIconTemplate']; foreach ((array) $this->d...
[ "private", "function", "generateIcons", "(", "$", "field", ")", "{", "$", "icons", "=", "array", "(", ")", ";", "$", "iconTemplate", "=", "isset", "(", "$", "this", "->", "dca", "[", "'fields'", "]", "[", "$", "field", "]", "[", "'eval'", "]", "[",...
Generate the icons. @param string $field The icons. @return array @SuppressWarnings(PHPMD.Superglobals)
[ "Generate", "the", "icons", "." ]
d0b5dba08d8167740f5828d0ee49b11f3eb0b946
https://github.com/netzmacht/contao-icon-wizard/blob/d0b5dba08d8167740f5828d0ee49b11f3eb0b946/src/WizardController.php#L182-L200
234,507
netzmacht/contao-icon-wizard
src/WizardController.php
WizardController.triggerCallback
private function triggerCallback($callback, $arguments) { if (is_array($callback)) { $this->import($callback[0]); return call_user_func_array(array($this->{$callback[0]}, $callback[1]), $arguments); } elseif (is_callable($callback)) { return call_user_func_array($...
php
private function triggerCallback($callback, $arguments) { if (is_array($callback)) { $this->import($callback[0]); return call_user_func_array(array($this->{$callback[0]}, $callback[1]), $arguments); } elseif (is_callable($callback)) { return call_user_func_array($...
[ "private", "function", "triggerCallback", "(", "$", "callback", ",", "$", "arguments", ")", "{", "if", "(", "is_array", "(", "$", "callback", ")", ")", "{", "$", "this", "->", "import", "(", "$", "callback", "[", "0", "]", ")", ";", "return", "call_u...
Trigger callback. @param array|callable $callback Callback to trigger. @param array $arguments Callback arguments. @return mixed
[ "Trigger", "callback", "." ]
d0b5dba08d8167740f5828d0ee49b11f3eb0b946
https://github.com/netzmacht/contao-icon-wizard/blob/d0b5dba08d8167740f5828d0ee49b11f3eb0b946/src/WizardController.php#L210-L220
234,508
FbF/Laravel-Comments
src/models/Comment.php
Comment.getRules
public function getRules($commentableType) { $commentableObj = new $commentableType; $table = $commentableObj->getTable(); $key = $commentableObj->getKeyName(); $rules = array( 'commentable_type' => 'required|in:'.implode(',', Config::get('laravel-comments::commentables')), 'commentable_id' => 'required|...
php
public function getRules($commentableType) { $commentableObj = new $commentableType; $table = $commentableObj->getTable(); $key = $commentableObj->getKeyName(); $rules = array( 'commentable_type' => 'required|in:'.implode(',', Config::get('laravel-comments::commentables')), 'commentable_id' => 'required|...
[ "public", "function", "getRules", "(", "$", "commentableType", ")", "{", "$", "commentableObj", "=", "new", "$", "commentableType", ";", "$", "table", "=", "$", "commentableObj", "->", "getTable", "(", ")", ";", "$", "key", "=", "$", "commentableObj", "->"...
Returns the validation rules for the comment @param string $commentableType The namespaced model that is being commented on @return array
[ "Returns", "the", "validation", "rules", "for", "the", "comment" ]
bbf35cdf7f30199757da6bde009d6ccd700e9ccb
https://github.com/FbF/Laravel-Comments/blob/bbf35cdf7f30199757da6bde009d6ccd700e9ccb/src/models/Comment.php#L105-L116
234,509
FbF/Laravel-Comments
src/models/Comment.php
Comment.getUrl
public function getUrl() { $commentable = $this->commentable; $url = false; if (method_exists($commentable, 'getUrl')) { $url = $commentable->getUrl(); } return \URL::to($url.'#C'.$this->id); }
php
public function getUrl() { $commentable = $this->commentable; $url = false; if (method_exists($commentable, 'getUrl')) { $url = $commentable->getUrl(); } return \URL::to($url.'#C'.$this->id); }
[ "public", "function", "getUrl", "(", ")", "{", "$", "commentable", "=", "$", "this", "->", "commentable", ";", "$", "url", "=", "false", ";", "if", "(", "method_exists", "(", "$", "commentable", ",", "'getUrl'", ")", ")", "{", "$", "url", "=", "$", ...
Returns the URL of the comment constructed based on the URL of the commentable object, plus the anchor of the comment @return string
[ "Returns", "the", "URL", "of", "the", "comment", "constructed", "based", "on", "the", "URL", "of", "the", "commentable", "object", "plus", "the", "anchor", "of", "the", "comment" ]
bbf35cdf7f30199757da6bde009d6ccd700e9ccb
https://github.com/FbF/Laravel-Comments/blob/bbf35cdf7f30199757da6bde009d6ccd700e9ccb/src/models/Comment.php#L124-L135
234,510
FbF/Laravel-Comments
src/models/Comment.php
Comment.getDate
public function getDate() { $date = $this->created_at; if (Lang::has('laravel-comments::messages.date_timezone')) { $oldTimezone = date_default_timezone_get(); $newTimezone = Lang::get('laravel-comments::messages.date_timezone'); $date->setTimezone($newTimezone); date_default_timezone_set($newTimezon...
php
public function getDate() { $date = $this->created_at; if (Lang::has('laravel-comments::messages.date_timezone')) { $oldTimezone = date_default_timezone_get(); $newTimezone = Lang::get('laravel-comments::messages.date_timezone'); $date->setTimezone($newTimezone); date_default_timezone_set($newTimezon...
[ "public", "function", "getDate", "(", ")", "{", "$", "date", "=", "$", "this", "->", "created_at", ";", "if", "(", "Lang", "::", "has", "(", "'laravel-comments::messages.date_timezone'", ")", ")", "{", "$", "oldTimezone", "=", "date_default_timezone_get", "(",...
Returns the locale formatted date, in the locale's timezone, both of which can be overridden in the language file @return string
[ "Returns", "the", "locale", "formatted", "date", "in", "the", "locale", "s", "timezone", "both", "of", "which", "can", "be", "overridden", "in", "the", "language", "file" ]
bbf35cdf7f30199757da6bde009d6ccd700e9ccb
https://github.com/FbF/Laravel-Comments/blob/bbf35cdf7f30199757da6bde009d6ccd700e9ccb/src/models/Comment.php#L142-L169
234,511
oxygen-cms/core
src/Action/Factory/ActionFactory.php
ActionFactory.create
public function create(array $parameters, $controller = null) { $parameters = $this->parseParameters($parameters, $controller); $action = new Action( $parameters['name'], $parameters['pattern'], $parameters['uses'], $parameters['group'] ); ...
php
public function create(array $parameters, $controller = null) { $parameters = $this->parseParameters($parameters, $controller); $action = new Action( $parameters['name'], $parameters['pattern'], $parameters['uses'], $parameters['group'] ); ...
[ "public", "function", "create", "(", "array", "$", "parameters", ",", "$", "controller", "=", "null", ")", "{", "$", "parameters", "=", "$", "this", "->", "parseParameters", "(", "$", "parameters", ",", "$", "controller", ")", ";", "$", "action", "=", ...
Creates a new Action using the passed parameters. @param array $parameters Passed parameters @param string $controller Default controller to use if none is provided @return mixed
[ "Creates", "a", "new", "Action", "using", "the", "passed", "parameters", "." ]
8f8349c669771d9a7a719a7b120821e06cb5a20b
https://github.com/oxygen-cms/core/blob/8f8349c669771d9a7a719a7b120821e06cb5a20b/src/Action/Factory/ActionFactory.php#L18-L31
234,512
ko-ko-ko/php-assert
src/Assert.php
Assert.assert
public static function assert($value, $name = 'value') { if (is_object($value)) { throw new InvalidNotObjectException($name); } if (!is_string($name)) { throw new InvalidStringException('name', $name); } if (empty(self::$validator)) { sel...
php
public static function assert($value, $name = 'value') { if (is_object($value)) { throw new InvalidNotObjectException($name); } if (!is_string($name)) { throw new InvalidStringException('name', $name); } if (empty(self::$validator)) { sel...
[ "public", "static", "function", "assert", "(", "$", "value", ",", "$", "name", "=", "'value'", ")", "{", "if", "(", "is_object", "(", "$", "value", ")", ")", "{", "throw", "new", "InvalidNotObjectException", "(", "$", "name", ")", ";", "}", "if", "("...
Creates validator instance for variable, first fail check will throw an exception @param int|float|string|resource|array|null $value @param string $name @return static @throws InvalidNotObjectException @throws InvalidStringException
[ "Creates", "validator", "instance", "for", "variable", "first", "fail", "check", "will", "throw", "an", "exception" ]
e4968588fd3f42c95a763ca3c36cfb846b24ab81
https://github.com/ko-ko-ko/php-assert/blob/e4968588fd3f42c95a763ca3c36cfb846b24ab81/src/Assert.php#L68-L86
234,513
ko-ko-ko/php-assert
src/Assert.php
Assert.isArray
public function isArray() { if (!is_array($this->value)) { throw new InvalidArrayException($this->name, $this->value); } return $this; }
php
public function isArray() { if (!is_array($this->value)) { throw new InvalidArrayException($this->name, $this->value); } return $this; }
[ "public", "function", "isArray", "(", ")", "{", "if", "(", "!", "is_array", "(", "$", "this", "->", "value", ")", ")", "{", "throw", "new", "InvalidArrayException", "(", "$", "this", "->", "name", ",", "$", "this", "->", "value", ")", ";", "}", "re...
Check if value is array @return $this @throws InvalidArrayException
[ "Check", "if", "value", "is", "array" ]
e4968588fd3f42c95a763ca3c36cfb846b24ab81
https://github.com/ko-ko-ko/php-assert/blob/e4968588fd3f42c95a763ca3c36cfb846b24ab81/src/Assert.php#L304-L311
234,514
ko-ko-ko/php-assert
src/Assert.php
Assert.hasKey
public function hasKey($key) { if (!is_string($key) && !is_int($key)) { throw new InvalidIntOrStringException('key', $key); } if (!is_array($this->value)) { throw new InvalidArrayException($this->name, $this->value); } if (!array_key_exists($key, $th...
php
public function hasKey($key) { if (!is_string($key) && !is_int($key)) { throw new InvalidIntOrStringException('key', $key); } if (!is_array($this->value)) { throw new InvalidArrayException($this->name, $this->value); } if (!array_key_exists($key, $th...
[ "public", "function", "hasKey", "(", "$", "key", ")", "{", "if", "(", "!", "is_string", "(", "$", "key", ")", "&&", "!", "is_int", "(", "$", "key", ")", ")", "{", "throw", "new", "InvalidIntOrStringException", "(", "'key'", ",", "$", "key", ")", ";...
Check if array key exists @param string|int $key @return $this @throws ArrayKeyNotExistsException @throws InvalidArrayException @throws InvalidIntOrStringException
[ "Check", "if", "array", "key", "exists" ]
e4968588fd3f42c95a763ca3c36cfb846b24ab81
https://github.com/ko-ko-ko/php-assert/blob/e4968588fd3f42c95a763ca3c36cfb846b24ab81/src/Assert.php#L322-L337
234,515
ko-ko-ko/php-assert
src/Assert.php
Assert.match
public function match($pattern) { if (!is_string($pattern)) { throw new InvalidStringException('pattern', $pattern); } elseif (empty($pattern)) { throw new InvalidNotEmptyException('pattern'); } if (!is_string($this->value)) { throw new InvalidStr...
php
public function match($pattern) { if (!is_string($pattern)) { throw new InvalidStringException('pattern', $pattern); } elseif (empty($pattern)) { throw new InvalidNotEmptyException('pattern'); } if (!is_string($this->value)) { throw new InvalidStr...
[ "public", "function", "match", "(", "$", "pattern", ")", "{", "if", "(", "!", "is_string", "(", "$", "pattern", ")", ")", "{", "throw", "new", "InvalidStringException", "(", "'pattern'", ",", "$", "pattern", ")", ";", "}", "elseif", "(", "empty", "(", ...
Check if value match regexp pattern @param string $pattern @return $this @throws InvalidNotEmptyException @throws InvalidRegexpPatternException @throws InvalidStringException @throws StringNotMatchRegExpException
[ "Check", "if", "value", "match", "regexp", "pattern" ]
e4968588fd3f42c95a763ca3c36cfb846b24ab81
https://github.com/ko-ko-ko/php-assert/blob/e4968588fd3f42c95a763ca3c36cfb846b24ab81/src/Assert.php#L621-L645
234,516
ko-ko-ko/php-assert
src/Assert.php
Assert.glob
public function glob($pattern) { if (!is_string($pattern)) { throw new InvalidStringException('pattern', $pattern); } elseif (empty($pattern)) { throw new InvalidNotEmptyException('pattern'); } if (!is_string($this->value)) { throw new InvalidStri...
php
public function glob($pattern) { if (!is_string($pattern)) { throw new InvalidStringException('pattern', $pattern); } elseif (empty($pattern)) { throw new InvalidNotEmptyException('pattern'); } if (!is_string($this->value)) { throw new InvalidStri...
[ "public", "function", "glob", "(", "$", "pattern", ")", "{", "if", "(", "!", "is_string", "(", "$", "pattern", ")", ")", "{", "throw", "new", "InvalidStringException", "(", "'pattern'", ",", "$", "pattern", ")", ";", "}", "elseif", "(", "empty", "(", ...
Check if value match glob pattern @param string $pattern @return $this @throws InvalidNotEmptyException @throws InvalidStringException @throws StringNotMatchGlobException
[ "Check", "if", "value", "match", "glob", "pattern" ]
e4968588fd3f42c95a763ca3c36cfb846b24ab81
https://github.com/ko-ko-ko/php-assert/blob/e4968588fd3f42c95a763ca3c36cfb846b24ab81/src/Assert.php#L656-L671
234,517
ko-ko-ko/php-assert
src/Assert.php
Assert.negative
public function negative() { if (!is_int($this->value) && !is_float($this->value)) { throw new InvalidIntOrFloatException($this->name, $this->value); } elseif ($this->value >= 0) { throw new NumberNotNegativeException($this->name, $this->value); } return $thi...
php
public function negative() { if (!is_int($this->value) && !is_float($this->value)) { throw new InvalidIntOrFloatException($this->name, $this->value); } elseif ($this->value >= 0) { throw new NumberNotNegativeException($this->name, $this->value); } return $thi...
[ "public", "function", "negative", "(", ")", "{", "if", "(", "!", "is_int", "(", "$", "this", "->", "value", ")", "&&", "!", "is_float", "(", "$", "this", "->", "value", ")", ")", "{", "throw", "new", "InvalidIntOrFloatException", "(", "$", "this", "-...
Check if value < 0 @return $this @throws InvalidIntOrFloatException @throws NumberNotNegativeException
[ "Check", "if", "value", "<", "0" ]
e4968588fd3f42c95a763ca3c36cfb846b24ab81
https://github.com/ko-ko-ko/php-assert/blob/e4968588fd3f42c95a763ca3c36cfb846b24ab81/src/Assert.php#L680-L689
234,518
ko-ko-ko/php-assert
src/Assert.php
Assert.positive
public function positive() { if (!is_int($this->value) && !is_float($this->value)) { throw new InvalidIntOrFloatException($this->name, $this->value); } elseif ($this->value <= 0) { throw new NumberNotPositiveException($this->name, $this->value); } return $thi...
php
public function positive() { if (!is_int($this->value) && !is_float($this->value)) { throw new InvalidIntOrFloatException($this->name, $this->value); } elseif ($this->value <= 0) { throw new NumberNotPositiveException($this->name, $this->value); } return $thi...
[ "public", "function", "positive", "(", ")", "{", "if", "(", "!", "is_int", "(", "$", "this", "->", "value", ")", "&&", "!", "is_float", "(", "$", "this", "->", "value", ")", ")", "{", "throw", "new", "InvalidIntOrFloatException", "(", "$", "this", "-...
Check if value > 0 @return $this @throws InvalidIntOrFloatException @throws NumberNotPositiveException
[ "Check", "if", "value", ">", "0" ]
e4968588fd3f42c95a763ca3c36cfb846b24ab81
https://github.com/ko-ko-ko/php-assert/blob/e4968588fd3f42c95a763ca3c36cfb846b24ab81/src/Assert.php#L698-L707
234,519
ko-ko-ko/php-assert
src/Assert.php
Assert.isNull
public function isNull() { if (!is_null($this->value)) { throw new InvalidNullException($this->name, $this->value); } return $this; }
php
public function isNull() { if (!is_null($this->value)) { throw new InvalidNullException($this->name, $this->value); } return $this; }
[ "public", "function", "isNull", "(", ")", "{", "if", "(", "!", "is_null", "(", "$", "this", "->", "value", ")", ")", "{", "throw", "new", "InvalidNullException", "(", "$", "this", "->", "name", ",", "$", "this", "->", "value", ")", ";", "}", "retur...
Check if value is null @return $this @throws InvalidNullException
[ "Check", "if", "value", "is", "null" ]
e4968588fd3f42c95a763ca3c36cfb846b24ab81
https://github.com/ko-ko-ko/php-assert/blob/e4968588fd3f42c95a763ca3c36cfb846b24ab81/src/Assert.php#L757-L764
234,520
ko-ko-ko/php-assert
src/Assert.php
Assert.toFloat
public function toFloat() { if (is_array($this->value)) { throw new InvalidNotArrayException($this->name); } elseif (!empty($this->value) && !is_numeric($this->value)) { throw new InvalidNumericException($this->name, $this->value); } $this->value = (float) $t...
php
public function toFloat() { if (is_array($this->value)) { throw new InvalidNotArrayException($this->name); } elseif (!empty($this->value) && !is_numeric($this->value)) { throw new InvalidNumericException($this->name, $this->value); } $this->value = (float) $t...
[ "public", "function", "toFloat", "(", ")", "{", "if", "(", "is_array", "(", "$", "this", "->", "value", ")", ")", "{", "throw", "new", "InvalidNotArrayException", "(", "$", "this", "->", "name", ")", ";", "}", "elseif", "(", "!", "empty", "(", "$", ...
Cast value to float. If it's not numeric - there will be fail cast @return $this @throws InvalidNotArrayException @throws InvalidNumericException
[ "Cast", "value", "to", "float", ".", "If", "it", "s", "not", "numeric", "-", "there", "will", "be", "fail", "cast" ]
e4968588fd3f42c95a763ca3c36cfb846b24ab81
https://github.com/ko-ko-ko/php-assert/blob/e4968588fd3f42c95a763ca3c36cfb846b24ab81/src/Assert.php#L848-L859
234,521
ko-ko-ko/php-assert
src/Assert.php
Assert.toInt
public function toInt() { if (is_array($this->value)) { throw new InvalidNotArrayException($this->name); } elseif (!empty($this->value) && !is_numeric($this->value)) { throw new InvalidNumericException($this->name, $this->value); } $this->value = (int) $this-...
php
public function toInt() { if (is_array($this->value)) { throw new InvalidNotArrayException($this->name); } elseif (!empty($this->value) && !is_numeric($this->value)) { throw new InvalidNumericException($this->name, $this->value); } $this->value = (int) $this-...
[ "public", "function", "toInt", "(", ")", "{", "if", "(", "is_array", "(", "$", "this", "->", "value", ")", ")", "{", "throw", "new", "InvalidNotArrayException", "(", "$", "this", "->", "name", ")", ";", "}", "elseif", "(", "!", "empty", "(", "$", "...
Cast value to int. If it's not numeric - there will be fail cast @return $this @throws InvalidNotArrayException @throws InvalidNumericException
[ "Cast", "value", "to", "int", ".", "If", "it", "s", "not", "numeric", "-", "there", "will", "be", "fail", "cast" ]
e4968588fd3f42c95a763ca3c36cfb846b24ab81
https://github.com/ko-ko-ko/php-assert/blob/e4968588fd3f42c95a763ca3c36cfb846b24ab81/src/Assert.php#L868-L879
234,522
ko-ko-ko/php-assert
src/Assert.php
Assert.toString
public function toString() { if (is_array($this->value)) { throw new InvalidNotArrayException($this->name); } $this->value = (string) $this->value; return $this; }
php
public function toString() { if (is_array($this->value)) { throw new InvalidNotArrayException($this->name); } $this->value = (string) $this->value; return $this; }
[ "public", "function", "toString", "(", ")", "{", "if", "(", "is_array", "(", "$", "this", "->", "value", ")", ")", "{", "throw", "new", "InvalidNotArrayException", "(", "$", "this", "->", "name", ")", ";", "}", "$", "this", "->", "value", "=", "(", ...
Cast value to string. If it's array - there will be fail cast @return $this @throws InvalidNotArrayException
[ "Cast", "value", "to", "string", ".", "If", "it", "s", "array", "-", "there", "will", "be", "fail", "cast" ]
e4968588fd3f42c95a763ca3c36cfb846b24ab81
https://github.com/ko-ko-ko/php-assert/blob/e4968588fd3f42c95a763ca3c36cfb846b24ab81/src/Assert.php#L887-L896
234,523
dave-redfern/laravel-doctrine-tenancy
src/Repositories/TenantAwareRepository.php
TenantAwareRepository.applySecurityModel
protected function applySecurityModel(QueryBuilder $qb, $alias) { $model = $this->tenant->getTenantSecurityModel(); $method = 'apply' . ucfirst($model) . 'SecurityModel'; if ( method_exists($this, $method) ) { $this->$method($qb, $alias); } else { throw new ...
php
protected function applySecurityModel(QueryBuilder $qb, $alias) { $model = $this->tenant->getTenantSecurityModel(); $method = 'apply' . ucfirst($model) . 'SecurityModel'; if ( method_exists($this, $method) ) { $this->$method($qb, $alias); } else { throw new ...
[ "protected", "function", "applySecurityModel", "(", "QueryBuilder", "$", "qb", ",", "$", "alias", ")", "{", "$", "model", "=", "$", "this", "->", "tenant", "->", "getTenantSecurityModel", "(", ")", ";", "$", "method", "=", "'apply'", ".", "ucfirst", "(", ...
Applies the rules for the selected Security Model The security model name is capitalised, and then turned into a method prefixed with apply and suffixed with SecurityModel e.g.: shared -> applySharedSecurityModel. @param QueryBuilder $qb @param string $alias
[ "Applies", "the", "rules", "for", "the", "selected", "Security", "Model" ]
3307fc57ad64d5a4dd5dfb235e19b301661255f9
https://github.com/dave-redfern/laravel-doctrine-tenancy/blob/3307fc57ad64d5a4dd5dfb235e19b301661255f9/src/Repositories/TenantAwareRepository.php#L137-L149
234,524
txj123/zilf
src/Zilf/Cache/CacheManager.php
CacheManager.get
protected function get($name) { return isset($this->stores[$name]) ? $this->stores[$name] : $this->resolve($name); }
php
protected function get($name) { return isset($this->stores[$name]) ? $this->stores[$name] : $this->resolve($name); }
[ "protected", "function", "get", "(", "$", "name", ")", "{", "return", "isset", "(", "$", "this", "->", "stores", "[", "$", "name", "]", ")", "?", "$", "this", "->", "stores", "[", "$", "name", "]", ":", "$", "this", "->", "resolve", "(", "$", "...
Attempt to get the store from the local cache. @param string $name @return \Zilf\Cache\Repository
[ "Attempt", "to", "get", "the", "store", "from", "the", "local", "cache", "." ]
8fc979ae338e850e6f40bfb97d4d57869f9e4480
https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/Cache/CacheManager.php#L76-L79
234,525
oxygen-cms/core
src/Console/Command.php
Command.heading
public function heading($text) { $this->info(''); $this->info('==================='); $this->info($text); $this->info('==================='); $this->info(''); }
php
public function heading($text) { $this->info(''); $this->info('==================='); $this->info($text); $this->info('==================='); $this->info(''); }
[ "public", "function", "heading", "(", "$", "text", ")", "{", "$", "this", "->", "info", "(", "''", ")", ";", "$", "this", "->", "info", "(", "'==================='", ")", ";", "$", "this", "->", "info", "(", "$", "text", ")", ";", "$", "this", "-...
Prints a heading. @param string $text
[ "Prints", "a", "heading", "." ]
8f8349c669771d9a7a719a7b120821e06cb5a20b
https://github.com/oxygen-cms/core/blob/8f8349c669771d9a7a719a7b120821e06cb5a20b/src/Console/Command.php#L14-L20
234,526
hfcorriez/pagon
app/src/Api/Api.php
Api.dump
protected function dump(array $data, $code = 200) { $this->output->status($code); switch ($this->_format) { case 'xml': $this->output->xml($data, $this->_xml_option); break; case 'jsonp': $this->output->jsonp($data, $this->_jso...
php
protected function dump(array $data, $code = 200) { $this->output->status($code); switch ($this->_format) { case 'xml': $this->output->xml($data, $this->_xml_option); break; case 'jsonp': $this->output->jsonp($data, $this->_jso...
[ "protected", "function", "dump", "(", "array", "$", "data", ",", "$", "code", "=", "200", ")", "{", "$", "this", "->", "output", "->", "status", "(", "$", "code", ")", ";", "switch", "(", "$", "this", "->", "_format", ")", "{", "case", "'xml'", "...
Dump API data @param array $data @param int $code
[ "Dump", "API", "data" ]
c847a59c4ce4876887c65d35880ded8bb559cc48
https://github.com/hfcorriez/pagon/blob/c847a59c4ce4876887c65d35880ded8bb559cc48/app/src/Api/Api.php#L64-L80
234,527
kharanenka/oc-pagination
src/Kharanenka/Helper/Pagination.php
Pagination.get
public static function get($iCurrentPage, $iTotalCount, $arSettings = []) { if(!empty($arSettings) && isset($arSettings['button_list']) && !empty($arSettings['button_list'])) { $arSettings['button_list'] = explode(',', $arSettings['button_list']); } return parent::get($iCurrentPag...
php
public static function get($iCurrentPage, $iTotalCount, $arSettings = []) { if(!empty($arSettings) && isset($arSettings['button_list']) && !empty($arSettings['button_list'])) { $arSettings['button_list'] = explode(',', $arSettings['button_list']); } return parent::get($iCurrentPag...
[ "public", "static", "function", "get", "(", "$", "iCurrentPage", ",", "$", "iTotalCount", ",", "$", "arSettings", "=", "[", "]", ")", "{", "if", "(", "!", "empty", "(", "$", "arSettings", ")", "&&", "isset", "(", "$", "arSettings", "[", "'button_list'"...
Get pagination elements @param int $iCurrentPage - current page number @param int $iTotalCount - total count elements @param array $arSettings - settings array @return array
[ "Get", "pagination", "elements" ]
0a26015df60c7a3194dbdabe1f882efa287affd3
https://github.com/kharanenka/oc-pagination/blob/0a26015df60c7a3194dbdabe1f882efa287affd3/src/Kharanenka/Helper/Pagination.php#L261-L269
234,528
mikelgoig/laravel-spotify-wrapper
src/SpotifyWrapper.php
SpotifyWrapper.requestAccessToken
public function requestAccessToken() { try { $this->session->requestAccessToken($_GET['code']); return $this; } catch (Exception $e) { $this->redirectToSpotifyAuthorizeUrl(); } }
php
public function requestAccessToken() { try { $this->session->requestAccessToken($_GET['code']); return $this; } catch (Exception $e) { $this->redirectToSpotifyAuthorizeUrl(); } }
[ "public", "function", "requestAccessToken", "(", ")", "{", "try", "{", "$", "this", "->", "session", "->", "requestAccessToken", "(", "$", "_GET", "[", "'code'", "]", ")", ";", "return", "$", "this", ";", "}", "catch", "(", "Exception", "$", "e", ")", ...
Request an access token. @return void
[ "Request", "an", "access", "token", "." ]
0f93b561ec1a590c3568c47f901f5f7ac4e61cf1
https://github.com/mikelgoig/laravel-spotify-wrapper/blob/0f93b561ec1a590c3568c47f901f5f7ac4e61cf1/src/SpotifyWrapper.php#L68-L76
234,529
txj123/zilf
src/Zilf/Queue/InteractsWithQueue.php
InteractsWithQueue.fail
public function fail($exception = null) { if ($this->job) { FailingJob::handle($this->job->getConnectionName(), $this->job, $exception); } }
php
public function fail($exception = null) { if ($this->job) { FailingJob::handle($this->job->getConnectionName(), $this->job, $exception); } }
[ "public", "function", "fail", "(", "$", "exception", "=", "null", ")", "{", "if", "(", "$", "this", "->", "job", ")", "{", "FailingJob", "::", "handle", "(", "$", "this", "->", "job", "->", "getConnectionName", "(", ")", ",", "$", "this", "->", "jo...
Fail the job from the queue. @param \Throwable $exception @return void
[ "Fail", "the", "job", "from", "the", "queue", "." ]
8fc979ae338e850e6f40bfb97d4d57869f9e4480
https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/Queue/InteractsWithQueue.php#L42-L47
234,530
kiwiz/esquery
src/Util.php
Util.escapeString
public static function escapeString($str, $allow_wildcards=false) { $needles = [ '\\', '+', '-', '=', '&&', '||', '>', '<', '!', '(', ')', '{', '}', '[', ']', '^', '"', '~', ':', '/', ' ' ]; $replacements = [ '\\\\', '\\+', '\\-', '\\=', '\\&&', '\\||', '\\>',...
php
public static function escapeString($str, $allow_wildcards=false) { $needles = [ '\\', '+', '-', '=', '&&', '||', '>', '<', '!', '(', ')', '{', '}', '[', ']', '^', '"', '~', ':', '/', ' ' ]; $replacements = [ '\\\\', '\\+', '\\-', '\\=', '\\&&', '\\||', '\\>',...
[ "public", "static", "function", "escapeString", "(", "$", "str", ",", "$", "allow_wildcards", "=", "false", ")", "{", "$", "needles", "=", "[", "'\\\\'", ",", "'+'", ",", "'-'", ",", "'='", ",", "'&&'", ",", "'||'", ",", "'>'", ",", "'<'", ",", "'!...
Escape special characters in a query.
[ "Escape", "special", "characters", "in", "a", "query", "." ]
ad05f8d18cb9f1227a82f8d0b9d270882865b31d
https://github.com/kiwiz/esquery/blob/ad05f8d18cb9f1227a82f8d0b9d270882865b31d/src/Util.php#L15-L29
234,531
kiwiz/esquery
src/Util.php
Util.escapeGroup
public static function escapeGroup($arr, $wildcard=false) { return implode('', array_map(function($x) use ($wildcard) { if(is_string($x)) { if($wildcard) { return Util::escapeString($x); } else { return '"' . str_replace('"', '\...
php
public static function escapeGroup($arr, $wildcard=false) { return implode('', array_map(function($x) use ($wildcard) { if(is_string($x)) { if($wildcard) { return Util::escapeString($x); } else { return '"' . str_replace('"', '\...
[ "public", "static", "function", "escapeGroup", "(", "$", "arr", ",", "$", "wildcard", "=", "false", ")", "{", "return", "implode", "(", "''", ",", "array_map", "(", "function", "(", "$", "x", ")", "use", "(", "$", "wildcard", ")", "{", "if", "(", "...
Escape special characters in an array of query chunks.
[ "Escape", "special", "characters", "in", "an", "array", "of", "query", "chunks", "." ]
ad05f8d18cb9f1227a82f8d0b9d270882865b31d
https://github.com/kiwiz/esquery/blob/ad05f8d18cb9f1227a82f8d0b9d270882865b31d/src/Util.php#L32-L46
234,532
kiwiz/esquery
src/Util.php
Util.combine
public static function combine($first, $rest, $idx) { $ret = []; $ret[] = $first; foreach($rest as $val) { $ret[] = $val[$idx]; } return $ret; }
php
public static function combine($first, $rest, $idx) { $ret = []; $ret[] = $first; foreach($rest as $val) { $ret[] = $val[$idx]; } return $ret; }
[ "public", "static", "function", "combine", "(", "$", "first", ",", "$", "rest", ",", "$", "idx", ")", "{", "$", "ret", "=", "[", "]", ";", "$", "ret", "[", "]", "=", "$", "first", ";", "foreach", "(", "$", "rest", "as", "$", "val", ")", "{", ...
Parser helper. Flatten results into an array.
[ "Parser", "helper", ".", "Flatten", "results", "into", "an", "array", "." ]
ad05f8d18cb9f1227a82f8d0b9d270882865b31d
https://github.com/kiwiz/esquery/blob/ad05f8d18cb9f1227a82f8d0b9d270882865b31d/src/Util.php#L49-L57
234,533
kiwiz/esquery
src/Util.php
Util.assoc
public static function assoc($first, $rest, $idx) { $ret = []; $ret[$first[0]] = $first[1]; foreach($rest as $val) { $ret[$val[$idx][0]] = $val[$idx][1]; } return $ret; }
php
public static function assoc($first, $rest, $idx) { $ret = []; $ret[$first[0]] = $first[1]; foreach($rest as $val) { $ret[$val[$idx][0]] = $val[$idx][1]; } return $ret; }
[ "public", "static", "function", "assoc", "(", "$", "first", ",", "$", "rest", ",", "$", "idx", ")", "{", "$", "ret", "=", "[", "]", ";", "$", "ret", "[", "$", "first", "[", "0", "]", "]", "=", "$", "first", "[", "1", "]", ";", "foreach", "(...
Parser helper. Turn results into an associative array.
[ "Parser", "helper", ".", "Turn", "results", "into", "an", "associative", "array", "." ]
ad05f8d18cb9f1227a82f8d0b9d270882865b31d
https://github.com/kiwiz/esquery/blob/ad05f8d18cb9f1227a82f8d0b9d270882865b31d/src/Util.php#L60-L68
234,534
kiwiz/esquery
src/Util.php
Util.generateDateIndices
public static function generateDateIndices($format, $interval, $from_ts, $to_ts) { $fmt_arr = []; $escaped = false; foreach(str_split($format) as $chr) { switch($chr) { case '[': $escaped = true; break; case ']': ...
php
public static function generateDateIndices($format, $interval, $from_ts, $to_ts) { $fmt_arr = []; $escaped = false; foreach(str_split($format) as $chr) { switch($chr) { case '[': $escaped = true; break; case ']': ...
[ "public", "static", "function", "generateDateIndices", "(", "$", "format", ",", "$", "interval", ",", "$", "from_ts", ",", "$", "to_ts", ")", "{", "$", "fmt_arr", "=", "[", "]", ";", "$", "escaped", "=", "false", ";", "foreach", "(", "str_split", "(", ...
Generate a list of date-based indices. @param string $format The index format. @param string $interval The interval size (h,d,w,m,y). @param int $from_ts Start timestamp. @param int $to_ts End timestamp. @return string[] List of indices.
[ "Generate", "a", "list", "of", "date", "-", "based", "indices", "." ]
ad05f8d18cb9f1227a82f8d0b9d270882865b31d
https://github.com/kiwiz/esquery/blob/ad05f8d18cb9f1227a82f8d0b9d270882865b31d/src/Util.php#L78-L119
234,535
krafthaus/bauhaus
src/KraftHaus/Bauhaus/Export/Builder.php
Builder.export
public function export($type) { $format = sprintf('\\KraftHaus\\Bauhaus\\Export\\Format\\%sFormat', ucfirst($type)); return (new $format) ->setListBuilder($this->getListBuilder()) ->export(); }
php
public function export($type) { $format = sprintf('\\KraftHaus\\Bauhaus\\Export\\Format\\%sFormat', ucfirst($type)); return (new $format) ->setListBuilder($this->getListBuilder()) ->export(); }
[ "public", "function", "export", "(", "$", "type", ")", "{", "$", "format", "=", "sprintf", "(", "'\\\\KraftHaus\\\\Bauhaus\\\\Export\\\\Format\\\\%sFormat'", ",", "ucfirst", "(", "$", "type", ")", ")", ";", "return", "(", "new", "$", "format", ")", "->", "se...
Create a new export based on the ListBuilder output. @param string $type @access public @return mixed
[ "Create", "a", "new", "export", "based", "on", "the", "ListBuilder", "output", "." ]
02b6c5f4f7e5b5748d5300ab037feaff2a84ca80
https://github.com/krafthaus/bauhaus/blob/02b6c5f4f7e5b5748d5300ab037feaff2a84ca80/src/KraftHaus/Bauhaus/Export/Builder.php#L60-L66
234,536
netzmacht/contao-icon-wizard
src/IconWidget.php
IconWidget.validator
protected function validator($value) { $value = parent::validator($value); if ($this->hasErrors()) { return null; } elseif ($value == '') { if ($this->mandatory) { $this->addError(sprintf($GLOBALS['TL_LANG']['ERR']['mandatory'], $this->strLabel)); ...
php
protected function validator($value) { $value = parent::validator($value); if ($this->hasErrors()) { return null; } elseif ($value == '') { if ($this->mandatory) { $this->addError(sprintf($GLOBALS['TL_LANG']['ERR']['mandatory'], $this->strLabel)); ...
[ "protected", "function", "validator", "(", "$", "value", ")", "{", "$", "value", "=", "parent", "::", "validator", "(", "$", "value", ")", ";", "if", "(", "$", "this", "->", "hasErrors", "(", ")", ")", "{", "return", "null", ";", "}", "elseif", "("...
Call the validator. @param mixed $value The value. @return mixed @SuppressWarnings(PHPMD.Superglobals)
[ "Call", "the", "validator", "." ]
d0b5dba08d8167740f5828d0ee49b11f3eb0b946
https://github.com/netzmacht/contao-icon-wizard/blob/d0b5dba08d8167740f5828d0ee49b11f3eb0b946/src/IconWidget.php#L121-L136
234,537
netzmacht/contao-icon-wizard
src/IconWidget.php
IconWidget.iconExists
protected function iconExists($icon) { foreach ($this->icons as $group) { foreach ($group as $entry) { if (!is_array($entry)) { continue; } if ($entry['value'] === $icon) { return true; } ...
php
protected function iconExists($icon) { foreach ($this->icons as $group) { foreach ($group as $entry) { if (!is_array($entry)) { continue; } if ($entry['value'] === $icon) { return true; } ...
[ "protected", "function", "iconExists", "(", "$", "icon", ")", "{", "foreach", "(", "$", "this", "->", "icons", "as", "$", "group", ")", "{", "foreach", "(", "$", "group", "as", "$", "entry", ")", "{", "if", "(", "!", "is_array", "(", "$", "entry", ...
Check if icon exists. @param string $icon The icon name. @return bool
[ "Check", "if", "icon", "exists", "." ]
d0b5dba08d8167740f5828d0ee49b11f3eb0b946
https://github.com/netzmacht/contao-icon-wizard/blob/d0b5dba08d8167740f5828d0ee49b11f3eb0b946/src/IconWidget.php#L186-L201
234,538
ivopetkov/lock
src/Lock.php
Lock.acquire
static public function acquire($key, $options = []) { $keyMD5 = md5(self::$keyPrefix . serialize($key)); $timeout = isset($options['timeout']) ? (float) $options['timeout'] : self::$defaultLockTimeout; $retryInterval = 0.5; $maxRetriesCount = floor($timeout / $retryInterval); ...
php
static public function acquire($key, $options = []) { $keyMD5 = md5(self::$keyPrefix . serialize($key)); $timeout = isset($options['timeout']) ? (float) $options['timeout'] : self::$defaultLockTimeout; $retryInterval = 0.5; $maxRetriesCount = floor($timeout / $retryInterval); ...
[ "static", "public", "function", "acquire", "(", "$", "key", ",", "$", "options", "=", "[", "]", ")", "{", "$", "keyMD5", "=", "md5", "(", "self", "::", "$", "keyPrefix", ".", "serialize", "(", "$", "key", ")", ")", ";", "$", "timeout", "=", "isse...
Acquires a new lock for the key specified. @param mixed $key The key of the lock. @param array $options Lock options. Available values: - timeout - A time (in seconds) to retry acquiring the lock. @throws \Exception
[ "Acquires", "a", "new", "lock", "for", "the", "key", "specified", "." ]
8b2a5f6dd3f1431c643d4eda2f647141a8811b50
https://github.com/ivopetkov/lock/blob/8b2a5f6dd3f1431c643d4eda2f647141a8811b50/src/Lock.php#L91-L140
234,539
ivopetkov/lock
src/Lock.php
Lock.exists
static public function exists($key) { $keyMD5 = md5(self::$keyPrefix . serialize($key)); $dir = self::getLocksDir(); if (!is_dir($dir)) { return false; } $filename = $dir . $keyMD5 . '.lock'; set_error_handler(function($errno, $errstr) { throw ...
php
static public function exists($key) { $keyMD5 = md5(self::$keyPrefix . serialize($key)); $dir = self::getLocksDir(); if (!is_dir($dir)) { return false; } $filename = $dir . $keyMD5 . '.lock'; set_error_handler(function($errno, $errstr) { throw ...
[ "static", "public", "function", "exists", "(", "$", "key", ")", "{", "$", "keyMD5", "=", "md5", "(", "self", "::", "$", "keyPrefix", ".", "serialize", "(", "$", "key", ")", ")", ";", "$", "dir", "=", "self", "::", "getLocksDir", "(", ")", ";", "i...
Checks if a lock exists. @param mixed $key The key of the lock. @throws \Exception @return boolean Returns TRUE if the lock exists, FALSE otherwise.
[ "Checks", "if", "a", "lock", "exists", "." ]
8b2a5f6dd3f1431c643d4eda2f647141a8811b50
https://github.com/ivopetkov/lock/blob/8b2a5f6dd3f1431c643d4eda2f647141a8811b50/src/Lock.php#L149-L177
234,540
ivopetkov/lock
src/Lock.php
Lock.release
static public function release($key) { $keyMD5 = md5(self::$keyPrefix . serialize($key)); if (!isset(self::$data[$keyMD5])) { throw new \Exception('A lock name "' . $key . '" does not exists in current process!'); } $dir = self::getLocksDir(); if (!is_dir($dir)) {...
php
static public function release($key) { $keyMD5 = md5(self::$keyPrefix . serialize($key)); if (!isset(self::$data[$keyMD5])) { throw new \Exception('A lock name "' . $key . '" does not exists in current process!'); } $dir = self::getLocksDir(); if (!is_dir($dir)) {...
[ "static", "public", "function", "release", "(", "$", "key", ")", "{", "$", "keyMD5", "=", "md5", "(", "self", "::", "$", "keyPrefix", ".", "serialize", "(", "$", "key", ")", ")", ";", "if", "(", "!", "isset", "(", "self", "::", "$", "data", "[", ...
Releases a lock. @param mixed $key The key of the lock. @throws \Exception
[ "Releases", "a", "lock", "." ]
8b2a5f6dd3f1431c643d4eda2f647141a8811b50
https://github.com/ivopetkov/lock/blob/8b2a5f6dd3f1431c643d4eda2f647141a8811b50/src/Lock.php#L185-L220
234,541
czukowski/markdown-toc
classes/TOCTrait.php
TOCTrait.findHeadlines
protected function findHeadlines($markdown, $fromLevel = 1, $toLevel = 6) { $headlines = []; foreach ($this->parseBlocks($this->splitLines($markdown)) as $block) { if ($this->isItemOfType($block, 'headline') && isset($block['level']) && $block['level'] >= $fromLevel && $block...
php
protected function findHeadlines($markdown, $fromLevel = 1, $toLevel = 6) { $headlines = []; foreach ($this->parseBlocks($this->splitLines($markdown)) as $block) { if ($this->isItemOfType($block, 'headline') && isset($block['level']) && $block['level'] >= $fromLevel && $block...
[ "protected", "function", "findHeadlines", "(", "$", "markdown", ",", "$", "fromLevel", "=", "1", ",", "$", "toLevel", "=", "6", ")", "{", "$", "headlines", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "parseBlocks", "(", "$", "this", "->", ...
Finds headlines in a markdown content. @param string $markdown source markdown. @param integer $fromLevel find headlines starting with this level @param integer $toLevel find headlines up to this level @return array
[ "Finds", "headlines", "in", "a", "markdown", "content", "." ]
eb1682acf9515afa19ee710666011937dcb4a2fc
https://github.com/czukowski/markdown-toc/blob/eb1682acf9515afa19ee710666011937dcb4a2fc/classes/TOCTrait.php#L58-L68
234,542
czukowski/markdown-toc
classes/TOCTrait.php
TOCTrait.toAscii
protected static function toAscii($s) { static $transliterator = NULL; if ($transliterator === NULL && class_exists('Transliterator', FALSE)) { $transliterator = \Transliterator::create('Any-Latin; Latin-ASCII'); } $s = preg_replace('#[^\x09\x0A\x0D\x20-\x7E\xA0-\x{2FF}\x{37...
php
protected static function toAscii($s) { static $transliterator = NULL; if ($transliterator === NULL && class_exists('Transliterator', FALSE)) { $transliterator = \Transliterator::create('Any-Latin; Latin-ASCII'); } $s = preg_replace('#[^\x09\x0A\x0D\x20-\x7E\xA0-\x{2FF}\x{37...
[ "protected", "static", "function", "toAscii", "(", "$", "s", ")", "{", "static", "$", "transliterator", "=", "NULL", ";", "if", "(", "$", "transliterator", "===", "NULL", "&&", "class_exists", "(", "'Transliterator'", ",", "FALSE", ")", ")", "{", "$", "t...
Converts string to ASCII. This function is taken from `nette/utils` package. @author David Grudl <https://davidgrudl.com> @see https://github.com/nette/utils @license https://github.com/nette/utils/blob/master/license.md @param string $s UTF-8 encoding @return string ASCII
[ "Converts", "string", "to", "ASCII", "." ]
eb1682acf9515afa19ee710666011937dcb4a2fc
https://github.com/czukowski/markdown-toc/blob/eb1682acf9515afa19ee710666011937dcb4a2fc/classes/TOCTrait.php#L229-L262
234,543
webbuilders-group/silverstripe-frontendgridfield
code/forms/FrontEndGridFieldDetailForm.php
FrontEndGridFieldDetailForm_ItemRequest.view
public function view($request) { if(!$this->record->canView()) { $this->httpError(403); } $controller=$this->getToplevelController(); $form=$this->ItemEditForm($this->gridField, $request); $form->makeReadonly(); return $controller->c...
php
public function view($request) { if(!$this->record->canView()) { $this->httpError(403); } $controller=$this->getToplevelController(); $form=$this->ItemEditForm($this->gridField, $request); $form->makeReadonly(); return $controller->c...
[ "public", "function", "view", "(", "$", "request", ")", "{", "if", "(", "!", "$", "this", "->", "record", "->", "canView", "(", ")", ")", "{", "$", "this", "->", "httpError", "(", "403", ")", ";", "}", "$", "controller", "=", "$", "this", "->", ...
Renders the view form @param {SS_HTTPRequest} $request Request data @return {string} Rendered view form
[ "Renders", "the", "view", "form" ]
e3ff8d3208c279e9af6e15a750af02632876b914
https://github.com/webbuilders-group/silverstripe-frontendgridfield/blob/e3ff8d3208c279e9af6e15a750af02632876b914/code/forms/FrontEndGridFieldDetailForm.php#L154-L168
234,544
webbuilders-group/silverstripe-frontendgridfield
code/forms/FrontEndGridFieldDetailForm.php
FrontEndGridFieldDetailForm_ItemRequest.edit
public function edit($request) { $controller=$this->getToplevelController(); $form=$this->ItemEditForm($this->gridField, $request); return $controller->customise(array( 'Title'=>($this->record && $this->record->ID ? $this->record->Title:sprin...
php
public function edit($request) { $controller=$this->getToplevelController(); $form=$this->ItemEditForm($this->gridField, $request); return $controller->customise(array( 'Title'=>($this->record && $this->record->ID ? $this->record->Title:sprin...
[ "public", "function", "edit", "(", "$", "request", ")", "{", "$", "controller", "=", "$", "this", "->", "getToplevelController", "(", ")", ";", "$", "form", "=", "$", "this", "->", "ItemEditForm", "(", "$", "this", "->", "gridField", ",", "$", "request...
Renders the edit form @param {SS_HTTPRequest} $request Request data @return {string} Rendered edit form
[ "Renders", "the", "edit", "form" ]
e3ff8d3208c279e9af6e15a750af02632876b914
https://github.com/webbuilders-group/silverstripe-frontendgridfield/blob/e3ff8d3208c279e9af6e15a750af02632876b914/code/forms/FrontEndGridFieldDetailForm.php#L175-L184
234,545
txj123/zilf
src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Validate/Abstract.php
Zend_Validate_Abstract._createMessage
protected function _createMessage($messageKey, $value) { if (!isset($this->_messageTemplates[$messageKey])) { return null; } $message = $this->_messageTemplates[$messageKey]; if (null !== ($translator = $this->getTranslator())) { if ($translator->isTranslate...
php
protected function _createMessage($messageKey, $value) { if (!isset($this->_messageTemplates[$messageKey])) { return null; } $message = $this->_messageTemplates[$messageKey]; if (null !== ($translator = $this->getTranslator())) { if ($translator->isTranslate...
[ "protected", "function", "_createMessage", "(", "$", "messageKey", ",", "$", "value", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "_messageTemplates", "[", "$", "messageKey", "]", ")", ")", "{", "return", "null", ";", "}", "$", "message"...
Constructs and returns a validation failure message with the given message key and value. Returns null if and only if $messageKey does not correspond to an existing template. If a translator is available and a translation exists for $messageKey, the translation will be used. @param string $messageKey @param string...
[ "Constructs", "and", "returns", "a", "validation", "failure", "message", "with", "the", "given", "message", "key", "and", "value", "." ]
8fc979ae338e850e6f40bfb97d4d57869f9e4480
https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Validate/Abstract.php#L188-L213
234,546
oscarotero/fly-crud
src/Directory.php
Directory.make
public static function make(string $path, FormatInterface $format): Directory { return new static(new Filesystem(new Local($path)), '', $format); }
php
public static function make(string $path, FormatInterface $format): Directory { return new static(new Filesystem(new Local($path)), '', $format); }
[ "public", "static", "function", "make", "(", "string", "$", "path", ",", "FormatInterface", "$", "format", ")", ":", "Directory", "{", "return", "new", "static", "(", "new", "Filesystem", "(", "new", "Local", "(", "$", "path", ")", ")", ",", "''", ",",...
Creates a new directory instance.
[ "Creates", "a", "new", "directory", "instance", "." ]
df826e4db5df954d3cace9c12762ec0309b050bf
https://github.com/oscarotero/fly-crud/blob/df826e4db5df954d3cace9c12762ec0309b050bf/src/Directory.php#L23-L26
234,547
oscarotero/fly-crud
src/Directory.php
Directory.getDocument
public function getDocument(string $id): Document { if (isset($this->documents[$id])) { return $this->documents[$id]; } if ($this->hasDocument($id)) { $path = $this->getDocumentPath($id); $source = $this->filesystem->read($path); if (is_strin...
php
public function getDocument(string $id): Document { if (isset($this->documents[$id])) { return $this->documents[$id]; } if ($this->hasDocument($id)) { $path = $this->getDocumentPath($id); $source = $this->filesystem->read($path); if (is_strin...
[ "public", "function", "getDocument", "(", "string", "$", "id", ")", ":", "Document", "{", "if", "(", "isset", "(", "$", "this", "->", "documents", "[", "$", "id", "]", ")", ")", "{", "return", "$", "this", "->", "documents", "[", "$", "id", "]", ...
Read and return a document.
[ "Read", "and", "return", "a", "document", "." ]
df826e4db5df954d3cace9c12762ec0309b050bf
https://github.com/oscarotero/fly-crud/blob/df826e4db5df954d3cace9c12762ec0309b050bf/src/Directory.php#L38-L56
234,548
oscarotero/fly-crud
src/Directory.php
Directory.getDirectory
public function getDirectory(string $id): Directory { if (isset($this->directories[$id])) { return $this->directories[$id]; } if ($this->hasDirectory($id)) { return $this->directories[$id] = new static($this->filesystem, $this->getDirectoryPath($id), $this->format); ...
php
public function getDirectory(string $id): Directory { if (isset($this->directories[$id])) { return $this->directories[$id]; } if ($this->hasDirectory($id)) { return $this->directories[$id] = new static($this->filesystem, $this->getDirectoryPath($id), $this->format); ...
[ "public", "function", "getDirectory", "(", "string", "$", "id", ")", ":", "Directory", "{", "if", "(", "isset", "(", "$", "this", "->", "directories", "[", "$", "id", "]", ")", ")", "{", "return", "$", "this", "->", "directories", "[", "$", "id", "...
Read and return a directory.
[ "Read", "and", "return", "a", "directory", "." ]
df826e4db5df954d3cace9c12762ec0309b050bf
https://github.com/oscarotero/fly-crud/blob/df826e4db5df954d3cace9c12762ec0309b050bf/src/Directory.php#L61-L72
234,549
oscarotero/fly-crud
src/Directory.php
Directory.hasDocument
public function hasDocument(string $id): bool { if (isset($this->documents[$id])) { return true; } $path = $this->getDocumentPath($id); if ($this->filesystem->has($path)) { $info = $this->filesystem->getMetadata($path); return $info['type'] === ...
php
public function hasDocument(string $id): bool { if (isset($this->documents[$id])) { return true; } $path = $this->getDocumentPath($id); if ($this->filesystem->has($path)) { $info = $this->filesystem->getMetadata($path); return $info['type'] === ...
[ "public", "function", "hasDocument", "(", "string", "$", "id", ")", ":", "bool", "{", "if", "(", "isset", "(", "$", "this", "->", "documents", "[", "$", "id", "]", ")", ")", "{", "return", "true", ";", "}", "$", "path", "=", "$", "this", "->", ...
Check whether a document exists.
[ "Check", "whether", "a", "document", "exists", "." ]
df826e4db5df954d3cace9c12762ec0309b050bf
https://github.com/oscarotero/fly-crud/blob/df826e4db5df954d3cace9c12762ec0309b050bf/src/Directory.php#L77-L92
234,550
oscarotero/fly-crud
src/Directory.php
Directory.hasDirectory
public function hasDirectory(string $id): bool { if (isset($this->directories[$id])) { return true; } $path = $this->getDirectoryPath($id); if ($this->filesystem->has($path)) { $info = $this->filesystem->getMetadata($path); return $info['type'] ...
php
public function hasDirectory(string $id): bool { if (isset($this->directories[$id])) { return true; } $path = $this->getDirectoryPath($id); if ($this->filesystem->has($path)) { $info = $this->filesystem->getMetadata($path); return $info['type'] ...
[ "public", "function", "hasDirectory", "(", "string", "$", "id", ")", ":", "bool", "{", "if", "(", "isset", "(", "$", "this", "->", "directories", "[", "$", "id", "]", ")", ")", "{", "return", "true", ";", "}", "$", "path", "=", "$", "this", "->",...
Check whether a document or directory exists.
[ "Check", "whether", "a", "document", "or", "directory", "exists", "." ]
df826e4db5df954d3cace9c12762ec0309b050bf
https://github.com/oscarotero/fly-crud/blob/df826e4db5df954d3cace9c12762ec0309b050bf/src/Directory.php#L97-L112
234,551
oscarotero/fly-crud
src/Directory.php
Directory.saveDocument
public function saveDocument(string $id, Document $document): self { $this->documents[$id] = $document; $this->filesystem->put($this->getDocumentPath($id), $this->format->stringify($document->getArrayCopy())); return $this; }
php
public function saveDocument(string $id, Document $document): self { $this->documents[$id] = $document; $this->filesystem->put($this->getDocumentPath($id), $this->format->stringify($document->getArrayCopy())); return $this; }
[ "public", "function", "saveDocument", "(", "string", "$", "id", ",", "Document", "$", "document", ")", ":", "self", "{", "$", "this", "->", "documents", "[", "$", "id", "]", "=", "$", "document", ";", "$", "this", "->", "filesystem", "->", "put", "("...
Saves a document.
[ "Saves", "a", "document", "." ]
df826e4db5df954d3cace9c12762ec0309b050bf
https://github.com/oscarotero/fly-crud/blob/df826e4db5df954d3cace9c12762ec0309b050bf/src/Directory.php#L117-L123
234,552
oscarotero/fly-crud
src/Directory.php
Directory.getAllDocuments
public function getAllDocuments(): array { $documents = []; foreach ($this->filesystem->listContents('/'.$this->path) as $info) { $id = $info['filename']; if ($this->hasDocument($id)) { $documents[$id] = $this->getDocument($id); } } ...
php
public function getAllDocuments(): array { $documents = []; foreach ($this->filesystem->listContents('/'.$this->path) as $info) { $id = $info['filename']; if ($this->hasDocument($id)) { $documents[$id] = $this->getDocument($id); } } ...
[ "public", "function", "getAllDocuments", "(", ")", ":", "array", "{", "$", "documents", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "filesystem", "->", "listContents", "(", "'/'", ".", "$", "this", "->", "path", ")", "as", "$", "info", ")"...
Returns all documents.
[ "Returns", "all", "documents", "." ]
df826e4db5df954d3cace9c12762ec0309b050bf
https://github.com/oscarotero/fly-crud/blob/df826e4db5df954d3cace9c12762ec0309b050bf/src/Directory.php#L161-L174
234,553
oscarotero/fly-crud
src/Directory.php
Directory.getAllDirectories
public function getAllDirectories(): array { $directories = []; foreach ($this->filesystem->listContents('/'.$this->path) as $info) { $id = $info['filename']; if ($this->hasDirectory($id)) { $directories[$id] = $this->getDirectory($id); } ...
php
public function getAllDirectories(): array { $directories = []; foreach ($this->filesystem->listContents('/'.$this->path) as $info) { $id = $info['filename']; if ($this->hasDirectory($id)) { $directories[$id] = $this->getDirectory($id); } ...
[ "public", "function", "getAllDirectories", "(", ")", ":", "array", "{", "$", "directories", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "filesystem", "->", "listContents", "(", "'/'", ".", "$", "this", "->", "path", ")", "as", "$", "info", ...
Returns all directories.
[ "Returns", "all", "directories", "." ]
df826e4db5df954d3cace9c12762ec0309b050bf
https://github.com/oscarotero/fly-crud/blob/df826e4db5df954d3cace9c12762ec0309b050bf/src/Directory.php#L179-L192
234,554
oscarotero/fly-crud
src/Directory.php
Directory.getDocumentPath
private function getDocumentPath(string $id): string { return $this->getDirectoryPath($id).'.'.$this->format->getExtension(); }
php
private function getDocumentPath(string $id): string { return $this->getDirectoryPath($id).'.'.$this->format->getExtension(); }
[ "private", "function", "getDocumentPath", "(", "string", "$", "id", ")", ":", "string", "{", "return", "$", "this", "->", "getDirectoryPath", "(", "$", "id", ")", ".", "'.'", ".", "$", "this", "->", "format", "->", "getExtension", "(", ")", ";", "}" ]
Returns a file path.
[ "Returns", "a", "file", "path", "." ]
df826e4db5df954d3cace9c12762ec0309b050bf
https://github.com/oscarotero/fly-crud/blob/df826e4db5df954d3cace9c12762ec0309b050bf/src/Directory.php#L197-L200
234,555
damonjones/Vebra-PHP-API-Wrapper
lib/YDD/Vebra/Model/Branch.php
Branch.fromArray
public function fromArray(array $arr) { foreach ($arr as $key => $value) { $method = 'set' . $key; if (method_exists($this, $method)) { $this->$method($value); } } }
php
public function fromArray(array $arr) { foreach ($arr as $key => $value) { $method = 'set' . $key; if (method_exists($this, $method)) { $this->$method($value); } } }
[ "public", "function", "fromArray", "(", "array", "$", "arr", ")", "{", "foreach", "(", "$", "arr", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "method", "=", "'set'", ".", "$", "key", ";", "if", "(", "method_exists", "(", "$", "this", ",...
Import object properties from an associative array @param array $arr An associative array
[ "Import", "object", "properties", "from", "an", "associative", "array" ]
9de0fb5181a6e4b90700027ffaa6b2e658d279c2
https://github.com/damonjones/Vebra-PHP-API-Wrapper/blob/9de0fb5181a6e4b90700027ffaa6b2e658d279c2/lib/YDD/Vebra/Model/Branch.php#L309-L317
234,556
damonjones/Vebra-PHP-API-Wrapper
lib/YDD/Vebra/Model/Branch.php
Branch.toArray
public function toArray() { $arr = array(); foreach ($this as $key => $value) { $method = 'get' . $key; if (method_exists($this, $method)) { $arr[$key] = $this->$method(); } } return $arr; }
php
public function toArray() { $arr = array(); foreach ($this as $key => $value) { $method = 'get' . $key; if (method_exists($this, $method)) { $arr[$key] = $this->$method(); } } return $arr; }
[ "public", "function", "toArray", "(", ")", "{", "$", "arr", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "method", "=", "'get'", ".", "$", "key", ";", "if", "(", "method_exists", ...
Export the object properties to an associative array @return array An associative array
[ "Export", "the", "object", "properties", "to", "an", "associative", "array" ]
9de0fb5181a6e4b90700027ffaa6b2e658d279c2
https://github.com/damonjones/Vebra-PHP-API-Wrapper/blob/9de0fb5181a6e4b90700027ffaa6b2e658d279c2/lib/YDD/Vebra/Model/Branch.php#L324-L335
234,557
crysalead/sql-dialect
src/Statement/Update.php
Update._buildSet
protected function _buildSet() { $values = []; $states = $this->_schema ? ['schema' => $this->_schema] : []; foreach ($this->_parts['values'] as $key => $value) { $states['name'] = $key; $values[] = $this->dialect()->name($key) . ' = ' . $this->dialect()->value($valu...
php
protected function _buildSet() { $values = []; $states = $this->_schema ? ['schema' => $this->_schema] : []; foreach ($this->_parts['values'] as $key => $value) { $states['name'] = $key; $values[] = $this->dialect()->name($key) . ' = ' . $this->dialect()->value($valu...
[ "protected", "function", "_buildSet", "(", ")", "{", "$", "values", "=", "[", "]", ";", "$", "states", "=", "$", "this", "->", "_schema", "?", "[", "'schema'", "=>", "$", "this", "->", "_schema", "]", ":", "[", "]", ";", "foreach", "(", "$", "thi...
Build `SET` clause. @return string Returns the `SET` clause.
[ "Build", "SET", "clause", "." ]
867a768086fb3eb539752671a0dd54b949fe9d79
https://github.com/crysalead/sql-dialect/blob/867a768086fb3eb539752671a0dd54b949fe9d79/src/Statement/Update.php#L110-L119
234,558
opis/orm
src/Core/DataMapper.php
DataMapper.executePendingLinkage
public function executePendingLinkage() { foreach ($this->pendingLinks as $item) { /** @var ShareOneOrMany $rel */ $rel = $item['relation']; if ($item['link']) { $rel->link($this, $item['entity']); } else { $rel->unlink($this, $...
php
public function executePendingLinkage() { foreach ($this->pendingLinks as $item) { /** @var ShareOneOrMany $rel */ $rel = $item['relation']; if ($item['link']) { $rel->link($this, $item['entity']); } else { $rel->unlink($this, $...
[ "public", "function", "executePendingLinkage", "(", ")", "{", "foreach", "(", "$", "this", "->", "pendingLinks", "as", "$", "item", ")", "{", "/** @var ShareOneOrMany $rel */", "$", "rel", "=", "$", "item", "[", "'relation'", "]", ";", "if", "(", "$", "ite...
Execute pending linkage
[ "Execute", "pending", "linkage" ]
2723235be55242cd20452b8c9648d4823b7ce8b5
https://github.com/opis/orm/blob/2723235be55242cd20452b8c9648d4823b7ce8b5/src/Core/DataMapper.php#L436-L449
234,559
railken/search-query
src/Languages/BoomTree/Resolvers/ComparisonOperatorResolver.php
ComparisonOperatorResolver.resolve
public function resolve(NodeContract $node) { $children = $node->getChildren(); if (count($children) > 0) { $this->resolve($node->getChildByIndex(0)); $value = ''; $positions = []; foreach ($node->getChildren() as $child) { if ($child...
php
public function resolve(NodeContract $node) { $children = $node->getChildren(); if (count($children) > 0) { $this->resolve($node->getChildByIndex(0)); $value = ''; $positions = []; foreach ($node->getChildren() as $child) { if ($child...
[ "public", "function", "resolve", "(", "NodeContract", "$", "node", ")", "{", "$", "children", "=", "$", "node", "->", "getChildren", "(", ")", ";", "if", "(", "count", "(", "$", "children", ")", ">", "0", ")", "{", "$", "this", "->", "resolve", "("...
Resolve token eq node. @param NodeContract $node @return NodeContract|null
[ "Resolve", "token", "eq", "node", "." ]
06e1bfb3eb59347afec9ca764d6f8c3b691d6889
https://github.com/railken/search-query/blob/06e1bfb3eb59347afec9ca764d6f8c3b691d6889/src/Languages/BoomTree/Resolvers/ComparisonOperatorResolver.php#L37-L73
234,560
txj123/zilf
src/Zilf/Db/Transaction.php
Transaction.setIsolationLevel
public function setIsolationLevel($level) { if (!$this->getIsActive()) { throw new Exception('Failed to set isolation level: transaction was inactive.'); } Log::debug('Setting transaction isolation level to ' . $level . __METHOD__); $this->db->getSchema()->setTransactionI...
php
public function setIsolationLevel($level) { if (!$this->getIsActive()) { throw new Exception('Failed to set isolation level: transaction was inactive.'); } Log::debug('Setting transaction isolation level to ' . $level . __METHOD__); $this->db->getSchema()->setTransactionI...
[ "public", "function", "setIsolationLevel", "(", "$", "level", ")", "{", "if", "(", "!", "$", "this", "->", "getIsActive", "(", ")", ")", "{", "throw", "new", "Exception", "(", "'Failed to set isolation level: transaction was inactive.'", ")", ";", "}", "Log", ...
Sets the transaction isolation level for this transaction. This method can be used to set the isolation level while the transaction is already active. However this is not supported by all DBMS so you might rather specify the isolation level directly when calling [[begin()]]. @param string $level The transaction isol...
[ "Sets", "the", "transaction", "isolation", "level", "for", "this", "transaction", "." ]
8fc979ae338e850e6f40bfb97d4d57869f9e4480
https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/Db/Transaction.php#L231-L238
234,561
oxygen-cms/core
src/Html/Toolbar/FormToolbarItem.php
FormToolbarItem.render
public function render(array $arguments = [], $renderer = null) { $this->runDynamicCallbacks($arguments); return $this->baseRender($arguments, $renderer); }
php
public function render(array $arguments = [], $renderer = null) { $this->runDynamicCallbacks($arguments); return $this->baseRender($arguments, $renderer); }
[ "public", "function", "render", "(", "array", "$", "arguments", "=", "[", "]", ",", "$", "renderer", "=", "null", ")", "{", "$", "this", "->", "runDynamicCallbacks", "(", "$", "arguments", ")", ";", "return", "$", "this", "->", "baseRender", "(", "$", ...
Renders the object. Before rendering all 'dynamic callbacks' will be excecuted. @param array $arguments @param RendererInterface|callable $renderer @throws Exception @return string the rendered object
[ "Renders", "the", "object", ".", "Before", "rendering", "all", "dynamic", "callbacks", "will", "be", "excecuted", "." ]
8f8349c669771d9a7a719a7b120821e06cb5a20b
https://github.com/oxygen-cms/core/blob/8f8349c669771d9a7a719a7b120821e06cb5a20b/src/Html/Toolbar/FormToolbarItem.php#L52-L56
234,562
oxygen-cms/core
src/Html/Header/Header.php
Header.fromBlueprint
public static function fromBlueprint(Blueprint $blueprint, $title, array $arguments = [], $type = self::TYPE_MAIN, $fillFromToolbar = 'section') { if($title instanceof FieldSet) { $title = $arguments['model']->getAttribute($title->getTitleFieldName()); } else { if(!is_string($tit...
php
public static function fromBlueprint(Blueprint $blueprint, $title, array $arguments = [], $type = self::TYPE_MAIN, $fillFromToolbar = 'section') { if($title instanceof FieldSet) { $title = $arguments['model']->getAttribute($title->getTitleFieldName()); } else { if(!is_string($tit...
[ "public", "static", "function", "fromBlueprint", "(", "Blueprint", "$", "blueprint", ",", "$", "title", ",", "array", "$", "arguments", "=", "[", "]", ",", "$", "type", "=", "self", "::", "TYPE_MAIN", ",", "$", "fillFromToolbar", "=", "'section'", ")", "...
Constructs a Header from a Blueprint. @param Blueprint $blueprint @param FieldSet|string $title @param array $arguments @param integer $type @param string $fillFromToolbar @return Header
[ "Constructs", "a", "Header", "from", "a", "Blueprint", "." ]
8f8349c669771d9a7a719a7b120821e06cb5a20b
https://github.com/oxygen-cms/core/blob/8f8349c669771d9a7a719a7b120821e06cb5a20b/src/Html/Header/Header.php#L303-L325
234,563
flashwave/whois-php
src/Whois/Client.php
Client.lookupIP
private function lookupIP($address) { // Create the responses storage array $responses = []; // Query every server in the IP list foreach ($this->servers->ip as $server) { // Check if we haven't queried this server yet if (array_key_exists($server, $responses...
php
private function lookupIP($address) { // Create the responses storage array $responses = []; // Query every server in the IP list foreach ($this->servers->ip as $server) { // Check if we haven't queried this server yet if (array_key_exists($server, $responses...
[ "private", "function", "lookupIP", "(", "$", "address", ")", "{", "// Create the responses storage array", "$", "responses", "=", "[", "]", ";", "// Query every server in the IP list", "foreach", "(", "$", "this", "->", "servers", "->", "ip", "as", "$", "server", ...
Whois an IP address. @param string $address The IP address to query. @return Result The whois results.
[ "Whois", "an", "IP", "address", "." ]
0eae1b4c863f8cfaee88bf3abdf2dd6d3d490bf8
https://github.com/flashwave/whois-php/blob/0eae1b4c863f8cfaee88bf3abdf2dd6d3d490bf8/src/Whois/Client.php#L145-L178
234,564
flashwave/whois-php
src/Whois/Client.php
Client.query
private function query($target, $server, $port = 43, $timeout = 5) { // Create the socket $sock = @fsockopen($server, $port, $errno, $errstr, $timeout); // Check for errors if (!$sock) { // Throw an exception with the error string throw new WhoisException($er...
php
private function query($target, $server, $port = 43, $timeout = 5) { // Create the socket $sock = @fsockopen($server, $port, $errno, $errstr, $timeout); // Check for errors if (!$sock) { // Throw an exception with the error string throw new WhoisException($er...
[ "private", "function", "query", "(", "$", "target", ",", "$", "server", ",", "$", "port", "=", "43", ",", "$", "timeout", "=", "5", ")", "{", "// Create the socket", "$", "sock", "=", "@", "fsockopen", "(", "$", "server", ",", "$", "port", ",", "$"...
Query the whois server. @param string $target The target IP/domain. @param string $server The server to be queried. @param int $port The port for the whois server. @param int $timeout The timeout. @throws WhoisException if the socket failed to open. @return string The response from the whois server.
[ "Query", "the", "whois", "server", "." ]
0eae1b4c863f8cfaee88bf3abdf2dd6d3d490bf8
https://github.com/flashwave/whois-php/blob/0eae1b4c863f8cfaee88bf3abdf2dd6d3d490bf8/src/Whois/Client.php#L206-L233
234,565
oxygen-cms/core
src/Html/Toolbar/ActionToolbarItem.php
ActionToolbarItem.shouldRenderBasic
public function shouldRenderBasic(array $arguments) { if(isset($arguments['evenOnSamePage']) && $arguments['evenOnSamePage'] === true) { return $this->hasPermissions(); } else { return $this->hasPermissions() && !$this->linksToCurrentPage($arguments); } }
php
public function shouldRenderBasic(array $arguments) { if(isset($arguments['evenOnSamePage']) && $arguments['evenOnSamePage'] === true) { return $this->hasPermissions(); } else { return $this->hasPermissions() && !$this->linksToCurrentPage($arguments); } }
[ "public", "function", "shouldRenderBasic", "(", "array", "$", "arguments", ")", "{", "if", "(", "isset", "(", "$", "arguments", "[", "'evenOnSamePage'", "]", ")", "&&", "$", "arguments", "[", "'evenOnSamePage'", "]", "===", "true", ")", "{", "return", "$",...
Provides simple shouldRender check, that checks. @return boolean
[ "Provides", "simple", "shouldRender", "check", "that", "checks", "." ]
8f8349c669771d9a7a719a7b120821e06cb5a20b
https://github.com/oxygen-cms/core/blob/8f8349c669771d9a7a719a7b120821e06cb5a20b/src/Html/Toolbar/ActionToolbarItem.php#L107-L113
234,566
oxygen-cms/core
src/Html/Toolbar/ActionToolbarItem.php
ActionToolbarItem.hasPermissions
public function hasPermissions() { return $this->action->usesPermissions() ? Auth::user()->hasPermissions($this->action->getPermissions()) : true; }
php
public function hasPermissions() { return $this->action->usesPermissions() ? Auth::user()->hasPermissions($this->action->getPermissions()) : true; }
[ "public", "function", "hasPermissions", "(", ")", "{", "return", "$", "this", "->", "action", "->", "usesPermissions", "(", ")", "?", "Auth", "::", "user", "(", ")", "->", "hasPermissions", "(", "$", "this", "->", "action", "->", "getPermissions", "(", "...
Determines if the user has the required permissions for the toolbar item. @return boolean
[ "Determines", "if", "the", "user", "has", "the", "required", "permissions", "for", "the", "toolbar", "item", "." ]
8f8349c669771d9a7a719a7b120821e06cb5a20b
https://github.com/oxygen-cms/core/blob/8f8349c669771d9a7a719a7b120821e06cb5a20b/src/Html/Toolbar/ActionToolbarItem.php#L120-L124
234,567
oxygen-cms/core
src/Html/Toolbar/ActionToolbarItem.php
ActionToolbarItem.linksToCurrentPage
public function linksToCurrentPage(array $arguments) { return URL::current() == URL::route($this->action->getName(), $this->action->getRouteParameters($arguments)) && Request::method() == $this->action->getMethod(); }
php
public function linksToCurrentPage(array $arguments) { return URL::current() == URL::route($this->action->getName(), $this->action->getRouteParameters($arguments)) && Request::method() == $this->action->getMethod(); }
[ "public", "function", "linksToCurrentPage", "(", "array", "$", "arguments", ")", "{", "return", "URL", "::", "current", "(", ")", "==", "URL", "::", "route", "(", "$", "this", "->", "action", "->", "getName", "(", ")", ",", "$", "this", "->", "action",...
Determines if the ActionToolbarItem will link to the current page. @param array $arguments @return boolean
[ "Determines", "if", "the", "ActionToolbarItem", "will", "link", "to", "the", "current", "page", "." ]
8f8349c669771d9a7a719a7b120821e06cb5a20b
https://github.com/oxygen-cms/core/blob/8f8349c669771d9a7a719a7b120821e06cb5a20b/src/Html/Toolbar/ActionToolbarItem.php#L132-L136
234,568
crysalead/sql-dialect
src/Statement/PostgreSql/Select.php
Select.lock
public function lock($mode = 'update') { switch (strtolower($mode)) { case 'update': $lock = 'FOR UPDATE'; break; case 'share': $lock = 'FOR SHARE'; break; case 'no key update': $lock = 'FOR N...
php
public function lock($mode = 'update') { switch (strtolower($mode)) { case 'update': $lock = 'FOR UPDATE'; break; case 'share': $lock = 'FOR SHARE'; break; case 'no key update': $lock = 'FOR N...
[ "public", "function", "lock", "(", "$", "mode", "=", "'update'", ")", "{", "switch", "(", "strtolower", "(", "$", "mode", ")", ")", "{", "case", "'update'", ":", "$", "lock", "=", "'FOR UPDATE'", ";", "break", ";", "case", "'share'", ":", "$", "lock"...
Set the lock mode. @param boolean $mode The lock mode. @return object Returns `$this`.
[ "Set", "the", "lock", "mode", "." ]
867a768086fb3eb539752671a0dd54b949fe9d79
https://github.com/crysalead/sql-dialect/blob/867a768086fb3eb539752671a0dd54b949fe9d79/src/Statement/PostgreSql/Select.php#L17-L41
234,569
awurth/SlimHelpers
Controller/SecurityTrait.php
SecurityTrait.accessDeniedException
protected function accessDeniedException(Request $request, Response $response, $message = 'Access denied.') { return new AccessDeniedException($request, $response, $message); }
php
protected function accessDeniedException(Request $request, Response $response, $message = 'Access denied.') { return new AccessDeniedException($request, $response, $message); }
[ "protected", "function", "accessDeniedException", "(", "Request", "$", "request", ",", "Response", "$", "response", ",", "$", "message", "=", "'Access denied.'", ")", "{", "return", "new", "AccessDeniedException", "(", "$", "request", ",", "$", "response", ",", ...
Creates a new AccessDeniedException. @param Request $request @param Response $response @param string $message @return AccessDeniedException
[ "Creates", "a", "new", "AccessDeniedException", "." ]
abaa0e16e285148f4e4c6b2fd0bb176bce6dac36
https://github.com/awurth/SlimHelpers/blob/abaa0e16e285148f4e4c6b2fd0bb176bce6dac36/Controller/SecurityTrait.php#L21-L24
234,570
awurth/SlimHelpers
Controller/SecurityTrait.php
SecurityTrait.unauthorizedException
protected function unauthorizedException(Request $request, Response $response, $message = 'Unauthorized.') { return new UnauthorizedException($request, $response, $message); }
php
protected function unauthorizedException(Request $request, Response $response, $message = 'Unauthorized.') { return new UnauthorizedException($request, $response, $message); }
[ "protected", "function", "unauthorizedException", "(", "Request", "$", "request", ",", "Response", "$", "response", ",", "$", "message", "=", "'Unauthorized.'", ")", "{", "return", "new", "UnauthorizedException", "(", "$", "request", ",", "$", "response", ",", ...
Creates a new UnauthorizedException. @param Request $request @param Response $response @param string $message @return UnauthorizedException
[ "Creates", "a", "new", "UnauthorizedException", "." ]
abaa0e16e285148f4e4c6b2fd0bb176bce6dac36
https://github.com/awurth/SlimHelpers/blob/abaa0e16e285148f4e4c6b2fd0bb176bce6dac36/Controller/SecurityTrait.php#L35-L38
234,571
omnilight/yii2-phonenumbers
PhoneNumber.php
PhoneNumber.format
public static function format($phone, $format = PhoneNumberFormat::E164, $region = 'RU') { return self::phoneUtil()->format(self::phoneUtil()->parse($phone, $region), $format); }
php
public static function format($phone, $format = PhoneNumberFormat::E164, $region = 'RU') { return self::phoneUtil()->format(self::phoneUtil()->parse($phone, $region), $format); }
[ "public", "static", "function", "format", "(", "$", "phone", ",", "$", "format", "=", "PhoneNumberFormat", "::", "E164", ",", "$", "region", "=", "'RU'", ")", "{", "return", "self", "::", "phoneUtil", "(", ")", "->", "format", "(", "self", "::", "phone...
Formats number to the desired format @param $phone @param int $format @param string $region @return string
[ "Formats", "number", "to", "the", "desired", "format" ]
01444ef39803b05321f75379198d88af9307f72f
https://github.com/omnilight/yii2-phonenumbers/blob/01444ef39803b05321f75379198d88af9307f72f/PhoneNumber.php#L22-L25
234,572
txj123/zilf
src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Http/Client.php
Zend_Http_Client.getUri
public function getUri($as_string = false) { if ($as_string && $this->uri instanceof Zend_Uri_Http) { return $this->uri->__toString(); } else { return $this->uri; } }
php
public function getUri($as_string = false) { if ($as_string && $this->uri instanceof Zend_Uri_Http) { return $this->uri->__toString(); } else { return $this->uri; } }
[ "public", "function", "getUri", "(", "$", "as_string", "=", "false", ")", "{", "if", "(", "$", "as_string", "&&", "$", "this", "->", "uri", "instanceof", "Zend_Uri_Http", ")", "{", "return", "$", "this", "->", "uri", "->", "__toString", "(", ")", ";", ...
Get the URI for the next request @param boolean $as_string If true, will return the URI as a string @return Zend_Uri_Http|string
[ "Get", "the", "URI", "for", "the", "next", "request" ]
8fc979ae338e850e6f40bfb97d4d57869f9e4480
https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Http/Client.php#L280-L287
234,573
txj123/zilf
src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Http/Client.php
Zend_Http_Client.setMethod
public function setMethod($method = self::GET) { $regex = '/^[^\x00-\x1f\x7f-\xff\(\)<>@,;:\\\\"\/\[\]\?={}\s]+$/'; if (! preg_match($regex, $method)) { /** * @see Zend_Http_Client_Exception */ include_once 'Zend/Http/Client/Exception.php'; throw new Zend_Http_C...
php
public function setMethod($method = self::GET) { $regex = '/^[^\x00-\x1f\x7f-\xff\(\)<>@,;:\\\\"\/\[\]\?={}\s]+$/'; if (! preg_match($regex, $method)) { /** * @see Zend_Http_Client_Exception */ include_once 'Zend/Http/Client/Exception.php'; throw new Zend_Http_C...
[ "public", "function", "setMethod", "(", "$", "method", "=", "self", "::", "GET", ")", "{", "$", "regex", "=", "'/^[^\\x00-\\x1f\\x7f-\\xff\\(\\)<>@,;:\\\\\\\\\"\\/\\[\\]\\?={}\\s]+$/'", ";", "if", "(", "!", "preg_match", "(", "$", "regex", ",", "$", "method", ")...
Set the next request's method Validated the passed method and sets it. If we have files set for POST requests, and the new method is not POST, the files are silently dropped. @param string $method @return Zend_Http_Client @throws Zend_Http_Client_Exception
[ "Set", "the", "next", "request", "s", "method" ]
8fc979ae338e850e6f40bfb97d4d57869f9e4480
https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Http/Client.php#L324-L342
234,574
txj123/zilf
src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Http/Client.php
Zend_Http_Client.setParameterGet
public function setParameterGet($name, $value = null) { if (is_array($name)) { foreach ($name as $k => $v) { $this->_setParameter('GET', $k, $v); } } else { $this->_setParameter('GET', $name, $value); } return $this; }
php
public function setParameterGet($name, $value = null) { if (is_array($name)) { foreach ($name as $k => $v) { $this->_setParameter('GET', $k, $v); } } else { $this->_setParameter('GET', $name, $value); } return $this; }
[ "public", "function", "setParameterGet", "(", "$", "name", ",", "$", "value", "=", "null", ")", "{", "if", "(", "is_array", "(", "$", "name", ")", ")", "{", "foreach", "(", "$", "name", "as", "$", "k", "=>", "$", "v", ")", "{", "$", "this", "->...
Set a GET parameter for the request. Wrapper around _setParameter @param string|array $name @param string $value @return Zend_Http_Client
[ "Set", "a", "GET", "parameter", "for", "the", "request", ".", "Wrapper", "around", "_setParameter" ]
8fc979ae338e850e6f40bfb97d4d57869f9e4480
https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Http/Client.php#L433-L444
234,575
txj123/zilf
src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Http/Client.php
Zend_Http_Client._detectFileMimeType
protected function _detectFileMimeType($file) { $type = null; // First try with fileinfo functions if (function_exists('finfo_open')) { if (self::$_fileInfoDb === null) { self::$_fileInfoDb = @finfo_open(FILEINFO_MIME); } ...
php
protected function _detectFileMimeType($file) { $type = null; // First try with fileinfo functions if (function_exists('finfo_open')) { if (self::$_fileInfoDb === null) { self::$_fileInfoDb = @finfo_open(FILEINFO_MIME); } ...
[ "protected", "function", "_detectFileMimeType", "(", "$", "file", ")", "{", "$", "type", "=", "null", ";", "// First try with fileinfo functions", "if", "(", "function_exists", "(", "'finfo_open'", ")", ")", "{", "if", "(", "self", "::", "$", "_fileInfoDb", "=...
Attempt to detect the MIME type of a file using available extensions This method will try to detect the MIME type of a file. If the fileinfo extension is available, it will be used. If not, the mime_magic extension which is deprected but is still available in many PHP setups will be tried. If neither extension is ava...
[ "Attempt", "to", "detect", "the", "MIME", "type", "of", "a", "file", "using", "available", "extensions" ]
8fc979ae338e850e6f40bfb97d4d57869f9e4480
https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/DataCrawler/PhpQuery/phpQuery/Zend/Http/Client.php#L1158-L1182
234,576
Syonix/log-viewer-lib
lib/LogFile.php
LogFile.getLines
public function getLines($limit = null, $offset = 0, $filter = null) { $lines = clone $this->lines; if ($filter !== null) { $logger = isset($filter['logger']) ? $filter['logger'] : null; $minLevel = isset($filter['level']) ? $filter['level'] : 0; $text = (isset($f...
php
public function getLines($limit = null, $offset = 0, $filter = null) { $lines = clone $this->lines; if ($filter !== null) { $logger = isset($filter['logger']) ? $filter['logger'] : null; $minLevel = isset($filter['level']) ? $filter['level'] : 0; $text = (isset($f...
[ "public", "function", "getLines", "(", "$", "limit", "=", "null", ",", "$", "offset", "=", "0", ",", "$", "filter", "=", "null", ")", "{", "$", "lines", "=", "clone", "$", "this", "->", "lines", ";", "if", "(", "$", "filter", "!==", "null", ")", ...
Returns log lines, either all or paginated and or filtered. @param int|null $limit Defines how many lines are returned. @param int $offset Defines the offset for returning lines. Offset 0 starts at the first line. @param array|null $filter Filter the log lines before returning and applying pagination. Can co...
[ "Returns", "log", "lines", "either", "all", "or", "paginated", "and", "or", "filtered", "." ]
5212208bf2f0174eb5d0408d2d3028db4d478a74
https://github.com/Syonix/log-viewer-lib/blob/5212208bf2f0174eb5d0408d2d3028db4d478a74/lib/LogFile.php#L95-L119
234,577
Syonix/log-viewer-lib
lib/LogFile.php
LogFile.logLineHasLogger
private static function logLineHasLogger($logger, $line) { if ($logger === null) { return true; } return array_key_exists('logger', $line) && $line['logger'] == $logger; }
php
private static function logLineHasLogger($logger, $line) { if ($logger === null) { return true; } return array_key_exists('logger', $line) && $line['logger'] == $logger; }
[ "private", "static", "function", "logLineHasLogger", "(", "$", "logger", ",", "$", "line", ")", "{", "if", "(", "$", "logger", "===", "null", ")", "{", "return", "true", ";", "}", "return", "array_key_exists", "(", "'logger'", ",", "$", "line", ")", "&...
Internal filtering method for determining whether a log line belongs to a specific logger. @param string $logger @param array $line @return bool
[ "Internal", "filtering", "method", "for", "determining", "whether", "a", "log", "line", "belongs", "to", "a", "specific", "logger", "." ]
5212208bf2f0174eb5d0408d2d3028db4d478a74
https://github.com/Syonix/log-viewer-lib/blob/5212208bf2f0174eb5d0408d2d3028db4d478a74/lib/LogFile.php#L129-L136
234,578
Syonix/log-viewer-lib
lib/LogFile.php
LogFile.logLineHasMinLevel
private static function logLineHasMinLevel($minLevel, $line) { if ($minLevel == 0) { return true; } return array_key_exists('level', $line) && static::getLevelNumber($line['level']) >= $minLevel; }
php
private static function logLineHasMinLevel($minLevel, $line) { if ($minLevel == 0) { return true; } return array_key_exists('level', $line) && static::getLevelNumber($line['level']) >= $minLevel; }
[ "private", "static", "function", "logLineHasMinLevel", "(", "$", "minLevel", ",", "$", "line", ")", "{", "if", "(", "$", "minLevel", "==", "0", ")", "{", "return", "true", ";", "}", "return", "array_key_exists", "(", "'level'", ",", "$", "line", ")", "...
Internal filtering method for determining whether a log line has a specific minimal log level. @param int $minLevel @param array $line @return bool
[ "Internal", "filtering", "method", "for", "determining", "whether", "a", "log", "line", "has", "a", "specific", "minimal", "log", "level", "." ]
5212208bf2f0174eb5d0408d2d3028db4d478a74
https://github.com/Syonix/log-viewer-lib/blob/5212208bf2f0174eb5d0408d2d3028db4d478a74/lib/LogFile.php#L146-L153
234,579
Syonix/log-viewer-lib
lib/LogFile.php
LogFile.logLineHasText
private static function logLineHasText($keyword, $line, $searchMeta = true) { if ($keyword === null) { return true; } if (array_key_exists('message', $line) && strpos(strtolower($line['message']), strtolower($keyword)) !== false) { return true; } if (a...
php
private static function logLineHasText($keyword, $line, $searchMeta = true) { if ($keyword === null) { return true; } if (array_key_exists('message', $line) && strpos(strtolower($line['message']), strtolower($keyword)) !== false) { return true; } if (a...
[ "private", "static", "function", "logLineHasText", "(", "$", "keyword", ",", "$", "line", ",", "$", "searchMeta", "=", "true", ")", "{", "if", "(", "$", "keyword", "===", "null", ")", "{", "return", "true", ";", "}", "if", "(", "array_key_exists", "(",...
Internal filtering method for determining whether a log line contains a specific string. @param string $keyword @param array $line @param bool $searchMeta @return bool
[ "Internal", "filtering", "method", "for", "determining", "whether", "a", "log", "line", "contains", "a", "specific", "string", "." ]
5212208bf2f0174eb5d0408d2d3028db4d478a74
https://github.com/Syonix/log-viewer-lib/blob/5212208bf2f0174eb5d0408d2d3028db4d478a74/lib/LogFile.php#L164-L201
234,580
Syonix/log-viewer-lib
lib/LogFile.php
LogFile.countLines
public function countLines($filter = null) { if ($filter !== null) { return count($this->getLines(null, 0, $filter)); } return $this->lines->count(); }
php
public function countLines($filter = null) { if ($filter !== null) { return count($this->getLines(null, 0, $filter)); } return $this->lines->count(); }
[ "public", "function", "countLines", "(", "$", "filter", "=", "null", ")", "{", "if", "(", "$", "filter", "!==", "null", ")", "{", "return", "count", "(", "$", "this", "->", "getLines", "(", "null", ",", "0", ",", "$", "filter", ")", ")", ";", "}"...
Returns the number of lines in the log file. @param array|null $filter @return int
[ "Returns", "the", "number", "of", "lines", "in", "the", "log", "file", "." ]
5212208bf2f0174eb5d0408d2d3028db4d478a74
https://github.com/Syonix/log-viewer-lib/blob/5212208bf2f0174eb5d0408d2d3028db4d478a74/lib/LogFile.php#L218-L225
234,581
Syonix/log-viewer-lib
lib/LogFile.php
LogFile.getLevelNumber
public static function getLevelNumber($level) { $levels = Logger::getLevels(); if (!isset($levels[$level])) { throw new InvalidArgumentException('Level "'.$level.'" is not defined, use one of: '.implode(', ', $levels)); } return $levels[$level]; }
php
public static function getLevelNumber($level) { $levels = Logger::getLevels(); if (!isset($levels[$level])) { throw new InvalidArgumentException('Level "'.$level.'" is not defined, use one of: '.implode(', ', $levels)); } return $levels[$level]; }
[ "public", "static", "function", "getLevelNumber", "(", "$", "level", ")", "{", "$", "levels", "=", "Logger", "::", "getLevels", "(", ")", ";", "if", "(", "!", "isset", "(", "$", "levels", "[", "$", "level", "]", ")", ")", "{", "throw", "new", "Inva...
Returns the associated number for a log level string. @param string $level @return int
[ "Returns", "the", "associated", "number", "for", "a", "log", "level", "string", "." ]
5212208bf2f0174eb5d0408d2d3028db4d478a74
https://github.com/Syonix/log-viewer-lib/blob/5212208bf2f0174eb5d0408d2d3028db4d478a74/lib/LogFile.php#L264-L273
234,582
damonjones/Vebra-PHP-API-Wrapper
lib/YDD/Vebra/TokenStorage/File.php
File.load
protected function load() { if (false !== ($token = @file_get_contents($this->getFilename()))) { $this->token = trim($token); } else { throw new \Exception(sprintf('Token could not be loaded from "%s"', $this->getFilename())); } }
php
protected function load() { if (false !== ($token = @file_get_contents($this->getFilename()))) { $this->token = trim($token); } else { throw new \Exception(sprintf('Token could not be loaded from "%s"', $this->getFilename())); } }
[ "protected", "function", "load", "(", ")", "{", "if", "(", "false", "!==", "(", "$", "token", "=", "@", "file_get_contents", "(", "$", "this", "->", "getFilename", "(", ")", ")", ")", ")", "{", "$", "this", "->", "token", "=", "trim", "(", "$", "...
Load the token from a file
[ "Load", "the", "token", "from", "a", "file" ]
9de0fb5181a6e4b90700027ffaa6b2e658d279c2
https://github.com/damonjones/Vebra-PHP-API-Wrapper/blob/9de0fb5181a6e4b90700027ffaa6b2e658d279c2/lib/YDD/Vebra/TokenStorage/File.php#L65-L72
234,583
damonjones/Vebra-PHP-API-Wrapper
lib/YDD/Vebra/TokenStorage/File.php
File.save
protected function save() { if (false === ($result = @file_put_contents($this->getFilename(), $this->token))) { throw new \Exception(sprintf('Token could not be saved to "%s"', $this->getFilename())); } }
php
protected function save() { if (false === ($result = @file_put_contents($this->getFilename(), $this->token))) { throw new \Exception(sprintf('Token could not be saved to "%s"', $this->getFilename())); } }
[ "protected", "function", "save", "(", ")", "{", "if", "(", "false", "===", "(", "$", "result", "=", "@", "file_put_contents", "(", "$", "this", "->", "getFilename", "(", ")", ",", "$", "this", "->", "token", ")", ")", ")", "{", "throw", "new", "\\"...
Save the token to a file
[ "Save", "the", "token", "to", "a", "file" ]
9de0fb5181a6e4b90700027ffaa6b2e658d279c2
https://github.com/damonjones/Vebra-PHP-API-Wrapper/blob/9de0fb5181a6e4b90700027ffaa6b2e658d279c2/lib/YDD/Vebra/TokenStorage/File.php#L77-L82
234,584
BusinessMastery/omnipay-mobilpay
src/BusinessMastery/Mobilpay/Message/PurchaseRequest.php
PurchaseRequest.getData
public function getData() { $this->validate('amount', 'currency', 'orderId', 'confirmUrl', 'returnUrl', 'details'); $envKey = $envData = null; $publicKey = $this->getParameter('publicKey'); if (! $publicKey) { throw new MissingKeyException("Missing public key path param...
php
public function getData() { $this->validate('amount', 'currency', 'orderId', 'confirmUrl', 'returnUrl', 'details'); $envKey = $envData = null; $publicKey = $this->getParameter('publicKey'); if (! $publicKey) { throw new MissingKeyException("Missing public key path param...
[ "public", "function", "getData", "(", ")", "{", "$", "this", "->", "validate", "(", "'amount'", ",", "'currency'", ",", "'orderId'", ",", "'confirmUrl'", ",", "'returnUrl'", ",", "'details'", ")", ";", "$", "envKey", "=", "$", "envData", "=", "null", ";"...
Build encrypted request data @return array @throws MissingKeyException @throws \Exception @throws \Omnipay\Common\Exception\InvalidRequestException
[ "Build", "encrypted", "request", "data" ]
e9013933e8d12bd69c7def4c88b293f9561ab6e1
https://github.com/BusinessMastery/omnipay-mobilpay/blob/e9013933e8d12bd69c7def4c88b293f9561ab6e1/src/BusinessMastery/Mobilpay/Message/PurchaseRequest.php#L224-L265
234,585
krafthaus/bauhaus
src/KraftHaus/Bauhaus/Builder/FormBuilder.php
FormBuilder.create
public function create($input) { $mapper = $this->getMapper(); $admin = $mapper->getAdmin(); $model = $this->getModel(); $primaryKey = (new $model)->getKeyName(); $this->setInput($input); // Field pre update foreach ($mapper->getFields() as $field) { $field->preUpdate(); $input = $this->ge...
php
public function create($input) { $mapper = $this->getMapper(); $admin = $mapper->getAdmin(); $model = $this->getModel(); $primaryKey = (new $model)->getKeyName(); $this->setInput($input); // Field pre update foreach ($mapper->getFields() as $field) { $field->preUpdate(); $input = $this->ge...
[ "public", "function", "create", "(", "$", "input", ")", "{", "$", "mapper", "=", "$", "this", "->", "getMapper", "(", ")", ";", "$", "admin", "=", "$", "mapper", "->", "getAdmin", "(", ")", ";", "$", "model", "=", "$", "this", "->", "getModel", "...
Create a new model from input. @param Input $input @access public @return FormBuilder
[ "Create", "a", "new", "model", "from", "input", "." ]
02b6c5f4f7e5b5748d5300ab037feaff2a84ca80
https://github.com/krafthaus/bauhaus/blob/02b6c5f4f7e5b5748d5300ab037feaff2a84ca80/src/KraftHaus/Bauhaus/Builder/FormBuilder.php#L203-L268
234,586
krafthaus/bauhaus
src/KraftHaus/Bauhaus/Builder/FormBuilder.php
FormBuilder.update
public function update($input) { $mapper = $this->getMapper(); $admin = $mapper->getAdmin(); $model = $this->getModel(); $this->setInput($input); // Field pre update foreach ($this->getMapper()->getFields() as $field) { $field->preUpdate(); // Is this a multiple field? if ($field->isMultiple()...
php
public function update($input) { $mapper = $this->getMapper(); $admin = $mapper->getAdmin(); $model = $this->getModel(); $this->setInput($input); // Field pre update foreach ($this->getMapper()->getFields() as $field) { $field->preUpdate(); // Is this a multiple field? if ($field->isMultiple()...
[ "public", "function", "update", "(", "$", "input", ")", "{", "$", "mapper", "=", "$", "this", "->", "getMapper", "(", ")", ";", "$", "admin", "=", "$", "mapper", "->", "getAdmin", "(", ")", ";", "$", "model", "=", "$", "this", "->", "getModel", "...
Update a model from input. @param Input $input @access public @return FormBuilder
[ "Update", "a", "model", "from", "input", "." ]
02b6c5f4f7e5b5748d5300ab037feaff2a84ca80
https://github.com/krafthaus/bauhaus/blob/02b6c5f4f7e5b5748d5300ab037feaff2a84ca80/src/KraftHaus/Bauhaus/Builder/FormBuilder.php#L278-L338
234,587
krafthaus/bauhaus
src/KraftHaus/Bauhaus/Builder/FormBuilder.php
FormBuilder.destroy
public function destroy() { $mapper = $this->getMapper(); $admin = $mapper->getAdmin(); $model = $this->getModel(); $model = $model::find($this->getIdentifier()); // Model before delete hook if (method_exists($admin, 'beforeDelete')) { $admin->beforeDelete($model); } // Model delete hook if (m...
php
public function destroy() { $mapper = $this->getMapper(); $admin = $mapper->getAdmin(); $model = $this->getModel(); $model = $model::find($this->getIdentifier()); // Model before delete hook if (method_exists($admin, 'beforeDelete')) { $admin->beforeDelete($model); } // Model delete hook if (m...
[ "public", "function", "destroy", "(", ")", "{", "$", "mapper", "=", "$", "this", "->", "getMapper", "(", ")", ";", "$", "admin", "=", "$", "mapper", "->", "getAdmin", "(", ")", ";", "$", "model", "=", "$", "this", "->", "getModel", "(", ")", ";",...
Destroy a specific item. @access public @return FormBuilder
[ "Destroy", "a", "specific", "item", "." ]
02b6c5f4f7e5b5748d5300ab037feaff2a84ca80
https://github.com/krafthaus/bauhaus/blob/02b6c5f4f7e5b5748d5300ab037feaff2a84ca80/src/KraftHaus/Bauhaus/Builder/FormBuilder.php#L346-L376
234,588
txj123/zilf
src/Zilf/Queue/DatabaseQueue.php
DatabaseQueue.marshalJob
protected function marshalJob($queue, $job) { $job = $this->markJobAsReserved($job); return new DatabaseJob( $this, $job, $this->connectionName, $queue ); }
php
protected function marshalJob($queue, $job) { $job = $this->markJobAsReserved($job); return new DatabaseJob( $this, $job, $this->connectionName, $queue ); }
[ "protected", "function", "marshalJob", "(", "$", "queue", ",", "$", "job", ")", "{", "$", "job", "=", "$", "this", "->", "markJobAsReserved", "(", "$", "job", ")", ";", "return", "new", "DatabaseJob", "(", "$", "this", ",", "$", "job", ",", "$", "t...
Marshal the reserved job into a DatabaseJob instance. @param string $queue @param \Illuminate\Queue\Jobs\DatabaseJobRecord $job @return \Illuminate\Queue\Jobs\DatabaseJob
[ "Marshal", "the", "reserved", "job", "into", "a", "DatabaseJob", "instance", "." ]
8fc979ae338e850e6f40bfb97d4d57869f9e4480
https://github.com/txj123/zilf/blob/8fc979ae338e850e6f40bfb97d4d57869f9e4480/src/Zilf/Queue/DatabaseQueue.php#L271-L278
234,589
quai10/quai10-template
lib/ContactForm.php
ContactForm.getClass
private static function getClass(FormTag $tag, $validation_error) { $class = wpcf7_form_controls_class($tag->getType(), 'wpcf7-text'); if (in_array($tag->getBaseType(), ['email', 'url', 'tel'])) { $class .= ' wpcf7-validates-as-'.$tag->getBaseType(); } if ($validation_e...
php
private static function getClass(FormTag $tag, $validation_error) { $class = wpcf7_form_controls_class($tag->getType(), 'wpcf7-text'); if (in_array($tag->getBaseType(), ['email', 'url', 'tel'])) { $class .= ' wpcf7-validates-as-'.$tag->getBaseType(); } if ($validation_e...
[ "private", "static", "function", "getClass", "(", "FormTag", "$", "tag", ",", "$", "validation_error", ")", "{", "$", "class", "=", "wpcf7_form_controls_class", "(", "$", "tag", "->", "getType", "(", ")", ",", "'wpcf7-text'", ")", ";", "if", "(", "in_array...
Get input class. @param FormTag $tag Input tag @param string $validation_error Validation error @return string Class
[ "Get", "input", "class", "." ]
3e98b7de031f5507831946200081b6cb35b468b7
https://github.com/quai10/quai10-template/blob/3e98b7de031f5507831946200081b6cb35b468b7/lib/ContactForm.php#L21-L34
234,590
quai10/quai10-template
lib/ContactForm.php
ContactForm.getAtts
private static function getAtts(FormTag $tag, $validation_error, $class) { $atts = []; $atts['size'] = $tag->get_size_option('40'); $atts['maxlength'] = $tag->get_maxlength_option(); $atts['minlength'] = $tag->get_minlength_option(); if ($atts['maxlength'] && $atts['minleng...
php
private static function getAtts(FormTag $tag, $validation_error, $class) { $atts = []; $atts['size'] = $tag->get_size_option('40'); $atts['maxlength'] = $tag->get_maxlength_option(); $atts['minlength'] = $tag->get_minlength_option(); if ($atts['maxlength'] && $atts['minleng...
[ "private", "static", "function", "getAtts", "(", "FormTag", "$", "tag", ",", "$", "validation_error", ",", "$", "class", ")", "{", "$", "atts", "=", "[", "]", ";", "$", "atts", "[", "'size'", "]", "=", "$", "tag", "->", "get_size_option", "(", "'40'"...
Get input attributes. @param FormTag $tag Input tag @param string $validation_error Validation error @param string $class Class @return string Attributes
[ "Get", "input", "attributes", "." ]
3e98b7de031f5507831946200081b6cb35b468b7
https://github.com/quai10/quai10-template/blob/3e98b7de031f5507831946200081b6cb35b468b7/lib/ContactForm.php#L45-L95
234,591
quai10/quai10-template
lib/ContactForm.php
ContactForm.addCustomFields
public static function addCustomFields($tag) { $tag = new FormTag($tag); if (empty($tag->getType())) { return ''; } $validation_error = wpcf7_get_validation_error($tag->getName()); $class = self::getClass($tag, $validation_error); $atts = self::getAtts(...
php
public static function addCustomFields($tag) { $tag = new FormTag($tag); if (empty($tag->getType())) { return ''; } $validation_error = wpcf7_get_validation_error($tag->getName()); $class = self::getClass($tag, $validation_error); $atts = self::getAtts(...
[ "public", "static", "function", "addCustomFields", "(", "$", "tag", ")", "{", "$", "tag", "=", "new", "FormTag", "(", "$", "tag", ")", ";", "if", "(", "empty", "(", "$", "tag", "->", "getType", "(", ")", ")", ")", "{", "return", "''", ";", "}", ...
Declare custom field types. @param array|string $tag Tag
[ "Declare", "custom", "field", "types", "." ]
3e98b7de031f5507831946200081b6cb35b468b7
https://github.com/quai10/quai10-template/blob/3e98b7de031f5507831946200081b6cb35b468b7/lib/ContactForm.php#L102-L123
234,592
quai10/quai10-template
lib/ContactForm.php
ContactForm.addFields
public static function addFields() { $tags = ['text', 'text*', 'email', 'email*', 'url', 'url*', 'tel', 'tel*']; foreach ($tags as $tag) { //We have to remove tags before replacing them. wpcf7_remove_form_tag($tag); } wpcf7_add_form_tag($tags, [self::class, 'a...
php
public static function addFields() { $tags = ['text', 'text*', 'email', 'email*', 'url', 'url*', 'tel', 'tel*']; foreach ($tags as $tag) { //We have to remove tags before replacing them. wpcf7_remove_form_tag($tag); } wpcf7_add_form_tag($tags, [self::class, 'a...
[ "public", "static", "function", "addFields", "(", ")", "{", "$", "tags", "=", "[", "'text'", ",", "'text*'", ",", "'email'", ",", "'email*'", ",", "'url'", ",", "'url*'", ",", "'tel'", ",", "'tel*'", "]", ";", "foreach", "(", "$", "tags", "as", "$", ...
Customize form fields.
[ "Customize", "form", "fields", "." ]
3e98b7de031f5507831946200081b6cb35b468b7
https://github.com/quai10/quai10-template/blob/3e98b7de031f5507831946200081b6cb35b468b7/lib/ContactForm.php#L128-L136
234,593
quai10/quai10-template
lib/ContactForm.php
ContactForm.addCustomSubmitBtn
public static function addCustomSubmitBtn($tag) { $tag = new FormTag($tag); $class = wpcf7_form_controls_class($tag->getType()); $atts = []; $atts['class'] = $tag->get_class_option($class).' btn'; $atts['id'] = $tag->get_id_option(); $atts['tabindex'] = $tag->get_o...
php
public static function addCustomSubmitBtn($tag) { $tag = new FormTag($tag); $class = wpcf7_form_controls_class($tag->getType()); $atts = []; $atts['class'] = $tag->get_class_option($class).' btn'; $atts['id'] = $tag->get_id_option(); $atts['tabindex'] = $tag->get_o...
[ "public", "static", "function", "addCustomSubmitBtn", "(", "$", "tag", ")", "{", "$", "tag", "=", "new", "FormTag", "(", "$", "tag", ")", ";", "$", "class", "=", "wpcf7_form_controls_class", "(", "$", "tag", "->", "getType", "(", ")", ")", ";", "$", ...
Declare custom submit button. @param array|string $tag Tag
[ "Declare", "custom", "submit", "button", "." ]
3e98b7de031f5507831946200081b6cb35b468b7
https://github.com/quai10/quai10-template/blob/3e98b7de031f5507831946200081b6cb35b468b7/lib/ContactForm.php#L143-L169
234,594
Syonix/log-viewer-lib
lib/Config.php
Config.lint
public static function lint($config, $verifyLogFiles = false) { $valid = true; $checks = []; // Valid YAML $checks['valid_yaml'] = [ 'message' => 'Is a valid YAML file', ]; try { $config = self::parse($config); $checks['valid_yaml'...
php
public static function lint($config, $verifyLogFiles = false) { $valid = true; $checks = []; // Valid YAML $checks['valid_yaml'] = [ 'message' => 'Is a valid YAML file', ]; try { $config = self::parse($config); $checks['valid_yaml'...
[ "public", "static", "function", "lint", "(", "$", "config", ",", "$", "verifyLogFiles", "=", "false", ")", "{", "$", "valid", "=", "true", ";", "$", "checks", "=", "[", "]", ";", "// Valid YAML", "$", "checks", "[", "'valid_yaml'", "]", "=", "[", "'m...
Lints a config file for syntactical and semantical correctness. @param array $config The parsed configuration to lint @param bool $verifyLogFiles Also verfy whether the log files are accessible @return array
[ "Lints", "a", "config", "file", "for", "syntactical", "and", "semantical", "correctness", "." ]
5212208bf2f0174eb5d0408d2d3028db4d478a74
https://github.com/Syonix/log-viewer-lib/blob/5212208bf2f0174eb5d0408d2d3028db4d478a74/lib/Config.php#L37-L99
234,595
Syonix/log-viewer-lib
lib/Config.php
Config.get
public function get($property = null) { if ($property === null || $property == '') { return $this->config; } $tree = explode('.', $property); $node = $this->config; foreach ($tree as $workingNode) { if (!array_key_exists($workingNode, $node)) { ...
php
public function get($property = null) { if ($property === null || $property == '') { return $this->config; } $tree = explode('.', $property); $node = $this->config; foreach ($tree as $workingNode) { if (!array_key_exists($workingNode, $node)) { ...
[ "public", "function", "get", "(", "$", "property", "=", "null", ")", "{", "if", "(", "$", "property", "===", "null", "||", "$", "property", "==", "''", ")", "{", "return", "$", "this", "->", "config", ";", "}", "$", "tree", "=", "explode", "(", "...
Returns a config property if it exists and throws an exception if not. @param string|null $property Dot-separated property (e.g. "date_format" or "logs.collection.log_file") @throws \InvalidArgumentException @return mixed
[ "Returns", "a", "config", "property", "if", "it", "exists", "and", "throws", "an", "exception", "if", "not", "." ]
5212208bf2f0174eb5d0408d2d3028db4d478a74
https://github.com/Syonix/log-viewer-lib/blob/5212208bf2f0174eb5d0408d2d3028db4d478a74/lib/Config.php#L352-L378
234,596
oscarotero/uploader
src/Uploader.php
Uploader.setDestination
public function setDestination($destination) { if ($destination instanceof Closure) { $this->callbacks['destination'] = $destination; } else { $this->options = self::parsePath($destination) + $this->options; } return $this; }
php
public function setDestination($destination) { if ($destination instanceof Closure) { $this->callbacks['destination'] = $destination; } else { $this->options = self::parsePath($destination) + $this->options; } return $this; }
[ "public", "function", "setDestination", "(", "$", "destination", ")", "{", "if", "(", "$", "destination", "instanceof", "Closure", ")", "{", "$", "this", "->", "callbacks", "[", "'destination'", "]", "=", "$", "destination", ";", "}", "else", "{", "$", "...
Set the destination of the file. It includes the directory, filename and extension. @param string|Closure $destination @return $this
[ "Set", "the", "destination", "of", "the", "file", ".", "It", "includes", "the", "directory", "filename", "and", "extension", "." ]
94f1461d324b467e2047568fcc5d88d53ab9ac8f
https://github.com/oscarotero/uploader/blob/94f1461d324b467e2047568fcc5d88d53ab9ac8f/src/Uploader.php#L161-L170
234,597
oscarotero/uploader
src/Uploader.php
Uploader.getDestination
public function getDestination($absolute = false) { return self::fixPath(($absolute ? '/'.$this->cwd : ''), $this->getDirectory(), $this->getPrefix().$this->getFilename().'.'.$this->getExtension()); }
php
public function getDestination($absolute = false) { return self::fixPath(($absolute ? '/'.$this->cwd : ''), $this->getDirectory(), $this->getPrefix().$this->getFilename().'.'.$this->getExtension()); }
[ "public", "function", "getDestination", "(", "$", "absolute", "=", "false", ")", "{", "return", "self", "::", "fixPath", "(", "(", "$", "absolute", "?", "'/'", ".", "$", "this", "->", "cwd", ":", "''", ")", ",", "$", "this", "->", "getDirectory", "("...
Returns the file destination. @param bool $absolute Whether or not returns the cwd @return string
[ "Returns", "the", "file", "destination", "." ]
94f1461d324b467e2047568fcc5d88d53ab9ac8f
https://github.com/oscarotero/uploader/blob/94f1461d324b467e2047568fcc5d88d53ab9ac8f/src/Uploader.php#L179-L182
234,598
oscarotero/uploader
src/Uploader.php
Uploader.with
public function with($original, $adapter = null) { $new = clone $this; $new->original = $original; $new->adapter = $adapter; if ($new->adapter === null) { foreach ($new->adapters as $each) { if ($each::check($original)) { $new->adapter...
php
public function with($original, $adapter = null) { $new = clone $this; $new->original = $original; $new->adapter = $adapter; if ($new->adapter === null) { foreach ($new->adapters as $each) { if ($each::check($original)) { $new->adapter...
[ "public", "function", "with", "(", "$", "original", ",", "$", "adapter", "=", "null", ")", "{", "$", "new", "=", "clone", "$", "this", ";", "$", "new", "->", "original", "=", "$", "original", ";", "$", "new", "->", "adapter", "=", "$", "adapter", ...
Set the original source. @param mixed $original @param null|string $adapter @throws \InvalidArgumentException On error @return Uploader A new cloned copy with the source and adapter configured
[ "Set", "the", "original", "source", "." ]
94f1461d324b467e2047568fcc5d88d53ab9ac8f
https://github.com/oscarotero/uploader/blob/94f1461d324b467e2047568fcc5d88d53ab9ac8f/src/Uploader.php#L260-L280
234,599
oscarotero/uploader
src/Uploader.php
Uploader.setOption
protected function setOption($name, $value) { if ($value instanceof Closure) { $this->callbacks[$name] = $value; } else { $this->options[$name] = $value; } return $this; }
php
protected function setOption($name, $value) { if ($value instanceof Closure) { $this->callbacks[$name] = $value; } else { $this->options[$name] = $value; } return $this; }
[ "protected", "function", "setOption", "(", "$", "name", ",", "$", "value", ")", "{", "if", "(", "$", "value", "instanceof", "Closure", ")", "{", "$", "this", "->", "callbacks", "[", "$", "name", "]", "=", "$", "value", ";", "}", "else", "{", "$", ...
Saves an option. @param string $name @param mixed $value @return $this
[ "Saves", "an", "option", "." ]
94f1461d324b467e2047568fcc5d88d53ab9ac8f
https://github.com/oscarotero/uploader/blob/94f1461d324b467e2047568fcc5d88d53ab9ac8f/src/Uploader.php#L333-L342