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
228,300
antaresproject/core
src/utils/customfield/src/Traits/Customfields.php
Customfields.customfields
public function customfields($fieldset = null) { $return = []; $customfields = $this->getAssignedCustomfields(); foreach ($customfields as $customfield) { if (is_null($customfield)) { continue; } $value = $customfield->setModel($this...
php
public function customfields($fieldset = null) { $return = []; $customfields = $this->getAssignedCustomfields(); foreach ($customfields as $customfield) { if (is_null($customfield)) { continue; } $value = $customfield->setModel($this...
[ "public", "function", "customfields", "(", "$", "fieldset", "=", "null", ")", "{", "$", "return", "=", "[", "]", ";", "$", "customfields", "=", "$", "this", "->", "getAssignedCustomfields", "(", ")", ";", "foreach", "(", "$", "customfields", "as", "$", ...
Gets all customfields available in model @param String $fieldset @return array
[ "Gets", "all", "customfields", "available", "in", "model" ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/utils/customfield/src/Traits/Customfields.php#L84-L97
228,301
lawoole/framework
src/Homer/Components/ServiceComponent.php
ServiceComponent.export
public function export() { if ($this->config == null) { throw new LogicException('Context must be set before export the service.'); } if ($this->dispatcher == null) { throw new LogicException('Dispatcher must be set before export the service.'); } $t...
php
public function export() { if ($this->config == null) { throw new LogicException('Context must be set before export the service.'); } if ($this->dispatcher == null) { throw new LogicException('Dispatcher must be set before export the service.'); } $t...
[ "public", "function", "export", "(", ")", "{", "if", "(", "$", "this", "->", "config", "==", "null", ")", "{", "throw", "new", "LogicException", "(", "'Context must be set before export the service.'", ")", ";", "}", "if", "(", "$", "this", "->", "dispatcher...
Export the interface.
[ "Export", "the", "interface", "." ]
ac701a76f5d37c81273b7202ba37094766cb5dfe
https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Homer/Components/ServiceComponent.php#L64-L77
228,302
lawoole/framework
src/Homer/Components/ServiceComponent.php
ServiceComponent.getInvoker
public function getInvoker() { if ($this->invoker !== null) { return $this->invoker; } return $this->invoker = $this->createInvoker(); }
php
public function getInvoker() { if ($this->invoker !== null) { return $this->invoker; } return $this->invoker = $this->createInvoker(); }
[ "public", "function", "getInvoker", "(", ")", "{", "if", "(", "$", "this", "->", "invoker", "!==", "null", ")", "{", "return", "$", "this", "->", "invoker", ";", "}", "return", "$", "this", "->", "invoker", "=", "$", "this", "->", "createInvoker", "(...
Get invoker for the interface. @return \Lawoole\Homer\Calling\Invokers\Invoker
[ "Get", "invoker", "for", "the", "interface", "." ]
ac701a76f5d37c81273b7202ba37094766cb5dfe
https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Homer/Components/ServiceComponent.php#L84-L91
228,303
lawoole/framework
src/Homer/Components/ServiceComponent.php
ServiceComponent.createInvoker
protected function createInvoker() { $config = $this->config; $interface = Arr::pull($config, 'interface'); $concrete = Arr::pull($config, 'refer', $interface); $invoker = new ConcreteInvoker($this->context, $interface, $concrete, $config); return $this->withMiddleware($in...
php
protected function createInvoker() { $config = $this->config; $interface = Arr::pull($config, 'interface'); $concrete = Arr::pull($config, 'refer', $interface); $invoker = new ConcreteInvoker($this->context, $interface, $concrete, $config); return $this->withMiddleware($in...
[ "protected", "function", "createInvoker", "(", ")", "{", "$", "config", "=", "$", "this", "->", "config", ";", "$", "interface", "=", "Arr", "::", "pull", "(", "$", "config", ",", "'interface'", ")", ";", "$", "concrete", "=", "Arr", "::", "pull", "(...
Create the invoker. @return \Lawoole\Homer\Calling\Invokers\Invoker
[ "Create", "the", "invoker", "." ]
ac701a76f5d37c81273b7202ba37094766cb5dfe
https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Homer/Components/ServiceComponent.php#L98-L108
228,304
gggeek/ggwebservices
classes/gghttpresponse.php
ggHTTPResponse.decodeStream
function decodeStream( $request, $stream, $headers=false, $cookies=array(), $statuscode="200" ) { $this->decodeStreamCommon( $request, $stream, $headers, $cookies, $statuscode ); $this->Value = $stream; }
php
function decodeStream( $request, $stream, $headers=false, $cookies=array(), $statuscode="200" ) { $this->decodeStreamCommon( $request, $stream, $headers, $cookies, $statuscode ); $this->Value = $stream; }
[ "function", "decodeStream", "(", "$", "request", ",", "$", "stream", ",", "$", "headers", "=", "false", ",", "$", "cookies", "=", "array", "(", ")", ",", "$", "statuscode", "=", "\"200\"", ")", "{", "$", "this", "->", "decodeStreamCommon", "(", "$", ...
Decodes the HTTP response stream.
[ "Decodes", "the", "HTTP", "response", "stream", "." ]
4f6e1ada1aa94301acd2ef3cd0966c7be06313ec
https://github.com/gggeek/ggwebservices/blob/4f6e1ada1aa94301acd2ef3cd0966c7be06313ec/classes/gghttpresponse.php#L23-L28
228,305
gggeek/ggwebservices
classes/ggwebservicesclient.php
ggWebservicesClient.decode_chunked
protected static function decode_chunked( $buffer ) { $length = 0; $new = ''; // read chunk-size, chunk-extension (if any) and crlf // get the position of the linebreak $chunkend = strpos($buffer,"\r\n") + 2; $temp = substr($buffer,0,$chunkend); $chunk_size =...
php
protected static function decode_chunked( $buffer ) { $length = 0; $new = ''; // read chunk-size, chunk-extension (if any) and crlf // get the position of the linebreak $chunkend = strpos($buffer,"\r\n") + 2; $temp = substr($buffer,0,$chunkend); $chunk_size =...
[ "protected", "static", "function", "decode_chunked", "(", "$", "buffer", ")", "{", "$", "length", "=", "0", ";", "$", "new", "=", "''", ";", "// read chunk-size, chunk-extension (if any) and crlf", "// get the position of the linebreak", "$", "chunkend", "=", "strpos"...
Decode a string that is encoded w. "chunked" transfer encoding as defined in rfc2068 par. 19.4.6 Code shamelessly stolen from nusoap library by Dietrich Ayala @param string $buffer the string to be decoded @return string
[ "Decode", "a", "string", "that", "is", "encoded", "w", ".", "chunked", "transfer", "encoding", "as", "defined", "in", "rfc2068", "par", ".", "19", ".", "4", ".", "6", "Code", "shamelessly", "stolen", "from", "nusoap", "library", "by", "Dietrich", "Ayala" ]
4f6e1ada1aa94301acd2ef3cd0966c7be06313ec
https://github.com/gggeek/ggwebservices/blob/4f6e1ada1aa94301acd2ef3cd0966c7be06313ec/classes/ggwebservicesclient.php#L752-L796
228,306
gggeek/ggwebservices
classes/ggwebservicesclient.php
ggWebservicesClient.setOption
function setOption( $option, $value ) { if ( !in_array( $option, $this->Options ) ) { // throwing an exception would make more sense, but we did not before - keep this for compat return false; //throw new Exception( "Option $option not supported" ); } ...
php
function setOption( $option, $value ) { if ( !in_array( $option, $this->Options ) ) { // throwing an exception would make more sense, but we did not before - keep this for compat return false; //throw new Exception( "Option $option not supported" ); } ...
[ "function", "setOption", "(", "$", "option", ",", "$", "value", ")", "{", "if", "(", "!", "in_array", "(", "$", "option", ",", "$", "this", "->", "Options", ")", ")", "{", "// throwing an exception would make more sense, but we did not before - keep this for compat"...
One-stop shop for setting all configuration options without having to write a hundred method calls @param string $option @param mixed $value @return bool false if option does not exist
[ "One", "-", "stop", "shop", "for", "setting", "all", "configuration", "options", "without", "having", "to", "write", "a", "hundred", "method", "calls" ]
4f6e1ada1aa94301acd2ef3cd0966c7be06313ec
https://github.com/gggeek/ggwebservices/blob/4f6e1ada1aa94301acd2ef3cd0966c7be06313ec/classes/ggwebservicesclient.php#L805-L877
228,307
gggeek/ggwebservices
classes/ggwebservicesclient.php
ggWebservicesClient.setOptions
function setOptions( $optionArray ) { foreach( $optionArray as $name => $value ) { $this->setOption( $name, $value ); } }
php
function setOptions( $optionArray ) { foreach( $optionArray as $name => $value ) { $this->setOption( $name, $value ); } }
[ "function", "setOptions", "(", "$", "optionArray", ")", "{", "foreach", "(", "$", "optionArray", "as", "$", "name", "=>", "$", "value", ")", "{", "$", "this", "->", "setOption", "(", "$", "name", ",", "$", "value", ")", ";", "}", "}" ]
Set many options in one fell swoop @param array $optionArray @throws Exception if an option does not exist
[ "Set", "many", "options", "in", "one", "fell", "swoop" ]
4f6e1ada1aa94301acd2ef3cd0966c7be06313ec
https://github.com/gggeek/ggwebservices/blob/4f6e1ada1aa94301acd2ef3cd0966c7be06313ec/classes/ggwebservicesclient.php#L884-L890
228,308
gggeek/ggwebservices
classes/ggwebservicesclient.php
ggWebservicesClient.getOption
function getOption( $option ) { if ( !in_array( $option, $this->Options ) ) { throw new Exception( "Option $option not supported" ); } switch( $option ) { case 'timeout': return $this->Timeout; case 'login': ...
php
function getOption( $option ) { if ( !in_array( $option, $this->Options ) ) { throw new Exception( "Option $option not supported" ); } switch( $option ) { case 'timeout': return $this->Timeout; case 'login': ...
[ "function", "getOption", "(", "$", "option", ")", "{", "if", "(", "!", "in_array", "(", "$", "option", ",", "$", "this", "->", "Options", ")", ")", "{", "throw", "new", "Exception", "(", "\"Option $option not supported\"", ")", ";", "}", "switch", "(", ...
Retrieves the current value for any option @param string $option @return bool|int|string @throws Exception if option does not exist
[ "Retrieves", "the", "current", "value", "for", "any", "option" ]
4f6e1ada1aa94301acd2ef3cd0966c7be06313ec
https://github.com/gggeek/ggwebservices/blob/4f6e1ada1aa94301acd2ef3cd0966c7be06313ec/classes/ggwebservicesclient.php#L898-L942
228,309
antaresproject/core
src/ui/components/templates/src/Adapter/AbstractTemplate.php
AbstractTemplate.setDefaults
protected function setDefaults() { $this->attributes['name'] = $this->name; $this->attributes['classname'] = get_called_class(); $attributesAdapter = new AttributesAdapter($this->name); $defaults = $attributesAdapter->defaults(); if (!iss...
php
protected function setDefaults() { $this->attributes['name'] = $this->name; $this->attributes['classname'] = get_called_class(); $attributesAdapter = new AttributesAdapter($this->name); $defaults = $attributesAdapter->defaults(); if (!iss...
[ "protected", "function", "setDefaults", "(", ")", "{", "$", "this", "->", "attributes", "[", "'name'", "]", "=", "$", "this", "->", "name", ";", "$", "this", "->", "attributes", "[", "'classname'", "]", "=", "get_called_class", "(", ")", ";", "$", "att...
set default widget attributes @return array
[ "set", "default", "widget", "attributes" ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/templates/src/Adapter/AbstractTemplate.php#L147-L167
228,310
antaresproject/core
src/ui/components/templates/src/Adapter/AbstractTemplate.php
AbstractTemplate.fill
public function fill() { $params = array_merge($this->attributes, [ 'id' => $this->id, 'widget' => $this->model, 'name' => $this->name, 'title' => strlen($this->title) > 0 ? $this->title : $this->name, 'd...
php
public function fill() { $params = array_merge($this->attributes, [ 'id' => $this->id, 'widget' => $this->model, 'name' => $this->name, 'title' => strlen($this->title) > 0 ? $this->title : $this->name, 'd...
[ "public", "function", "fill", "(", ")", "{", "$", "params", "=", "array_merge", "(", "$", "this", "->", "attributes", ",", "[", "'id'", "=>", "$", "this", "->", "id", ",", "'widget'", "=>", "$", "this", "->", "model", ",", "'name'", "=>", "$", "thi...
fill widget params @return array
[ "fill", "widget", "params" ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/templates/src/Adapter/AbstractTemplate.php#L211-L230
228,311
antaresproject/core
src/ui/components/templates/src/Adapter/AbstractTemplate.php
AbstractTemplate.controls
public function controls() { $this->form(); $form = app('antares.form')->of("antares.ui-components: custom"); $fieldsets = $form->grid->fieldsets(); $controls = []; foreach ($fieldsets as $fieldset) { foreach ($fieldset->controls as $control) { ...
php
public function controls() { $this->form(); $form = app('antares.form')->of("antares.ui-components: custom"); $fieldsets = $form->grid->fieldsets(); $controls = []; foreach ($fieldsets as $fieldset) { foreach ($fieldset->controls as $control) { ...
[ "public", "function", "controls", "(", ")", "{", "$", "this", "->", "form", "(", ")", ";", "$", "form", "=", "app", "(", "'antares.form'", ")", "->", "of", "(", "\"antares.ui-components: custom\"", ")", ";", "$", "fieldsets", "=", "$", "form", "->", "g...
getting all controls available in edition form of widget @return array
[ "getting", "all", "controls", "available", "in", "edition", "form", "of", "widget" ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/ui/components/templates/src/Adapter/AbstractTemplate.php#L237-L249
228,312
antaresproject/core
src/components/support/src/Support/Traits/UploadableTrait.php
UploadableTrait.saveUploadedFile
protected function saveUploadedFile(UploadedFile $file, $path) { $file->move($path, $filename = $this->getUploadedFilename($file)); return $filename; }
php
protected function saveUploadedFile(UploadedFile $file, $path) { $file->move($path, $filename = $this->getUploadedFilename($file)); return $filename; }
[ "protected", "function", "saveUploadedFile", "(", "UploadedFile", "$", "file", ",", "$", "path", ")", "{", "$", "file", "->", "move", "(", "$", "path", ",", "$", "filename", "=", "$", "this", "->", "getUploadedFilename", "(", "$", "file", ")", ")", ";"...
Save uploaded file into directory. @param \Symfony\Component\HttpFoundation\File\UploadedFile $file @param string $path @return string
[ "Save", "uploaded", "file", "into", "directory", "." ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/support/src/Support/Traits/UploadableTrait.php#L37-L42
228,313
antaresproject/core
src/foundation/src/Processor/Extension/ModuleViewer.php
ModuleViewer.index
public function index(Listener $listener, $category = null) { $presenter = $this->presenter->setCategory($category); $modules = $presenter->modules(); return $listener->show(compact('modules', 'category')); }
php
public function index(Listener $listener, $category = null) { $presenter = $this->presenter->setCategory($category); $modules = $presenter->modules(); return $listener->show(compact('modules', 'category')); }
[ "public", "function", "index", "(", "Listener", "$", "listener", ",", "$", "category", "=", "null", ")", "{", "$", "presenter", "=", "$", "this", "->", "presenter", "->", "setCategory", "(", "$", "category", ")", ";", "$", "modules", "=", "$", "present...
View modules page. @param \Antares\Contracts\Extension\Listener\Viewer $listener @return mixed
[ "View", "modules", "page", "." ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Processor/Extension/ModuleViewer.php#L66-L71
228,314
antaresproject/core
src/components/memory/src/Repository/Resource.php
Resource.add
public function add(array $attributes = array()) { if (!$this->contains($attributes)) { $this->model->getModel()->newInstance($attributes)->save(); $this->cache->forget($this->cacheKey); } return $this; }
php
public function add(array $attributes = array()) { if (!$this->contains($attributes)) { $this->model->getModel()->newInstance($attributes)->save(); $this->cache->forget($this->cacheKey); } return $this; }
[ "public", "function", "add", "(", "array", "$", "attributes", "=", "array", "(", ")", ")", "{", "if", "(", "!", "$", "this", "->", "contains", "(", "$", "attributes", ")", ")", "{", "$", "this", "->", "model", "->", "getModel", "(", ")", "->", "n...
add resource do resource stack @param array $attributes @return \Antares\Memory\Repository\Resource
[ "add", "resource", "do", "resource", "stack" ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/memory/src/Repository/Resource.php#L89-L96
228,315
antaresproject/core
src/components/memory/src/Repository/Resource.php
Resource.contains
protected function contains(array $attributes = array()) { $collection = $this->findAll(); $filtered = $collection->filter(function($value, $key) use($attributes) { foreach ($attributes as $keyname => $attrVal) { if ($value->{$keyname} != $attrVal) { ...
php
protected function contains(array $attributes = array()) { $collection = $this->findAll(); $filtered = $collection->filter(function($value, $key) use($attributes) { foreach ($attributes as $keyname => $attrVal) { if ($value->{$keyname} != $attrVal) { ...
[ "protected", "function", "contains", "(", "array", "$", "attributes", "=", "array", "(", ")", ")", "{", "$", "collection", "=", "$", "this", "->", "findAll", "(", ")", ";", "$", "filtered", "=", "$", "collection", "->", "filter", "(", "function", "(", ...
whether resource stack contains parametrized row with component and action name @param array $attributes @return boolean
[ "whether", "resource", "stack", "contains", "parametrized", "row", "with", "component", "and", "action", "name" ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/memory/src/Repository/Resource.php#L104-L116
228,316
antaresproject/core
src/components/memory/src/Repository/Resource.php
Resource.findOneByAttributes
public function findOneByAttributes(array $attributes = array(), $columns = array('*')) { if (empty($attributes)) { throw new Exception('Unable to find entity'); } return $this->model->where($attributes)->first($columns); }
php
public function findOneByAttributes(array $attributes = array(), $columns = array('*')) { if (empty($attributes)) { throw new Exception('Unable to find entity'); } return $this->model->where($attributes)->first($columns); }
[ "public", "function", "findOneByAttributes", "(", "array", "$", "attributes", "=", "array", "(", ")", ",", "$", "columns", "=", "array", "(", "'*'", ")", ")", "{", "if", "(", "empty", "(", "$", "attributes", ")", ")", "{", "throw", "new", "Exception", ...
find item by attributes @param array $attributes @param array $columns @return mixed @throws Exception
[ "find", "item", "by", "attributes" ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/memory/src/Repository/Resource.php#L126-L132
228,317
tomwalder/php-appengine-search
src/Search/Document.php
Document.getExpression
public function getExpression($str_name) { if(isset($this->arr_expressions[$str_name])) { return $this->arr_expressions[$str_name]; } return null; }
php
public function getExpression($str_name) { if(isset($this->arr_expressions[$str_name])) { return $this->arr_expressions[$str_name]; } return null; }
[ "public", "function", "getExpression", "(", "$", "str_name", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "arr_expressions", "[", "$", "str_name", "]", ")", ")", "{", "return", "$", "this", "->", "arr_expressions", "[", "$", "str_name", "]", "...
Get a specific returned expression @param $str_name @return null
[ "Get", "a", "specific", "returned", "expression" ]
e34a7f6ddf2f5e8dc51487562d413ca4fd1331ba
https://github.com/tomwalder/php-appengine-search/blob/e34a7f6ddf2f5e8dc51487562d413ca4fd1331ba/src/Search/Document.php#L186-L192
228,318
lawoole/framework
src/Homer/Transport/Whisper/WhisperClient.php
WhisperClient.send
protected function send($data) { try { $result = $this->client->send($data); if ($result === false) { $errorCode = $this->client->errCode; throw new TransportException('Send data failed, cause: '.socket_strerror($errorCode).'.', T...
php
protected function send($data) { try { $result = $this->client->send($data); if ($result === false) { $errorCode = $this->client->errCode; throw new TransportException('Send data failed, cause: '.socket_strerror($errorCode).'.', T...
[ "protected", "function", "send", "(", "$", "data", ")", "{", "try", "{", "$", "result", "=", "$", "this", "->", "client", "->", "send", "(", "$", "data", ")", ";", "if", "(", "$", "result", "===", "false", ")", "{", "$", "errorCode", "=", "$", ...
Send data. @param string $data @return int
[ "Send", "data", "." ]
ac701a76f5d37c81273b7202ba37094766cb5dfe
https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Homer/Transport/Whisper/WhisperClient.php#L137-L159
228,319
lawoole/framework
src/Homer/Transport/Whisper/WhisperClient.php
WhisperClient.receive
protected function receive() { try { $data = $this->client->recv(); if ($data === false) { $errorCode = $this->client->errCode; if ($errorCode == 11) { throw new TransportException('Receive timeout in '.$this->getTimeout().' ms.',...
php
protected function receive() { try { $data = $this->client->recv(); if ($data === false) { $errorCode = $this->client->errCode; if ($errorCode == 11) { throw new TransportException('Receive timeout in '.$this->getTimeout().' ms.',...
[ "protected", "function", "receive", "(", ")", "{", "try", "{", "$", "data", "=", "$", "this", "->", "client", "->", "recv", "(", ")", ";", "if", "(", "$", "data", "===", "false", ")", "{", "$", "errorCode", "=", "$", "this", "->", "client", "->",...
Receive result. @return string
[ "Receive", "result", "." ]
ac701a76f5d37c81273b7202ba37094766cb5dfe
https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Homer/Transport/Whisper/WhisperClient.php#L200-L231
228,320
antaresproject/core
src/foundation/src/Repository/AbstractRepository.php
AbstractRepository.getBy
public function getBy($attribute, $value, $columns = array('*')) { return $this->model->where($attribute, '=', $value)->get($columns); }
php
public function getBy($attribute, $value, $columns = array('*')) { return $this->model->where($attribute, '=', $value)->get($columns); }
[ "public", "function", "getBy", "(", "$", "attribute", ",", "$", "value", ",", "$", "columns", "=", "array", "(", "'*'", ")", ")", "{", "return", "$", "this", "->", "model", "->", "where", "(", "$", "attribute", ",", "'='", ",", "$", "value", ")", ...
gets rows by attribute @param array $columns @return mixed
[ "gets", "rows", "by", "attribute" ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Repository/AbstractRepository.php#L73-L76
228,321
antaresproject/core
src/utils/customfield/src/Twig/Customfield.php
Customfield.hasCustomfield
protected function hasCustomfield() { $function = function ($object, $name) { return method_exists($object, 'hasCustomfield') ? $object->hasCustomfield($name) : false; }; return new Twig_SimpleFunction( 'hasCustomfield', $function ); }
php
protected function hasCustomfield() { $function = function ($object, $name) { return method_exists($object, 'hasCustomfield') ? $object->hasCustomfield($name) : false; }; return new Twig_SimpleFunction( 'hasCustomfield', $function ); }
[ "protected", "function", "hasCustomfield", "(", ")", "{", "$", "function", "=", "function", "(", "$", "object", ",", "$", "name", ")", "{", "return", "method_exists", "(", "$", "object", ",", "'hasCustomfield'", ")", "?", "$", "object", "->", "hasCustomfie...
create widget view helper for get brand title @return Twig_SimpleFunction
[ "create", "widget", "view", "helper", "for", "get", "brand", "title" ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/utils/customfield/src/Twig/Customfield.php#L43-L52
228,322
antaresproject/core
src/components/support/src/Support/Traits/ValidationTrait.php
ValidationTrait.runValidationEvents
protected function runValidationEvents($events, array $phrases) { is_array($events) || $events = (array) $events; $events = array_merge($this->getValidationEvents(), $events); $rules = new Fluent($this->getBindedRules()); $phrases = new Fluent(array_merge($this->getValidationPhra...
php
protected function runValidationEvents($events, array $phrases) { is_array($events) || $events = (array) $events; $events = array_merge($this->getValidationEvents(), $events); $rules = new Fluent($this->getBindedRules()); $phrases = new Fluent(array_merge($this->getValidationPhra...
[ "protected", "function", "runValidationEvents", "(", "$", "events", ",", "array", "$", "phrases", ")", "{", "is_array", "(", "$", "events", ")", "||", "$", "events", "=", "(", "array", ")", "$", "events", ";", "$", "events", "=", "array_merge", "(", "$...
Run validation events and return the finalize rules and phrases. @param array|string $events @param array $phrases @return array
[ "Run", "validation", "events", "and", "return", "the", "finalize", "rules", "and", "phrases", "." ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/support/src/Support/Traits/ValidationTrait.php#L173-L190
228,323
joomla-framework/google-api
src/Data/Picasa/Album.php
Album.save
public function save($match = '*') { if ($this->isAuthenticated()) { $url = $this->getLink(); if ($match === true) { $match = $this->xml->xpath('./@gd:etag'); $match = $match[0]; } try { $headers = array('GData-Version' => 2, 'Content-type' => 'application/atom+xml', 'If-Match' => $...
php
public function save($match = '*') { if ($this->isAuthenticated()) { $url = $this->getLink(); if ($match === true) { $match = $this->xml->xpath('./@gd:etag'); $match = $match[0]; } try { $headers = array('GData-Version' => 2, 'Content-type' => 'application/atom+xml', 'If-Match' => $...
[ "public", "function", "save", "(", "$", "match", "=", "'*'", ")", "{", "if", "(", "$", "this", "->", "isAuthenticated", "(", ")", ")", "{", "$", "url", "=", "$", "this", "->", "getLink", "(", ")", ";", "if", "(", "$", "match", "===", "true", ")...
Method to modify a Picasa Album @param string $match Optional eTag matching parameter @return mixed Data from Google. @since 1.0 @throws \Exception @throws \RuntimeException
[ "Method", "to", "modify", "a", "Picasa", "Album" ]
c78f06cfaba3f0dfc3ce411a335b417a5f0ee904
https://github.com/joomla-framework/google-api/blob/c78f06cfaba3f0dfc3ce411a335b417a5f0ee904/src/Data/Picasa/Album.php#L276-L309
228,324
joomla-framework/google-api
src/Data/Picasa/Album.php
Album.refresh
public function refresh() { if ($this->isAuthenticated()) { $url = $this->getLink(); $jdata = $this->query($url, null, array('GData-Version' => 2)); $this->xml = $this->safeXml($jdata->body); return $this; } return false; }
php
public function refresh() { if ($this->isAuthenticated()) { $url = $this->getLink(); $jdata = $this->query($url, null, array('GData-Version' => 2)); $this->xml = $this->safeXml($jdata->body); return $this; } return false; }
[ "public", "function", "refresh", "(", ")", "{", "if", "(", "$", "this", "->", "isAuthenticated", "(", ")", ")", "{", "$", "url", "=", "$", "this", "->", "getLink", "(", ")", ";", "$", "jdata", "=", "$", "this", "->", "query", "(", "$", "url", "...
Refresh Picasa Album @return mixed Data from Google @since 1.0
[ "Refresh", "Picasa", "Album" ]
c78f06cfaba3f0dfc3ce411a335b417a5f0ee904
https://github.com/joomla-framework/google-api/blob/c78f06cfaba3f0dfc3ce411a335b417a5f0ee904/src/Data/Picasa/Album.php#L318-L330
228,325
antaresproject/core
src/components/extension/src/Repositories/ComponentsRepository.php
ComponentsRepository.getRequired
public function getRequired() : array { $required = []; foreach($this->required as $component) { $required[$component] = $this->getTargetBranch($component); } return $required; }
php
public function getRequired() : array { $required = []; foreach($this->required as $component) { $required[$component] = $this->getTargetBranch($component); } return $required; }
[ "public", "function", "getRequired", "(", ")", ":", "array", "{", "$", "required", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "required", "as", "$", "component", ")", "{", "$", "required", "[", "$", "component", "]", "=", "$", "this", "...
Returns an array of required components with branches. @return array
[ "Returns", "an", "array", "of", "required", "components", "with", "branches", "." ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/extension/src/Repositories/ComponentsRepository.php#L57-L65
228,326
antaresproject/core
src/components/extension/src/Repositories/ComponentsRepository.php
ComponentsRepository.getOptional
public function getOptional() : array { $optional = []; foreach($this->optional as $component) { $optional[$component] = $this->getTargetBranch($component); } return $optional; }
php
public function getOptional() : array { $optional = []; foreach($this->optional as $component) { $optional[$component] = $this->getTargetBranch($component); } return $optional; }
[ "public", "function", "getOptional", "(", ")", ":", "array", "{", "$", "optional", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "optional", "as", "$", "component", ")", "{", "$", "optional", "[", "$", "component", "]", "=", "$", "this", "...
Returns an array of optional components with branches. @return array
[ "Returns", "an", "array", "of", "optional", "components", "with", "branches", "." ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/extension/src/Repositories/ComponentsRepository.php#L72-L80
228,327
antaresproject/core
src/components/extension/src/Repositories/ComponentsRepository.php
ComponentsRepository.getWithBranches
public function getWithBranches(array $components) : array { $data = []; foreach($components as $component) { $data[$component] = $this->getTargetBranch($component); } return $data; }
php
public function getWithBranches(array $components) : array { $data = []; foreach($components as $component) { $data[$component] = $this->getTargetBranch($component); } return $data; }
[ "public", "function", "getWithBranches", "(", "array", "$", "components", ")", ":", "array", "{", "$", "data", "=", "[", "]", ";", "foreach", "(", "$", "components", "as", "$", "component", ")", "{", "$", "data", "[", "$", "component", "]", "=", "$",...
Returns the given components with branches. @param array $components @return array
[ "Returns", "the", "given", "components", "with", "branches", "." ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/extension/src/Repositories/ComponentsRepository.php#L88-L96
228,328
antaresproject/core
src/components/extension/src/Repositories/ComponentsRepository.php
ComponentsRepository.getTargetBranch
public function getTargetBranch(string $component) : string { return array_key_exists($component, $this->branches) ? $this->branches[$component] : self::$defaultBranch; }
php
public function getTargetBranch(string $component) : string { return array_key_exists($component, $this->branches) ? $this->branches[$component] : self::$defaultBranch; }
[ "public", "function", "getTargetBranch", "(", "string", "$", "component", ")", ":", "string", "{", "return", "array_key_exists", "(", "$", "component", ",", "$", "this", "->", "branches", ")", "?", "$", "this", "->", "branches", "[", "$", "component", "]",...
Returns the target branch. @param string $component @return string
[ "Returns", "the", "target", "branch", "." ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/extension/src/Repositories/ComponentsRepository.php#L104-L108
228,329
antaresproject/customfields
src/CustomFieldsServiceProvider.php
CustomFieldsServiceProvider.register
public function register() { $this->app->bind('antares.customfields.model', function() { return new Field(); }); $this->app->bind('antares.customfields.model.view', function() { return new FieldView(); }); $this->app->bind('antares.customfields.model.c...
php
public function register() { $this->app->bind('antares.customfields.model', function() { return new Field(); }); $this->app->bind('antares.customfields.model.view', function() { return new FieldView(); }); $this->app->bind('antares.customfields.model.c...
[ "public", "function", "register", "(", ")", "{", "$", "this", "->", "app", "->", "bind", "(", "'antares.customfields.model'", ",", "function", "(", ")", "{", "return", "new", "Field", "(", ")", ";", "}", ")", ";", "$", "this", "->", "app", "->", "bin...
registering service provider
[ "registering", "service", "provider" ]
7e7fd9dec91249c946592c31dbd3994a3d41c1bd
https://github.com/antaresproject/customfields/blob/7e7fd9dec91249c946592c31dbd3994a3d41c1bd/src/CustomFieldsServiceProvider.php#L80-L109
228,330
antaresproject/customfields
src/CustomFieldsServiceProvider.php
CustomFieldsServiceProvider.bootFormEvents
protected function bootFormEvents() { $categoriesCollection = Foundation::make('antares.customfields.model.category') ->select(['name'])->with(['group' => function($query) { $query->select(['name']); }])->get(); $formHandler =...
php
protected function bootFormEvents() { $categoriesCollection = Foundation::make('antares.customfields.model.category') ->select(['name'])->with(['group' => function($query) { $query->select(['name']); }])->get(); $formHandler =...
[ "protected", "function", "bootFormEvents", "(", ")", "{", "$", "categoriesCollection", "=", "Foundation", "::", "make", "(", "'antares.customfields.model.category'", ")", "->", "select", "(", "[", "'name'", "]", ")", "->", "with", "(", "[", "'group'", "=>", "f...
booting form events
[ "booting", "form", "events" ]
7e7fd9dec91249c946592c31dbd3994a3d41c1bd
https://github.com/antaresproject/customfields/blob/7e7fd9dec91249c946592c31dbd3994a3d41c1bd/src/CustomFieldsServiceProvider.php#L153-L174
228,331
antaresproject/core
src/utils/twig/Extension/Avatar.php
Avatar.createInitials
protected function createInitials($filename, $fullname, $width = null, $height = null) { $width = is_null($width) ? config('avatar.width') : $width; $height = is_null($height) ? config('avatar.height') : $height; $defaultWidth = config('avatar.width'); $fontSize = co...
php
protected function createInitials($filename, $fullname, $width = null, $height = null) { $width = is_null($width) ? config('avatar.width') : $width; $height = is_null($height) ? config('avatar.height') : $height; $defaultWidth = config('avatar.width'); $fontSize = co...
[ "protected", "function", "createInitials", "(", "$", "filename", ",", "$", "fullname", ",", "$", "width", "=", "null", ",", "$", "height", "=", "null", ")", "{", "$", "width", "=", "is_null", "(", "$", "width", ")", "?", "config", "(", "'avatar.width'"...
create initials from string @param String $filename @param String $fullname @param mixed $width @param mixed $height @return Avatar
[ "create", "initials", "from", "string" ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/utils/twig/Extension/Avatar.php#L152-L163
228,332
antaresproject/core
src/utils/twig/Extension/Avatar.php
Avatar.createWidgetInitials
protected function createWidgetInitials($filename, $title, $width = null, $height = null) { $avatar = AvatarFacade::create($title)->setDimension($width, $height)->setBackground('#02a8f3')->setFontSize(40)->setShape('square'); $avatar->save($filename, 100); return $avatar; }
php
protected function createWidgetInitials($filename, $title, $width = null, $height = null) { $avatar = AvatarFacade::create($title)->setDimension($width, $height)->setBackground('#02a8f3')->setFontSize(40)->setShape('square'); $avatar->save($filename, 100); return $avatar; }
[ "protected", "function", "createWidgetInitials", "(", "$", "filename", ",", "$", "title", ",", "$", "width", "=", "null", ",", "$", "height", "=", "null", ")", "{", "$", "avatar", "=", "AvatarFacade", "::", "create", "(", "$", "title", ")", "->", "setD...
create widget initials from string @param String $filename @param String $title @param mixed $width @param mixed $height @return Avatar
[ "create", "widget", "initials", "from", "string" ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/utils/twig/Extension/Avatar.php#L174-L180
228,333
antaresproject/core
src/utils/twig/Extension/Avatar.php
Avatar.response
protected function response($filename) { Image::make($filename)->response('png', 100); return str_replace([public_path(), DIRECTORY_SEPARATOR], ['', '/'], $filename); }
php
protected function response($filename) { Image::make($filename)->response('png', 100); return str_replace([public_path(), DIRECTORY_SEPARATOR], ['', '/'], $filename); }
[ "protected", "function", "response", "(", "$", "filename", ")", "{", "Image", "::", "make", "(", "$", "filename", ")", "->", "response", "(", "'png'", ",", "100", ")", ";", "return", "str_replace", "(", "[", "public_path", "(", ")", ",", "DIRECTORY_SEPAR...
create image response @param String $filename @return Response
[ "create", "image", "response" ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/utils/twig/Extension/Avatar.php#L188-L193
228,334
lawoole/framework
src/Homer/Serialize/Serializations/ObjectSerialization.php
ObjectSerialization.recover
public function recover() { $instance = $this->values; foreach (get_object_vars($instance) as $key => $value) { $instance->$key = $value instanceof Serialization ? $value->recover() : $value; } return $instance; }
php
public function recover() { $instance = $this->values; foreach (get_object_vars($instance) as $key => $value) { $instance->$key = $value instanceof Serialization ? $value->recover() : $value; } return $instance; }
[ "public", "function", "recover", "(", ")", "{", "$", "instance", "=", "$", "this", "->", "values", ";", "foreach", "(", "get_object_vars", "(", "$", "instance", ")", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "instance", "->", "$", "key", ...
Recover the instance from the serialization. @return \stdClass
[ "Recover", "the", "instance", "from", "the", "serialization", "." ]
ac701a76f5d37c81273b7202ba37094766cb5dfe
https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Homer/Serialize/Serializations/ObjectSerialization.php#L34-L43
228,335
antaresproject/core
src/components/publisher/src/Publishing/Publisher.php
Publisher.publish
public function publish($package, $source) { $name = trim(str_replace(['modules', 'components'], '', $package), '/'); $destination = $this->getDestinationPath($name); $this->makeDestination($destination); return app('antares.asset.publisher')->publishAndPropagate($this->files-...
php
public function publish($package, $source) { $name = trim(str_replace(['modules', 'components'], '', $package), '/'); $destination = $this->getDestinationPath($name); $this->makeDestination($destination); return app('antares.asset.publisher')->publishAndPropagate($this->files-...
[ "public", "function", "publish", "(", "$", "package", ",", "$", "source", ")", "{", "$", "name", "=", "trim", "(", "str_replace", "(", "[", "'modules'", ",", "'components'", "]", ",", "''", ",", "$", "package", ")", ",", "'/'", ")", ";", "$", "dest...
Publish files from a given path. @param string $package @param string $source @return bool
[ "Publish", "files", "from", "a", "given", "path", "." ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/publisher/src/Publishing/Publisher.php#L83-L89
228,336
antaresproject/core
src/components/support/src/Providers/Traits/FilterProviderTrait.php
FilterProviderTrait.registerRouteFilters
protected function registerRouteFilters(Router $router) { foreach ( ( array ) $this->before as $before ) { $router->before ( $before ); } foreach ( ( array ) $this->after as $after ) { $router->after ( $after ); } foreach ( ( array ) $this->filters as $name => $filter ) { $router->filter ( $nam...
php
protected function registerRouteFilters(Router $router) { foreach ( ( array ) $this->before as $before ) { $router->before ( $before ); } foreach ( ( array ) $this->after as $after ) { $router->after ( $after ); } foreach ( ( array ) $this->filters as $name => $filter ) { $router->filter ( $nam...
[ "protected", "function", "registerRouteFilters", "(", "Router", "$", "router", ")", "{", "foreach", "(", "(", "array", ")", "$", "this", "->", "before", "as", "$", "before", ")", "{", "$", "router", "->", "before", "(", "$", "before", ")", ";", "}", ...
Register route filters. @param \Illuminate\Routing\Router $router @return void
[ "Register", "route", "filters", "." ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/support/src/Providers/Traits/FilterProviderTrait.php#L36-L48
228,337
antaresproject/core
src/components/html/src/Memory/Handler.php
Handler.initiate
public function initiate() { $items = []; $memories = $this->cache instanceof Repository ? $this->getItemsFromCache() : $this->getItemsFromDatabase(); foreach ($memories as $memory) { $value = $memory->value; $items[$memory->name] = unserialize($valu...
php
public function initiate() { $items = []; $memories = $this->cache instanceof Repository ? $this->getItemsFromCache() : $this->getItemsFromDatabase(); foreach ($memories as $memory) { $value = $memory->value; $items[$memory->name] = unserialize($valu...
[ "public", "function", "initiate", "(", ")", "{", "$", "items", "=", "[", "]", ";", "$", "memories", "=", "$", "this", "->", "cache", "instanceof", "Repository", "?", "$", "this", "->", "getItemsFromCache", "(", ")", ":", "$", "this", "->", "getItemsFro...
Load the data from database. @return array
[ "Load", "the", "data", "from", "database", "." ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/html/src/Memory/Handler.php#L115-L129
228,338
gggeek/ggwebservices
classes/ggwebservicesjscfunctions.php
ggwebservicesJSCFunctions.listMethods
static function listMethods( ) { $methods = array(); $ini = eZINI::Instance( 'ezjscore.ini' ); foreach( $ini->groups() as $blockname => $data ) { if ( strpos( $blockname, 'ezjscServer_' ) === 0 ) { $classname = substr( $blockname, 12 );...
php
static function listMethods( ) { $methods = array(); $ini = eZINI::Instance( 'ezjscore.ini' ); foreach( $ini->groups() as $blockname => $data ) { if ( strpos( $blockname, 'ezjscServer_' ) === 0 ) { $classname = substr( $blockname, 12 );...
[ "static", "function", "listMethods", "(", ")", "{", "$", "methods", "=", "array", "(", ")", ";", "$", "ini", "=", "eZINI", "::", "Instance", "(", "'ezjscore.ini'", ")", ";", "foreach", "(", "$", "ini", "->", "groups", "(", ")", "as", "$", "blockname"...
Returns the list of all webservices available on this server @return array
[ "Returns", "the", "list", "of", "all", "webservices", "available", "on", "this", "server" ]
4f6e1ada1aa94301acd2ef3cd0966c7be06313ec
https://github.com/gggeek/ggwebservices/blob/4f6e1ada1aa94301acd2ef3cd0966c7be06313ec/classes/ggwebservicesjscfunctions.php#L19-L65
228,339
FlorianWolters/PHP-Component-Core-StringUtils
src/main/php/StringUtils.php
StringUtils.chomp
public static function chomp($str) { if (true === self::isEmpty($str)) { return $str; } if (1 === self::length($str)) { $firstChar = self::charAt($str, 0); if ("\r" === $firstChar || "\n" === $firstChar) { return self::EMPTY_STR; ...
php
public static function chomp($str) { if (true === self::isEmpty($str)) { return $str; } if (1 === self::length($str)) { $firstChar = self::charAt($str, 0); if ("\r" === $firstChar || "\n" === $firstChar) { return self::EMPTY_STR; ...
[ "public", "static", "function", "chomp", "(", "$", "str", ")", "{", "if", "(", "true", "===", "self", "::", "isEmpty", "(", "$", "str", ")", ")", "{", "return", "$", "str", ";", "}", "if", "(", "1", "===", "self", "::", "length", "(", "$", "str...
Removes one newline from end of a string if it's there, otherwise leave it alone. A newline is "`\n`", "`\r`", or "`\r\n`". StringUtils::chomp(null); // null StringUtils::chomp(''); // '' StringUtils::chomp("abc \r"); // 'abc ' StringUtils::chomp("abc\n"); // 'abc' StringUtils::chomp("a...
[ "Removes", "one", "newline", "from", "end", "of", "a", "string", "if", "it", "s", "there", "otherwise", "leave", "it", "alone", "." ]
3b5e8762031cf66d6441ee98772fae4be0f5d0aa
https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/StringUtils.php#L105-L133
228,340
FlorianWolters/PHP-Component-Core-StringUtils
src/main/php/StringUtils.php
StringUtils.chop
public static function chop($str) { if (true === self::isEmpty($str)) { return $str; } if ("\r\n" === \substr($str, -2)) { return \substr($str, 0, -2); } return \substr($str, 0, -1); }
php
public static function chop($str) { if (true === self::isEmpty($str)) { return $str; } if ("\r\n" === \substr($str, -2)) { return \substr($str, 0, -2); } return \substr($str, 0, -1); }
[ "public", "static", "function", "chop", "(", "$", "str", ")", "{", "if", "(", "true", "===", "self", "::", "isEmpty", "(", "$", "str", ")", ")", "{", "return", "$", "str", ";", "}", "if", "(", "\"\\r\\n\"", "===", "\\", "substr", "(", "$", "str",...
Remove the specified last character from a `string`. If the `string` ends in `\r\n`, then remove both of them. StringUtils::chop(null); // null StringUtils::chop(''); // '' StringUtils::chop("abc \r"); // 'abc ' StringUtils::chop("abc\n"); // 'abc' StringUtils::chop("abc\r\n"); // 'abc' StringUtil...
[ "Remove", "the", "specified", "last", "character", "from", "a", "string", "." ]
3b5e8762031cf66d6441ee98772fae4be0f5d0aa
https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/StringUtils.php#L157-L168
228,341
FlorianWolters/PHP-Component-Core-StringUtils
src/main/php/StringUtils.php
StringUtils.replace
public static function replace($text, $search, $replace, $max = -1) { if ((true === self::isEmpty($text)) || (true === self::isEmpty($search)) || (null === $replace) || (0 === $max) ) { return $text; } return \preg_replace( ...
php
public static function replace($text, $search, $replace, $max = -1) { if ((true === self::isEmpty($text)) || (true === self::isEmpty($search)) || (null === $replace) || (0 === $max) ) { return $text; } return \preg_replace( ...
[ "public", "static", "function", "replace", "(", "$", "text", ",", "$", "search", ",", "$", "replace", ",", "$", "max", "=", "-", "1", ")", "{", "if", "(", "(", "true", "===", "self", "::", "isEmpty", "(", "$", "text", ")", ")", "||", "(", "true...
Replaces a `string` with another `string` inside a larger `string`, for the first maximum number of values to replace of the search `string`. StringUtils::replace(null, *, *, *) // null StringUtils::replace('', *, *, *) // '' StringUtils::replace('any', null, *, *) // 'any' StringUtils::replace('...
[ "Replaces", "a", "string", "with", "another", "string", "inside", "a", "larger", "string", "for", "the", "first", "maximum", "number", "of", "values", "to", "replace", "of", "the", "search", "string", "." ]
3b5e8762031cf66d6441ee98772fae4be0f5d0aa
https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/StringUtils.php#L328-L344
228,342
FlorianWolters/PHP-Component-Core-StringUtils
src/main/php/StringUtils.php
StringUtils.strip
public static function strip($str, $chars) { return (true === self::isEmpty($str)) ? $str : self::stripEnd(self::stripStart($str, $chars), $chars); }
php
public static function strip($str, $chars) { return (true === self::isEmpty($str)) ? $str : self::stripEnd(self::stripStart($str, $chars), $chars); }
[ "public", "static", "function", "strip", "(", "$", "str", ",", "$", "chars", ")", "{", "return", "(", "true", "===", "self", "::", "isEmpty", "(", "$", "str", ")", ")", "?", "$", "str", ":", "self", "::", "stripEnd", "(", "self", "::", "stripStart"...
Strips any of a set of characters from the start and end of a `string`. This is similar to {@see trim} but allows the characters to be stripped to be controlled. A `null` input `string` returns `null`. An empty string (`''`) input returns the empty `string`. If the `string` for the characters to remove is `null`, wh...
[ "Strips", "any", "of", "a", "set", "of", "characters", "from", "the", "start", "and", "end", "of", "a", "string", "." ]
3b5e8762031cf66d6441ee98772fae4be0f5d0aa
https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/StringUtils.php#L458-L463
228,343
FlorianWolters/PHP-Component-Core-StringUtils
src/main/php/StringUtils.php
StringUtils.stripToEmpty
public static function stripToEmpty($str) { return (null === $str) ? self::EMPTY_STR : self::strip($str, null); }
php
public static function stripToEmpty($str) { return (null === $str) ? self::EMPTY_STR : self::strip($str, null); }
[ "public", "static", "function", "stripToEmpty", "(", "$", "str", ")", "{", "return", "(", "null", "===", "$", "str", ")", "?", "self", "::", "EMPTY_STR", ":", "self", "::", "strip", "(", "$", "str", ",", "null", ")", ";", "}" ]
Strips whitespace from the start and end of a `string` returning an empty `string` if `null` input. This is similar to {@see trimToEmpty} but removes whitespace. StringUtils::stripToEmpty(null); // '' StringUtils::stripToEmpty(''); // '' StringUtils::stripToEmpty(' '); // '' StringUtils::stripToEmpty('...
[ "Strips", "whitespace", "from", "the", "start", "and", "end", "of", "a", "string", "returning", "an", "empty", "string", "if", "null", "input", "." ]
3b5e8762031cf66d6441ee98772fae4be0f5d0aa
https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/StringUtils.php#L485-L490
228,344
FlorianWolters/PHP-Component-Core-StringUtils
src/main/php/StringUtils.php
StringUtils.stripStart
public static function stripStart($str, $chars) { if (true === self::isEmpty($str)) { return $str; } return (null === $chars) ? \ltrim($str) : \ltrim($str, $chars); }
php
public static function stripStart($str, $chars) { if (true === self::isEmpty($str)) { return $str; } return (null === $chars) ? \ltrim($str) : \ltrim($str, $chars); }
[ "public", "static", "function", "stripStart", "(", "$", "str", ",", "$", "chars", ")", "{", "if", "(", "true", "===", "self", "::", "isEmpty", "(", "$", "str", ")", ")", "{", "return", "$", "str", ";", "}", "return", "(", "null", "===", "$", "cha...
Strips any of a set of characters from the start of a `string`. A `null` input `string` returns `null`. An empty string (`''`) input returns the empty `string`. If the `string` for the characters to remove is `null`, whitespace is stripped. StringUtils::stripStart(null, *); // null StringUtils::stripStart('...
[ "Strips", "any", "of", "a", "set", "of", "characters", "from", "the", "start", "of", "a", "string", "." ]
3b5e8762031cf66d6441ee98772fae4be0f5d0aa
https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/StringUtils.php#L546-L555
228,345
FlorianWolters/PHP-Component-Core-StringUtils
src/main/php/StringUtils.php
StringUtils.stripEnd
public static function stripEnd($str, $chars) { if (true === self::isEmpty($str)) { return $str; } return (null === $chars) ? \rtrim($str) : \rtrim($str, $chars); }
php
public static function stripEnd($str, $chars) { if (true === self::isEmpty($str)) { return $str; } return (null === $chars) ? \rtrim($str) : \rtrim($str, $chars); }
[ "public", "static", "function", "stripEnd", "(", "$", "str", ",", "$", "chars", ")", "{", "if", "(", "true", "===", "self", "::", "isEmpty", "(", "$", "str", ")", ")", "{", "return", "$", "str", ";", "}", "return", "(", "null", "===", "$", "chars...
Strips any of a set of characters from the end of a `string`. A `null` input `string` returns `null`. An empty string (`''`) input returns the empty `string`. If the `string` for the characters to remove is `null`, whitespace is stripped. StringUtils::stripEnd(null, *) = null StringUtils::stripEnd('', *) ...
[ "Strips", "any", "of", "a", "set", "of", "characters", "from", "the", "end", "of", "a", "string", "." ]
3b5e8762031cf66d6441ee98772fae4be0f5d0aa
https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/StringUtils.php#L582-L591
228,346
FlorianWolters/PHP-Component-Core-StringUtils
src/main/php/StringUtils.php
StringUtils.equalsIgnoreCase
public static function equalsIgnoreCase($str1, $str2) { return (null === $str1) ? (null === $str2) : (self::lowercase($str1) === self::lowercase($str2)); }
php
public static function equalsIgnoreCase($str1, $str2) { return (null === $str1) ? (null === $str2) : (self::lowercase($str1) === self::lowercase($str2)); }
[ "public", "static", "function", "equalsIgnoreCase", "(", "$", "str1", ",", "$", "str2", ")", "{", "return", "(", "null", "===", "$", "str1", ")", "?", "(", "null", "===", "$", "str2", ")", ":", "(", "self", "::", "lowercase", "(", "$", "str1", ")",...
Compares two `string`s, returning `true` if they are equal ignoring the case. `null`s are handled without exceptions. Two `null` references are considered to be equal. The comparison is case insensitive. StringUtils::equalsIgnoreCase(null, null); // true StringUtils::equalsIgnoreCase(null, 'abc'); // false StringU...
[ "Compares", "two", "string", "s", "returning", "true", "if", "they", "are", "equal", "ignoring", "the", "case", "." ]
3b5e8762031cf66d6441ee98772fae4be0f5d0aa
https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/StringUtils.php#L689-L694
228,347
FlorianWolters/PHP-Component-Core-StringUtils
src/main/php/StringUtils.php
StringUtils.indexOf
public static function indexOf($str, $search, $startPos = 0) { $result = self::validateIndexOf($str, $search, $startPos); if (true !== $result) { return $result; } if (true === self::isEmpty($search)) { return $startPos; } $pos = \strpos($str...
php
public static function indexOf($str, $search, $startPos = 0) { $result = self::validateIndexOf($str, $search, $startPos); if (true !== $result) { return $result; } if (true === self::isEmpty($search)) { return $startPos; } $pos = \strpos($str...
[ "public", "static", "function", "indexOf", "(", "$", "str", ",", "$", "search", ",", "$", "startPos", "=", "0", ")", "{", "$", "result", "=", "self", "::", "validateIndexOf", "(", "$", "str", ",", "$", "search", ",", "$", "startPos", ")", ";", "if"...
Finds the first index within a `string` from a start position, handling `null`. A `null` or empty (`''`) `string` will return `-1`. A negative start position is treated as zero. A start position greater than the string length returns `-1`. StringUtils::indexOf(null, *, *); // -1 StringUtils::indexOf(*, null,...
[ "Finds", "the", "first", "index", "within", "a", "string", "from", "a", "start", "position", "handling", "null", "." ]
3b5e8762031cf66d6441ee98772fae4be0f5d0aa
https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/StringUtils.php#L723-L739
228,348
FlorianWolters/PHP-Component-Core-StringUtils
src/main/php/StringUtils.php
StringUtils.lastIndexOf
public static function lastIndexOf($str, $search, $startPos = 0) { $result = self::validateIndexOf($str, $search, $startPos); if (true !== $result) { return $result; } if (true === self::isEmpty($search)) { return $startPos; } $pos = \strrpos...
php
public static function lastIndexOf($str, $search, $startPos = 0) { $result = self::validateIndexOf($str, $search, $startPos); if (true !== $result) { return $result; } if (true === self::isEmpty($search)) { return $startPos; } $pos = \strrpos...
[ "public", "static", "function", "lastIndexOf", "(", "$", "str", ",", "$", "search", ",", "$", "startPos", "=", "0", ")", "{", "$", "result", "=", "self", "::", "validateIndexOf", "(", "$", "str", ",", "$", "search", ",", "$", "startPos", ")", ";", ...
Finds the first index within a `string`, handling `null`. A `null` `string` will return `-1`. A negative start position returns `-1`. An empty (`''`) search `string` always matches unless the start position is negative. A start position greater than the `string` length searches the whole `string`. StringUtils::lastIn...
[ "Finds", "the", "first", "index", "within", "a", "string", "handling", "null", "." ]
3b5e8762031cf66d6441ee98772fae4be0f5d0aa
https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/StringUtils.php#L801-L817
228,349
FlorianWolters/PHP-Component-Core-StringUtils
src/main/php/StringUtils.php
StringUtils.split
public static function split($str, $chars = null, $max = 0) { $result = self::EMPTY_STR; if (null === $str) { return null; } if (self::EMPTY_STR === $str) { return array(); } if (null === $chars) { $result = \preg_split('/\s+/', ...
php
public static function split($str, $chars = null, $max = 0) { $result = self::EMPTY_STR; if (null === $str) { return null; } if (self::EMPTY_STR === $str) { return array(); } if (null === $chars) { $result = \preg_split('/\s+/', ...
[ "public", "static", "function", "split", "(", "$", "str", ",", "$", "chars", "=", "null", ",", "$", "max", "=", "0", ")", "{", "$", "result", "=", "self", "::", "EMPTY_STR", ";", "if", "(", "null", "===", "$", "str", ")", "{", "return", "null", ...
Splits the provided text into an `array` with a maximum length, separators specified. The separator is not included in the returned `string` `array`. Adjacent separators are treated as one separator. A `null` input `string` returns `null`. A `null` $chars splits on whitespace. If more than $max delimited substrings ar...
[ "Splits", "the", "provided", "text", "into", "an", "array", "with", "a", "maximum", "length", "separators", "specified", "." ]
3b5e8762031cf66d6441ee98772fae4be0f5d0aa
https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/StringUtils.php#L850-L871
228,350
FlorianWolters/PHP-Component-Core-StringUtils
src/main/php/StringUtils.php
StringUtils.substring
public static function substring($str, $start, $end = null) { if ((0 > $start) && (0 < $end)) { $start = 0; } if (null === $end) { $end = self::length($str); } return \substr($str, $start, $end - $start); }
php
public static function substring($str, $start, $end = null) { if ((0 > $start) && (0 < $end)) { $start = 0; } if (null === $end) { $end = self::length($str); } return \substr($str, $start, $end - $start); }
[ "public", "static", "function", "substring", "(", "$", "str", ",", "$", "start", ",", "$", "end", "=", "null", ")", "{", "if", "(", "(", "0", ">", "$", "start", ")", "&&", "(", "0", "<", "$", "end", ")", ")", "{", "$", "start", "=", "0", ";...
Gets a substring from the specified `string` avoiding exceptions. A negative start position can be used to start/end *n* characters from the end of the `string`. The returned substring starts with the character in the `$start` position and ends before the `$end` position. All position counting is zero-based -- i.e., ...
[ "Gets", "a", "substring", "from", "the", "specified", "string", "avoiding", "exceptions", "." ]
3b5e8762031cf66d6441ee98772fae4be0f5d0aa
https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/StringUtils.php#L915-L926
228,351
FlorianWolters/PHP-Component-Core-StringUtils
src/main/php/StringUtils.php
StringUtils.substringAfter
public static function substringAfter($str, $separator) { if (true === self::isEmpty($str)) { return $str; } if (null === $separator) { return self::EMPTY_STR; } $pos = self::indexOf($str, $separator); if (self::INDEX_NOT_FOUND === $pos) { ...
php
public static function substringAfter($str, $separator) { if (true === self::isEmpty($str)) { return $str; } if (null === $separator) { return self::EMPTY_STR; } $pos = self::indexOf($str, $separator); if (self::INDEX_NOT_FOUND === $pos) { ...
[ "public", "static", "function", "substringAfter", "(", "$", "str", ",", "$", "separator", ")", "{", "if", "(", "true", "===", "self", "::", "isEmpty", "(", "$", "str", ")", ")", "{", "return", "$", "str", ";", "}", "if", "(", "null", "===", "$", ...
Gets the substring after the first occurrence of a separator. The separator is not returned. A `null` `string` input will return `null`. An empty (`''`) `string` input will return the empty `string`. A `null` separator will return the empty `string` if the input `string` is not `null`. If nothing is found, the empty...
[ "Gets", "the", "substring", "after", "the", "first", "occurrence", "of", "a", "separator", "." ]
3b5e8762031cf66d6441ee98772fae4be0f5d0aa
https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/StringUtils.php#L955-L972
228,352
FlorianWolters/PHP-Component-Core-StringUtils
src/main/php/StringUtils.php
StringUtils.substringAfterLast
public static function substringAfterLast($str, $separator) { if (true === self::isEmpty($str)) { return $str; } if (true === self::isEmpty($separator)) { return self::EMPTY_STR; } $pos = self::lastIndexOf($str, $separator); if (self::INDEX_...
php
public static function substringAfterLast($str, $separator) { if (true === self::isEmpty($str)) { return $str; } if (true === self::isEmpty($separator)) { return self::EMPTY_STR; } $pos = self::lastIndexOf($str, $separator); if (self::INDEX_...
[ "public", "static", "function", "substringAfterLast", "(", "$", "str", ",", "$", "separator", ")", "{", "if", "(", "true", "===", "self", "::", "isEmpty", "(", "$", "str", ")", ")", "{", "return", "$", "str", ";", "}", "if", "(", "true", "===", "se...
Gets the substring after the last occurrence of a separator. The separator is not returned. A `null` `string` input will return `null`. An empty (`''`) `string` input will return the empty `string`. An empty or `null` separator will return the empty `string` if the input `string` is not `null`. If nothing is found, ...
[ "Gets", "the", "substring", "after", "the", "last", "occurrence", "of", "a", "separator", "." ]
3b5e8762031cf66d6441ee98772fae4be0f5d0aa
https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/StringUtils.php#L1002-L1021
228,353
FlorianWolters/PHP-Component-Core-StringUtils
src/main/php/StringUtils.php
StringUtils.substringBeforeLast
public static function substringBeforeLast($str, $separator) { if ((true === self::isEmpty($str)) || (true === self::isEmpty($separator)) ) { return $str; } $pos = self::lastIndexOf($str, $separator); if (self::INDEX_NOT_FOUND === $pos) { ...
php
public static function substringBeforeLast($str, $separator) { if ((true === self::isEmpty($str)) || (true === self::isEmpty($separator)) ) { return $str; } $pos = self::lastIndexOf($str, $separator); if (self::INDEX_NOT_FOUND === $pos) { ...
[ "public", "static", "function", "substringBeforeLast", "(", "$", "str", ",", "$", "separator", ")", "{", "if", "(", "(", "true", "===", "self", "::", "isEmpty", "(", "$", "str", ")", ")", "||", "(", "true", "===", "self", "::", "isEmpty", "(", "$", ...
Gets the substring before the last occurrence of a separator. The separator is not returned. A `null` `string` input will return `null`. An empty (`''`) `string` input will return the empty `string`. An empty or `null` separator will return the input `string`. If nothing is found, the `string` input is returned. St...
[ "Gets", "the", "substring", "before", "the", "last", "occurrence", "of", "a", "separator", "." ]
3b5e8762031cf66d6441ee98772fae4be0f5d0aa
https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/StringUtils.php#L1094-L1109
228,354
FlorianWolters/PHP-Component-Core-StringUtils
src/main/php/StringUtils.php
StringUtils.substringBetween
public static function substringBetween($str, $open, $close = null) { $result = null; if (null === $close) { $close = $open; } $startPos = self::indexOf($str, $open); if (self::INDEX_NOT_FOUND !== $startPos) { $startPos += self::length($open); ...
php
public static function substringBetween($str, $open, $close = null) { $result = null; if (null === $close) { $close = $open; } $startPos = self::indexOf($str, $open); if (self::INDEX_NOT_FOUND !== $startPos) { $startPos += self::length($open); ...
[ "public", "static", "function", "substringBetween", "(", "$", "str", ",", "$", "open", ",", "$", "close", "=", "null", ")", "{", "$", "result", "=", "null", ";", "if", "(", "null", "===", "$", "close", ")", "{", "$", "close", "=", "$", "open", ";...
Gets the `string` that is nested in between two `string`s. Only the first match is returned. A `null` input `string` returns `null`. A `null` `$open`/`$close` returns `null` (no match). An empty (`''`) `$open` and `$close` returns an empty `string`. StringUtils::substringBetween('wx[b]yz', '[', ']'); // 'b' Strin...
[ "Gets", "the", "string", "that", "is", "nested", "in", "between", "two", "string", "s", "." ]
3b5e8762031cf66d6441ee98772fae4be0f5d0aa
https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/StringUtils.php#L1140-L1160
228,355
FlorianWolters/PHP-Component-Core-StringUtils
src/main/php/StringUtils.php
StringUtils.repeat
public static function repeat($str, $repeat, $separator = null) { $result = self::EMPTY_STR; if ((null === $str) || (null === $separator)) { $result = \str_repeat($str, $repeat); } else { $result = \str_repeat($str . $separator, $repeat); if (true === se...
php
public static function repeat($str, $repeat, $separator = null) { $result = self::EMPTY_STR; if ((null === $str) || (null === $separator)) { $result = \str_repeat($str, $repeat); } else { $result = \str_repeat($str . $separator, $repeat); if (true === se...
[ "public", "static", "function", "repeat", "(", "$", "str", ",", "$", "repeat", ",", "$", "separator", "=", "null", ")", "{", "$", "result", "=", "self", "::", "EMPTY_STR", ";", "if", "(", "(", "null", "===", "$", "str", ")", "||", "(", "null", "=...
Repeats a `string` the specified number of times to form a new `string`, with a specified `string` injected each time. StringUtils::repeat(null, 2, null); // null StringUtils::repeat(null, 2, 'x'); // null StringUtils::repeat('', 0, null); // '' StringUtils::repeat('', 2, ''); // '' StringUtils::repeat('', 3, '...
[ "Repeats", "a", "string", "the", "specified", "number", "of", "times", "to", "form", "a", "new", "string", "with", "a", "specified", "string", "injected", "each", "time", "." ]
3b5e8762031cf66d6441ee98772fae4be0f5d0aa
https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/StringUtils.php#L1233-L1248
228,356
FlorianWolters/PHP-Component-Core-StringUtils
src/main/php/StringUtils.php
StringUtils.endsWith
public static function endsWith($str, $suffix) { return ((null === $str) && (null === $suffix)) ? true : self::substring( $str, self::length($str) - self::length($suffix) ) === $suffix; }
php
public static function endsWith($str, $suffix) { return ((null === $str) && (null === $suffix)) ? true : self::substring( $str, self::length($str) - self::length($suffix) ) === $suffix; }
[ "public", "static", "function", "endsWith", "(", "$", "str", ",", "$", "suffix", ")", "{", "return", "(", "(", "null", "===", "$", "str", ")", "&&", "(", "null", "===", "$", "suffix", ")", ")", "?", "true", ":", "self", "::", "substring", "(", "$...
Checks if a `string` ends with a specified suffix. `null`s are handled without exceptions. Two `null` references are considered to be equal. The comparison is case sensitive. StringUtils::endsWith(null, null); // true StringUtils::endsWith(null, 'def'); // false StringUtils::endsWith('abcdef', null); // fal...
[ "Checks", "if", "a", "string", "ends", "with", "a", "specified", "suffix", "." ]
3b5e8762031cf66d6441ee98772fae4be0f5d0aa
https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/StringUtils.php#L1273-L1281
228,357
FlorianWolters/PHP-Component-Core-StringUtils
src/main/php/StringUtils.php
StringUtils.startsWith
public static function startsWith($str, $prefix) { return ((null === $str) && (null === $prefix)) ? true : self::substring($str, 0, self::length($prefix)) === $prefix; }
php
public static function startsWith($str, $prefix) { return ((null === $str) && (null === $prefix)) ? true : self::substring($str, 0, self::length($prefix)) === $prefix; }
[ "public", "static", "function", "startsWith", "(", "$", "str", ",", "$", "prefix", ")", "{", "return", "(", "(", "null", "===", "$", "str", ")", "&&", "(", "null", "===", "$", "prefix", ")", ")", "?", "true", ":", "self", "::", "substring", "(", ...
Checks if a `string` starts with a specified prefix. `null`s are handled without exceptions. Two `null` references are considered to be equal. The comparison is case sensitive. StringUtils::startsWith(null, null); // true StringUtils::startsWith(null, 'abc'); // false StringUtils::startsWith('abcdef', null);...
[ "Checks", "if", "a", "string", "starts", "with", "a", "specified", "prefix", "." ]
3b5e8762031cf66d6441ee98772fae4be0f5d0aa
https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/StringUtils.php#L1301-L1306
228,358
FlorianWolters/PHP-Component-Core-StringUtils
src/main/php/StringUtils.php
StringUtils.removeEnd
public static function removeEnd($str, $remove) { if ((true === self::isEmpty($str)) || (true === self::isEmpty($remove)) ) { return $str; } if (true === self::endsWith($str, $remove)) { return self::substring( $str, ...
php
public static function removeEnd($str, $remove) { if ((true === self::isEmpty($str)) || (true === self::isEmpty($remove)) ) { return $str; } if (true === self::endsWith($str, $remove)) { return self::substring( $str, ...
[ "public", "static", "function", "removeEnd", "(", "$", "str", ",", "$", "remove", ")", "{", "if", "(", "(", "true", "===", "self", "::", "isEmpty", "(", "$", "str", ")", ")", "||", "(", "true", "===", "self", "::", "isEmpty", "(", "$", "remove", ...
Removes a substring only if it is at the end of a source `string`, otherwise returns the source `string`. A `null` source `string` will return `null`. An empty (`''`) source `string` will return the empty `string`. A `null` search `string` will return the source `string`. StringUtils::removeEnd(null, *); ...
[ "Removes", "a", "substring", "only", "if", "it", "is", "at", "the", "end", "of", "a", "source", "string", "otherwise", "returns", "the", "source", "string", "." ]
3b5e8762031cf66d6441ee98772fae4be0f5d0aa
https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/StringUtils.php#L1334-L1351
228,359
FlorianWolters/PHP-Component-Core-StringUtils
src/main/php/StringUtils.php
StringUtils.removeStart
public static function removeStart($str, $remove) { if ((true === self::isEmpty($str)) || (true === self::isEmpty($remove)) ) { return $str; } if (true === self::startsWith($str, $remove)) { return self::substring($str, self::length($remove)); ...
php
public static function removeStart($str, $remove) { if ((true === self::isEmpty($str)) || (true === self::isEmpty($remove)) ) { return $str; } if (true === self::startsWith($str, $remove)) { return self::substring($str, self::length($remove)); ...
[ "public", "static", "function", "removeStart", "(", "$", "str", ",", "$", "remove", ")", "{", "if", "(", "(", "true", "===", "self", "::", "isEmpty", "(", "$", "str", ")", ")", "||", "(", "true", "===", "self", "::", "isEmpty", "(", "$", "remove", ...
Removes a substring only if it is at the beginning of a source `string`, otherwise returns the source `string`. A `null` source string will return `null`. An empty (`''`) source `string` will return the empty `string`. A `null` search `string` will return the source `string`. StringUtils::removeStart(null, *); ...
[ "Removes", "a", "substring", "only", "if", "it", "is", "at", "the", "beginning", "of", "a", "source", "string", "otherwise", "returns", "the", "source", "string", "." ]
3b5e8762031cf66d6441ee98772fae4be0f5d0aa
https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/StringUtils.php#L1375-L1388
228,360
antaresproject/core
src/components/html/src/Adapter/CustomfieldAdapter.php
CustomfieldAdapter.adapt
public function adapt(Grid &$grid) { $this->grid = $grid; $customfields = app('customfields')->get(); if (empty($customfields)) { return; } foreach ($customfields as $classname => $customfield) { if (is_array($grid->row)) { continue;...
php
public function adapt(Grid &$grid) { $this->grid = $grid; $customfields = app('customfields')->get(); if (empty($customfields)) { return; } foreach ($customfields as $classname => $customfield) { if (is_array($grid->row)) { continue;...
[ "public", "function", "adapt", "(", "Grid", "&", "$", "grid", ")", "{", "$", "this", "->", "grid", "=", "$", "grid", ";", "$", "customfields", "=", "app", "(", "'customfields'", ")", "->", "get", "(", ")", ";", "if", "(", "empty", "(", "$", "cust...
Adapts customfields to form grid @param Grid $grid
[ "Adapts", "customfields", "to", "form", "grid" ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/html/src/Adapter/CustomfieldAdapter.php#L44-L93
228,361
antaresproject/core
src/components/html/src/Adapter/CustomfieldAdapter.php
CustomfieldAdapter.addToForm
protected function addToForm(CustomField $customfield) { if (!$customfield->formAutoDisplay()) { return false; } $field = $customfield->setModel($this->grid->row); $this->grid->fieldset(function (Fieldset $fieldset) use($field) { $fieldset->add($field); ...
php
protected function addToForm(CustomField $customfield) { if (!$customfield->formAutoDisplay()) { return false; } $field = $customfield->setModel($this->grid->row); $this->grid->fieldset(function (Fieldset $fieldset) use($field) { $fieldset->add($field); ...
[ "protected", "function", "addToForm", "(", "CustomField", "$", "customfield", ")", "{", "if", "(", "!", "$", "customfield", "->", "formAutoDisplay", "(", ")", ")", "{", "return", "false", ";", "}", "$", "field", "=", "$", "customfield", "->", "setModel", ...
Assigns customfield to form @param CustomField $customfield @return $this
[ "Assigns", "customfield", "to", "form" ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/html/src/Adapter/CustomfieldAdapter.php#L101-L123
228,362
lawoole/framework
src/Server/Console/ReloadCommand.php
ReloadCommand.getServerRuntime
protected function getServerRuntime() { $filename = $this->option('filename') ?? storage_path('framework/server.runtime'); if (! file_exists($filename)) { return null; } return json_decode(file_get_contents($filename), true); }
php
protected function getServerRuntime() { $filename = $this->option('filename') ?? storage_path('framework/server.runtime'); if (! file_exists($filename)) { return null; } return json_decode(file_get_contents($filename), true); }
[ "protected", "function", "getServerRuntime", "(", ")", "{", "$", "filename", "=", "$", "this", "->", "option", "(", "'filename'", ")", "??", "storage_path", "(", "'framework/server.runtime'", ")", ";", "if", "(", "!", "file_exists", "(", "$", "filename", ")"...
Get the running info. @return array
[ "Get", "the", "running", "info", "." ]
ac701a76f5d37c81273b7202ba37094766cb5dfe
https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Server/Console/ReloadCommand.php#L46-L55
228,363
antaresproject/core
src/components/model/src/UserMeta.php
UserMeta.scopeSearch
public function scopeSearch(Builder $query, $name, $userId) { return $query->where('user_id', '=', $userId)->where('name', '=', $name); }
php
public function scopeSearch(Builder $query, $name, $userId) { return $query->where('user_id', '=', $userId)->where('name', '=', $name); }
[ "public", "function", "scopeSearch", "(", "Builder", "$", "query", ",", "$", "name", ",", "$", "userId", ")", "{", "return", "$", "query", "->", "where", "(", "'user_id'", ",", "'='", ",", "$", "userId", ")", "->", "where", "(", "'name'", ",", "'='",...
Return a meta data belong to a user. @param \Illuminate\Database\Eloquent\Builder $query @param string $name @param int $userId @return \Illuminate\Database\Eloquent\Builder
[ "Return", "a", "meta", "data", "belong", "to", "a", "user", "." ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/model/src/UserMeta.php#L65-L68
228,364
antaresproject/core
src/components/html/src/HtmlBuilder.php
HtmlBuilder.decorate
public function decorate(array $attributes, array $defaults = []) { $class = $this->buildClassDecorate($attributes, $defaults); $attributes = array_merge($defaults, $attributes); empty($class) || $attributes['class'] = $class; return $attributes; }
php
public function decorate(array $attributes, array $defaults = []) { $class = $this->buildClassDecorate($attributes, $defaults); $attributes = array_merge($defaults, $attributes); empty($class) || $attributes['class'] = $class; return $attributes; }
[ "public", "function", "decorate", "(", "array", "$", "attributes", ",", "array", "$", "defaults", "=", "[", "]", ")", "{", "$", "class", "=", "$", "this", "->", "buildClassDecorate", "(", "$", "attributes", ",", "$", "defaults", ")", ";", "$", "attribu...
Build a list of HTML attributes from one or two array. @param array $attributes @param array $defaults @return array
[ "Build", "a", "list", "of", "HTML", "attributes", "from", "one", "or", "two", "array", "." ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/html/src/HtmlBuilder.php#L88-L97
228,365
antaresproject/core
src/components/html/src/HtmlBuilder.php
HtmlBuilder.buildClassDecorate
protected function buildClassDecorate(array $attributes, array $defaults = []) { $default = Arr::get($defaults, 'class', ''); $attribute = Arr::get($attributes, 'class', ''); $classes = explode(' ', trim($default.' '.$attribute)); $current = array_unique($class...
php
protected function buildClassDecorate(array $attributes, array $defaults = []) { $default = Arr::get($defaults, 'class', ''); $attribute = Arr::get($attributes, 'class', ''); $classes = explode(' ', trim($default.' '.$attribute)); $current = array_unique($class...
[ "protected", "function", "buildClassDecorate", "(", "array", "$", "attributes", ",", "array", "$", "defaults", "=", "[", "]", ")", "{", "$", "default", "=", "Arr", "::", "get", "(", "$", "defaults", ",", "'class'", ",", "''", ")", ";", "$", "attribute"...
Build class attribute from one or two array. @param array $attributes @param array $defaults @return string
[ "Build", "class", "attribute", "from", "one", "or", "two", "array", "." ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/html/src/HtmlBuilder.php#L107-L124
228,366
antaresproject/core
src/components/auth/src/Authorization/AuthorizationTrait.php
AuthorizationTrait.groupedAssignAction
protected function groupedAssignAction($role, array $actions, $allow = true) { foreach ($actions as $action) { if (!$this->actions->has($action)) { throw new InvalidArgumentException("Action {$action} does not exist."); } $this->assign($role, $action, $al...
php
protected function groupedAssignAction($role, array $actions, $allow = true) { foreach ($actions as $action) { if (!$this->actions->has($action)) { throw new InvalidArgumentException("Action {$action} does not exist."); } $this->assign($role, $action, $al...
[ "protected", "function", "groupedAssignAction", "(", "$", "role", ",", "array", "$", "actions", ",", "$", "allow", "=", "true", ")", "{", "foreach", "(", "$", "actions", "as", "$", "action", ")", "{", "if", "(", "!", "$", "this", "->", "actions", "->...
Grouped assign actions to have access. @param string $role @param array $actions @param bool $allow @return bool @throws \InvalidArgumentException
[ "Grouped", "assign", "actions", "to", "have", "access", "." ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/auth/src/Authorization/AuthorizationTrait.php#L126-L137
228,367
antaresproject/core
src/components/memory/resources/database/migrations/2016_11_16_152342_create_tbl_brand_options_table.php
CreateTblBrandOptionsTable.setDefaultOptions
protected function setDefaultOptions() { $areas = array_keys(config('areas.areas')); $default = config('areas.default'); $configuration = require_once(modules_path('core/brands/resources/config/install.php')); $countryId = Country::where('code', 'pl')->first()->id; ...
php
protected function setDefaultOptions() { $areas = array_keys(config('areas.areas')); $default = config('areas.default'); $configuration = require_once(modules_path('core/brands/resources/config/install.php')); $countryId = Country::where('code', 'pl')->first()->id; ...
[ "protected", "function", "setDefaultOptions", "(", ")", "{", "$", "areas", "=", "array_keys", "(", "config", "(", "'areas.areas'", ")", ")", ";", "$", "default", "=", "config", "(", "'areas.default'", ")", ";", "$", "configuration", "=", "require_once", "(",...
Sets brand default options @return void
[ "Sets", "brand", "default", "options" ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/memory/resources/database/migrations/2016_11_16_152342_create_tbl_brand_options_table.php#L81-L127
228,368
FlorianWolters/PHP-Component-Core-StringUtils
src/main/php/RandomStringUtils.php
RandomStringUtils.random
public static function random( $count, $startPosition = 0, $endPosition = 0, $letters = true, $numbers = true, array $characters = array() ) { if (0 === $count) { return StringUtils::EMPTY_STR; } if (0 > $count) { throw...
php
public static function random( $count, $startPosition = 0, $endPosition = 0, $letters = true, $numbers = true, array $characters = array() ) { if (0 === $count) { return StringUtils::EMPTY_STR; } if (0 > $count) { throw...
[ "public", "static", "function", "random", "(", "$", "count", ",", "$", "startPosition", "=", "0", ",", "$", "endPosition", "=", "0", ",", "$", "letters", "=", "true", ",", "$", "numbers", "=", "true", ",", "array", "$", "characters", "=", "array", "(...
Creates a random string based on a variety of options. If start and end are both `0`, `$startPosition` is set to `' '` and `$endPosition` is set to `'z'`, the ASCII printable characters, will be used, unless letters and numbers are both `false`, in which case, all printable characters are used that are *not* alphanume...
[ "Creates", "a", "random", "string", "based", "on", "a", "variety", "of", "options", "." ]
3b5e8762031cf66d6441ee98772fae4be0f5d0aa
https://github.com/FlorianWolters/PHP-Component-Core-StringUtils/blob/3b5e8762031cf66d6441ee98772fae4be0f5d0aa/src/main/php/RandomStringUtils.php#L165-L249
228,369
gggeek/ggwebservices
classes/ggsimpletemplatexml.php
ggSimpleTemplateXML.toArray
function toArray() { $out = array (); $attributes = $this->attribute( 'attributes' ); if ( count( $attributes ) ) { $out['attributes'] = $attributes; } $children = $this->attribute( 'children' ); foreach( $children as $name => $value ) { ...
php
function toArray() { $out = array (); $attributes = $this->attribute( 'attributes' ); if ( count( $attributes ) ) { $out['attributes'] = $attributes; } $children = $this->attribute( 'children' ); foreach( $children as $name => $value ) { ...
[ "function", "toArray", "(", ")", "{", "$", "out", "=", "array", "(", ")", ";", "$", "attributes", "=", "$", "this", "->", "attribute", "(", "'attributes'", ")", ";", "if", "(", "count", "(", "$", "attributes", ")", ")", "{", "$", "out", "[", "'at...
Try a useful conversion to an array structure. Useful for eg. dump calls
[ "Try", "a", "useful", "conversion", "to", "an", "array", "structure", ".", "Useful", "for", "eg", ".", "dump", "calls" ]
4f6e1ada1aa94301acd2ef3cd0966c7be06313ec
https://github.com/gggeek/ggwebservices/blob/4f6e1ada1aa94301acd2ef3cd0966c7be06313ec/classes/ggsimpletemplatexml.php#L157-L201
228,370
gggeek/ggwebservices
classes/ggsimpletemplatexml.php
ggSimpleTemplateXML.domNode2STX
protected static function domNode2STX( $node ) { if ( $node->hasAttributes() ) { return new ggSimpleTemplateXML( $node ); } foreach( $node->childNodes as $childNode ) { if ( $childNode->nodeType == XML_ELEMENT_NODE ) { return...
php
protected static function domNode2STX( $node ) { if ( $node->hasAttributes() ) { return new ggSimpleTemplateXML( $node ); } foreach( $node->childNodes as $childNode ) { if ( $childNode->nodeType == XML_ELEMENT_NODE ) { return...
[ "protected", "static", "function", "domNode2STX", "(", "$", "node", ")", "{", "if", "(", "$", "node", "->", "hasAttributes", "(", ")", ")", "{", "return", "new", "ggSimpleTemplateXML", "(", "$", "node", ")", ";", "}", "foreach", "(", "$", "node", "->",...
Returns either a ggSimpleTemplateXML wrapping a dom element or a string, based on whether the element has any attribute or child or none
[ "Returns", "either", "a", "ggSimpleTemplateXML", "wrapping", "a", "dom", "element", "or", "a", "string", "based", "on", "whether", "the", "element", "has", "any", "attribute", "or", "child", "or", "none" ]
4f6e1ada1aa94301acd2ef3cd0966c7be06313ec
https://github.com/gggeek/ggwebservices/blob/4f6e1ada1aa94301acd2ef3cd0966c7be06313ec/classes/ggsimpletemplatexml.php#L215-L229
228,371
akramfares/rundeck-sdk-php
src/Resources/Project.php
Project.resource
public function resource($name, $alt = "xml") { $response = $this->client->get('/project/'.$this->name. '/resource/' .$name, $alt); return $response; }
php
public function resource($name, $alt = "xml") { $response = $this->client->get('/project/'.$this->name. '/resource/' .$name, $alt); return $response; }
[ "public", "function", "resource", "(", "$", "name", ",", "$", "alt", "=", "\"xml\"", ")", "{", "$", "response", "=", "$", "this", "->", "client", "->", "get", "(", "'/project/'", ".", "$", "this", "->", "name", ".", "'/resource/'", ".", "$", "name", ...
Get project resource @param $name @param string $alt xml|json @return array
[ "Get", "project", "resource" ]
6a806c2830787b875dc8033e5c6883cbcb4b5abd
https://github.com/akramfares/rundeck-sdk-php/blob/6a806c2830787b875dc8033e5c6883cbcb4b5abd/src/Resources/Project.php#L65-L69
228,372
antaresproject/core
src/utils/asset/src/Factory.php
Factory.scriptsByParams
public function scriptsByParams(array $params = array()) { if (!isset($params['resources']) or ! isset($params['position'])) { return $this; } if (empty($params['resources'])) { return $this; } $container = $this->container($params['position']); ...
php
public function scriptsByParams(array $params = array()) { if (!isset($params['resources']) or ! isset($params['position'])) { return $this; } if (empty($params['resources'])) { return $this; } $container = $this->container($params['position']); ...
[ "public", "function", "scriptsByParams", "(", "array", "$", "params", "=", "array", "(", ")", ")", "{", "if", "(", "!", "isset", "(", "$", "params", "[", "'resources'", "]", ")", "or", "!", "isset", "(", "$", "params", "[", "'position'", "]", ")", ...
add scripts from params @param array $params @return \Antares\Asset\Factory
[ "add", "scripts", "from", "params" ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/utils/asset/src/Factory.php#L121-L135
228,373
lawoole/framework
src/Homer/Transport/ClientFactory.php
ClientFactory.client
public function client(array $config) { $key = $this->getClientKey($config); if (isset($this->clients[$key])) { return $this->clients[$key]; } return $this->clients[$key] = $this->createClient($config); }
php
public function client(array $config) { $key = $this->getClientKey($config); if (isset($this->clients[$key])) { return $this->clients[$key]; } return $this->clients[$key] = $this->createClient($config); }
[ "public", "function", "client", "(", "array", "$", "config", ")", "{", "$", "key", "=", "$", "this", "->", "getClientKey", "(", "$", "config", ")", ";", "if", "(", "isset", "(", "$", "this", "->", "clients", "[", "$", "key", "]", ")", ")", "{", ...
Get client instance. @param array $config @return \Lawoole\Homer\Transport\Client
[ "Get", "client", "instance", "." ]
ac701a76f5d37c81273b7202ba37094766cb5dfe
https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Homer/Transport/ClientFactory.php#L53-L62
228,374
lawoole/framework
src/Homer/Transport/ClientFactory.php
ClientFactory.createClient
protected function createClient(array $config) { $url = Arr::pull($config, 'url'); $urls = parse_url($url); $config['host'] = $urls['host']; $config['port'] = $urls['port']; switch ($urls['scheme']) { case 'http': return new HttpClient($this->ap...
php
protected function createClient(array $config) { $url = Arr::pull($config, 'url'); $urls = parse_url($url); $config['host'] = $urls['host']; $config['port'] = $urls['port']; switch ($urls['scheme']) { case 'http': return new HttpClient($this->ap...
[ "protected", "function", "createClient", "(", "array", "$", "config", ")", "{", "$", "url", "=", "Arr", "::", "pull", "(", "$", "config", ",", "'url'", ")", ";", "$", "urls", "=", "parse_url", "(", "$", "url", ")", ";", "$", "config", "[", "'host'"...
Create the client instance. @param array $config @return \Lawoole\Homer\Transport\Client
[ "Create", "the", "client", "instance", "." ]
ac701a76f5d37c81273b7202ba37094766cb5dfe
https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Homer/Transport/ClientFactory.php#L71-L88
228,375
lawoole/framework
src/Homer/Calling/ProxyFactory.php
ProxyFactory.proxy
public function proxy(Invoker $invoker) { $interface = $invoker->getInterface(); $className = $this->generateClassName($interface); $code = $this->populateStub($this->getStub(), $className, $interface); $this->load($className, $code); return $this->createProxyInstance($cl...
php
public function proxy(Invoker $invoker) { $interface = $invoker->getInterface(); $className = $this->generateClassName($interface); $code = $this->populateStub($this->getStub(), $className, $interface); $this->load($className, $code); return $this->createProxyInstance($cl...
[ "public", "function", "proxy", "(", "Invoker", "$", "invoker", ")", "{", "$", "interface", "=", "$", "invoker", "->", "getInterface", "(", ")", ";", "$", "className", "=", "$", "this", "->", "generateClassName", "(", "$", "interface", ")", ";", "$", "c...
Get a invoking proxy instance. @param \Lawoole\Homer\Calling\Invokers\Invoker $invoker @return mixed
[ "Get", "a", "invoking", "proxy", "instance", "." ]
ac701a76f5d37c81273b7202ba37094766cb5dfe
https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Homer/Calling/ProxyFactory.php#L27-L38
228,376
lawoole/framework
src/Homer/Calling/ProxyFactory.php
ProxyFactory.createProxyInstance
protected function createProxyInstance($className, $interface, Invoker $invoker) { $className = $this->getFullClassName($className); return new $className($interface, $invoker); }
php
protected function createProxyInstance($className, $interface, Invoker $invoker) { $className = $this->getFullClassName($className); return new $className($interface, $invoker); }
[ "protected", "function", "createProxyInstance", "(", "$", "className", ",", "$", "interface", ",", "Invoker", "$", "invoker", ")", "{", "$", "className", "=", "$", "this", "->", "getFullClassName", "(", "$", "className", ")", ";", "return", "new", "$", "cl...
Create a invoking proxy instance. @param string $className @param string $interface @param \Lawoole\Homer\Calling\Invokers\Invoker $invoker @return mixed
[ "Create", "a", "invoking", "proxy", "instance", "." ]
ac701a76f5d37c81273b7202ba37094766cb5dfe
https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Homer/Calling/ProxyFactory.php#L49-L54
228,377
lawoole/framework
src/Homer/Calling/ProxyFactory.php
ProxyFactory.load
protected function load($className, $code) { if (class_exists($this->getFullClassName($className), false)) { return; } eval('?>'.$code); }
php
protected function load($className, $code) { if (class_exists($this->getFullClassName($className), false)) { return; } eval('?>'.$code); }
[ "protected", "function", "load", "(", "$", "className", ",", "$", "code", ")", "{", "if", "(", "class_exists", "(", "$", "this", "->", "getFullClassName", "(", "$", "className", ")", ",", "false", ")", ")", "{", "return", ";", "}", "eval", "(", "'?>'...
Load the proxy class. @param string $className @param string $code
[ "Load", "the", "proxy", "class", "." ]
ac701a76f5d37c81273b7202ba37094766cb5dfe
https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Homer/Calling/ProxyFactory.php#L62-L69
228,378
lawoole/framework
src/Homer/Calling/ProxyFactory.php
ProxyFactory.populateStub
protected function populateStub($stub, $className, $interface) { $stub = str_replace('ProxyClass', $className, $stub); $stub = str_replace('ProxyInterface', '\\'.$interface, $stub); $stub = str_replace('// ## Implemented Methods ##', $this->getMethodDefinitions($interface), $stub); ...
php
protected function populateStub($stub, $className, $interface) { $stub = str_replace('ProxyClass', $className, $stub); $stub = str_replace('ProxyInterface', '\\'.$interface, $stub); $stub = str_replace('// ## Implemented Methods ##', $this->getMethodDefinitions($interface), $stub); ...
[ "protected", "function", "populateStub", "(", "$", "stub", ",", "$", "className", ",", "$", "interface", ")", "{", "$", "stub", "=", "str_replace", "(", "'ProxyClass'", ",", "$", "className", ",", "$", "stub", ")", ";", "$", "stub", "=", "str_replace", ...
Populate the place-holders in the proxy stub. @param string $stub @param string $className @param string $interface @return string
[ "Populate", "the", "place", "-", "holders", "in", "the", "proxy", "stub", "." ]
ac701a76f5d37c81273b7202ba37094766cb5dfe
https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Homer/Calling/ProxyFactory.php#L92-L100
228,379
lawoole/framework
src/Homer/Calling/ProxyFactory.php
ProxyFactory.getMethodDefinitions
protected function getMethodDefinitions($interface) { $definitions = []; try { $reflection = new ReflectionClass($interface); if (! $reflection->isInterface()) { throw new InvalidArgumentException("{$interface} must be an interface."); } ...
php
protected function getMethodDefinitions($interface) { $definitions = []; try { $reflection = new ReflectionClass($interface); if (! $reflection->isInterface()) { throw new InvalidArgumentException("{$interface} must be an interface."); } ...
[ "protected", "function", "getMethodDefinitions", "(", "$", "interface", ")", "{", "$", "definitions", "=", "[", "]", ";", "try", "{", "$", "reflection", "=", "new", "ReflectionClass", "(", "$", "interface", ")", ";", "if", "(", "!", "$", "reflection", "-...
Get interface's method definitions. @param string $interface @return string
[ "Get", "interface", "s", "method", "definitions", "." ]
ac701a76f5d37c81273b7202ba37094766cb5dfe
https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Homer/Calling/ProxyFactory.php#L109-L139
228,380
lawoole/framework
src/Homer/Calling/ProxyFactory.php
ProxyFactory.renderMethodParameters
protected function renderMethodParameters($method) { $parameters = []; foreach ($method->getParameters() as $parameter) { if ($parameter->isPassedByReference()) { throw new InvalidArgumentException(sprintf( 'Parameter [%s] in %s->%s cannot declared as...
php
protected function renderMethodParameters($method) { $parameters = []; foreach ($method->getParameters() as $parameter) { if ($parameter->isPassedByReference()) { throw new InvalidArgumentException(sprintf( 'Parameter [%s] in %s->%s cannot declared as...
[ "protected", "function", "renderMethodParameters", "(", "$", "method", ")", "{", "$", "parameters", "=", "[", "]", ";", "foreach", "(", "$", "method", "->", "getParameters", "(", ")", "as", "$", "parameter", ")", "{", "if", "(", "$", "parameter", "->", ...
Render method parameters definition. @param \ReflectionMethod $method @return string
[ "Render", "method", "parameters", "definition", "." ]
ac701a76f5d37c81273b7202ba37094766cb5dfe
https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Homer/Calling/ProxyFactory.php#L148-L176
228,381
lawoole/framework
src/Homer/Calling/ProxyFactory.php
ProxyFactory.renderParameterTypeHint
protected function renderParameterTypeHint($parameter) { $typeHint = $parameter->hasType() ? (string) $parameter->getType() : ''; $typeHint = trim($typeHint); if ($typeHint) { // If the type is not a built in types, we should add a leading slash // in the type hint ...
php
protected function renderParameterTypeHint($parameter) { $typeHint = $parameter->hasType() ? (string) $parameter->getType() : ''; $typeHint = trim($typeHint); if ($typeHint) { // If the type is not a built in types, we should add a leading slash // in the type hint ...
[ "protected", "function", "renderParameterTypeHint", "(", "$", "parameter", ")", "{", "$", "typeHint", "=", "$", "parameter", "->", "hasType", "(", ")", "?", "(", "string", ")", "$", "parameter", "->", "getType", "(", ")", ":", "''", ";", "$", "typeHint",...
Render method parameter's type hint. @param \ReflectionParameter $parameter @return string
[ "Render", "method", "parameter", "s", "type", "hint", "." ]
ac701a76f5d37c81273b7202ba37094766cb5dfe
https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Homer/Calling/ProxyFactory.php#L185-L211
228,382
lawoole/framework
src/Homer/Calling/ProxyFactory.php
ProxyFactory.renderMethodBody
protected function renderMethodBody($method) { $body = '{'; $body .= '$arguments = func_get_args();'; $body .= '$result = $this->__call(__FUNCTION__, $arguments);'; if ($method->getReturnType() !== 'void') { $body .= 'return $result;'; } $body .= '}'; ...
php
protected function renderMethodBody($method) { $body = '{'; $body .= '$arguments = func_get_args();'; $body .= '$result = $this->__call(__FUNCTION__, $arguments);'; if ($method->getReturnType() !== 'void') { $body .= 'return $result;'; } $body .= '}'; ...
[ "protected", "function", "renderMethodBody", "(", "$", "method", ")", "{", "$", "body", "=", "'{'", ";", "$", "body", ".=", "'$arguments = func_get_args();'", ";", "$", "body", ".=", "'$result = $this->__call(__FUNCTION__, $arguments);'", ";", "if", "(", "$", "met...
Render method body definition. @param string $method @return string
[ "Render", "method", "body", "definition", "." ]
ac701a76f5d37c81273b7202ba37094766cb5dfe
https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Homer/Calling/ProxyFactory.php#L234-L247
228,383
lawoole/framework
src/Homer/Calling/ProxyFactory.php
ProxyFactory.getStub
protected function getStub() { if ($this->proxyStub == null) { $this->proxyStub = file_get_contents($this->stubPath().'/proxy.stub'); } return $this->proxyStub; }
php
protected function getStub() { if ($this->proxyStub == null) { $this->proxyStub = file_get_contents($this->stubPath().'/proxy.stub'); } return $this->proxyStub; }
[ "protected", "function", "getStub", "(", ")", "{", "if", "(", "$", "this", "->", "proxyStub", "==", "null", ")", "{", "$", "this", "->", "proxyStub", "=", "file_get_contents", "(", "$", "this", "->", "stubPath", "(", ")", ".", "'/proxy.stub'", ")", ";"...
Get the proxy stub file. @return string
[ "Get", "the", "proxy", "stub", "file", "." ]
ac701a76f5d37c81273b7202ba37094766cb5dfe
https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Homer/Calling/ProxyFactory.php#L266-L273
228,384
antaresproject/core
src/components/kernel/src/Http/RouteManager.php
RouteManager.sandbox
protected function sandbox(&$locate, UrlGenerator $url, array $options = []) { $sandbox = (isset($options['sandbox']) && $options['sandbox'] == false) ? null : $url->getRequest()->query('sandbox'); if (!is_null($sandbox)) { $separator = (parse_url($locate, PHP_URL_QUERY) == NULL) ? '?' :...
php
protected function sandbox(&$locate, UrlGenerator $url, array $options = []) { $sandbox = (isset($options['sandbox']) && $options['sandbox'] == false) ? null : $url->getRequest()->query('sandbox'); if (!is_null($sandbox)) { $separator = (parse_url($locate, PHP_URL_QUERY) == NULL) ? '?' :...
[ "protected", "function", "sandbox", "(", "&", "$", "locate", ",", "UrlGenerator", "$", "url", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "sandbox", "=", "(", "isset", "(", "$", "options", "[", "'sandbox'", "]", ")", "&&", "$", "opt...
Creates url with sandbox param @param String $locate @param UrlGenerator $url @param array $options @return String
[ "Creates", "url", "with", "sandbox", "param" ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/kernel/src/Http/RouteManager.php#L153-L161
228,385
antaresproject/core
src/components/html/src/Form/Control.php
Control.generate
public function generate($type) { return function ($row, $control, $templates = []) use ($type) { $data = $this->buildFieldByType($type, $row, $control); return $this->render($templates, $data); }; }
php
public function generate($type) { return function ($row, $control, $templates = []) use ($type) { $data = $this->buildFieldByType($type, $row, $control); return $this->render($templates, $data); }; }
[ "public", "function", "generate", "(", "$", "type", ")", "{", "return", "function", "(", "$", "row", ",", "$", "control", ",", "$", "templates", "=", "[", "]", ")", "use", "(", "$", "type", ")", "{", "$", "data", "=", "$", "this", "->", "buildFie...
Generate Field. @param string $type @return \Closure
[ "Generate", "Field", "." ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/html/src/Form/Control.php#L142-L148
228,386
lawoole/framework
src/Snowflake/Snowflake.php
Snowflake.nextId
public function nextId() { $timestamp = time() - static::BASE_TIME; if ($this->lastTimestamp >= $timestamp) { $timestamp = $this->lastTimestamp; $sequence = ++ $this->sequence; if ($sequence > 0x7ff) { $this->lastTimestamp = ++ $timestamp; ...
php
public function nextId() { $timestamp = time() - static::BASE_TIME; if ($this->lastTimestamp >= $timestamp) { $timestamp = $this->lastTimestamp; $sequence = ++ $this->sequence; if ($sequence > 0x7ff) { $this->lastTimestamp = ++ $timestamp; ...
[ "public", "function", "nextId", "(", ")", "{", "$", "timestamp", "=", "time", "(", ")", "-", "static", "::", "BASE_TIME", ";", "if", "(", "$", "this", "->", "lastTimestamp", ">=", "$", "timestamp", ")", "{", "$", "timestamp", "=", "$", "this", "->", ...
Generate a new snowflake id. @return string
[ "Generate", "a", "new", "snowflake", "id", "." ]
ac701a76f5d37c81273b7202ba37094766cb5dfe
https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Snowflake/Snowflake.php#L119-L140
228,387
antaresproject/core
src/components/memory/src/Handler.php
Handler.generateNewChecksum
protected function generateNewChecksum($value) { !is_string($value) && $value = (is_object($value) ? spl_object_hash($value) : serialize($value)); return md5($value); }
php
protected function generateNewChecksum($value) { !is_string($value) && $value = (is_object($value) ? spl_object_hash($value) : serialize($value)); return md5($value); }
[ "protected", "function", "generateNewChecksum", "(", "$", "value", ")", "{", "!", "is_string", "(", "$", "value", ")", "&&", "$", "value", "=", "(", "is_object", "(", "$", "value", ")", "?", "spl_object_hash", "(", "$", "value", ")", ":", "serialize", ...
Generate a checksum from given value. @param mixed $value @return string
[ "Generate", "a", "checksum", "from", "given", "value", "." ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/memory/src/Handler.php#L129-L134
228,388
antaresproject/core
src/components/memory/src/Handler.php
Handler.forgetCache
public function forgetCache() { return !is_null($this->cache) ? $this->cache->forget($this->cacheKey) : true; }
php
public function forgetCache() { return !is_null($this->cache) ? $this->cache->forget($this->cacheKey) : true; }
[ "public", "function", "forgetCache", "(", ")", "{", "return", "!", "is_null", "(", "$", "this", "->", "cache", ")", "?", "$", "this", "->", "cache", "->", "forget", "(", "$", "this", "->", "cacheKey", ")", ":", "true", ";", "}" ]
force forgetting cache each driver @return mixed
[ "force", "forgetting", "cache", "each", "driver" ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/memory/src/Handler.php#L185-L188
228,389
lawoole/framework
src/Homer/Calling/Dispatcher.php
Dispatcher.exportInvoker
public function exportInvoker(Invoker $invoker) { $interface = $invoker->getInterface(); if (isset($this->invokers[$interface])) { return; } Log::channel('homer')->info("Service {$interface} has been exported."); $this->invokers[$interface] = $invoker; }
php
public function exportInvoker(Invoker $invoker) { $interface = $invoker->getInterface(); if (isset($this->invokers[$interface])) { return; } Log::channel('homer')->info("Service {$interface} has been exported."); $this->invokers[$interface] = $invoker; }
[ "public", "function", "exportInvoker", "(", "Invoker", "$", "invoker", ")", "{", "$", "interface", "=", "$", "invoker", "->", "getInterface", "(", ")", ";", "if", "(", "isset", "(", "$", "this", "->", "invokers", "[", "$", "interface", "]", ")", ")", ...
Export the invoker. @param \Lawoole\Homer\Calling\Invokers\Invoker $invoker
[ "Export", "the", "invoker", "." ]
ac701a76f5d37c81273b7202ba37094766cb5dfe
https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Homer/Calling/Dispatcher.php#L23-L34
228,390
lawoole/framework
src/Homer/Calling/Dispatcher.php
Dispatcher.handleMessage
public function handleMessage($message) { try { if ($message instanceof Invocation) { return $this->handleInvocation($message); } return $message; } catch (HomerException $e) { throw $e; } catch (Throwable $e) { Log...
php
public function handleMessage($message) { try { if ($message instanceof Invocation) { return $this->handleInvocation($message); } return $message; } catch (HomerException $e) { throw $e; } catch (Throwable $e) { Log...
[ "public", "function", "handleMessage", "(", "$", "message", ")", "{", "try", "{", "if", "(", "$", "message", "instanceof", "Invocation", ")", "{", "return", "$", "this", "->", "handleInvocation", "(", "$", "message", ")", ";", "}", "return", "$", "messag...
Handler the invoking request. @param mixed $message @return mixed
[ "Handler", "the", "invoking", "request", "." ]
ac701a76f5d37c81273b7202ba37094766cb5dfe
https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Homer/Calling/Dispatcher.php#L43-L60
228,391
lawoole/framework
src/Homer/Calling/Dispatcher.php
Dispatcher.handleInvocation
protected function handleInvocation(Invocation $invocation) { $invoker = $this->dispatchInvocation($invocation); return $invoker->invoke($invocation); }
php
protected function handleInvocation(Invocation $invocation) { $invoker = $this->dispatchInvocation($invocation); return $invoker->invoke($invocation); }
[ "protected", "function", "handleInvocation", "(", "Invocation", "$", "invocation", ")", "{", "$", "invoker", "=", "$", "this", "->", "dispatchInvocation", "(", "$", "invocation", ")", ";", "return", "$", "invoker", "->", "invoke", "(", "$", "invocation", ")"...
Handle the invocation. @param \Lawoole\Homer\Calling\Invocation $invocation @return \Lawoole\Homer\Calling\Result
[ "Handle", "the", "invocation", "." ]
ac701a76f5d37c81273b7202ba37094766cb5dfe
https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Homer/Calling/Dispatcher.php#L69-L74
228,392
lawoole/framework
src/Homer/Calling/Dispatcher.php
Dispatcher.dispatchInvocation
protected function dispatchInvocation(Invocation $invocation) { $interface = $invocation->getInterface(); if (isset($this->invokers[$interface])) { return $this->invokers[$interface]; } throw new CallingException("No invoker found for {$interface}."); }
php
protected function dispatchInvocation(Invocation $invocation) { $interface = $invocation->getInterface(); if (isset($this->invokers[$interface])) { return $this->invokers[$interface]; } throw new CallingException("No invoker found for {$interface}."); }
[ "protected", "function", "dispatchInvocation", "(", "Invocation", "$", "invocation", ")", "{", "$", "interface", "=", "$", "invocation", "->", "getInterface", "(", ")", ";", "if", "(", "isset", "(", "$", "this", "->", "invokers", "[", "$", "interface", "]"...
Dispatch the invocation. @param \Lawoole\Homer\Calling\Invocation $invocation @return \Lawoole\Homer\Calling\Invokers\Invoker
[ "Dispatch", "the", "invocation", "." ]
ac701a76f5d37c81273b7202ba37094766cb5dfe
https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Homer/Calling/Dispatcher.php#L83-L92
228,393
alexinator1/yii2-jta
src/ActiveQuery.php
ActiveQuery.joinWithRelations
private function joinWithRelations($model, $with, $joinType) { $relations = []; foreach ($with as $name => $callback) { if (is_int($name)) { $name = $callback; $callback = null; } $primaryModel = $model; $parent = $thi...
php
private function joinWithRelations($model, $with, $joinType) { $relations = []; foreach ($with as $name => $callback) { if (is_int($name)) { $name = $callback; $callback = null; } $primaryModel = $model; $parent = $thi...
[ "private", "function", "joinWithRelations", "(", "$", "model", ",", "$", "with", ",", "$", "joinType", ")", "{", "$", "relations", "=", "[", "]", ";", "foreach", "(", "$", "with", "as", "$", "name", "=>", "$", "callback", ")", "{", "if", "(", "is_i...
Modifies the current query by adding join fragments based on the given relations. @param ActiveRecord $model the primary model @param array $with the relations to be joined @param string|array $joinType the join type
[ "Modifies", "the", "current", "query", "by", "adding", "join", "fragments", "based", "on", "the", "given", "relations", "." ]
540d767883fdfebedf64ceedbe1c1ca48082f230
https://github.com/alexinator1/yii2-jta/blob/540d767883fdfebedf64ceedbe1c1ca48082f230/src/ActiveQuery.php#L207-L248
228,394
alexinator1/yii2-jta
src/ActiveQuery.php
ActiveQuery.getJoinType
private function getJoinType($joinType, $name) { if (is_array($joinType) && isset($joinType[$name])) { return $joinType[$name]; } else { return is_string($joinType) ? $joinType : 'INNER JOIN'; } }
php
private function getJoinType($joinType, $name) { if (is_array($joinType) && isset($joinType[$name])) { return $joinType[$name]; } else { return is_string($joinType) ? $joinType : 'INNER JOIN'; } }
[ "private", "function", "getJoinType", "(", "$", "joinType", ",", "$", "name", ")", "{", "if", "(", "is_array", "(", "$", "joinType", ")", "&&", "isset", "(", "$", "joinType", "[", "$", "name", "]", ")", ")", "{", "return", "$", "joinType", "[", "$"...
Returns the join type based on the given join type parameter and the relation name. @param string|array $joinType the given join type(s) @param string $name relation name @return string the real join type
[ "Returns", "the", "join", "type", "based", "on", "the", "given", "join", "type", "parameter", "and", "the", "relation", "name", "." ]
540d767883fdfebedf64ceedbe1c1ca48082f230
https://github.com/alexinator1/yii2-jta/blob/540d767883fdfebedf64ceedbe1c1ca48082f230/src/ActiveQuery.php#L256-L263
228,395
antaresproject/core
src/foundation/src/Support/Providers/Traits/RouteProviderTrait.php
RouteProviderTrait.resolveRouteGroupAttributes
protected function resolveRouteGroupAttributes($namespace = null, array $attributes = []) { if (is_array($namespace)) { $attributes = $namespace; $namespace = ''; } if (!is_null($namespace)) { $attributes['namespace'] = empty($namespace) ? $this->namespac...
php
protected function resolveRouteGroupAttributes($namespace = null, array $attributes = []) { if (is_array($namespace)) { $attributes = $namespace; $namespace = ''; } if (!is_null($namespace)) { $attributes['namespace'] = empty($namespace) ? $this->namespac...
[ "protected", "function", "resolveRouteGroupAttributes", "(", "$", "namespace", "=", "null", ",", "array", "$", "attributes", "=", "[", "]", ")", "{", "if", "(", "is_array", "(", "$", "namespace", ")", ")", "{", "$", "attributes", "=", "$", "namespace", "...
Resolve route group attributes. @param array|string|null $namespace @param array $attributes @return array
[ "Resolve", "route", "group", "attributes", "." ]
b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2
https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/foundation/src/Support/Providers/Traits/RouteProviderTrait.php#L88-L98
228,396
soberwp/unravel
src/Migrate.php
Migrate.setDestinationPath
protected function setDestinationPath($folder) { $this->destinationPath = wp_upload_dir(); $this->destinationPath = rtrim($this->destinationPath['basedir'], 'uploads') . $folder; // fix rtrim uploads name }
php
protected function setDestinationPath($folder) { $this->destinationPath = wp_upload_dir(); $this->destinationPath = rtrim($this->destinationPath['basedir'], 'uploads') . $folder; // fix rtrim uploads name }
[ "protected", "function", "setDestinationPath", "(", "$", "folder", ")", "{", "$", "this", "->", "destinationPath", "=", "wp_upload_dir", "(", ")", ";", "$", "this", "->", "destinationPath", "=", "rtrim", "(", "$", "this", "->", "destinationPath", "[", "'base...
Set destination path
[ "Set", "destination", "path" ]
e9ad06ae8bb1b92b612c1b5ee4f38a462272c265
https://github.com/soberwp/unravel/blob/e9ad06ae8bb1b92b612c1b5ee4f38a462272c265/src/Migrate.php#L19-L23
228,397
soberwp/unravel
src/Migrate.php
Migrate.setOriginPath
protected function setOriginPath($filter) { $this->originPath = (has_filter($filter) ? apply_filters($filter, rtrim($this->originPath)) : get_stylesheet_directory() . '/' . $this->pathDefault); }
php
protected function setOriginPath($filter) { $this->originPath = (has_filter($filter) ? apply_filters($filter, rtrim($this->originPath)) : get_stylesheet_directory() . '/' . $this->pathDefault); }
[ "protected", "function", "setOriginPath", "(", "$", "filter", ")", "{", "$", "this", "->", "originPath", "=", "(", "has_filter", "(", "$", "filter", ")", "?", "apply_filters", "(", "$", "filter", ",", "rtrim", "(", "$", "this", "->", "originPath", ")", ...
Get origin path
[ "Get", "origin", "path" ]
e9ad06ae8bb1b92b612c1b5ee4f38a462272c265
https://github.com/soberwp/unravel/blob/e9ad06ae8bb1b92b612c1b5ee4f38a462272c265/src/Migrate.php#L36-L39
228,398
soberwp/unravel
src/Migrate.php
Migrate.deregister
public function deregister() { $this->pathOrigin = get_stylesheet_directory() . '/' . $this->pathDefault; if ($this->folderExist($this->pathOrigin)) return; rename($this->destinationPath, $this->pathOrigin); }
php
public function deregister() { $this->pathOrigin = get_stylesheet_directory() . '/' . $this->pathDefault; if ($this->folderExist($this->pathOrigin)) return; rename($this->destinationPath, $this->pathOrigin); }
[ "public", "function", "deregister", "(", ")", "{", "$", "this", "->", "pathOrigin", "=", "get_stylesheet_directory", "(", ")", ".", "'/'", ".", "$", "this", "->", "pathDefault", ";", "if", "(", "$", "this", "->", "folderExist", "(", "$", "this", "->", ...
make it work for advanced custom fields
[ "make", "it", "work", "for", "advanced", "custom", "fields" ]
e9ad06ae8bb1b92b612c1b5ee4f38a462272c265
https://github.com/soberwp/unravel/blob/e9ad06ae8bb1b92b612c1b5ee4f38a462272c265/src/Migrate.php#L64-L69
228,399
lawoole/framework
src/Homer/Calling/Invokers/Invoker.php
Invoker.invoke
public function invoke(Invocation $invocation) { try { return $this->doInvoke($invocation); } catch (Throwable $e) { return $this->createExceptionResult($e); } }
php
public function invoke(Invocation $invocation) { try { return $this->doInvoke($invocation); } catch (Throwable $e) { return $this->createExceptionResult($e); } }
[ "public", "function", "invoke", "(", "Invocation", "$", "invocation", ")", "{", "try", "{", "return", "$", "this", "->", "doInvoke", "(", "$", "invocation", ")", ";", "}", "catch", "(", "Throwable", "$", "e", ")", "{", "return", "$", "this", "->", "c...
Do invoking. @param \Lawoole\Homer\Calling\Invocation $invocation @return \Lawoole\Homer\Calling\Result
[ "Do", "invoking", "." ]
ac701a76f5d37c81273b7202ba37094766cb5dfe
https://github.com/lawoole/framework/blob/ac701a76f5d37c81273b7202ba37094766cb5dfe/src/Homer/Calling/Invokers/Invoker.php#L63-L70