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
187,300
mikemirten/ZExt
library/ZExt/Datagate/MongoCollection.php
MongoCollection.delete
public function delete(array $criteria = [], array $options = []) { return $this->getAdapter()->remove( $this->getTableName(), $criteria, $options ); }
php
public function delete(array $criteria = [], array $options = []) { return $this->getAdapter()->remove( $this->getTableName(), $criteria, $options ); }
[ "public", "function", "delete", "(", "array", "$", "criteria", "=", "[", "]", ",", "array", "$", "options", "=", "[", "]", ")", "{", "return", "$", "this", "->", "getAdapter", "(", ")", "->", "remove", "(", "$", "this", "->", "getTableName", "(", "...
Delete an items from a database @param array $criteria @param array $options @return bool
[ "Delete", "an", "items", "from", "a", "database" ]
284956f5b85ba10571f64aaa651169e00f05ae56
https://github.com/mikemirten/ZExt/blob/284956f5b85ba10571f64aaa651169e00f05ae56/library/ZExt/Datagate/MongoCollection.php#L435-L441
187,301
mikemirten/ZExt
library/ZExt/Datagate/MongoCollection.php
MongoCollection.update
public function update(array $data, array $criteria = [], array $options = []) { return $this->getAdapter()->update( $this->getTableName(), $criteria, $data, $options ); }
php
public function update(array $data, array $criteria = [], array $options = []) { return $this->getAdapter()->update( $this->getTableName(), $criteria, $data, $options ); }
[ "public", "function", "update", "(", "array", "$", "data", ",", "array", "$", "criteria", "=", "[", "]", ",", "array", "$", "options", "=", "[", "]", ")", "{", "return", "$", "this", "->", "getAdapter", "(", ")", "->", "update", "(", "$", "this", ...
Update some items of a database @param array $data @param array $criteria @param array $options @return bool
[ "Update", "some", "items", "of", "a", "database" ]
284956f5b85ba10571f64aaa651169e00f05ae56
https://github.com/mikemirten/ZExt/blob/284956f5b85ba10571f64aaa651169e00f05ae56/library/ZExt/Datagate/MongoCollection.php#L451-L458
187,302
mikemirten/ZExt
library/ZExt/Datagate/MongoCollection.php
MongoCollection.getAdapter
public function getAdapter() { if ($this->_adapter === null) { if ($this->hasLocator()) { $this->_adapter = $this->getLocator()->get($this->getAdapterName()); } else { throw new Exceptions\NoAdapter('Nor a database adapter neither a services locator has been provided'); } } return $this->_adap...
php
public function getAdapter() { if ($this->_adapter === null) { if ($this->hasLocator()) { $this->_adapter = $this->getLocator()->get($this->getAdapterName()); } else { throw new Exceptions\NoAdapter('Nor a database adapter neither a services locator has been provided'); } } return $this->_adap...
[ "public", "function", "getAdapter", "(", ")", "{", "if", "(", "$", "this", "->", "_adapter", "===", "null", ")", "{", "if", "(", "$", "this", "->", "hasLocator", "(", ")", ")", "{", "$", "this", "->", "_adapter", "=", "$", "this", "->", "getLocator...
Get a database adapter @return MongoAdapter
[ "Get", "a", "database", "adapter" ]
284956f5b85ba10571f64aaa651169e00f05ae56
https://github.com/mikemirten/ZExt/blob/284956f5b85ba10571f64aaa651169e00f05ae56/library/ZExt/Datagate/MongoCollection.php#L536-L546
187,303
dmetri333/wiggum-framework
src/commons/template/CachedTemplate.class.php
CachedTemplate.isCached
public function isCached() { if ($this->cached) return true; // Passed a cacheId? if (!$this->cacheId) return false; // Cache file exists? if (!file_exists($this->cachePath . $this->cacheId)) return false; // Can get the time of the file? if (!($mtime = filemtime($this->cachePath . $this->cacheId))) re...
php
public function isCached() { if ($this->cached) return true; // Passed a cacheId? if (!$this->cacheId) return false; // Cache file exists? if (!file_exists($this->cachePath . $this->cacheId)) return false; // Can get the time of the file? if (!($mtime = filemtime($this->cachePath . $this->cacheId))) re...
[ "public", "function", "isCached", "(", ")", "{", "if", "(", "$", "this", "->", "cached", ")", "return", "true", ";", "// Passed a cacheId?", "if", "(", "!", "$", "this", "->", "cacheId", ")", "return", "false", ";", "// Cache file exists?", "if", "(", "!...
Test to see whether the currently loaded cacheId has a valid corrosponding cache file. @return boolean
[ "Test", "to", "see", "whether", "the", "currently", "loaded", "cacheId", "has", "a", "valid", "corrosponding", "cache", "file", "." ]
9a255a2390ca5259895afe808516109de2b5bb85
https://github.com/dmetri333/wiggum-framework/blob/9a255a2390ca5259895afe808516109de2b5bb85/src/commons/template/CachedTemplate.class.php#L32-L58
187,304
swokit/server
src/Traits/ServerCreateTrait.php
ServerCreateTrait.registerServerEvents
protected function registerServerEvents(array $events): void { $eventInfo = []; // register event to swoole foreach ($events as $name => $cb) { // is a Closure callback, add by self::onSwoole() if (\is_object($cb) && \method_exists($cb, '__invoke')) { ...
php
protected function registerServerEvents(array $events): void { $eventInfo = []; // register event to swoole foreach ($events as $name => $cb) { // is a Closure callback, add by self::onSwoole() if (\is_object($cb) && \method_exists($cb, '__invoke')) { ...
[ "protected", "function", "registerServerEvents", "(", "array", "$", "events", ")", ":", "void", "{", "$", "eventInfo", "=", "[", "]", ";", "// register event to swoole", "foreach", "(", "$", "events", "as", "$", "name", "=>", "$", "cb", ")", "{", "// is a ...
register Swoole Events @param array $events
[ "register", "Swoole", "Events" ]
1e85d30cf6c7110a5fe9c285bb8f4ff5fa9ccc92
https://github.com/swokit/server/blob/1e85d30cf6c7110a5fe9c285bb8f4ff5fa9ccc92/src/Traits/ServerCreateTrait.php#L184-L217
187,305
swokit/server
src/Traits/ServerCreateTrait.php
ServerCreateTrait.attachUserProcesses
protected function attachUserProcesses(): void { // create Reload Worker if ($reloader = $this->createHotReloader()) { $this->server->addProcess($reloader); } foreach ($this->processCallbacks as $name => $callback) { $this->createProcess($name, $callback); ...
php
protected function attachUserProcesses(): void { // create Reload Worker if ($reloader = $this->createHotReloader()) { $this->server->addProcess($reloader); } foreach ($this->processCallbacks as $name => $callback) { $this->createProcess($name, $callback); ...
[ "protected", "function", "attachUserProcesses", "(", ")", ":", "void", "{", "// create Reload Worker", "if", "(", "$", "reloader", "=", "$", "this", "->", "createHotReloader", "(", ")", ")", "{", "$", "this", "->", "server", "->", "addProcess", "(", "$", "...
attach user's custom process
[ "attach", "user", "s", "custom", "process" ]
1e85d30cf6c7110a5fe9c285bb8f4ff5fa9ccc92
https://github.com/swokit/server/blob/1e85d30cf6c7110a5fe9c285bb8f4ff5fa9ccc92/src/Traits/ServerCreateTrait.php#L226-L236
187,306
swokit/server
src/Traits/ServerCreateTrait.php
ServerCreateTrait.createHotReloader
protected function createHotReloader() { $reload = $this->config['auto_reload']; if (!$reload || !\function_exists('inotify_init')) { return false; } $mgr = $this; $options = [ 'dirs' => $reload, // 'masterPid' => $this->server->maste...
php
protected function createHotReloader() { $reload = $this->config['auto_reload']; if (!$reload || !\function_exists('inotify_init')) { return false; } $mgr = $this; $options = [ 'dirs' => $reload, // 'masterPid' => $this->server->maste...
[ "protected", "function", "createHotReloader", "(", ")", "{", "$", "reload", "=", "$", "this", "->", "config", "[", "'auto_reload'", "]", ";", "if", "(", "!", "$", "reload", "||", "!", "\\", "function_exists", "(", "'inotify_init'", ")", ")", "{", "return...
create code hot reload worker @see https://wiki.swoole.com/wiki/page/390.html @return Process|false @throws \RuntimeException
[ "create", "code", "hot", "reload", "worker" ]
1e85d30cf6c7110a5fe9c285bb8f4ff5fa9ccc92
https://github.com/swokit/server/blob/1e85d30cf6c7110a5fe9c285bb8f4ff5fa9ccc92/src/Traits/ServerCreateTrait.php#L306-L347
187,307
swokit/server
src/Traits/ServerCreateTrait.php
ServerCreateTrait.createListenServers
protected function createListenServers(Server $server): void { $this->fire(ServerEvent::PORT_CREATE, $this); foreach ($this->attachedListeners as $name => $cb) { $info = ''; if ($cb instanceof \Closure) { $port = $cb($server, $this); } else { ...
php
protected function createListenServers(Server $server): void { $this->fire(ServerEvent::PORT_CREATE, $this); foreach ($this->attachedListeners as $name => $cb) { $info = ''; if ($cb instanceof \Closure) { $port = $cb($server, $this); } else { ...
[ "protected", "function", "createListenServers", "(", "Server", "$", "server", ")", ":", "void", "{", "$", "this", "->", "fire", "(", "ServerEvent", "::", "PORT_CREATE", ",", "$", "this", ")", ";", "foreach", "(", "$", "this", "->", "attachedListeners", "as...
create Listen Port Servers @param Server $server
[ "create", "Listen", "Port", "Servers" ]
1e85d30cf6c7110a5fe9c285bb8f4ff5fa9ccc92
https://github.com/swokit/server/blob/1e85d30cf6c7110a5fe9c285bb8f4ff5fa9ccc92/src/Traits/ServerCreateTrait.php#L357-L384
187,308
swokit/server
src/Traits/ServerCreateTrait.php
ServerCreateTrait.attachPort
public function attachPort(string $name, $config): void { if (isset($this->attachedNames[strtolower($name)])) { throw new \InvalidArgumentException("The add listen port server [$name] has been exists!"); } if (\is_array($config)) { $class = Arr::remove($config, 'list...
php
public function attachPort(string $name, $config): void { if (isset($this->attachedNames[strtolower($name)])) { throw new \InvalidArgumentException("The add listen port server [$name] has been exists!"); } if (\is_array($config)) { $class = Arr::remove($config, 'list...
[ "public", "function", "attachPort", "(", "string", "$", "name", ",", "$", "config", ")", ":", "void", "{", "if", "(", "isset", "(", "$", "this", "->", "attachedNames", "[", "strtolower", "(", "$", "name", ")", "]", ")", ")", "{", "throw", "new", "\...
attach add listen port to main server. @param string $name @param \Closure|array|PortListenerInterface $config @throws \InvalidArgumentException
[ "attach", "add", "listen", "port", "to", "main", "server", "." ]
1e85d30cf6c7110a5fe9c285bb8f4ff5fa9ccc92
https://github.com/swokit/server/blob/1e85d30cf6c7110a5fe9c285bb8f4ff5fa9ccc92/src/Traits/ServerCreateTrait.php#L403-L432
187,309
JumpGateio/Users
src/JumpGate/Users/Http/Controllers/Activation.php
Activation.inactive
public function inactive() { $layout = view()->exists('layouts.default') ? 'layouts.default' : 'layout'; $pageTitle = 'Inactive account'; $token = $this->activation->findTokenByEmail(session('inactive_email')); return view('auth.activation.inactiv...
php
public function inactive() { $layout = view()->exists('layouts.default') ? 'layouts.default' : 'layout'; $pageTitle = 'Inactive account'; $token = $this->activation->findTokenByEmail(session('inactive_email')); return view('auth.activation.inactiv...
[ "public", "function", "inactive", "(", ")", "{", "$", "layout", "=", "view", "(", ")", "->", "exists", "(", "'layouts.default'", ")", "?", "'layouts.default'", ":", "'layout'", ";", "$", "pageTitle", "=", "'Inactive account'", ";", "$", "token", "=", "$", ...
Display the account inactive page. @return mixed
[ "Display", "the", "account", "inactive", "page", "." ]
2a63b9088b4fb385a1888918ede98be53e733f56
https://github.com/JumpGateio/Users/blob/2a63b9088b4fb385a1888918ede98be53e733f56/src/JumpGate/Users/Http/Controllers/Activation.php#L87-L98
187,310
JumpGateio/Users
src/JumpGate/Users/Http/Controllers/Activation.php
Activation.failed
public function failed($tokenString) { $layout = view()->exists('layouts.default') ? 'layouts.default' : 'layout'; $pageTitle = 'Activation failed'; $token = $this->activation->findToken($tokenString); return view('auth.activation.failed', compact...
php
public function failed($tokenString) { $layout = view()->exists('layouts.default') ? 'layouts.default' : 'layout'; $pageTitle = 'Activation failed'; $token = $this->activation->findToken($tokenString); return view('auth.activation.failed', compact...
[ "public", "function", "failed", "(", "$", "tokenString", ")", "{", "$", "layout", "=", "view", "(", ")", "->", "exists", "(", "'layouts.default'", ")", "?", "'layouts.default'", ":", "'layout'", ";", "$", "pageTitle", "=", "'Activation failed'", ";", "$", ...
Display the page saying that activation failed. @param string $tokenString The user's activation token. @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
[ "Display", "the", "page", "saying", "that", "activation", "failed", "." ]
2a63b9088b4fb385a1888918ede98be53e733f56
https://github.com/JumpGateio/Users/blob/2a63b9088b4fb385a1888918ede98be53e733f56/src/JumpGate/Users/Http/Controllers/Activation.php#L107-L118
187,311
xabou/google-geocoding
src/Geocoder.php
Geocoder.parameters
public function parameters(array $parameters) { foreach ($parameters as $parameter => $value) { if (property_exists($this->parameters, $parameter)) { $this->parameters->{$parameter} = $value; } } return $this; }
php
public function parameters(array $parameters) { foreach ($parameters as $parameter => $value) { if (property_exists($this->parameters, $parameter)) { $this->parameters->{$parameter} = $value; } } return $this; }
[ "public", "function", "parameters", "(", "array", "$", "parameters", ")", "{", "foreach", "(", "$", "parameters", "as", "$", "parameter", "=>", "$", "value", ")", "{", "if", "(", "property_exists", "(", "$", "this", "->", "parameters", ",", "$", "paramet...
Set parameters from given array. @param array $parameters @return $this
[ "Set", "parameters", "from", "given", "array", "." ]
0b4a88e65a54331205e01503ce33aed9beca48c1
https://github.com/xabou/google-geocoding/blob/0b4a88e65a54331205e01503ce33aed9beca48c1/src/Geocoder.php#L108-L117
187,312
xabou/google-geocoding
src/Geocoder.php
Geocoder.sendRequest
protected function sendRequest() { $parameters = $this->parameters->toArray(); $parameters['key'] = $this->config['api_key']; $response = $this->guzzle->get($this->getRequestUrl(), [ 'query' => $parameters, ]); return json_decode((string)$response->getBody()); ...
php
protected function sendRequest() { $parameters = $this->parameters->toArray(); $parameters['key'] = $this->config['api_key']; $response = $this->guzzle->get($this->getRequestUrl(), [ 'query' => $parameters, ]); return json_decode((string)$response->getBody()); ...
[ "protected", "function", "sendRequest", "(", ")", "{", "$", "parameters", "=", "$", "this", "->", "parameters", "->", "toArray", "(", ")", ";", "$", "parameters", "[", "'key'", "]", "=", "$", "this", "->", "config", "[", "'api_key'", "]", ";", "$", "...
Send a request to Google Geocoding API. @return mixed
[ "Send", "a", "request", "to", "Google", "Geocoding", "API", "." ]
0b4a88e65a54331205e01503ce33aed9beca48c1
https://github.com/xabou/google-geocoding/blob/0b4a88e65a54331205e01503ce33aed9beca48c1/src/Geocoder.php#L136-L146
187,313
GetOlympus/Zeus-Core
src/Zeus/Term/Controller/TermHook.php
TermHook.addFields
public function addFields($term, $mode = 'edit') { // Check mode $mode = in_array($mode, ['add', 'edit']) ? $mode : 'edit'; // Check fields if (empty($this->fields)) { return; } // Get current $term = is_object($term) ? $term : get_term($term); ...
php
public function addFields($term, $mode = 'edit') { // Check mode $mode = in_array($mode, ['add', 'edit']) ? $mode : 'edit'; // Check fields if (empty($this->fields)) { return; } // Get current $term = is_object($term) ? $term : get_term($term); ...
[ "public", "function", "addFields", "(", "$", "term", ",", "$", "mode", "=", "'edit'", ")", "{", "// Check mode", "$", "mode", "=", "in_array", "(", "$", "mode", ",", "[", "'add'", ",", "'edit'", "]", ")", "?", "$", "mode", ":", "'edit'", ";", "// C...
Hook building custom fields. @param string|object $term @param string $mode
[ "Hook", "building", "custom", "fields", "." ]
2bdee751e8fcf8ed082080ddcd198855631720ff
https://github.com/GetOlympus/Zeus-Core/blob/2bdee751e8fcf8ed082080ddcd198855631720ff/src/Zeus/Term/Controller/TermHook.php#L103-L143
187,314
GetOlympus/Zeus-Core
src/Zeus/Term/Controller/TermHook.php
TermHook.manageCustomColumn
public function manageCustomColumn($content, $column, $term_id) { // Get current post type $current = Request::get('taxonomy'); // check post type if (empty($current)) { return; } /** * Fires for each custom column of a specific post type in the...
php
public function manageCustomColumn($content, $column, $term_id) { // Get current post type $current = Request::get('taxonomy'); // check post type if (empty($current)) { return; } /** * Fires for each custom column of a specific post type in the...
[ "public", "function", "manageCustomColumn", "(", "$", "content", ",", "$", "column", ",", "$", "term_id", ")", "{", "// Get current post type", "$", "current", "=", "Request", "::", "get", "(", "'taxonomy'", ")", ";", "// check post type", "if", "(", "empty", ...
Hook to add custom column. @param string $content @param string $column @param int $term_id
[ "Hook", "to", "add", "custom", "column", "." ]
2bdee751e8fcf8ed082080ddcd198855631720ff
https://github.com/GetOlympus/Zeus-Core/blob/2bdee751e8fcf8ed082080ddcd198855631720ff/src/Zeus/Term/Controller/TermHook.php#L172-L190
187,315
GetOlympus/Zeus-Core
src/Zeus/Term/Controller/TermHook.php
TermHook.saveFields
public function saveFields($term_id) { // No term or no fields if (!isset($term_id) || empty($term_id) || empty($this->fields)) { return; } // Check slug $slug = Request::post('taxonomy', ''); // Check integrity if (empty($slug) || $slug !== $thi...
php
public function saveFields($term_id) { // No term or no fields if (!isset($term_id) || empty($term_id) || empty($this->fields)) { return; } // Check slug $slug = Request::post('taxonomy', ''); // Check integrity if (empty($slug) || $slug !== $thi...
[ "public", "function", "saveFields", "(", "$", "term_id", ")", "{", "// No term or no fields", "if", "(", "!", "isset", "(", "$", "term_id", ")", "||", "empty", "(", "$", "term_id", ")", "||", "empty", "(", "$", "this", "->", "fields", ")", ")", "{", ...
Hook building custom fields for Post types. @param number $term_id @return number|void
[ "Hook", "building", "custom", "fields", "for", "Post", "types", "." ]
2bdee751e8fcf8ed082080ddcd198855631720ff
https://github.com/GetOlympus/Zeus-Core/blob/2bdee751e8fcf8ed082080ddcd198855631720ff/src/Zeus/Term/Controller/TermHook.php#L227-L298
187,316
GetOlympus/Zeus-Core
src/Zeus/Field/Controller/Field.php
Field.build
public static function build($id, $contents = [], $details = []) { // Get instance try { $field = self::getInstance(); } catch (Exception $e) { throw new FieldException(Translate::t('field.errors.class_is_not_defined')); } // Set class $class ...
php
public static function build($id, $contents = [], $details = []) { // Get instance try { $field = self::getInstance(); } catch (Exception $e) { throw new FieldException(Translate::t('field.errors.class_is_not_defined')); } // Set class $class ...
[ "public", "static", "function", "build", "(", "$", "id", ",", "$", "contents", "=", "[", "]", ",", "$", "details", "=", "[", "]", ")", "{", "// Get instance", "try", "{", "$", "field", "=", "self", "::", "getInstance", "(", ")", ";", "}", "catch", ...
Build Field component. @param string $id @param array $contents @param array $details
[ "Build", "Field", "component", "." ]
2bdee751e8fcf8ed082080ddcd198855631720ff
https://github.com/GetOlympus/Zeus-Core/blob/2bdee751e8fcf8ed082080ddcd198855631720ff/src/Zeus/Field/Controller/Field.php#L44-L71
187,317
GetOlympus/Zeus-Core
src/Zeus/Field/Controller/Field.php
Field.render
public function render($contents = [], $details = [], $renderView = true, $context = 'field') { // Merge datum $contents = array_merge($this->getModel()->getContents(), $contents); $details = array_merge($this->getModel()->getDetails(), $details); // Get context $class = $th...
php
public function render($contents = [], $details = [], $renderView = true, $context = 'field') { // Merge datum $contents = array_merge($this->getModel()->getContents(), $contents); $details = array_merge($this->getModel()->getDetails(), $details); // Get context $class = $th...
[ "public", "function", "render", "(", "$", "contents", "=", "[", "]", ",", "$", "details", "=", "[", "]", ",", "$", "renderView", "=", "true", ",", "$", "context", "=", "'field'", ")", "{", "// Merge datum", "$", "contents", "=", "array_merge", "(", "...
Render HTML component. @param array $contents @param array $details @param boolean $renderView @param string $context
[ "Render", "HTML", "component", "." ]
2bdee751e8fcf8ed082080ddcd198855631720ff
https://github.com/GetOlympus/Zeus-Core/blob/2bdee751e8fcf8ed082080ddcd198855631720ff/src/Zeus/Field/Controller/Field.php#L95-L128
187,318
GetOlympus/Zeus-Core
src/Zeus/Field/Controller/Field.php
Field.renderAssets
public function renderAssets() { // Retrieve path to Resources and shortname's class $class = $this->getClass(); $path = $class['resources'].S.'assets'.S; // Get assets $script = $this->getModel()->getScript(); $style = $this->getModel()->getStyle(); $assets...
php
public function renderAssets() { // Retrieve path to Resources and shortname's class $class = $this->getClass(); $path = $class['resources'].S.'assets'.S; // Get assets $script = $this->getModel()->getScript(); $style = $this->getModel()->getStyle(); $assets...
[ "public", "function", "renderAssets", "(", ")", "{", "// Retrieve path to Resources and shortname's class", "$", "class", "=", "$", "this", "->", "getClass", "(", ")", ";", "$", "path", "=", "$", "class", "[", "'resources'", "]", ".", "S", ".", "'assets'", "...
Render assets' component. @return array $assets
[ "Render", "assets", "component", "." ]
2bdee751e8fcf8ed082080ddcd198855631720ff
https://github.com/GetOlympus/Zeus-Core/blob/2bdee751e8fcf8ed082080ddcd198855631720ff/src/Zeus/Field/Controller/Field.php#L135-L163
187,319
samanix/laranix
src/Laranix/Auth/User/User.php
User.primaryGroup
public function primaryGroup() : ?Model { if ($this->userPrimaryGroup !== null) { return $this->userPrimaryGroup; } $usergroups = $this->usergroups; foreach ($usergroups as $id => $usergroup) { if ($usergroup->primary) { return $this->userPri...
php
public function primaryGroup() : ?Model { if ($this->userPrimaryGroup !== null) { return $this->userPrimaryGroup; } $usergroups = $this->usergroups; foreach ($usergroups as $id => $usergroup) { if ($usergroup->primary) { return $this->userPri...
[ "public", "function", "primaryGroup", "(", ")", ":", "?", "Model", "{", "if", "(", "$", "this", "->", "userPrimaryGroup", "!==", "null", ")", "{", "return", "$", "this", "->", "userPrimaryGroup", ";", "}", "$", "usergroups", "=", "$", "this", "->", "us...
Get users primary group @return \Laranix\Auth\Group\Group|\Laranix\Support\Database\Model|null
[ "Get", "users", "primary", "group" ]
6dfc0b341657e0429f2629e91a469bc6203af3a1
https://github.com/samanix/laranix/blob/6dfc0b341657e0429f2629e91a469bc6203af3a1/src/Laranix/Auth/User/User.php#L150-L165
187,320
samanix/laranix
src/Laranix/Auth/User/User.php
User.getActiveCages
public function getActiveCages() : Collection { if ($this->activeCagesCollection !== null) { return $this->activeCagesCollection; } $this->activeCagesCollection = new Collection(); foreach ($this->allCages as $id => $cage) { if (!$cage->isExpired() && !$cage...
php
public function getActiveCages() : Collection { if ($this->activeCagesCollection !== null) { return $this->activeCagesCollection; } $this->activeCagesCollection = new Collection(); foreach ($this->allCages as $id => $cage) { if (!$cage->isExpired() && !$cage...
[ "public", "function", "getActiveCages", "(", ")", ":", "Collection", "{", "if", "(", "$", "this", "->", "activeCagesCollection", "!==", "null", ")", "{", "return", "$", "this", "->", "activeCagesCollection", ";", "}", "$", "this", "->", "activeCagesCollection"...
Get active cages from all cages This saves a query @return \Illuminate\Database\Eloquent\Collection
[ "Get", "active", "cages", "from", "all", "cages", "This", "saves", "a", "query" ]
6dfc0b341657e0429f2629e91a469bc6203af3a1
https://github.com/samanix/laranix/blob/6dfc0b341657e0429f2629e91a469bc6203af3a1/src/Laranix/Auth/User/User.php#L173-L188
187,321
samanix/laranix
src/Laranix/Auth/User/User.php
User.getUserFlags
public function getUserFlags() : array { if ($this->flags !== null) { return $this->flags; } $this->flags = []; $usergroups = $this->usergroups; foreach ($usergroups as $usergroup) { $group = $usergroup->group; $flags = $group->flags; ...
php
public function getUserFlags() : array { if ($this->flags !== null) { return $this->flags; } $this->flags = []; $usergroups = $this->usergroups; foreach ($usergroups as $usergroup) { $group = $usergroup->group; $flags = $group->flags; ...
[ "public", "function", "getUserFlags", "(", ")", ":", "array", "{", "if", "(", "$", "this", "->", "flags", "!==", "null", ")", "{", "return", "$", "this", "->", "flags", ";", "}", "$", "this", "->", "flags", "=", "[", "]", ";", "$", "usergroups", ...
Get all user flags. @return array
[ "Get", "all", "user", "flags", "." ]
6dfc0b341657e0429f2629e91a469bc6203af3a1
https://github.com/samanix/laranix/blob/6dfc0b341657e0429f2629e91a469bc6203af3a1/src/Laranix/Auth/User/User.php#L195-L214
187,322
samanix/laranix
src/Laranix/Auth/User/User.php
User.hasFlag
public function hasFlag($flag) : bool { if (is_array($flag)) { return $this->hasFlags($flag); } return in_array($flag, $this->getUserFlags()); }
php
public function hasFlag($flag) : bool { if (is_array($flag)) { return $this->hasFlags($flag); } return in_array($flag, $this->getUserFlags()); }
[ "public", "function", "hasFlag", "(", "$", "flag", ")", ":", "bool", "{", "if", "(", "is_array", "(", "$", "flag", ")", ")", "{", "return", "$", "this", "->", "hasFlags", "(", "$", "flag", ")", ";", "}", "return", "in_array", "(", "$", "flag", ",...
Check if user has flag. @param string|array $flag @return bool
[ "Check", "if", "user", "has", "flag", "." ]
6dfc0b341657e0429f2629e91a469bc6203af3a1
https://github.com/samanix/laranix/blob/6dfc0b341657e0429f2629e91a469bc6203af3a1/src/Laranix/Auth/User/User.php#L223-L230
187,323
samanix/laranix
src/Laranix/Auth/User/User.php
User.hasFlags
public function hasFlags(array $flags, bool $matchAll = false) : bool { $matched = false; $userFlags = $this->getUserFlags(); foreach ($flags as $flag) { if (in_array($flag, $userFlags)) { if ($matchAll) { $matched = true; ...
php
public function hasFlags(array $flags, bool $matchAll = false) : bool { $matched = false; $userFlags = $this->getUserFlags(); foreach ($flags as $flag) { if (in_array($flag, $userFlags)) { if ($matchAll) { $matched = true; ...
[ "public", "function", "hasFlags", "(", "array", "$", "flags", ",", "bool", "$", "matchAll", "=", "false", ")", ":", "bool", "{", "$", "matched", "=", "false", ";", "$", "userFlags", "=", "$", "this", "->", "getUserFlags", "(", ")", ";", "foreach", "(...
Check if user has flags @param array $flags @param bool $matchAll @return bool
[ "Check", "if", "user", "has", "flags" ]
6dfc0b341657e0429f2629e91a469bc6203af3a1
https://github.com/samanix/laranix/blob/6dfc0b341657e0429f2629e91a469bc6203af3a1/src/Laranix/Auth/User/User.php#L239-L262
187,324
samanix/laranix
src/Laranix/Auth/User/User.php
User.hasGroupId
public function hasGroupId(int $id) : bool { $usergroups = $this->usergroups; foreach ($usergroups as $index => $usergroup) { if ($usergroup->group_id === $id) { return true; } } return false; }
php
public function hasGroupId(int $id) : bool { $usergroups = $this->usergroups; foreach ($usergroups as $index => $usergroup) { if ($usergroup->group_id === $id) { return true; } } return false; }
[ "public", "function", "hasGroupId", "(", "int", "$", "id", ")", ":", "bool", "{", "$", "usergroups", "=", "$", "this", "->", "usergroups", ";", "foreach", "(", "$", "usergroups", "as", "$", "index", "=>", "$", "usergroup", ")", "{", "if", "(", "$", ...
Check if user has group. @param int $id @return bool
[ "Check", "if", "user", "has", "group", "." ]
6dfc0b341657e0429f2629e91a469bc6203af3a1
https://github.com/samanix/laranix/blob/6dfc0b341657e0429f2629e91a469bc6203af3a1/src/Laranix/Auth/User/User.php#L282-L293
187,325
samanix/laranix
src/Laranix/Auth/User/User.php
User.hasCage
public function hasCage(string $area, int $level = 0, bool $activeOnly = true) : ?Model { $cages = $activeOnly ? $this->getActiveCages() : $this->allCages; foreach ($cages as $index => $cage) { if ($cage->area === $area && $cage->level >= $level) { return $cage; ...
php
public function hasCage(string $area, int $level = 0, bool $activeOnly = true) : ?Model { $cages = $activeOnly ? $this->getActiveCages() : $this->allCages; foreach ($cages as $index => $cage) { if ($cage->area === $area && $cage->level >= $level) { return $cage; ...
[ "public", "function", "hasCage", "(", "string", "$", "area", ",", "int", "$", "level", "=", "0", ",", "bool", "$", "activeOnly", "=", "true", ")", ":", "?", "Model", "{", "$", "cages", "=", "$", "activeOnly", "?", "$", "this", "->", "getActiveCages",...
Check if user has cage. @param string $area @param int $level @param bool $activeOnly If false, will search through all cages, otherwise will only search active ones @return \Laranix\Auth\User\Cage\Cage|\Laranix\Support\Database\Model|null
[ "Check", "if", "user", "has", "cage", "." ]
6dfc0b341657e0429f2629e91a469bc6203af3a1
https://github.com/samanix/laranix/blob/6dfc0b341657e0429f2629e91a469bc6203af3a1/src/Laranix/Auth/User/User.php#L303-L314
187,326
Gemorroj/HTMLValidator
src/HTMLValidator.php
HTMLValidator.validateUri
public function validateUri($uri) { $query = http_build_query(array_merge( $this->getOptions()->buildOptions(), array('uri' => $uri) )); $context = stream_context_create(array( 'http' => array( 'method' => 'GET', 'header' =...
php
public function validateUri($uri) { $query = http_build_query(array_merge( $this->getOptions()->buildOptions(), array('uri' => $uri) )); $context = stream_context_create(array( 'http' => array( 'method' => 'GET', 'header' =...
[ "public", "function", "validateUri", "(", "$", "uri", ")", "{", "$", "query", "=", "http_build_query", "(", "array_merge", "(", "$", "this", "->", "getOptions", "(", ")", "->", "buildOptions", "(", ")", ",", "array", "(", "'uri'", "=>", "$", "uri", ")"...
Validates a given URI Executes the validator using the current parameters and returns a Response object on success. @param string $uri The address to the page to validate ex: http://example.com/ @return Response object HTMLValidator\Response
[ "Validates", "a", "given", "URI" ]
10e4142b316bfca728dfa359c6834053a5f2acf0
https://github.com/Gemorroj/HTMLValidator/blob/10e4142b316bfca728dfa359c6834053a5f2acf0/src/HTMLValidator.php#L94-L111
187,327
Gemorroj/HTMLValidator
src/HTMLValidator.php
HTMLValidator.validateFile
public function validateFile($file) { if (file_exists($file) !== true) { throw new Exception('File not found'); } if (is_readable($file) !== true) { throw new Exception('File not readable'); } $data = file_get_contents($file); if ($data === fa...
php
public function validateFile($file) { if (file_exists($file) !== true) { throw new Exception('File not found'); } if (is_readable($file) !== true) { throw new Exception('File not readable'); } $data = file_get_contents($file); if ($data === fa...
[ "public", "function", "validateFile", "(", "$", "file", ")", "{", "if", "(", "file_exists", "(", "$", "file", ")", "!==", "true", ")", "{", "throw", "new", "Exception", "(", "'File not found'", ")", ";", "}", "if", "(", "is_readable", "(", "$", "file",...
Validates the local file Requests validation on the local file, from an instance of the W3C validator. @param string $file file to be validated. @throws Exception @return Response object HTMLValidator\Response
[ "Validates", "the", "local", "file" ]
10e4142b316bfca728dfa359c6834053a5f2acf0
https://github.com/Gemorroj/HTMLValidator/blob/10e4142b316bfca728dfa359c6834053a5f2acf0/src/HTMLValidator.php#L124-L139
187,328
Gemorroj/HTMLValidator
src/HTMLValidator.php
HTMLValidator.validateFragment
public function validateFragment($html) { $query = http_build_query(array_merge( $this->getOptions()->buildOptions(), array('fragment' => $html) )); $context = stream_context_create(array( 'http' => array( 'method' => 'POST', ...
php
public function validateFragment($html) { $query = http_build_query(array_merge( $this->getOptions()->buildOptions(), array('fragment' => $html) )); $context = stream_context_create(array( 'http' => array( 'method' => 'POST', ...
[ "public", "function", "validateFragment", "(", "$", "html", ")", "{", "$", "query", "=", "http_build_query", "(", "array_merge", "(", "$", "this", "->", "getOptions", "(", ")", "->", "buildOptions", "(", ")", ",", "array", "(", "'fragment'", "=>", "$", "...
Validate an html string @param string $html full html document fragment @return Response object HTMLValidator\Response
[ "Validate", "an", "html", "string" ]
10e4142b316bfca728dfa359c6834053a5f2acf0
https://github.com/Gemorroj/HTMLValidator/blob/10e4142b316bfca728dfa359c6834053a5f2acf0/src/HTMLValidator.php#L148-L166
187,329
Gemorroj/HTMLValidator
src/HTMLValidator.php
HTMLValidator.parseSOAP12Response
protected function parseSOAP12Response($xml) { $doc = new \DOMDocument('1.0', 'UTF-8'); if ($doc->loadXML($xml) === false) { throw new Exception('Failed load xml'); } $response = new Response(); // Get the standard CDATA elements foreach (array('uri', '...
php
protected function parseSOAP12Response($xml) { $doc = new \DOMDocument('1.0', 'UTF-8'); if ($doc->loadXML($xml) === false) { throw new Exception('Failed load xml'); } $response = new Response(); // Get the standard CDATA elements foreach (array('uri', '...
[ "protected", "function", "parseSOAP12Response", "(", "$", "xml", ")", "{", "$", "doc", "=", "new", "\\", "DOMDocument", "(", "'1.0'", ",", "'UTF-8'", ")", ";", "if", "(", "$", "doc", "->", "loadXML", "(", "$", "xml", ")", "===", "false", ")", "{", ...
Parse an XML response from the validator This function parses a SOAP 1.2 response xml string from the validator. @param string $xml The raw soap12 XML response from the validator. @return Response object HTMLValidator\Response @throws Exception
[ "Parse", "an", "XML", "response", "from", "the", "validator" ]
10e4142b316bfca728dfa359c6834053a5f2acf0
https://github.com/Gemorroj/HTMLValidator/blob/10e4142b316bfca728dfa359c6834053a5f2acf0/src/HTMLValidator.php#L179-L217
187,330
koolkode/webdav
src/Handler/PatchResponseBuilder.php
PatchResponseBuilder.getPropStats
protected function getPropStats(): array { $result = []; $failed = false; foreach ($this->proppatch->getOperations() as $operation) { $tmp = $operation->getResult(); if (is_integer($tmp)) { if (empty($result[$tmp])) { ...
php
protected function getPropStats(): array { $result = []; $failed = false; foreach ($this->proppatch->getOperations() as $operation) { $tmp = $operation->getResult(); if (is_integer($tmp)) { if (empty($result[$tmp])) { ...
[ "protected", "function", "getPropStats", "(", ")", ":", "array", "{", "$", "result", "=", "[", "]", ";", "$", "failed", "=", "false", ";", "foreach", "(", "$", "this", "->", "proppatch", "->", "getOperations", "(", ")", "as", "$", "operation", ")", "...
Compute propstats from patch operations and return them groupded by HTTP status code. @return array<integer, array<ProppatchOperationInterface>>
[ "Compute", "propstats", "from", "patch", "operations", "and", "return", "them", "groupded", "by", "HTTP", "status", "code", "." ]
05e7d45b090d7384a6a0b6dfe6ac305d9138d88e
https://github.com/koolkode/webdav/blob/05e7d45b090d7384a6a0b6dfe6ac305d9138d88e/src/Handler/PatchResponseBuilder.php#L120-L172
187,331
Chemaclass/knob-base
src/models/Image.php
Image.getImage
protected function getImage($keyImg, $sizeW, $sizeH = false) { $sizeH = ($sizeH) ? $sizeH : $sizeW; // fetch local avatar from meta and make sure it's properly ste $local_avatars = get_user_meta($this->ID, $keyImg, true); if (empty($local_avatars['full'])) { return ''; ...
php
protected function getImage($keyImg, $sizeW, $sizeH = false) { $sizeH = ($sizeH) ? $sizeH : $sizeW; // fetch local avatar from meta and make sure it's properly ste $local_avatars = get_user_meta($this->ID, $keyImg, true); if (empty($local_avatars['full'])) { return ''; ...
[ "protected", "function", "getImage", "(", "$", "keyImg", ",", "$", "sizeW", ",", "$", "sizeH", "=", "false", ")", "{", "$", "sizeH", "=", "(", "$", "sizeH", ")", "?", "$", "sizeH", ":", "$", "sizeW", ";", "// fetch local avatar from meta and make sure it's...
Get the image @param string $keyImg Key image @param int $sizeW weight @param int $sizeH height @return string URL to the image
[ "Get", "the", "image" ]
b7517e0a7cb28a7d19d22ceeae761bde4db9eaa5
https://github.com/Chemaclass/knob-base/blob/b7517e0a7cb28a7d19d22ceeae761bde4db9eaa5/src/models/Image.php#L85-L123
187,332
Chemaclass/knob-base
src/models/Image.php
Image.removeImage
private function removeImage($keyImg) { // Save the path in one temporal var $getImagePath = $this->getImagePath($keyImg); $sizes = $this->getImageSizesToDelete(); foreach ($sizes as $size) { $imgPath = $getImagePath['virgen'] . "-{$size}x{$size}" . $getImagePath['ext']; ...
php
private function removeImage($keyImg) { // Save the path in one temporal var $getImagePath = $this->getImagePath($keyImg); $sizes = $this->getImageSizesToDelete(); foreach ($sizes as $size) { $imgPath = $getImagePath['virgen'] . "-{$size}x{$size}" . $getImagePath['ext']; ...
[ "private", "function", "removeImage", "(", "$", "keyImg", ")", "{", "// Save the path in one temporal var", "$", "getImagePath", "=", "$", "this", "->", "getImagePath", "(", "$", "keyImg", ")", ";", "$", "sizes", "=", "$", "this", "->", "getImageSizesToDelete", ...
Remove the image @param unknown $keyImg
[ "Remove", "the", "image" ]
b7517e0a7cb28a7d19d22ceeae761bde4db9eaa5
https://github.com/Chemaclass/knob-base/blob/b7517e0a7cb28a7d19d22ceeae761bde4db9eaa5/src/models/Image.php#L130-L152
187,333
Chemaclass/knob-base
src/models/Image.php
Image.getImagePath
private function getImagePath($keyImg) { $upload_path = wp_upload_dir(); $img = $this->getImage($keyImg, User::AVATAR_SIZE_ICO); $path = str_replace($upload_path['baseurl'], $upload_path['basedir'], $img); $current = $base = basename($path); if (strpos($base, '-') !== false) ...
php
private function getImagePath($keyImg) { $upload_path = wp_upload_dir(); $img = $this->getImage($keyImg, User::AVATAR_SIZE_ICO); $path = str_replace($upload_path['baseurl'], $upload_path['basedir'], $img); $current = $base = basename($path); if (strpos($base, '-') !== false) ...
[ "private", "function", "getImagePath", "(", "$", "keyImg", ")", "{", "$", "upload_path", "=", "wp_upload_dir", "(", ")", ";", "$", "img", "=", "$", "this", "->", "getImage", "(", "$", "keyImg", ",", "User", "::", "AVATAR_SIZE_ICO", ")", ";", "$", "path...
Return the base name of the img and the name of the current img. for example [ 'current' => 'Chemaclass_avatar-26x26.png', 'base' => 'Chemaclass_avatar.png', 'virgen' => 'Chemaclass_avatar', 'ext' => '.png', ]; @return array<string> List with the current name, base, virgen and extension of the image
[ "Return", "the", "base", "name", "of", "the", "img", "and", "the", "name", "of", "the", "current", "img", "." ]
b7517e0a7cb28a7d19d22ceeae761bde4db9eaa5
https://github.com/Chemaclass/knob-base/blob/b7517e0a7cb28a7d19d22ceeae761bde4db9eaa5/src/models/Image.php#L166-L186
187,334
devp-eu/tmcms-core
src/Network/Domains.php
Domains.getDomainName
public static function getDomainName(string $url): string { if (isset(self::$cached_url_domains[$url])) { return self::$cached_url_domains[$url]; } $parsed_url = parse_url(strtolower($url)); $host = $parsed_url['host'] ?? ''; /// Remove www. part if (0 =...
php
public static function getDomainName(string $url): string { if (isset(self::$cached_url_domains[$url])) { return self::$cached_url_domains[$url]; } $parsed_url = parse_url(strtolower($url)); $host = $parsed_url['host'] ?? ''; /// Remove www. part if (0 =...
[ "public", "static", "function", "getDomainName", "(", "string", "$", "url", ")", ":", "string", "{", "if", "(", "isset", "(", "self", "::", "$", "cached_url_domains", "[", "$", "url", "]", ")", ")", "{", "return", "self", "::", "$", "cached_url_domains",...
Get domain name by full URL address @param string $url @return string
[ "Get", "domain", "name", "by", "full", "URL", "address" ]
b031af5643b6dc641539847784875137c8979cdd
https://github.com/devp-eu/tmcms-core/blob/b031af5643b6dc641539847784875137c8979cdd/src/Network/Domains.php#L32-L63
187,335
volodymyr-volynets/framework
System/Config.php
Config.ini
public static function ini(string $ini_file, $environment = null) : array { $result = []; $data = parse_ini_file($ini_file, true); // processing environment if (!empty($data['environment'])) { foreach ($data['environment'] as $k => $v) { array_key_set($result, explode('.', $k), $v); } } unset($dat...
php
public static function ini(string $ini_file, $environment = null) : array { $result = []; $data = parse_ini_file($ini_file, true); // processing environment if (!empty($data['environment'])) { foreach ($data['environment'] as $k => $v) { array_key_set($result, explode('.', $k), $v); } } unset($dat...
[ "public", "static", "function", "ini", "(", "string", "$", "ini_file", ",", "$", "environment", "=", "null", ")", ":", "array", "{", "$", "result", "=", "[", "]", ";", "$", "data", "=", "parse_ini_file", "(", "$", "ini_file", ",", "true", ")", ";", ...
Process ini file @param string $ini_file @param string $environment @return array
[ "Process", "ini", "file" ]
975a49d7ac1697ed13e82e445908e7886ee62fb8
https://github.com/volodymyr-volynets/framework/blob/975a49d7ac1697ed13e82e445908e7886ee62fb8/System/Config.php#L16-L46
187,336
PayUMEA/payu-mea-sdk-php
lib/PayU/Api/Currency.php
Currency.setValue
public function setValue($value) { NumericValidator::validate($value, "Value"); $value = Formatter::formatToPrice($value, $this->getCurrency()); $this->value = $value; return $this; }
php
public function setValue($value) { NumericValidator::validate($value, "Value"); $value = Formatter::formatToPrice($value, $this->getCurrency()); $this->value = $value; return $this; }
[ "public", "function", "setValue", "(", "$", "value", ")", "{", "NumericValidator", "::", "validate", "(", "$", "value", ",", "\"Value\"", ")", ";", "$", "value", "=", "Formatter", "::", "formatToPrice", "(", "$", "value", ",", "$", "this", "->", "getCurr...
amount up to N digit after the decimals separator as defined in ISO 4217 for the appropriate currency code. @param string|double $value @return $this
[ "amount", "up", "to", "N", "digit", "after", "the", "decimals", "separator", "as", "defined", "in", "ISO", "4217", "for", "the", "appropriate", "currency", "code", "." ]
ebfcd99303cc424458732da8e1771edff843e437
https://github.com/PayUMEA/payu-mea-sdk-php/blob/ebfcd99303cc424458732da8e1771edff843e437/lib/PayU/Api/Currency.php#L50-L56
187,337
vegas-cmf/auth
src/Authentication/Adapter/Standard.php
Standard.authenticate
public function authenticate(GenericUserInterface $user, $credential) { $authenticationResult = $this->passwordManager->validate($credential, $user->getCredential()); if (!$authenticationResult) { throw new InvalidCredentialException(); } $this->store($user->getAttribute...
php
public function authenticate(GenericUserInterface $user, $credential) { $authenticationResult = $this->passwordManager->validate($credential, $user->getCredential()); if (!$authenticationResult) { throw new InvalidCredentialException(); } $this->store($user->getAttribute...
[ "public", "function", "authenticate", "(", "GenericUserInterface", "$", "user", ",", "$", "credential", ")", "{", "$", "authenticationResult", "=", "$", "this", "->", "passwordManager", "->", "validate", "(", "$", "credential", ",", "$", "user", "->", "getCred...
Authenticates user with indicated credential @param \Vegas\Security\Authentication\GenericUserInterface $user @param $credential @throws \Vegas\Security\Authentication\Exception\InvalidCredentialException @return bool
[ "Authenticates", "user", "with", "indicated", "credential" ]
c4cc42ed6d0b7caae81d18f857470cdfefdffedd
https://github.com/vegas-cmf/auth/blob/c4cc42ed6d0b7caae81d18f857470cdfefdffedd/src/Authentication/Adapter/Standard.php#L35-L45
187,338
koolkode/k1
src/Http/DeflateServerMiddleware.php
DeflateServerMiddleware.isCompressable
protected function isCompressable(ServerRequestInterface $request, ResponseInterface $response): bool { if ($request->getMethod() === Http::HEAD) { return false; } if (Http::isResponseWithoutBody($response->getStatusCode())) { return false; } if (!$r...
php
protected function isCompressable(ServerRequestInterface $request, ResponseInterface $response): bool { if ($request->getMethod() === Http::HEAD) { return false; } if (Http::isResponseWithoutBody($response->getStatusCode())) { return false; } if (!$r...
[ "protected", "function", "isCompressable", "(", "ServerRequestInterface", "$", "request", ",", "ResponseInterface", "$", "response", ")", ":", "bool", "{", "if", "(", "$", "request", "->", "getMethod", "(", ")", "===", "Http", "::", "HEAD", ")", "{", "return...
Check if the given response payload should be compressed.
[ "Check", "if", "the", "given", "response", "payload", "should", "be", "compressed", "." ]
5b21df0ef7b0b53ded72157855ab2bc2fb398538
https://github.com/koolkode/k1/blob/5b21df0ef7b0b53ded72157855ab2bc2fb398538/src/Http/DeflateServerMiddleware.php#L183-L225
187,339
CradlePHP/Handlebars
src/HandlebarsTokenizer.php
HandlebarsTokenizer.findVariable
protected function findVariable($i, $escape) { $close = $this->bars[1] . $this->bars[1]; if ($escape) { $close = $close . $this->bars[1]; } for (; substr($this->source, $i, strlen($close)) !== $close; $i++) { } return $i + strlen($close); }
php
protected function findVariable($i, $escape) { $close = $this->bars[1] . $this->bars[1]; if ($escape) { $close = $close . $this->bars[1]; } for (; substr($this->source, $i, strlen($close)) !== $close; $i++) { } return $i + strlen($close); }
[ "protected", "function", "findVariable", "(", "$", "i", ",", "$", "escape", ")", "{", "$", "close", "=", "$", "this", "->", "bars", "[", "1", "]", ".", "$", "this", "->", "bars", "[", "1", "]", ";", "if", "(", "$", "escape", ")", "{", "$", "c...
Since we know where the start is, we need to find the end in the source @param *int $i @param *bool $escape @return int
[ "Since", "we", "know", "where", "the", "start", "is", "we", "need", "to", "find", "the", "end", "in", "the", "source" ]
c74b2016ea845e95b782d65cd4a8964bb334542e
https://github.com/CradlePHP/Handlebars/blob/c74b2016ea845e95b782d65cd4a8964bb334542e/src/HandlebarsTokenizer.php#L245-L258
187,340
Litecms/PriceList
src/Policies/PriceListPolicy.php
PriceListPolicy.update
public function update(UserPolicy $user, PriceList $price_list) { if ($user->canDo('pricelist.price_list.edit') && $user->isAdmin()) { return true; } return $price_list->user_id == user_id() && $price_list->user_type == user_type(); }
php
public function update(UserPolicy $user, PriceList $price_list) { if ($user->canDo('pricelist.price_list.edit') && $user->isAdmin()) { return true; } return $price_list->user_id == user_id() && $price_list->user_type == user_type(); }
[ "public", "function", "update", "(", "UserPolicy", "$", "user", ",", "PriceList", "$", "price_list", ")", "{", "if", "(", "$", "user", "->", "canDo", "(", "'pricelist.price_list.edit'", ")", "&&", "$", "user", "->", "isAdmin", "(", ")", ")", "{", "return...
Determine if the given user can update the given price_list. @param UserPolicy $user @param PriceList $price_list @return bool
[ "Determine", "if", "the", "given", "user", "can", "update", "the", "given", "price_list", "." ]
d80c365913773a359131911d49a82a3b9c620ad5
https://github.com/Litecms/PriceList/blob/d80c365913773a359131911d49a82a3b9c620ad5/src/Policies/PriceListPolicy.php#L49-L56
187,341
Litecms/PriceList
src/Policies/PriceListPolicy.php
PriceListPolicy.destroy
public function destroy(UserPolicy $user, PriceList $price_list) { return $price_list->user_id == user_id() && $price_list->user_type == user_type(); }
php
public function destroy(UserPolicy $user, PriceList $price_list) { return $price_list->user_id == user_id() && $price_list->user_type == user_type(); }
[ "public", "function", "destroy", "(", "UserPolicy", "$", "user", ",", "PriceList", "$", "price_list", ")", "{", "return", "$", "price_list", "->", "user_id", "==", "user_id", "(", ")", "&&", "$", "price_list", "->", "user_type", "==", "user_type", "(", ")"...
Determine if the given user can delete the given price_list. @param UserPolicy $user @param PriceList $price_list @return bool
[ "Determine", "if", "the", "given", "user", "can", "delete", "the", "given", "price_list", "." ]
d80c365913773a359131911d49a82a3b9c620ad5
https://github.com/Litecms/PriceList/blob/d80c365913773a359131911d49a82a3b9c620ad5/src/Policies/PriceListPolicy.php#L66-L69
187,342
Litecms/PriceList
src/Http/Controllers/PriceListResourceController.php
PriceListResourceController.index
public function index(PriceListRequest $request) { $view = $this->response->theme->listView(); if ($this->response->typeIs('json')) { $function = camel_case('get-' . $view); return $this->repository ->setPresenter(\Litecms\Pricelist\Repositories\Presenter\Pri...
php
public function index(PriceListRequest $request) { $view = $this->response->theme->listView(); if ($this->response->typeIs('json')) { $function = camel_case('get-' . $view); return $this->repository ->setPresenter(\Litecms\Pricelist\Repositories\Presenter\Pri...
[ "public", "function", "index", "(", "PriceListRequest", "$", "request", ")", "{", "$", "view", "=", "$", "this", "->", "response", "->", "theme", "->", "listView", "(", ")", ";", "if", "(", "$", "this", "->", "response", "->", "typeIs", "(", "'json'", ...
Display a list of price_list. @return Response
[ "Display", "a", "list", "of", "price_list", "." ]
d80c365913773a359131911d49a82a3b9c620ad5
https://github.com/Litecms/PriceList/blob/d80c365913773a359131911d49a82a3b9c620ad5/src/Http/Controllers/PriceListResourceController.php#L38-L55
187,343
Litecms/PriceList
src/Http/Controllers/PriceListResourceController.php
PriceListResourceController.show
public function show(PriceListRequest $request, PriceList $price_list) { if ($price_list->exists) { $view = 'pricelist::price_list.show'; } else { $view = 'pricelist::price_list.new'; } return $this->response->title(trans('app.view') . ' ' . trans('pricelist...
php
public function show(PriceListRequest $request, PriceList $price_list) { if ($price_list->exists) { $view = 'pricelist::price_list.show'; } else { $view = 'pricelist::price_list.new'; } return $this->response->title(trans('app.view') . ' ' . trans('pricelist...
[ "public", "function", "show", "(", "PriceListRequest", "$", "request", ",", "PriceList", "$", "price_list", ")", "{", "if", "(", "$", "price_list", "->", "exists", ")", "{", "$", "view", "=", "'pricelist::price_list.show'", ";", "}", "else", "{", "$", "vie...
Display price_list. @param Request $request @param Model $price_list @return Response
[ "Display", "price_list", "." ]
d80c365913773a359131911d49a82a3b9c620ad5
https://github.com/Litecms/PriceList/blob/d80c365913773a359131911d49a82a3b9c620ad5/src/Http/Controllers/PriceListResourceController.php#L65-L78
187,344
Litecms/PriceList
src/Http/Controllers/PriceListResourceController.php
PriceListResourceController.edit
public function edit(PriceListRequest $request, PriceList $price_list) { return $this->response->title(trans('app.edit') . ' ' . trans('pricelist::price_list.name')) ->view('pricelist::price_list.edit', true) ->data(compact('price_list')) ->output(); }
php
public function edit(PriceListRequest $request, PriceList $price_list) { return $this->response->title(trans('app.edit') . ' ' . trans('pricelist::price_list.name')) ->view('pricelist::price_list.edit', true) ->data(compact('price_list')) ->output(); }
[ "public", "function", "edit", "(", "PriceListRequest", "$", "request", ",", "PriceList", "$", "price_list", ")", "{", "return", "$", "this", "->", "response", "->", "title", "(", "trans", "(", "'app.edit'", ")", ".", "' '", ".", "trans", "(", "'pricelist::...
Show price_list for editing. @param Request $request @param Model $price_list @return Response
[ "Show", "price_list", "for", "editing", "." ]
d80c365913773a359131911d49a82a3b9c620ad5
https://github.com/Litecms/PriceList/blob/d80c365913773a359131911d49a82a3b9c620ad5/src/Http/Controllers/PriceListResourceController.php#L135-L141
187,345
Litecms/PriceList
src/Http/Controllers/PriceListResourceController.php
PriceListResourceController.update
public function update(PriceListRequest $request, PriceList $price_list) { try { $attributes = $request->all(); $price_list->update($attributes); return $this->response->message(trans('messages.success.updated', ['Module' => trans('pricelist::price_list.name')])) ...
php
public function update(PriceListRequest $request, PriceList $price_list) { try { $attributes = $request->all(); $price_list->update($attributes); return $this->response->message(trans('messages.success.updated', ['Module' => trans('pricelist::price_list.name')])) ...
[ "public", "function", "update", "(", "PriceListRequest", "$", "request", ",", "PriceList", "$", "price_list", ")", "{", "try", "{", "$", "attributes", "=", "$", "request", "->", "all", "(", ")", ";", "$", "price_list", "->", "update", "(", "$", "attribut...
Update the price_list. @param Request $request @param Model $price_list @return Response
[ "Update", "the", "price_list", "." ]
d80c365913773a359131911d49a82a3b9c620ad5
https://github.com/Litecms/PriceList/blob/d80c365913773a359131911d49a82a3b9c620ad5/src/Http/Controllers/PriceListResourceController.php#L151-L170
187,346
Litecms/PriceList
src/Http/Controllers/PriceListResourceController.php
PriceListResourceController.destroy
public function destroy(PriceListRequest $request, PriceList $price_list) { try { $price_list->delete(); return $this->response->message(trans('messages.success.deleted', ['Module' => trans('pricelist::price_list.name')])) ->code(202) ->status('succes...
php
public function destroy(PriceListRequest $request, PriceList $price_list) { try { $price_list->delete(); return $this->response->message(trans('messages.success.deleted', ['Module' => trans('pricelist::price_list.name')])) ->code(202) ->status('succes...
[ "public", "function", "destroy", "(", "PriceListRequest", "$", "request", ",", "PriceList", "$", "price_list", ")", "{", "try", "{", "$", "price_list", "->", "delete", "(", ")", ";", "return", "$", "this", "->", "response", "->", "message", "(", "trans", ...
Remove the price_list. @param Model $price_list @return Response
[ "Remove", "the", "price_list", "." ]
d80c365913773a359131911d49a82a3b9c620ad5
https://github.com/Litecms/PriceList/blob/d80c365913773a359131911d49a82a3b9c620ad5/src/Http/Controllers/PriceListResourceController.php#L179-L199
187,347
typidesign/laravel-artisan-translations
src/Console/Commands/AbstractTranslations.php
AbstractTranslations.getTranslations
protected function getTranslations(string $file) : array { return $this->files->exists($file) ? (array) json_decode($this->files->get($file)) : []; }
php
protected function getTranslations(string $file) : array { return $this->files->exists($file) ? (array) json_decode($this->files->get($file)) : []; }
[ "protected", "function", "getTranslations", "(", "string", "$", "file", ")", ":", "array", "{", "return", "$", "this", "->", "files", "->", "exists", "(", "$", "file", ")", "?", "(", "array", ")", "json_decode", "(", "$", "this", "->", "files", "->", ...
Get an array containing all translations form a json file.
[ "Get", "an", "array", "containing", "all", "translations", "form", "a", "json", "file", "." ]
ef72faef049973a31ea92d5281647196e37116f7
https://github.com/typidesign/laravel-artisan-translations/blob/ef72faef049973a31ea92d5281647196e37116f7/src/Console/Commands/AbstractTranslations.php#L28-L31
187,348
typidesign/laravel-artisan-translations
src/Console/Commands/AbstractTranslations.php
AbstractTranslations.put
protected function put(string $file, array $translations) { $this->files->put($file, json_encode($translations, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT)); }
php
protected function put(string $file, array $translations) { $this->files->put($file, json_encode($translations, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT)); }
[ "protected", "function", "put", "(", "string", "$", "file", ",", "array", "$", "translations", ")", "{", "$", "this", "->", "files", "->", "put", "(", "$", "file", ",", "json_encode", "(", "$", "translations", ",", "JSON_PRETTY_PRINT", "|", "JSON_UNESCAPED...
Update the json file with new object.
[ "Update", "the", "json", "file", "with", "new", "object", "." ]
ef72faef049973a31ea92d5281647196e37116f7
https://github.com/typidesign/laravel-artisan-translations/blob/ef72faef049973a31ea92d5281647196e37116f7/src/Console/Commands/AbstractTranslations.php#L36-L39
187,349
Litecms/Faq
src/Http/Controllers/FaqResourceController.php
FaqResourceController.index
public function index(FaqRequest $request) { $view = $this->response->theme->listView(); if ($this->response->typeIs('json')) { $function = camel_case('get-' . $view); return $this->repository ->setPresenter(\Litecms\Faq\Repositories\Presenter\FaqPresenter::c...
php
public function index(FaqRequest $request) { $view = $this->response->theme->listView(); if ($this->response->typeIs('json')) { $function = camel_case('get-' . $view); return $this->repository ->setPresenter(\Litecms\Faq\Repositories\Presenter\FaqPresenter::c...
[ "public", "function", "index", "(", "FaqRequest", "$", "request", ")", "{", "$", "view", "=", "$", "this", "->", "response", "->", "theme", "->", "listView", "(", ")", ";", "if", "(", "$", "this", "->", "response", "->", "typeIs", "(", "'json'", ")",...
Display a list of faq. @return Response
[ "Display", "a", "list", "of", "faq", "." ]
4101a630db28ef16980754da962054eb1bdb12de
https://github.com/Litecms/Faq/blob/4101a630db28ef16980754da962054eb1bdb12de/src/Http/Controllers/FaqResourceController.php#L38-L55
187,350
Litecms/Faq
src/Http/Controllers/FaqResourceController.php
FaqResourceController.show
public function show(FaqRequest $request, Faq $faq) { if ($faq->exists) { $view = 'faq::faq.show'; } else { $view = 'faq::faq.new'; } return $this->response->title(trans('app.view') . ' ' . trans('faq::faq.name')) ->data(compact('faq')) ...
php
public function show(FaqRequest $request, Faq $faq) { if ($faq->exists) { $view = 'faq::faq.show'; } else { $view = 'faq::faq.new'; } return $this->response->title(trans('app.view') . ' ' . trans('faq::faq.name')) ->data(compact('faq')) ...
[ "public", "function", "show", "(", "FaqRequest", "$", "request", ",", "Faq", "$", "faq", ")", "{", "if", "(", "$", "faq", "->", "exists", ")", "{", "$", "view", "=", "'faq::faq.show'", ";", "}", "else", "{", "$", "view", "=", "'faq::faq.new'", ";", ...
Display faq. @param Request $request @param Model $faq @return Response
[ "Display", "faq", "." ]
4101a630db28ef16980754da962054eb1bdb12de
https://github.com/Litecms/Faq/blob/4101a630db28ef16980754da962054eb1bdb12de/src/Http/Controllers/FaqResourceController.php#L65-L78
187,351
Litecms/Faq
src/Http/Controllers/FaqResourceController.php
FaqResourceController.edit
public function edit(FaqRequest $request, Faq $faq) { return $this->response->title(trans('app.edit') . ' ' . trans('faq::faq.name')) ->view('faq::faq.edit', true) ->data(compact('faq')) ->output(); }
php
public function edit(FaqRequest $request, Faq $faq) { return $this->response->title(trans('app.edit') . ' ' . trans('faq::faq.name')) ->view('faq::faq.edit', true) ->data(compact('faq')) ->output(); }
[ "public", "function", "edit", "(", "FaqRequest", "$", "request", ",", "Faq", "$", "faq", ")", "{", "return", "$", "this", "->", "response", "->", "title", "(", "trans", "(", "'app.edit'", ")", ".", "' '", ".", "trans", "(", "'faq::faq.name'", ")", ")",...
Show faq for editing. @param Request $request @param Model $faq @return Response
[ "Show", "faq", "for", "editing", "." ]
4101a630db28ef16980754da962054eb1bdb12de
https://github.com/Litecms/Faq/blob/4101a630db28ef16980754da962054eb1bdb12de/src/Http/Controllers/FaqResourceController.php#L135-L141
187,352
Litecms/Faq
src/Http/Controllers/FaqResourceController.php
FaqResourceController.update
public function update(FaqRequest $request, Faq $faq) { try { $attributes = $request->all(); $faq->update($attributes); return $this->response->message(trans('messages.success.updated', ['Module' => trans('faq::faq.name')])) ->code(204) ->...
php
public function update(FaqRequest $request, Faq $faq) { try { $attributes = $request->all(); $faq->update($attributes); return $this->response->message(trans('messages.success.updated', ['Module' => trans('faq::faq.name')])) ->code(204) ->...
[ "public", "function", "update", "(", "FaqRequest", "$", "request", ",", "Faq", "$", "faq", ")", "{", "try", "{", "$", "attributes", "=", "$", "request", "->", "all", "(", ")", ";", "$", "faq", "->", "update", "(", "$", "attributes", ")", ";", "retu...
Update the faq. @param Request $request @param Model $faq @return Response
[ "Update", "the", "faq", "." ]
4101a630db28ef16980754da962054eb1bdb12de
https://github.com/Litecms/Faq/blob/4101a630db28ef16980754da962054eb1bdb12de/src/Http/Controllers/FaqResourceController.php#L151-L170
187,353
Litecms/Faq
src/Http/Controllers/FaqResourceController.php
FaqResourceController.destroy
public function destroy(FaqRequest $request, Faq $faq) { try { $faq->delete(); return $this->response->message(trans('messages.success.deleted', ['Module' => trans('faq::faq.name')])) ->code(202) ->status('success') ->url(guard_url('fa...
php
public function destroy(FaqRequest $request, Faq $faq) { try { $faq->delete(); return $this->response->message(trans('messages.success.deleted', ['Module' => trans('faq::faq.name')])) ->code(202) ->status('success') ->url(guard_url('fa...
[ "public", "function", "destroy", "(", "FaqRequest", "$", "request", ",", "Faq", "$", "faq", ")", "{", "try", "{", "$", "faq", "->", "delete", "(", ")", ";", "return", "$", "this", "->", "response", "->", "message", "(", "trans", "(", "'messages.success...
Remove the faq. @param Model $faq @return Response
[ "Remove", "the", "faq", "." ]
4101a630db28ef16980754da962054eb1bdb12de
https://github.com/Litecms/Faq/blob/4101a630db28ef16980754da962054eb1bdb12de/src/Http/Controllers/FaqResourceController.php#L179-L199
187,354
Litecms/Faq
src/Policies/FaqPolicy.php
FaqPolicy.view
public function view(UserPolicy $user, Faq $faq) { if ($user->canDo('faq.faq.view') && $user->isAdmin()) { return true; } return $faq->user_id == user_id() && $faq->user_type == user_type(); }
php
public function view(UserPolicy $user, Faq $faq) { if ($user->canDo('faq.faq.view') && $user->isAdmin()) { return true; } return $faq->user_id == user_id() && $faq->user_type == user_type(); }
[ "public", "function", "view", "(", "UserPolicy", "$", "user", ",", "Faq", "$", "faq", ")", "{", "if", "(", "$", "user", "->", "canDo", "(", "'faq.faq.view'", ")", "&&", "$", "user", "->", "isAdmin", "(", ")", ")", "{", "return", "true", ";", "}", ...
Determine if the given user can view the faq. @param UserPolicy $user @param Faq $faq @return bool
[ "Determine", "if", "the", "given", "user", "can", "view", "the", "faq", "." ]
4101a630db28ef16980754da962054eb1bdb12de
https://github.com/Litecms/Faq/blob/4101a630db28ef16980754da962054eb1bdb12de/src/Policies/FaqPolicy.php#L19-L26
187,355
Litecms/Faq
src/Policies/FaqPolicy.php
FaqPolicy.destroy
public function destroy(UserPolicy $user, Faq $faq) { return $faq->user_id == user_id() && $faq->user_type == user_type(); }
php
public function destroy(UserPolicy $user, Faq $faq) { return $faq->user_id == user_id() && $faq->user_type == user_type(); }
[ "public", "function", "destroy", "(", "UserPolicy", "$", "user", ",", "Faq", "$", "faq", ")", "{", "return", "$", "faq", "->", "user_id", "==", "user_id", "(", ")", "&&", "$", "faq", "->", "user_type", "==", "user_type", "(", ")", ";", "}" ]
Determine if the given user can delete the given faq. @param UserPolicy $user @param Faq $faq @return bool
[ "Determine", "if", "the", "given", "user", "can", "delete", "the", "given", "faq", "." ]
4101a630db28ef16980754da962054eb1bdb12de
https://github.com/Litecms/Faq/blob/4101a630db28ef16980754da962054eb1bdb12de/src/Policies/FaqPolicy.php#L66-L69
187,356
Litecms/Faq
src/Http/Controllers/CategoryResourceController.php
CategoryResourceController.create
public function create(CategoryRequest $request) { $category = $this->repository->newInstance([]); return $this->response->title(trans('app.new') . ' ' . trans('faq::category.name')) ->view('faq::category.create', true) ->data(compact('category')) ->output(); ...
php
public function create(CategoryRequest $request) { $category = $this->repository->newInstance([]); return $this->response->title(trans('app.new') . ' ' . trans('faq::category.name')) ->view('faq::category.create', true) ->data(compact('category')) ->output(); ...
[ "public", "function", "create", "(", "CategoryRequest", "$", "request", ")", "{", "$", "category", "=", "$", "this", "->", "repository", "->", "newInstance", "(", "[", "]", ")", ";", "return", "$", "this", "->", "response", "->", "title", "(", "trans", ...
Show the form for creating a new category. @param Request $request @return Response
[ "Show", "the", "form", "for", "creating", "a", "new", "category", "." ]
4101a630db28ef16980754da962054eb1bdb12de
https://github.com/Litecms/Faq/blob/4101a630db28ef16980754da962054eb1bdb12de/src/Http/Controllers/CategoryResourceController.php#L87-L95
187,357
Litecms/Faq
src/Http/Controllers/CategoryResourceController.php
CategoryResourceController.store
public function store(CategoryRequest $request) { try { $attributes = $request->all(); $attributes['user_id'] = user_id(); $attributes['user_type'] = user_type(); $category = $this->repository->create($attributes); r...
php
public function store(CategoryRequest $request) { try { $attributes = $request->all(); $attributes['user_id'] = user_id(); $attributes['user_type'] = user_type(); $category = $this->repository->create($attributes); r...
[ "public", "function", "store", "(", "CategoryRequest", "$", "request", ")", "{", "try", "{", "$", "attributes", "=", "$", "request", "->", "all", "(", ")", ";", "$", "attributes", "[", "'user_id'", "]", "=", "user_id", "(", ")", ";", "$", "attributes",...
Create new category. @param Request $request @return Response
[ "Create", "new", "category", "." ]
4101a630db28ef16980754da962054eb1bdb12de
https://github.com/Litecms/Faq/blob/4101a630db28ef16980754da962054eb1bdb12de/src/Http/Controllers/CategoryResourceController.php#L104-L125
187,358
Litecms/Faq
src/Http/Controllers/CategoryResourceController.php
CategoryResourceController.edit
public function edit(CategoryRequest $request, Category $category) { return $this->response->title(trans('app.edit') . ' ' . trans('faq::category.name')) ->view('faq::category.edit', true) ->data(compact('category')) ->output(); }
php
public function edit(CategoryRequest $request, Category $category) { return $this->response->title(trans('app.edit') . ' ' . trans('faq::category.name')) ->view('faq::category.edit', true) ->data(compact('category')) ->output(); }
[ "public", "function", "edit", "(", "CategoryRequest", "$", "request", ",", "Category", "$", "category", ")", "{", "return", "$", "this", "->", "response", "->", "title", "(", "trans", "(", "'app.edit'", ")", ".", "' '", ".", "trans", "(", "'faq::category.n...
Show category for editing. @param Request $request @param Model $category @return Response
[ "Show", "category", "for", "editing", "." ]
4101a630db28ef16980754da962054eb1bdb12de
https://github.com/Litecms/Faq/blob/4101a630db28ef16980754da962054eb1bdb12de/src/Http/Controllers/CategoryResourceController.php#L135-L141
187,359
Litecms/Faq
src/Http/Controllers/CategoryResourceController.php
CategoryResourceController.update
public function update(CategoryRequest $request, Category $category) { try { $attributes = $request->all(); $category->update($attributes); return $this->response->message(trans('messages.success.updated', ['Module' => trans('faq::category.name')])) ->cod...
php
public function update(CategoryRequest $request, Category $category) { try { $attributes = $request->all(); $category->update($attributes); return $this->response->message(trans('messages.success.updated', ['Module' => trans('faq::category.name')])) ->cod...
[ "public", "function", "update", "(", "CategoryRequest", "$", "request", ",", "Category", "$", "category", ")", "{", "try", "{", "$", "attributes", "=", "$", "request", "->", "all", "(", ")", ";", "$", "category", "->", "update", "(", "$", "attributes", ...
Update the category. @param Request $request @param Model $category @return Response
[ "Update", "the", "category", "." ]
4101a630db28ef16980754da962054eb1bdb12de
https://github.com/Litecms/Faq/blob/4101a630db28ef16980754da962054eb1bdb12de/src/Http/Controllers/CategoryResourceController.php#L151-L170
187,360
Litecms/Faq
src/Http/Controllers/CategoryResourceController.php
CategoryResourceController.destroy
public function destroy(CategoryRequest $request, Category $category) { try { $category->delete(); return $this->response->message(trans('messages.success.deleted', ['Module' => trans('faq::category.name')])) ->code(202) ->status('success') ...
php
public function destroy(CategoryRequest $request, Category $category) { try { $category->delete(); return $this->response->message(trans('messages.success.deleted', ['Module' => trans('faq::category.name')])) ->code(202) ->status('success') ...
[ "public", "function", "destroy", "(", "CategoryRequest", "$", "request", ",", "Category", "$", "category", ")", "{", "try", "{", "$", "category", "->", "delete", "(", ")", ";", "return", "$", "this", "->", "response", "->", "message", "(", "trans", "(", ...
Remove the category. @param Model $category @return Response
[ "Remove", "the", "category", "." ]
4101a630db28ef16980754da962054eb1bdb12de
https://github.com/Litecms/Faq/blob/4101a630db28ef16980754da962054eb1bdb12de/src/Http/Controllers/CategoryResourceController.php#L179-L199
187,361
kartik-v/mpdf
mpdfi/pdf_parser.php
pdf_parser.getEncryption
function getEncryption() { if (isset($this->xref['trailer'][1]['/Encrypt'])) { // mPDF 4.0 $this->success = false; $this->errormsg = sprintf("File is encrypted!"); return false; } }
php
function getEncryption() { if (isset($this->xref['trailer'][1]['/Encrypt'])) { // mPDF 4.0 $this->success = false; $this->errormsg = sprintf("File is encrypted!"); return false; } }
[ "function", "getEncryption", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "xref", "[", "'trailer'", "]", "[", "1", "]", "[", "'/Encrypt'", "]", ")", ")", "{", "// mPDF 4.0", "$", "this", "->", "success", "=", "false", ";", "$", "this"...
Check Trailer for Encryption
[ "Check", "Trailer", "for", "Encryption" ]
01689a83d4e428ef55645d0d0ff1d2f6268047a4
https://github.com/kartik-v/mpdf/blob/01689a83d4e428ef55645d0d0ff1d2f6268047a4/mpdfi/pdf_parser.php#L140-L147
187,362
kartik-v/mpdf
mpdfi/pdf_parser.php
pdf_parser.pdf_find_xref
function pdf_find_xref() { fseek ($this->f, -min(filesize($this->filename),1500), SEEK_END); $data = fread($this->f, 1500); $pos = strlen($data) - strpos(strrev($data), strrev('startxref')); $data = substr($data, $pos); if (!preg_match('/\s*(\d+).*$/s', $data, ...
php
function pdf_find_xref() { fseek ($this->f, -min(filesize($this->filename),1500), SEEK_END); $data = fread($this->f, 1500); $pos = strlen($data) - strpos(strrev($data), strrev('startxref')); $data = substr($data, $pos); if (!preg_match('/\s*(\d+).*$/s', $data, ...
[ "function", "pdf_find_xref", "(", ")", "{", "fseek", "(", "$", "this", "->", "f", ",", "-", "min", "(", "filesize", "(", "$", "this", "->", "filename", ")", ",", "1500", ")", ",", "SEEK_END", ")", ";", "$", "data", "=", "fread", "(", "$", "this",...
Find the xref-Table
[ "Find", "the", "xref", "-", "Table" ]
01689a83d4e428ef55645d0d0ff1d2f6268047a4
https://github.com/kartik-v/mpdf/blob/01689a83d4e428ef55645d0d0ff1d2f6268047a4/mpdfi/pdf_parser.php#L180-L195
187,363
kartik-v/mpdf
mpdfi/pdf_parser.php
pdf_parser.pdf_resolve_object
function pdf_resolve_object(&$c, $obj_spec, $encapsulate = true) { // Exit if we get invalid data if (!is_array($obj_spec)) { return false; } if ($obj_spec[0] == PDF_TYPE_OBJREF) { // This is a reference, resolve it if (isset($this->xref['xref'][$obj_spec[1]][$obj_spec[2...
php
function pdf_resolve_object(&$c, $obj_spec, $encapsulate = true) { // Exit if we get invalid data if (!is_array($obj_spec)) { return false; } if ($obj_spec[0] == PDF_TYPE_OBJREF) { // This is a reference, resolve it if (isset($this->xref['xref'][$obj_spec[1]][$obj_spec[2...
[ "function", "pdf_resolve_object", "(", "&", "$", "c", ",", "$", "obj_spec", ",", "$", "encapsulate", "=", "true", ")", "{", "// Exit if we get invalid data", "if", "(", "!", "is_array", "(", "$", "obj_spec", ")", ")", "{", "return", "false", ";", "}", "i...
Resolve an object @param object $c pdf_context @param array $obj_spec The object-data @param boolean $encapsulate Must set to true, cause the parsing and fpdi use this method only without this para
[ "Resolve", "an", "object" ]
01689a83d4e428ef55645d0d0ff1d2f6268047a4
https://github.com/kartik-v/mpdf/blob/01689a83d4e428ef55645d0d0ff1d2f6268047a4/mpdfi/pdf_parser.php#L516-L590
187,364
kartik-v/mpdf
mpdfi/pdf_parser.php
pdf_parser.pdf_read_token
function pdf_read_token(&$c) { // If there is a token available // on the stack, pop it out and // return it. if (count($c->stack)) { return array_pop($c->stack); } // Strip away any whitespace do { if (!$c->ensure_content()) { return false; } $c-...
php
function pdf_read_token(&$c) { // If there is a token available // on the stack, pop it out and // return it. if (count($c->stack)) { return array_pop($c->stack); } // Strip away any whitespace do { if (!$c->ensure_content()) { return false; } $c-...
[ "function", "pdf_read_token", "(", "&", "$", "c", ")", "{", "// If there is a token available", "// on the stack, pop it out and", "// return it.", "if", "(", "count", "(", "$", "c", "->", "stack", ")", ")", "{", "return", "array_pop", "(", "$", "c", "->", "st...
Reads a token from the file @param object $c pdf_context @return mixed
[ "Reads", "a", "token", "from", "the", "file" ]
01689a83d4e428ef55645d0d0ff1d2f6268047a4
https://github.com/kartik-v/mpdf/blob/01689a83d4e428ef55645d0d0ff1d2f6268047a4/mpdfi/pdf_parser.php#L600-L685
187,365
kartik-v/mpdf
classes/myanmar.php
MYANMAR.in_range
public static function in_range ($u, $lo, $hi) { if ( (($lo^$hi) & $lo) == 0 && (($lo^$hi) & $hi) == ($lo^$hi) && (($lo^$hi) & (($lo^$hi) + 1)) == 0 ) return ($u & ~($lo^$hi)) == $lo; else return $lo <= $u && $u <= $hi; }
php
public static function in_range ($u, $lo, $hi) { if ( (($lo^$hi) & $lo) == 0 && (($lo^$hi) & $hi) == ($lo^$hi) && (($lo^$hi) & (($lo^$hi) + 1)) == 0 ) return ($u & ~($lo^$hi)) == $lo; else return $lo <= $u && $u <= $hi; }
[ "public", "static", "function", "in_range", "(", "$", "u", ",", "$", "lo", ",", "$", "hi", ")", "{", "if", "(", "(", "(", "$", "lo", "^", "$", "hi", ")", "&", "$", "lo", ")", "==", "0", "&&", "(", "(", "$", "lo", "^", "$", "hi", ")", "&...
From hb-private.hh
[ "From", "hb", "-", "private", ".", "hh" ]
01689a83d4e428ef55645d0d0ff1d2f6268047a4
https://github.com/kartik-v/mpdf/blob/01689a83d4e428ef55645d0d0ff1d2f6268047a4/classes/myanmar.php#L399-L404
187,366
kartik-v/mpdf
mpdfi/pdf_context.php
pdf_context.reset
function reset($pos = null, $l = 100) { if (!is_null ($pos)) { fseek ($this->file, $pos); } $this->buffer = $l > 0 ? fread($this->file, $l) : ''; $this->offset = 0; $this->length = strlen($this->buffer); $this->stack = array(); }
php
function reset($pos = null, $l = 100) { if (!is_null ($pos)) { fseek ($this->file, $pos); } $this->buffer = $l > 0 ? fread($this->file, $l) : ''; $this->offset = 0; $this->length = strlen($this->buffer); $this->stack = array(); }
[ "function", "reset", "(", "$", "pos", "=", "null", ",", "$", "l", "=", "100", ")", "{", "if", "(", "!", "is_null", "(", "$", "pos", ")", ")", "{", "fseek", "(", "$", "this", "->", "file", ",", "$", "pos", ")", ";", "}", "$", "this", "->", ...
and reset the buffered data
[ "and", "reset", "the", "buffered", "data" ]
01689a83d4e428ef55645d0d0ff1d2f6268047a4
https://github.com/kartik-v/mpdf/blob/01689a83d4e428ef55645d0d0ff1d2f6268047a4/mpdfi/pdf_context.php#L40-L49
187,367
PhpGt/Http
src/ResponseFactory.php
ResponseFactory.create
public static function create(RequestInterface $request):Response { $negotiator = new Negotiator(); $acceptHeader = $request->getHeaderLine("accept") ?: self::DEFAULT_ACCEPT; $priorities = [ "text/html; charset=UTF-8", "application/json", "application/xml;q=0.5", ]; static::$mediaType = $negotiat...
php
public static function create(RequestInterface $request):Response { $negotiator = new Negotiator(); $acceptHeader = $request->getHeaderLine("accept") ?: self::DEFAULT_ACCEPT; $priorities = [ "text/html; charset=UTF-8", "application/json", "application/xml;q=0.5", ]; static::$mediaType = $negotiat...
[ "public", "static", "function", "create", "(", "RequestInterface", "$", "request", ")", ":", "Response", "{", "$", "negotiator", "=", "new", "Negotiator", "(", ")", ";", "$", "acceptHeader", "=", "$", "request", "->", "getHeaderLine", "(", "\"accept\"", ")",...
A Response object is a PSR-7 compatible object that is created here from the current Request. The type of Response that is returned is determined by the type of request. @see http://www.php-fig.org/psr/psr-7
[ "A", "Response", "object", "is", "a", "PSR", "-", "7", "compatible", "object", "that", "is", "created", "here", "from", "the", "current", "Request", ".", "The", "type", "of", "Response", "that", "is", "returned", "is", "determined", "by", "the", "type", ...
f0ce5d78180e45e9d0f2a86bc8fe5b366dc7b6ef
https://github.com/PhpGt/Http/blob/f0ce5d78180e45e9d0f2a86bc8fe5b366dc7b6ef/src/ResponseFactory.php#L20-L46
187,368
PhpGt/Http
src/ResponseFactory.php
ResponseFactory.registerResponseClass
public static function registerResponseClass( string $responseClassName, string...$accept ):void { if(empty($accept)) { $accept = [self::DEFAULT_ACCEPT]; } foreach($accept as $a) { static::$responseClassLookup [$a] = $responseClassName; } }
php
public static function registerResponseClass( string $responseClassName, string...$accept ):void { if(empty($accept)) { $accept = [self::DEFAULT_ACCEPT]; } foreach($accept as $a) { static::$responseClassLookup [$a] = $responseClassName; } }
[ "public", "static", "function", "registerResponseClass", "(", "string", "$", "responseClassName", ",", "string", "...", "$", "accept", ")", ":", "void", "{", "if", "(", "empty", "(", "$", "accept", ")", ")", "{", "$", "accept", "=", "[", "self", "::", ...
In order for this factory to create the correct type of Response, class names need to be registered to match the request's "accept" header. This allows the web client to request a web page in HTML format, over a web API in JSON format, for example.
[ "In", "order", "for", "this", "factory", "to", "create", "the", "correct", "type", "of", "Response", "class", "names", "need", "to", "be", "registered", "to", "match", "the", "request", "s", "accept", "header", ".", "This", "allows", "the", "web", "client"...
f0ce5d78180e45e9d0f2a86bc8fe5b366dc7b6ef
https://github.com/PhpGt/Http/blob/f0ce5d78180e45e9d0f2a86bc8fe5b366dc7b6ef/src/ResponseFactory.php#L53-L64
187,369
PhpGt/Http
src/ServerInfo.php
ServerInfo.getHttpHeadersArray
public function getHttpHeadersArray():array { $headers = []; foreach($this->server as $key => $value) { if(strpos($key, "HTTP_") !== 0) { continue; } $headerName = substr($key, strlen("HTTP_")); $headerName = strtoupper($headerName); $headers[$headerName] = $value; } return $headers; }
php
public function getHttpHeadersArray():array { $headers = []; foreach($this->server as $key => $value) { if(strpos($key, "HTTP_") !== 0) { continue; } $headerName = substr($key, strlen("HTTP_")); $headerName = strtoupper($headerName); $headers[$headerName] = $value; } return $headers; }
[ "public", "function", "getHttpHeadersArray", "(", ")", ":", "array", "{", "$", "headers", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "server", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "strpos", "(", "$", "key", ",", ...
HTTP headers are case-insensitive, so headers are transformed to uppercase. @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
[ "HTTP", "headers", "are", "case", "-", "insensitive", "so", "headers", "are", "transformed", "to", "uppercase", "." ]
f0ce5d78180e45e9d0f2a86bc8fe5b366dc7b6ef
https://github.com/PhpGt/Http/blob/f0ce5d78180e45e9d0f2a86bc8fe5b366dc7b6ef/src/ServerInfo.php#L21-L35
187,370
PhpGt/Http
src/UriFactory.php
UriFactory.composeFromComponents
public static function composeFromComponents( string $scheme = null, string $authority = null, string $path = null, string $query = null, string $fragment = null ):Uri { $uri = ""; if(!is_null($scheme ) && strlen($scheme) > 0) { $uri .= $scheme . ":"; } if((!is_null($authority) && strlen($au...
php
public static function composeFromComponents( string $scheme = null, string $authority = null, string $path = null, string $query = null, string $fragment = null ):Uri { $uri = ""; if(!is_null($scheme ) && strlen($scheme) > 0) { $uri .= $scheme . ":"; } if((!is_null($authority) && strlen($au...
[ "public", "static", "function", "composeFromComponents", "(", "string", "$", "scheme", "=", "null", ",", "string", "$", "authority", "=", "null", ",", "string", "$", "path", "=", "null", ",", "string", "$", "query", "=", "null", ",", "string", "$", "frag...
Composes a URI reference string from its various components. Usually this method does not need to be called manually but instead is used indirectly via `Psr\Http\Message\UriInterface::__toString`. PSR-7 UriInterface treats an empty component the same as a missing component as getQuery(), getFragment() etc. always ret...
[ "Composes", "a", "URI", "reference", "string", "from", "its", "various", "components", "." ]
f0ce5d78180e45e9d0f2a86bc8fe5b366dc7b6ef
https://github.com/PhpGt/Http/blob/f0ce5d78180e45e9d0f2a86bc8fe5b366dc7b6ef/src/UriFactory.php#L31-L66
187,371
philippfrenzel/yii2fullcalendar
yii2fullcalendar.php
yii2fullcalendar.registerPlugin
protected function registerPlugin() { $id = $this->options['id']; $view = $this->getView(); /** @var \yii\web\AssetBundle $assetClass */ $assets = CoreAsset::register($view); //by default we load the jui theme, but if you like you can set the theme to false and nothing gets...
php
protected function registerPlugin() { $id = $this->options['id']; $view = $this->getView(); /** @var \yii\web\AssetBundle $assetClass */ $assets = CoreAsset::register($view); //by default we load the jui theme, but if you like you can set the theme to false and nothing gets...
[ "protected", "function", "registerPlugin", "(", ")", "{", "$", "id", "=", "$", "this", "->", "options", "[", "'id'", "]", ";", "$", "view", "=", "$", "this", "->", "getView", "(", ")", ";", "/** @var \\yii\\web\\AssetBundle $assetClass */", "$", "assets", ...
Registers the FullCalendar javascript assets and builds the requiered js for the widget and the related events
[ "Registers", "the", "FullCalendar", "javascript", "assets", "and", "builds", "the", "requiered", "js", "for", "the", "widget", "and", "the", "related", "events" ]
ce3100f70d3d51dd700f7515a7e06cf13d3954f9
https://github.com/philippfrenzel/yii2fullcalendar/blob/ce3100f70d3d51dd700f7515a7e06cf13d3954f9/yii2fullcalendar.php#L214-L295
187,372
acacha/llum
src/Parser/LlumRCParser.php
LlumRCParser.getCredentials
public function getCredentials() { $rc_file = $this->parse(); if ( array_key_exists('username',$rc_file) && array_key_exists('username',$rc_file)) { return [$rc_file['username'],$rc_file['token']]; } }
php
public function getCredentials() { $rc_file = $this->parse(); if ( array_key_exists('username',$rc_file) && array_key_exists('username',$rc_file)) { return [$rc_file['username'],$rc_file['token']]; } }
[ "public", "function", "getCredentials", "(", ")", "{", "$", "rc_file", "=", "$", "this", "->", "parse", "(", ")", ";", "if", "(", "array_key_exists", "(", "'username'", ",", "$", "rc_file", ")", "&&", "array_key_exists", "(", "'username'", ",", "$", "rc_...
Get credentials from config file. @return array
[ "Get", "credentials", "from", "config", "file", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Parser/LlumRCParser.php#L50-L56
187,373
acacha/llum
src/Traits/Serve.php
Serve.serve
protected function serve(InputInterface $input, OutputInterface $output) { $port = $this->port($input); $continue = true; do { if ($this->check_port($port)) { $this->output->writeln('<info>Running php artisan serve --port='.$port.'</info>'); exec('...
php
protected function serve(InputInterface $input, OutputInterface $output) { $port = $this->port($input); $continue = true; do { if ($this->check_port($port)) { $this->output->writeln('<info>Running php artisan serve --port='.$port.'</info>'); exec('...
[ "protected", "function", "serve", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "$", "port", "=", "$", "this", "->", "port", "(", "$", "input", ")", ";", "$", "continue", "=", "true", ";", "do", "{", "if", "(",...
Serve command. @param InputInterface $input @param OutputInterface $output
[ "Serve", "command", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Traits/Serve.php#L22-L39
187,374
acacha/llum
src/Traits/Serve.php
Serve.check_port
protected function check_port($port = 8000, $host = '127.0.0.1', $timeout = 3) { $fp = @fsockopen($host, $port, $errno, $errstr, $timeout); if (!$fp) { return true; } else { fclose($fp); return false; } }
php
protected function check_port($port = 8000, $host = '127.0.0.1', $timeout = 3) { $fp = @fsockopen($host, $port, $errno, $errstr, $timeout); if (!$fp) { return true; } else { fclose($fp); return false; } }
[ "protected", "function", "check_port", "(", "$", "port", "=", "8000", ",", "$", "host", "=", "'127.0.0.1'", ",", "$", "timeout", "=", "3", ")", "{", "$", "fp", "=", "@", "fsockopen", "(", "$", "host", ",", "$", "port", ",", "$", "errno", ",", "$"...
Check if port is in use. @param int $port @param string $host @param int $timeout @return bool
[ "Check", "if", "port", "is", "in", "use", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Traits/Serve.php#L50-L60
187,375
acacha/llum
src/Traits/Serve.php
Serve.port
protected function port(InputInterface $input) { $name = $input->getArgument('port'); return isset($name) ? (int) $name : 8080; }
php
protected function port(InputInterface $input) { $name = $input->getArgument('port'); return isset($name) ? (int) $name : 8080; }
[ "protected", "function", "port", "(", "InputInterface", "$", "input", ")", "{", "$", "name", "=", "$", "input", "->", "getArgument", "(", "'port'", ")", ";", "return", "isset", "(", "$", "name", ")", "?", "(", "int", ")", "$", "name", ":", "8080", ...
Obtain port. @param InputInterface $input @return integer
[ "Obtain", "port", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Traits/Serve.php#L81-L84
187,376
acacha/llum
src/Console/GithubRepoCommand.php
GithubRepoCommand.githubCreateRepo
public function githubCreateRepo(InputInterface $input, OutputInterface $output) { $this->api->setCredentials($this->getCredentials($output)); $name = $this->repoName($input); try { $this->api->createRepo($name,$this->repoDescription($input)); } catch (ServerException $se...
php
public function githubCreateRepo(InputInterface $input, OutputInterface $output) { $this->api->setCredentials($this->getCredentials($output)); $name = $this->repoName($input); try { $this->api->createRepo($name,$this->repoDescription($input)); } catch (ServerException $se...
[ "public", "function", "githubCreateRepo", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "$", "this", "->", "api", "->", "setCredentials", "(", "$", "this", "->", "getCredentials", "(", "$", "output", ")", ")", ";", "...
Github create repo command. @param InputInterface $input @param OutputInterface $output
[ "Github", "create", "repo", "command", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Console/GithubRepoCommand.php#L77-L91
187,377
acacha/llum
src/Console/GithubRepoCommand.php
GithubRepoCommand.showError
protected function showError(ClientException $ce, OutputInterface $output) { if ($ce->getResponse()->getStatusCode() == 422) { $output->writeln('<error>Repository already exists</error>'); die(); } $output->writeln('<error>Client Request exception thrown</error>'); ...
php
protected function showError(ClientException $ce, OutputInterface $output) { if ($ce->getResponse()->getStatusCode() == 422) { $output->writeln('<error>Repository already exists</error>'); die(); } $output->writeln('<error>Client Request exception thrown</error>'); ...
[ "protected", "function", "showError", "(", "ClientException", "$", "ce", ",", "OutputInterface", "$", "output", ")", "{", "if", "(", "$", "ce", "->", "getResponse", "(", ")", "->", "getStatusCode", "(", ")", "==", "422", ")", "{", "$", "output", "->", ...
Show error. @param ClientException $ce @param OutputInterface $output
[ "Show", "error", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Console/GithubRepoCommand.php#L100-L108
187,378
acacha/llum
src/Console/GithubRepoCommand.php
GithubRepoCommand.getCredentials
public function getCredentials(OutputInterface $output) { $credentials = $this->parser->getCredentials(); if ( is_null($credentials)) { $this->showErrorRunLlumInitFirst($output,"Credentials"); }; return $credentials; }
php
public function getCredentials(OutputInterface $output) { $credentials = $this->parser->getCredentials(); if ( is_null($credentials)) { $this->showErrorRunLlumInitFirst($output,"Credentials"); }; return $credentials; }
[ "public", "function", "getCredentials", "(", "OutputInterface", "$", "output", ")", "{", "$", "credentials", "=", "$", "this", "->", "parser", "->", "getCredentials", "(", ")", ";", "if", "(", "is_null", "(", "$", "credentials", ")", ")", "{", "$", "this...
Get credentials. @param OutputInterface $input @return array
[ "Get", "credentials", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Console/GithubRepoCommand.php#L117-L124
187,379
acacha/llum
src/Console/GithubRepoCommand.php
GithubRepoCommand.repoName
protected function repoName(InputInterface $input) { $name = $input->getArgument('name'); return isset($name) ? $name : basename(getcwd()); }
php
protected function repoName(InputInterface $input) { $name = $input->getArgument('name'); return isset($name) ? $name : basename(getcwd()); }
[ "protected", "function", "repoName", "(", "InputInterface", "$", "input", ")", "{", "$", "name", "=", "$", "input", "->", "getArgument", "(", "'name'", ")", ";", "return", "isset", "(", "$", "name", ")", "?", "$", "name", ":", "basename", "(", "getcwd"...
Obtain repo name. @param InputInterface $input @return mixed|string
[ "Obtain", "repo", "name", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Console/GithubRepoCommand.php#L132-L135
187,380
acacha/llum
src/Console/PackageListCommand.php
PackageListCommand.packageList
protected function packageList() { $packages = $this->config->all(); foreach ($packages as $name => $package) { $this->output->writeln('<info>'.$name.'</info> | '.$this->parsePackageInfo($package)); } }
php
protected function packageList() { $packages = $this->config->all(); foreach ($packages as $name => $package) { $this->output->writeln('<info>'.$name.'</info> | '.$this->parsePackageInfo($package)); } }
[ "protected", "function", "packageList", "(", ")", "{", "$", "packages", "=", "$", "this", "->", "config", "->", "all", "(", ")", ";", "foreach", "(", "$", "packages", "as", "$", "name", "=>", "$", "package", ")", "{", "$", "this", "->", "output", "...
Shows list of supported packages.
[ "Shows", "list", "of", "supported", "packages", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Console/PackageListCommand.php#L34-L40
187,381
acacha/llum
src/Traits/SqliteEnv.php
SqliteEnv.sqliteEnv
protected function sqliteEnv() { passthru('sed -i \'s/^DB_/#DB_/g\' .env ', $error); if ($error !== 0) { $this->output->writeln('<error>Error commenting DB_ entries in .env file </error>'); } passthru('sed -i \'s/.*DB_HOST.*/DB_CONNECTION=sqlite\n&/\' .env', $error); ...
php
protected function sqliteEnv() { passthru('sed -i \'s/^DB_/#DB_/g\' .env ', $error); if ($error !== 0) { $this->output->writeln('<error>Error commenting DB_ entries in .env file </error>'); } passthru('sed -i \'s/.*DB_HOST.*/DB_CONNECTION=sqlite\n&/\' .env', $error); ...
[ "protected", "function", "sqliteEnv", "(", ")", "{", "passthru", "(", "'sed -i \\'s/^DB_/#DB_/g\\' .env '", ",", "$", "error", ")", ";", "if", "(", "$", "error", "!==", "0", ")", "{", "$", "this", "->", "output", "->", "writeln", "(", "'<error>Error commenti...
Config .env file.
[ "Config", ".", "env", "file", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Traits/SqliteEnv.php#L17-L29
187,382
acacha/llum
src/Console/GithubInitCommand.php
GithubInitCommand.gitHubInitRepo
public function gitHubInitRepo(InputInterface $input, OutputInterface $output) { $this->output = $output; $this->runGitInit(); $this->runGitAdd(); $this->runGitCommit(); $this->runGitCreateRepo(); $this->runGitRemoteAddOrigin($this->getRepoURL($input,$output)); ...
php
public function gitHubInitRepo(InputInterface $input, OutputInterface $output) { $this->output = $output; $this->runGitInit(); $this->runGitAdd(); $this->runGitCommit(); $this->runGitCreateRepo(); $this->runGitRemoteAddOrigin($this->getRepoURL($input,$output)); ...
[ "public", "function", "gitHubInitRepo", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "$", "this", "->", "output", "=", "$", "output", ";", "$", "this", "->", "runGitInit", "(", ")", ";", "$", "this", "->", "runGit...
Github init repo command. @param InputInterface $input @param OutputInterface $output
[ "Github", "init", "repo", "command", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Console/GithubInitCommand.php#L72-L82
187,383
acacha/llum
src/Console/GithubInitCommand.php
GithubInitCommand.getRepoURL
public function getRepoURL(InputInterface $input, OutputInterface $output) { return 'git@github.com:' . $this->gitHubUsername($input,$output) . '/' . $this->repoName($input) . '.git'; }
php
public function getRepoURL(InputInterface $input, OutputInterface $output) { return 'git@github.com:' . $this->gitHubUsername($input,$output) . '/' . $this->repoName($input) . '.git'; }
[ "public", "function", "getRepoURL", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "return", "'git@github.com:'", ".", "$", "this", "->", "gitHubUsername", "(", "$", "input", ",", "$", "output", ")", ".", "'/'", ".", ...
Get github repo URL. @param OutputInterface $output @param InputInterface $input @return string
[ "Get", "github", "repo", "URL", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Console/GithubInitCommand.php#L92-L95
187,384
acacha/llum
src/Console/GithubInitCommand.php
GithubInitCommand.gitHubUsername
protected function gitHubUsername(InputInterface $input, OutputInterface $output) { $username = $input->getArgument('github_username'); return isset($username) ? $username : $this->getGithubUserNameFromConfig($output); }
php
protected function gitHubUsername(InputInterface $input, OutputInterface $output) { $username = $input->getArgument('github_username'); return isset($username) ? $username : $this->getGithubUserNameFromConfig($output); }
[ "protected", "function", "gitHubUsername", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "$", "username", "=", "$", "input", "->", "getArgument", "(", "'github_username'", ")", ";", "return", "isset", "(", "$", "username...
Get github username. @param InputInterface $input @param OutputInterface $output @return array|mixed
[ "Get", "github", "username", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Console/GithubInitCommand.php#L116-L120
187,385
acacha/llum
src/Console/GithubInitCommand.php
GithubInitCommand.getGithubUserNameFromConfig
protected function getGithubUserNameFromConfig(OutputInterface $output) { $username = $this->parser->getGitHubUsername(); if (is_null($username)) { $this->showErrorRunLlumInitFirst($output,'username'); } return $username; }
php
protected function getGithubUserNameFromConfig(OutputInterface $output) { $username = $this->parser->getGitHubUsername(); if (is_null($username)) { $this->showErrorRunLlumInitFirst($output,'username'); } return $username; }
[ "protected", "function", "getGithubUserNameFromConfig", "(", "OutputInterface", "$", "output", ")", "{", "$", "username", "=", "$", "this", "->", "parser", "->", "getGitHubUsername", "(", ")", ";", "if", "(", "is_null", "(", "$", "username", ")", ")", "{", ...
Get github username from llum config. @param OutputInterface $output @return array
[ "Get", "github", "username", "from", "llum", "config", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Console/GithubInitCommand.php#L128-L135
187,386
acacha/llum
src/Console/InitCommand.php
InitCommand.init
public function init(InputInterface $input, OutputInterface $output) { try { $this->executeWizard($input,$output); $this->filesystem->overwrite( (new LlumRCFile())->path(), $this->compiler->compile( $this->filesystem->get($this->get...
php
public function init(InputInterface $input, OutputInterface $output) { try { $this->executeWizard($input,$output); $this->filesystem->overwrite( (new LlumRCFile())->path(), $this->compiler->compile( $this->filesystem->get($this->get...
[ "public", "function", "init", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "try", "{", "$", "this", "->", "executeWizard", "(", "$", "input", ",", "$", "output", ")", ";", "$", "this", "->", "filesystem", "->", ...
init command.
[ "init", "command", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Console/InitCommand.php#L105-L117
187,387
acacha/llum
src/Console/InitCommand.php
InitCommand.executeWizard
protected function executeWizard(InputInterface $input, OutputInterface $output){ $this->askGithubUsername($input,$output); $this->askGithubToken($input,$output); $this->data = [ "GITHUB_USERNAME" => $this->github_username, "GITHUB_TOKEN" => $this->github_token, ...
php
protected function executeWizard(InputInterface $input, OutputInterface $output){ $this->askGithubUsername($input,$output); $this->askGithubToken($input,$output); $this->data = [ "GITHUB_USERNAME" => $this->github_username, "GITHUB_TOKEN" => $this->github_token, ...
[ "protected", "function", "executeWizard", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "$", "this", "->", "askGithubUsername", "(", "$", "input", ",", "$", "output", ")", ";", "$", "this", "->", "askGithubToken", "(",...
Executes wizard. @param InputInterface $input @param OutputInterface $output
[ "Executes", "wizard", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Console/InitCommand.php#L125-L135
187,388
acacha/llum
src/Console/BootCommand.php
BootCommand.boot
protected function boot(InputInterface $input, OutputInterface $output) { if ($this->devtools() == -1) { return; } $this->touchSqliteFile(); $this->sqliteEnv(); $this->migrate(); $this->serve($input, $output); }
php
protected function boot(InputInterface $input, OutputInterface $output) { if ($this->devtools() == -1) { return; } $this->touchSqliteFile(); $this->sqliteEnv(); $this->migrate(); $this->serve($input, $output); }
[ "protected", "function", "boot", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "if", "(", "$", "this", "->", "devtools", "(", ")", "==", "-", "1", ")", "{", "return", ";", "}", "$", "this", "->", "touchSqliteFile...
Executes boot command. @param InputInterface $input @param OutputInterface $output
[ "Executes", "boot", "command", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Console/BootCommand.php#L48-L57
187,389
acacha/llum
src/Github/GithubAPI.php
GithubAPI.getPersonalToken
public function getPersonalToken($username, $password) { $response = $this->client->request('POST', $this->authorization_url(), [ "auth" => [ $username, $password], "json" => $this->authorizationsRequestJson() ] ); $response = json_deco...
php
public function getPersonalToken($username, $password) { $response = $this->client->request('POST', $this->authorization_url(), [ "auth" => [ $username, $password], "json" => $this->authorizationsRequestJson() ] ); $response = json_deco...
[ "public", "function", "getPersonalToken", "(", "$", "username", ",", "$", "password", ")", "{", "$", "response", "=", "$", "this", "->", "client", "->", "request", "(", "'POST'", ",", "$", "this", "->", "authorization_url", "(", ")", ",", "[", "\"auth\""...
Obtain personal token. @param $username @param $password @return mixed
[ "Obtain", "personal", "token", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Github/GithubAPI.php#L101-L112
187,390
acacha/llum
src/Github/GithubAPI.php
GithubAPI.createRepo
public function createRepo($repo_name, $repo_description) { return $this->client->request('POST', $this->create_repo_url(), [ "auth" => $this->credentials(), "json" => json_decode($this->compileStub($repo_name, $repo_description),true), ] ); ...
php
public function createRepo($repo_name, $repo_description) { return $this->client->request('POST', $this->create_repo_url(), [ "auth" => $this->credentials(), "json" => json_decode($this->compileStub($repo_name, $repo_description),true), ] ); ...
[ "public", "function", "createRepo", "(", "$", "repo_name", ",", "$", "repo_description", ")", "{", "return", "$", "this", "->", "client", "->", "request", "(", "'POST'", ",", "$", "this", "->", "create_repo_url", "(", ")", ",", "[", "\"auth\"", "=>", "$"...
Create repo in github. @param $repo_name @param $repo_description @return mixed
[ "Create", "repo", "in", "github", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Github/GithubAPI.php#L131-L139
187,391
acacha/llum
src/Github/GithubAPI.php
GithubAPI.compileStub
protected function compileStub($repo_name, $repo_description) { $data = [ "REPO_NAME" => $repo_name, "REPO_DESCRIPTION" => $repo_description ]; return $this->compile( $this->filesystem->get($this->repo_json_stub()) , $data); }
php
protected function compileStub($repo_name, $repo_description) { $data = [ "REPO_NAME" => $repo_name, "REPO_DESCRIPTION" => $repo_description ]; return $this->compile( $this->filesystem->get($this->repo_json_stub()) , $data); }
[ "protected", "function", "compileStub", "(", "$", "repo_name", ",", "$", "repo_description", ")", "{", "$", "data", "=", "[", "\"REPO_NAME\"", "=>", "$", "repo_name", ",", "\"REPO_DESCRIPTION\"", "=>", "$", "repo_description", "]", ";", "return", "$", "this", ...
Compile stub. @param $repo_name @param $repo_description @return mixed
[ "Compile", "stub", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Github/GithubAPI.php#L171-L180
187,392
acacha/llum
src/Github/GithubAPI.php
GithubAPI.compile
protected function compile($template, $data) { foreach($data as $key => $value) { $template = preg_replace("/\\$$key\\$/i", $value, $template); } return $template; }
php
protected function compile($template, $data) { foreach($data as $key => $value) { $template = preg_replace("/\\$$key\\$/i", $value, $template); } return $template; }
[ "protected", "function", "compile", "(", "$", "template", ",", "$", "data", ")", "{", "foreach", "(", "$", "data", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "template", "=", "preg_replace", "(", "\"/\\\\$$key\\\\$/i\"", ",", "$", "value", ",...
Compile the template using the given data. @param $template @param $data @return mixed
[ "Compile", "the", "template", "using", "the", "given", "data", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Github/GithubAPI.php#L189-L196
187,393
acacha/llum
src/Console/LlumCommand.php
LlumCommand.initialize
protected function initialize(InputInterface $input, OutputInterface $output) { parent::initialize($input, $output); if (($input->hasOption('dev'))) { if (($input->getOption('dev'))) { $this->installDev = true; } } }
php
protected function initialize(InputInterface $input, OutputInterface $output) { parent::initialize($input, $output); if (($input->hasOption('dev'))) { if (($input->getOption('dev'))) { $this->installDev = true; } } }
[ "protected", "function", "initialize", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "parent", "::", "initialize", "(", "$", "input", ",", "$", "output", ")", ";", "if", "(", "(", "$", "input", "->", "hasOption", "...
Initialize command. @param InputInterface $input @param OutputInterface $output
[ "Initialize", "command", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Console/LlumCommand.php#L123-L131
187,394
acacha/llum
src/Console/LlumCommand.php
LlumCommand.requireComposerPackage
private function requireComposerPackage($package) { $composer = $this->findComposer(); $process = new Process($composer.' require '.$package.''.$this->getDevOption(), null, null, null, null); $this->output->writeln('<info>Running composer require '.$package.$this->getD...
php
private function requireComposerPackage($package) { $composer = $this->findComposer(); $process = new Process($composer.' require '.$package.''.$this->getDevOption(), null, null, null, null); $this->output->writeln('<info>Running composer require '.$package.$this->getD...
[ "private", "function", "requireComposerPackage", "(", "$", "package", ")", "{", "$", "composer", "=", "$", "this", "->", "findComposer", "(", ")", ";", "$", "process", "=", "new", "Process", "(", "$", "composer", ".", "' require '", ".", "$", "package", ...
Require composer package. @param $package
[ "Require", "composer", "package", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Console/LlumCommand.php#L148-L157
187,395
acacha/llum
src/Console/LlumCommand.php
LlumCommand.getPackageFromConfig
private function getPackageFromConfig($name) { //Check if package name is a composer package name if (str_contains($name, '/')) { return $this->config->get($this->getPackageNameByComposerName($name)); } return $this->config->get($name); }
php
private function getPackageFromConfig($name) { //Check if package name is a composer package name if (str_contains($name, '/')) { return $this->config->get($this->getPackageNameByComposerName($name)); } return $this->config->get($name); }
[ "private", "function", "getPackageFromConfig", "(", "$", "name", ")", "{", "//Check if package name is a composer package name", "if", "(", "str_contains", "(", "$", "name", ",", "'/'", ")", ")", "{", "return", "$", "this", "->", "config", "->", "get", "(", "$...
get package from config. @param $name @return array
[ "get", "package", "from", "config", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Console/LlumCommand.php#L180-L188
187,396
acacha/llum
src/Console/LlumCommand.php
LlumCommand.obtainPackage
private function obtainPackage($name) { $package = $this->getPackageFromConfig($name); if ($package == null) { $this->showPackageNotFoundError($name); return -1; } return $package; }
php
private function obtainPackage($name) { $package = $this->getPackageFromConfig($name); if ($package == null) { $this->showPackageNotFoundError($name); return -1; } return $package; }
[ "private", "function", "obtainPackage", "(", "$", "name", ")", "{", "$", "package", "=", "$", "this", "->", "getPackageFromConfig", "(", "$", "name", ")", ";", "if", "(", "$", "package", "==", "null", ")", "{", "$", "this", "->", "showPackageNotFoundErro...
Obtain package. @param $name @return array|int
[ "Obtain", "package", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Console/LlumCommand.php#L224-L235
187,397
acacha/llum
src/Console/LlumCommand.php
LlumCommand.getPackageNameByComposerName
private function getPackageNameByComposerName($composerPackageName) { foreach ($this->config->all() as $key => $configItem) { if ($configItem['name'] == $composerPackageName) { return $key; } } }
php
private function getPackageNameByComposerName($composerPackageName) { foreach ($this->config->all() as $key => $configItem) { if ($configItem['name'] == $composerPackageName) { return $key; } } }
[ "private", "function", "getPackageNameByComposerName", "(", "$", "composerPackageName", ")", "{", "foreach", "(", "$", "this", "->", "config", "->", "all", "(", ")", "as", "$", "key", "=>", "$", "configItem", ")", "{", "if", "(", "$", "configItem", "[", ...
Get package name by composer package name. @param $composerPackageName @return string
[ "Get", "package", "name", "by", "composer", "package", "name", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Console/LlumCommand.php#L266-L273
187,398
acacha/llum
src/Traits/LaravelConfigFile.php
LaravelConfigFile.addTextIntoMountPoint
private function addTextIntoMountPoint($mountpoint, $textToAdd) { passthru( 'sed -i \'s/.*'.$mountpoint.'.*/ \ \ \ \ \ \ \ '.$this->scapeSingleQuotes(preg_quote($textToAdd)).',\n \ \ \ \ \ \ \ '.$mountpoint.'/\' '.str_replace(" ", "\ ", $this->laravel_config_file), $error); return $erro...
php
private function addTextIntoMountPoint($mountpoint, $textToAdd) { passthru( 'sed -i \'s/.*'.$mountpoint.'.*/ \ \ \ \ \ \ \ '.$this->scapeSingleQuotes(preg_quote($textToAdd)).',\n \ \ \ \ \ \ \ '.$mountpoint.'/\' '.str_replace(" ", "\ ", $this->laravel_config_file), $error); return $erro...
[ "private", "function", "addTextIntoMountPoint", "(", "$", "mountpoint", ",", "$", "textToAdd", ")", "{", "passthru", "(", "'sed -i \\'s/.*'", ".", "$", "mountpoint", ".", "'.*/ \\ \\ \\ \\ \\ \\ \\ '", ".", "$", "this", "->", "scapeSingleQuotes", "(", "preg_quote", ...
Insert text into file using mountpoint. Mountpoint is maintained at file. @param string $mountpoint @param $textToAdd @return int|null
[ "Insert", "text", "into", "file", "using", "mountpoint", ".", "Mountpoint", "is", "maintained", "at", "file", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Traits/LaravelConfigFile.php#L108-L114
187,399
acacha/llum
src/Traits/LaravelConfigFile.php
LaravelConfigFile.addFileIntoMountPoint
private function addFileIntoMountPoint($mountpoint, $fileToInsert, $outputFile = null) { if ($outputFile != null) { passthru( 'sed -e \'/'.$mountpoint.'/r'.$fileToInsert.'\' '. str_replace(" ", "\ ", $this->laravel_services_file).' > '.$outputFile, $error); ...
php
private function addFileIntoMountPoint($mountpoint, $fileToInsert, $outputFile = null) { if ($outputFile != null) { passthru( 'sed -e \'/'.$mountpoint.'/r'.$fileToInsert.'\' '. str_replace(" ", "\ ", $this->laravel_services_file).' > '.$outputFile, $error); ...
[ "private", "function", "addFileIntoMountPoint", "(", "$", "mountpoint", ",", "$", "fileToInsert", ",", "$", "outputFile", "=", "null", ")", "{", "if", "(", "$", "outputFile", "!=", "null", ")", "{", "passthru", "(", "'sed -e \\'/'", ".", "$", "mountpoint", ...
Insert file into file using mountpoint. @param $mountpoint @param $fileToInsert @return mixed
[ "Insert", "file", "into", "file", "using", "mountpoint", "." ]
b17d3c6df5fc0a5a95140652776c2eb1a422be2f
https://github.com/acacha/llum/blob/b17d3c6df5fc0a5a95140652776c2eb1a422be2f/src/Traits/LaravelConfigFile.php#L124-L136