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
21,500
nabab/bbn
src/bbn/util/timer.php
timer.has_started
public function has_started($key) { if ( isset($this->measures[$key]) ){ return $this->measures[$key]['start'] > 0; } return false; }
php
public function has_started($key) { if ( isset($this->measures[$key]) ){ return $this->measures[$key]['start'] > 0; } return false; }
[ "public", "function", "has_started", "(", "$", "key", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "measures", "[", "$", "key", "]", ")", ")", "{", "return", "$", "this", "->", "measures", "[", "$", "key", "]", "[", "'start'", "]", ">", ...
Returns true is the timer has started for the given key @return bool
[ "Returns", "true", "is", "the", "timer", "has", "started", "for", "the", "given", "key" ]
439fea2faa0de22fdaae2611833bab8061f40c37
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/util/timer.php#L53-L59
21,501
nabab/bbn
src/bbn/util/timer.php
timer.stop
public function stop($key='default') { if ( isset($this->measures[$key], $this->measures[$key]['start']) ){ $this->measures[$key]['num']++; $time = $this->measure($key); $this->measures[$key]['sum'] += $time; unset($this->measures[$key]['start']); return $time; } else{ ...
php
public function stop($key='default') { if ( isset($this->measures[$key], $this->measures[$key]['start']) ){ $this->measures[$key]['num']++; $time = $this->measure($key); $this->measures[$key]['sum'] += $time; unset($this->measures[$key]['start']); return $time; } else{ ...
[ "public", "function", "stop", "(", "$", "key", "=", "'default'", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "measures", "[", "$", "key", "]", ",", "$", "this", "->", "measures", "[", "$", "key", "]", "[", "'start'", "]", ")", ")", "{...
Stops a timer for a given key @return int
[ "Stops", "a", "timer", "for", "a", "given", "key" ]
439fea2faa0de22fdaae2611833bab8061f40c37
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/util/timer.php#L67-L79
21,502
interactivesolutions/honeycomb-core
src/models/traits/CustomAppends.php
CustomAppends.getArrayAbleAppends
protected function getArrayAbleAppends() { if (property_exists($this, 'customAppends')) { // you can set custom appends array if (is_array(self::$customAppends) && count(self::$customAppends)) return self::$customAppends; // or if you want to disable cus...
php
protected function getArrayAbleAppends() { if (property_exists($this, 'customAppends')) { // you can set custom appends array if (is_array(self::$customAppends) && count(self::$customAppends)) return self::$customAppends; // or if you want to disable cus...
[ "protected", "function", "getArrayAbleAppends", "(", ")", "{", "if", "(", "property_exists", "(", "$", "this", ",", "'customAppends'", ")", ")", "{", "// you can set custom appends array", "if", "(", "is_array", "(", "self", "::", "$", "customAppends", ")", "&&"...
Append attribute ignore @return array
[ "Append", "attribute", "ignore" ]
06b8d88bb285e73a1a286e60411ca5f41863f39f
https://github.com/interactivesolutions/honeycomb-core/blob/06b8d88bb285e73a1a286e60411ca5f41863f39f/src/models/traits/CustomAppends.php#L19-L33
21,503
nabab/bbn
src/bbn/appui/masks.php
masks.get
public function get(string $id): ?array { $mask = $this->db->rselect('bbn_notes_masks', [], ['id_note' => $id]); if ( $data = $this->notes->get($mask['id_note']) ){ $data['default'] = $mask['def']; $data['id_type'] = $mask['id_type']; $data['type'] = $this->o->text($mask['id_type']); $...
php
public function get(string $id): ?array { $mask = $this->db->rselect('bbn_notes_masks', [], ['id_note' => $id]); if ( $data = $this->notes->get($mask['id_note']) ){ $data['default'] = $mask['def']; $data['id_type'] = $mask['id_type']; $data['type'] = $this->o->text($mask['id_type']); $...
[ "public", "function", "get", "(", "string", "$", "id", ")", ":", "?", "array", "{", "$", "mask", "=", "$", "this", "->", "db", "->", "rselect", "(", "'bbn_notes_masks'", ",", "[", "]", ",", "[", "'id_note'", "=>", "$", "id", "]", ")", ";", "if", ...
Gets the content of a mask based on the provided ID @param string $id @return array|null
[ "Gets", "the", "content", "of", "a", "mask", "based", "on", "the", "provided", "ID" ]
439fea2faa0de22fdaae2611833bab8061f40c37
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/masks.php#L42-L53
21,504
Laralum/Events
src/Controllers/EventController.php
EventController.getDatetime
private function getDatetime($datein, $timein) { $date = explode('-', $datein); $time = explode(':', $timein); $datetime = Carbon::create($date[0], $date[1], $date[2], $time[0], $time[1]); return $datetime; }
php
private function getDatetime($datein, $timein) { $date = explode('-', $datein); $time = explode(':', $timein); $datetime = Carbon::create($date[0], $date[1], $date[2], $time[0], $time[1]); return $datetime; }
[ "private", "function", "getDatetime", "(", "$", "datein", ",", "$", "timein", ")", "{", "$", "date", "=", "explode", "(", "'-'", ",", "$", "datein", ")", ";", "$", "time", "=", "explode", "(", "':'", ",", "$", "timein", ")", ";", "$", "datetime", ...
Get Carbon start datetime and end datemime. @param mixed $object @return array
[ "Get", "Carbon", "start", "datetime", "and", "end", "datemime", "." ]
9dc36468f4253e7d040863a115ea94cded0e6aa5
https://github.com/Laralum/Events/blob/9dc36468f4253e7d040863a115ea94cded0e6aa5/src/Controllers/EventController.php#L48-L55
21,505
Laralum/Events
src/Controllers/EventController.php
EventController.confirmDestroy
public function confirmDestroy(Request $request, Event $event) { $this->authorize('delete', $event); return view('laralum::pages.confirmation', [ 'method' => 'DELETE', 'message' => __('laralum_events::general.sure_del_event', ['event' => $event->title]), 'action...
php
public function confirmDestroy(Request $request, Event $event) { $this->authorize('delete', $event); return view('laralum::pages.confirmation', [ 'method' => 'DELETE', 'message' => __('laralum_events::general.sure_del_event', ['event' => $event->title]), 'action...
[ "public", "function", "confirmDestroy", "(", "Request", "$", "request", ",", "Event", "$", "event", ")", "{", "$", "this", "->", "authorize", "(", "'delete'", ",", "$", "event", ")", ";", "return", "view", "(", "'laralum::pages.confirmation'", ",", "[", "'...
confirm destroy of the specified resource from storage. @param \Laralum\Events\Models\Event $event @return \Illuminate\Http\Response
[ "confirm", "destroy", "of", "the", "specified", "resource", "from", "storage", "." ]
9dc36468f4253e7d040863a115ea94cded0e6aa5
https://github.com/Laralum/Events/blob/9dc36468f4253e7d040863a115ea94cded0e6aa5/src/Controllers/EventController.php#L221-L230
21,506
Laralum/Events
src/Controllers/EventController.php
EventController.join
public function join(Event $event) { $this->authorize('join', Event::class); $event->addUser(User::findOrfail(Auth::id())); return redirect()->route('laralum::events.index') ->with('success', __('laralum_events::general.joined_event', ['id' => $event->id])); }
php
public function join(Event $event) { $this->authorize('join', Event::class); $event->addUser(User::findOrfail(Auth::id())); return redirect()->route('laralum::events.index') ->with('success', __('laralum_events::general.joined_event', ['id' => $event->id])); }
[ "public", "function", "join", "(", "Event", "$", "event", ")", "{", "$", "this", "->", "authorize", "(", "'join'", ",", "Event", "::", "class", ")", ";", "$", "event", "->", "addUser", "(", "User", "::", "findOrfail", "(", "Auth", "::", "id", "(", ...
Join to the specified resource from storage. @param \Laralum\Events\Models\Event $event @return \Illuminate\Http\Response
[ "Join", "to", "the", "specified", "resource", "from", "storage", "." ]
9dc36468f4253e7d040863a115ea94cded0e6aa5
https://github.com/Laralum/Events/blob/9dc36468f4253e7d040863a115ea94cded0e6aa5/src/Controllers/EventController.php#L256-L263
21,507
Laralum/Events
src/Controllers/EventController.php
EventController.leave
public function leave(Event $event) { $this->authorize('join', Event::class); $event->deleteUser(User::findOrfail(Auth::id())); return redirect()->route('laralum::events.index') ->with('success', __('laralum_events::general.left_event', ['id' => $event->id])); }
php
public function leave(Event $event) { $this->authorize('join', Event::class); $event->deleteUser(User::findOrfail(Auth::id())); return redirect()->route('laralum::events.index') ->with('success', __('laralum_events::general.left_event', ['id' => $event->id])); }
[ "public", "function", "leave", "(", "Event", "$", "event", ")", "{", "$", "this", "->", "authorize", "(", "'join'", ",", "Event", "::", "class", ")", ";", "$", "event", "->", "deleteUser", "(", "User", "::", "findOrfail", "(", "Auth", "::", "id", "("...
Leave from the specified resource from storage. @param \Laralum\Events\Models\Event $event @return \Illuminate\Http\Response
[ "Leave", "from", "the", "specified", "resource", "from", "storage", "." ]
9dc36468f4253e7d040863a115ea94cded0e6aa5
https://github.com/Laralum/Events/blob/9dc36468f4253e7d040863a115ea94cded0e6aa5/src/Controllers/EventController.php#L272-L279
21,508
Laralum/Events
src/Controllers/EventController.php
EventController.makeResponsible
public function makeResponsible(Event $event, User $user) { $this->authorize('update', $event); $event->addResponsible($user); return redirect()->route('laralum::events.show', ['event' => $event->id]) ->with('success', __('laralum_events::general.responsible_added', ['event_id' ...
php
public function makeResponsible(Event $event, User $user) { $this->authorize('update', $event); $event->addResponsible($user); return redirect()->route('laralum::events.show', ['event' => $event->id]) ->with('success', __('laralum_events::general.responsible_added', ['event_id' ...
[ "public", "function", "makeResponsible", "(", "Event", "$", "event", ",", "User", "$", "user", ")", "{", "$", "this", "->", "authorize", "(", "'update'", ",", "$", "event", ")", ";", "$", "event", "->", "addResponsible", "(", "$", "user", ")", ";", "...
Make author of to the specified resource from storage. @param \Laralum\Events\Models\Event $event @param \Laralum\Users\Models\User $user @return \Illuminate\Http\Response
[ "Make", "author", "of", "to", "the", "specified", "resource", "from", "storage", "." ]
9dc36468f4253e7d040863a115ea94cded0e6aa5
https://github.com/Laralum/Events/blob/9dc36468f4253e7d040863a115ea94cded0e6aa5/src/Controllers/EventController.php#L289-L296
21,509
Laralum/Events
src/Controllers/EventController.php
EventController.undoResponsible
public function undoResponsible(Event $event, User $user) { $this->authorize('update', $event); $event->deleteResponsible($user); return redirect()->route('laralum::events.show', ['event' => $event->id]) ->with('success', __('laralum_events::general.responsible_deleted', ['event...
php
public function undoResponsible(Event $event, User $user) { $this->authorize('update', $event); $event->deleteResponsible($user); return redirect()->route('laralum::events.show', ['event' => $event->id]) ->with('success', __('laralum_events::general.responsible_deleted', ['event...
[ "public", "function", "undoResponsible", "(", "Event", "$", "event", ",", "User", "$", "user", ")", "{", "$", "this", "->", "authorize", "(", "'update'", ",", "$", "event", ")", ";", "$", "event", "->", "deleteResponsible", "(", "$", "user", ")", ";", ...
Undo author from the specified resource from storage. @param \Laralum\Events\Models\Event $event @param \Laralum\Users\Models\User $user @return \Illuminate\Http\Response
[ "Undo", "author", "from", "the", "specified", "resource", "from", "storage", "." ]
9dc36468f4253e7d040863a115ea94cded0e6aa5
https://github.com/Laralum/Events/blob/9dc36468f4253e7d040863a115ea94cded0e6aa5/src/Controllers/EventController.php#L306-L313
21,510
jasny/codeception-module
src/RequestConvertor.php
RequestConvertor.createStream
protected function createStream(BrowserKitRequest $request) { $stream = fopen('php://temp', 'a+'); fwrite($stream, $request->getContent()); return new Stream($stream); }
php
protected function createStream(BrowserKitRequest $request) { $stream = fopen('php://temp', 'a+'); fwrite($stream, $request->getContent()); return new Stream($stream); }
[ "protected", "function", "createStream", "(", "BrowserKitRequest", "$", "request", ")", "{", "$", "stream", "=", "fopen", "(", "'php://temp'", ",", "'a+'", ")", ";", "fwrite", "(", "$", "stream", ",", "$", "request", "->", "getContent", "(", ")", ")", ";...
Create the output stream handle @param BrowserKitRequest $request @return Stream
[ "Create", "the", "output", "stream", "handle" ]
5c2b12e4ab291f26424fda9fbf1618c818bc8d6e
https://github.com/jasny/codeception-module/blob/5c2b12e4ab291f26424fda9fbf1618c818bc8d6e/src/RequestConvertor.php#L25-L31
21,511
jasny/codeception-module
src/RequestConvertor.php
RequestConvertor.buildFullUri
protected function buildFullUri(BrowserKitRequest $request) { $uri = new Uri($request->getUri()); $queryParams = []; parse_str($uri->getQuery(), $queryParams); if ($request->getMethod() === 'GET') { $queryParams = array_merge($queryParams, $request->getP...
php
protected function buildFullUri(BrowserKitRequest $request) { $uri = new Uri($request->getUri()); $queryParams = []; parse_str($uri->getQuery(), $queryParams); if ($request->getMethod() === 'GET') { $queryParams = array_merge($queryParams, $request->getP...
[ "protected", "function", "buildFullUri", "(", "BrowserKitRequest", "$", "request", ")", "{", "$", "uri", "=", "new", "Uri", "(", "$", "request", "->", "getUri", "(", ")", ")", ";", "$", "queryParams", "=", "[", "]", ";", "parse_str", "(", "$", "uri", ...
Build a full URI from a request @param BrowserKitRequest $request @return array [Uri, queryParams]
[ "Build", "a", "full", "URI", "from", "a", "request" ]
5c2b12e4ab291f26424fda9fbf1618c818bc8d6e
https://github.com/jasny/codeception-module/blob/5c2b12e4ab291f26424fda9fbf1618c818bc8d6e/src/RequestConvertor.php#L39-L52
21,512
jasny/codeception-module
src/RequestConvertor.php
RequestConvertor.setRequestHeaders
protected function setRequestHeaders(ServerRequestInterface $baseRequest, array $params) { $headers = (new ServerRequest())->withServerParams($params)->getHeaders(); $psrRequest = $baseRequest; foreach ($headers as $header => $values) { $psrRequest = $psrRequest->withHeader($hea...
php
protected function setRequestHeaders(ServerRequestInterface $baseRequest, array $params) { $headers = (new ServerRequest())->withServerParams($params)->getHeaders(); $psrRequest = $baseRequest; foreach ($headers as $header => $values) { $psrRequest = $psrRequest->withHeader($hea...
[ "protected", "function", "setRequestHeaders", "(", "ServerRequestInterface", "$", "baseRequest", ",", "array", "$", "params", ")", "{", "$", "headers", "=", "(", "new", "ServerRequest", "(", ")", ")", "->", "withServerParams", "(", "$", "params", ")", "->", ...
Set the request headers @param ServerRequestInterface $baseRequest @param array $params @retrun ServerRequestInterface
[ "Set", "the", "request", "headers" ]
5c2b12e4ab291f26424fda9fbf1618c818bc8d6e
https://github.com/jasny/codeception-module/blob/5c2b12e4ab291f26424fda9fbf1618c818bc8d6e/src/RequestConvertor.php#L61-L71
21,513
jasny/codeception-module
src/RequestConvertor.php
RequestConvertor.setRequestProperties
protected function setRequestProperties( ServerRequestInterface $baseRequest, BrowserKitRequest $request, Stream $stream, UriInterface $uri, array $queryParams ) { return $baseRequest ->withProtocolVersion('1.1') ->withBody($stream) ...
php
protected function setRequestProperties( ServerRequestInterface $baseRequest, BrowserKitRequest $request, Stream $stream, UriInterface $uri, array $queryParams ) { return $baseRequest ->withProtocolVersion('1.1') ->withBody($stream) ...
[ "protected", "function", "setRequestProperties", "(", "ServerRequestInterface", "$", "baseRequest", ",", "BrowserKitRequest", "$", "request", ",", "Stream", "$", "stream", ",", "UriInterface", "$", "uri", ",", "array", "$", "queryParams", ")", "{", "return", "$", ...
Set the server request properties @param ServerRequestInterface $baseRequest @param BrowserKitRequest $request @param Stream $stream @param UriInterface $uri @param array $queryParams @return ServerRequestInterface
[ "Set", "the", "server", "request", "properties" ]
5c2b12e4ab291f26424fda9fbf1618c818bc8d6e
https://github.com/jasny/codeception-module/blob/5c2b12e4ab291f26424fda9fbf1618c818bc8d6e/src/RequestConvertor.php#L101-L119
21,514
jasny/codeception-module
src/RequestConvertor.php
RequestConvertor.convertUploadedFiles
protected function convertUploadedFiles(array $files) { $fileObjects = []; foreach ($files as $fieldName => $file) { if ($file instanceof UploadedFileInterface) { $fileObjects[$fieldName] = $file; } elseif (!isset($file['tmp_name']) && !isset($file['e...
php
protected function convertUploadedFiles(array $files) { $fileObjects = []; foreach ($files as $fieldName => $file) { if ($file instanceof UploadedFileInterface) { $fileObjects[$fieldName] = $file; } elseif (!isset($file['tmp_name']) && !isset($file['e...
[ "protected", "function", "convertUploadedFiles", "(", "array", "$", "files", ")", "{", "$", "fileObjects", "=", "[", "]", ";", "foreach", "(", "$", "files", "as", "$", "fieldName", "=>", "$", "file", ")", "{", "if", "(", "$", "file", "instanceof", "Upl...
Convert a list of uploaded files to a Jasny PSR-7 uploaded files @param array $files @return UploadedFile[]|array
[ "Convert", "a", "list", "of", "uploaded", "files", "to", "a", "Jasny", "PSR", "-", "7", "uploaded", "files" ]
5c2b12e4ab291f26424fda9fbf1618c818bc8d6e
https://github.com/jasny/codeception-module/blob/5c2b12e4ab291f26424fda9fbf1618c818bc8d6e/src/RequestConvertor.php#L127-L142
21,515
jasny/codeception-module
src/RequestConvertor.php
RequestConvertor.convert
public function convert(BrowserKitRequest $request, ServerRequestInterface $baseRequest) { $stream = $this->createStream($request); list($uri, $queryParams) = $this->buildFullUri($request); if ($baseRequest instanceof ServerRequest) { $serverParams = $this->determineServ...
php
public function convert(BrowserKitRequest $request, ServerRequestInterface $baseRequest) { $stream = $this->createStream($request); list($uri, $queryParams) = $this->buildFullUri($request); if ($baseRequest instanceof ServerRequest) { $serverParams = $this->determineServ...
[ "public", "function", "convert", "(", "BrowserKitRequest", "$", "request", ",", "ServerRequestInterface", "$", "baseRequest", ")", "{", "$", "stream", "=", "$", "this", "->", "createStream", "(", "$", "request", ")", ";", "list", "(", "$", "uri", ",", "$",...
Convert a codeception request to a PSR-7 server request @param BrowserKitRequest $request @param ServerRequestInterface $baseRequest @return ServerRequest
[ "Convert", "a", "codeception", "request", "to", "a", "PSR", "-", "7", "server", "request" ]
5c2b12e4ab291f26424fda9fbf1618c818bc8d6e
https://github.com/jasny/codeception-module/blob/5c2b12e4ab291f26424fda9fbf1618c818bc8d6e/src/RequestConvertor.php#L152-L165
21,516
inhere/php-librarys
src/Helpers/PhpException.php
PhpException.toArray
public static function toArray($e, $getTrace = true, $catcher = null) { $data = [ 'class' => \get_class($e), 'message' => $e->getMessage(), 'code' => $e->getCode(), 'file' => $e->getFile() . ':' . $e->getLine(), ]; if ($catcher) { ...
php
public static function toArray($e, $getTrace = true, $catcher = null) { $data = [ 'class' => \get_class($e), 'message' => $e->getMessage(), 'code' => $e->getCode(), 'file' => $e->getFile() . ':' . $e->getLine(), ]; if ($catcher) { ...
[ "public", "static", "function", "toArray", "(", "$", "e", ",", "$", "getTrace", "=", "true", ",", "$", "catcher", "=", "null", ")", "{", "$", "data", "=", "[", "'class'", "=>", "\\", "get_class", "(", "$", "e", ")", ",", "'message'", "=>", "$", "...
Converts an exception into a simple array. @param \Exception|\Throwable $e the exception being converted @param bool $getTrace @param null|string $catcher @return array
[ "Converts", "an", "exception", "into", "a", "simple", "array", "." ]
e6ca598685469794f310e3ab0e2bc19519cd0ae6
https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Helpers/PhpException.php#L61-L79
21,517
blesta/composer-installer
src/Installer.php
Installer.supportedType
protected function supportedType($type) { $supportedType = false; $baseType = substr($type, 0, strpos($type, '-')); if (array_key_exists($baseType, $this->supportedTypes)) { $supportedType = $baseType; } return $supportedType; }
php
protected function supportedType($type) { $supportedType = false; $baseType = substr($type, 0, strpos($type, '-')); if (array_key_exists($baseType, $this->supportedTypes)) { $supportedType = $baseType; } return $supportedType; }
[ "protected", "function", "supportedType", "(", "$", "type", ")", "{", "$", "supportedType", "=", "false", ";", "$", "baseType", "=", "substr", "(", "$", "type", ",", "0", ",", "strpos", "(", "$", "type", ",", "'-'", ")", ")", ";", "if", "(", "array...
Find the matching installer type @param string $type @return boolean|string
[ "Find", "the", "matching", "installer", "type" ]
11672a7cbe9c74a6d5bc602ce8148ae92781ba2e
https://github.com/blesta/composer-installer/blob/11672a7cbe9c74a6d5bc602ce8148ae92781ba2e/src/Installer.php#L89-L100
21,518
Root-XS/SudoBible
src/SudoBible.php
SudoBible.dbConnect
protected function dbConnect(array $aOptions) { $aOptions = array_merge(SudoBible::DB_CREDS, $aOptions); try { $this->db = new mysqli( $aOptions['db_host'], $aOptions['db_user'], $aOptions['db_pass'], $aOptions['db_name'], $aOptions['db_port'] ); } catch (Exception $e) { // Clean up ...
php
protected function dbConnect(array $aOptions) { $aOptions = array_merge(SudoBible::DB_CREDS, $aOptions); try { $this->db = new mysqli( $aOptions['db_host'], $aOptions['db_user'], $aOptions['db_pass'], $aOptions['db_name'], $aOptions['db_port'] ); } catch (Exception $e) { // Clean up ...
[ "protected", "function", "dbConnect", "(", "array", "$", "aOptions", ")", "{", "$", "aOptions", "=", "array_merge", "(", "SudoBible", "::", "DB_CREDS", ",", "$", "aOptions", ")", ";", "try", "{", "$", "this", "->", "db", "=", "new", "mysqli", "(", "$",...
Connect to the DB. @param array $aOptions @throws Exception
[ "Connect", "to", "the", "DB", "." ]
562462e92e1b2c019bdd48ed83414502ca0bdb0c
https://github.com/Root-XS/SudoBible/blob/562462e92e1b2c019bdd48ed83414502ca0bdb0c/src/SudoBible.php#L65-L80
21,519
Root-XS/SudoBible
src/SudoBible.php
SudoBible.setTranslation
public function setTranslation($mTranslation) { $this->iTranslation = is_numeric($mTranslation) ? $mTranslation : $this->getIdFor('translation', $mTranslation); }
php
public function setTranslation($mTranslation) { $this->iTranslation = is_numeric($mTranslation) ? $mTranslation : $this->getIdFor('translation', $mTranslation); }
[ "public", "function", "setTranslation", "(", "$", "mTranslation", ")", "{", "$", "this", "->", "iTranslation", "=", "is_numeric", "(", "$", "mTranslation", ")", "?", "$", "mTranslation", ":", "$", "this", "->", "getIdFor", "(", "'translation'", ",", "$", "...
Set the translation preference. @param int|string $mTranslation
[ "Set", "the", "translation", "preference", "." ]
562462e92e1b2c019bdd48ed83414502ca0bdb0c
https://github.com/Root-XS/SudoBible/blob/562462e92e1b2c019bdd48ed83414502ca0bdb0c/src/SudoBible.php#L87-L91
21,520
Root-XS/SudoBible
src/SudoBible.php
SudoBible.queryFiles
protected function queryFiles($strAction) { if (!in_array($strAction, ['create', 'insert', 'drop'])) throw new Exception('Invalid parameter "' . $strAction . '" sent to SudoBible::queryFiles()'); $strPath = 'queries/' . $this->dbType . '/' . $strAction; foreach (scandir($strPath) as $strFilename) { // On...
php
protected function queryFiles($strAction) { if (!in_array($strAction, ['create', 'insert', 'drop'])) throw new Exception('Invalid parameter "' . $strAction . '" sent to SudoBible::queryFiles()'); $strPath = 'queries/' . $this->dbType . '/' . $strAction; foreach (scandir($strPath) as $strFilename) { // On...
[ "protected", "function", "queryFiles", "(", "$", "strAction", ")", "{", "if", "(", "!", "in_array", "(", "$", "strAction", ",", "[", "'create'", ",", "'insert'", ",", "'drop'", "]", ")", ")", "throw", "new", "Exception", "(", "'Invalid parameter \"'", ".",...
Run the query files in a given directory. @param string $strAction create, insert, or drop @throws Exception
[ "Run", "the", "query", "files", "in", "a", "given", "directory", "." ]
562462e92e1b2c019bdd48ed83414502ca0bdb0c
https://github.com/Root-XS/SudoBible/blob/562462e92e1b2c019bdd48ed83414502ca0bdb0c/src/SudoBible.php#L125-L145
21,521
Root-XS/SudoBible
src/SudoBible.php
SudoBible.topic
public function topic($mTopic, $bRandomOne = false) { // Sanitize input if (is_string($mTopic)) $mTopic = $this->getIdFor('topic', $mTopic); // Search $q = 'SELECT tv.*, verses.`text`, books.`name` AS book_name, books.`abbr` AS book_abbr, books.`ot`, books.`nt`' . ' FROM `sudo_bible_topic_verses` AS tv'...
php
public function topic($mTopic, $bRandomOne = false) { // Sanitize input if (is_string($mTopic)) $mTopic = $this->getIdFor('topic', $mTopic); // Search $q = 'SELECT tv.*, verses.`text`, books.`name` AS book_name, books.`abbr` AS book_abbr, books.`ot`, books.`nt`' . ' FROM `sudo_bible_topic_verses` AS tv'...
[ "public", "function", "topic", "(", "$", "mTopic", ",", "$", "bRandomOne", "=", "false", ")", "{", "// Sanitize input", "if", "(", "is_string", "(", "$", "mTopic", ")", ")", "$", "mTopic", "=", "$", "this", "->", "getIdFor", "(", "'topic'", ",", "$", ...
Return all verses on a single topic. @param int|string $mTopic The topic ID or name. @param bool $bRandomOne Pick a random passage? @return array|SudoBiblePassage
[ "Return", "all", "verses", "on", "a", "single", "topic", "." ]
562462e92e1b2c019bdd48ed83414502ca0bdb0c
https://github.com/Root-XS/SudoBible/blob/562462e92e1b2c019bdd48ed83414502ca0bdb0c/src/SudoBible.php#L291-L317
21,522
Root-XS/SudoBible
src/SudoBible.php
SudoBible.nextVerse
public function nextVerse($mBook, $iChapter, $iVerse) { $oPassage = new SudoBiblePassage([], $this); $iBookId = is_numeric($mBook) ? $mBook : getIdFor('book', $mBook); // Steps to try $aSteps = [ [$iBookId, $iChapter, $iVerse + 1], // next verse in chapter [$iBookId, $iChapter + 1, 1], // beginning of n...
php
public function nextVerse($mBook, $iChapter, $iVerse) { $oPassage = new SudoBiblePassage([], $this); $iBookId = is_numeric($mBook) ? $mBook : getIdFor('book', $mBook); // Steps to try $aSteps = [ [$iBookId, $iChapter, $iVerse + 1], // next verse in chapter [$iBookId, $iChapter + 1, 1], // beginning of n...
[ "public", "function", "nextVerse", "(", "$", "mBook", ",", "$", "iChapter", ",", "$", "iVerse", ")", "{", "$", "oPassage", "=", "new", "SudoBiblePassage", "(", "[", "]", ",", "$", "this", ")", ";", "$", "iBookId", "=", "is_numeric", "(", "$", "mBook"...
Get the verse following the given reference. @param int|string $mBook @param int $iChapter @param int $iVerse @return SudoBiblePassage
[ "Get", "the", "verse", "following", "the", "given", "reference", "." ]
562462e92e1b2c019bdd48ed83414502ca0bdb0c
https://github.com/Root-XS/SudoBible/blob/562462e92e1b2c019bdd48ed83414502ca0bdb0c/src/SudoBible.php#L327-L346
21,523
Root-XS/SudoBible
src/SudoBible.php
SudoBible.getIdFor
protected function getIdFor($strType, $strNameAbbr) { // Validate input if (!in_array($strType, ['book', 'translation', 'topic'])) throw new Exception('Invalid entity type "' . $strType . '"'); // Query the db to get the ID $strTableName = 'sudo_bible_' . $strType . 's'; $q = 'SELECT `id` FROM `' . $strT...
php
protected function getIdFor($strType, $strNameAbbr) { // Validate input if (!in_array($strType, ['book', 'translation', 'topic'])) throw new Exception('Invalid entity type "' . $strType . '"'); // Query the db to get the ID $strTableName = 'sudo_bible_' . $strType . 's'; $q = 'SELECT `id` FROM `' . $strT...
[ "protected", "function", "getIdFor", "(", "$", "strType", ",", "$", "strNameAbbr", ")", "{", "// Validate input", "if", "(", "!", "in_array", "(", "$", "strType", ",", "[", "'book'", ",", "'translation'", ",", "'topic'", "]", ")", ")", "throw", "new", "E...
Get an ID, given the name. For now, we're using this instead of a JOIN in the main query so we can throw a useful error. @param string $strType translation, book, or topic @param string $strNameAbbr Name of the translation or book. @throws Exception @return int
[ "Get", "an", "ID", "given", "the", "name", "." ]
562462e92e1b2c019bdd48ed83414502ca0bdb0c
https://github.com/Root-XS/SudoBible/blob/562462e92e1b2c019bdd48ed83414502ca0bdb0c/src/SudoBible.php#L359-L381
21,524
Root-XS/SudoBible
src/SudoBible.php
SudoBible.runPreparedQuery
protected function runPreparedQuery($strSql, array $aParams = []) { // call_user_func_array needs references, not values $aRefParams = []; foreach ($aParams as $k =>$v) $aRefParams[$k] = &$aParams[$k]; // Build data type string for bind_param $strDataTypes = ''; foreach ($aRefParams as $mValue) $str...
php
protected function runPreparedQuery($strSql, array $aParams = []) { // call_user_func_array needs references, not values $aRefParams = []; foreach ($aParams as $k =>$v) $aRefParams[$k] = &$aParams[$k]; // Build data type string for bind_param $strDataTypes = ''; foreach ($aRefParams as $mValue) $str...
[ "protected", "function", "runPreparedQuery", "(", "$", "strSql", ",", "array", "$", "aParams", "=", "[", "]", ")", "{", "// call_user_func_array needs references, not values", "$", "aRefParams", "=", "[", "]", ";", "foreach", "(", "$", "aParams", "as", "$", "k...
Run a "mysqli" prepared query, given the query string and params. @param string $strSql Query string with "?" placeholders. @param array $aParams Array of values to fill in for the placeholders. @return array Result set.
[ "Run", "a", "mysqli", "prepared", "query", "given", "the", "query", "string", "and", "params", "." ]
562462e92e1b2c019bdd48ed83414502ca0bdb0c
https://github.com/Root-XS/SudoBible/blob/562462e92e1b2c019bdd48ed83414502ca0bdb0c/src/SudoBible.php#L390-L417
21,525
NuclearCMS/Hierarchy
src/Support/FileKeeper.php
FileKeeper.tryDelete
protected static function tryDelete($path) { $success = true; try { if ( ! @unlink($path)) { $success = false; } } catch (ErrorException $e) { $success = false; } return $success; }
php
protected static function tryDelete($path) { $success = true; try { if ( ! @unlink($path)) { $success = false; } } catch (ErrorException $e) { $success = false; } return $success; }
[ "protected", "static", "function", "tryDelete", "(", "$", "path", ")", "{", "$", "success", "=", "true", ";", "try", "{", "if", "(", "!", "@", "unlink", "(", "$", "path", ")", ")", "{", "$", "success", "=", "false", ";", "}", "}", "catch", "(", ...
Try to delete a file @param $path @return bool
[ "Try", "to", "delete", "a", "file" ]
535171c5e2db72265313fd2110aec8456e46f459
https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Support/FileKeeper.php#L89-L105
21,526
bluetree-service/event
src/Event/Base/EventLog.php
EventLog.makeLogEvent
public function makeLogEvent($name, $eventListener, $status) { if ($this->options['log_events'] && ($this->options['log_all_events'] || in_array($name, $this->logEvents, true) ) ) { $this->loggerInstance->makeLog( [ ...
php
public function makeLogEvent($name, $eventListener, $status) { if ($this->options['log_events'] && ($this->options['log_all_events'] || in_array($name, $this->logEvents, true) ) ) { $this->loggerInstance->makeLog( [ ...
[ "public", "function", "makeLogEvent", "(", "$", "name", ",", "$", "eventListener", ",", "$", "status", ")", "{", "if", "(", "$", "this", "->", "options", "[", "'log_events'", "]", "&&", "(", "$", "this", "->", "options", "[", "'log_all_events'", "]", "...
check that event data can be logged and create log message @param string $name @param mixed $eventListener @param bool|string $status @return $this
[ "check", "that", "event", "data", "can", "be", "logged", "and", "create", "log", "message" ]
64ef4c77af6284fc22748285d5e527edbdbed69b
https://github.com/bluetree-service/event/blob/64ef4c77af6284fc22748285d5e527edbdbed69b/src/Event/Base/EventLog.php#L56-L73
21,527
thienhungho/yii2-product-management
src/modules/ProductManage/controllers/ProductTypeMetaController.php
ProductTypeMetaController.findModel
protected function findModel($id) { if (($model = ProductTypeMeta::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException(t('app', 'The requested page does not exist.')); } }
php
protected function findModel($id) { if (($model = ProductTypeMeta::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException(t('app', 'The requested page does not exist.')); } }
[ "protected", "function", "findModel", "(", "$", "id", ")", "{", "if", "(", "(", "$", "model", "=", "ProductTypeMeta", "::", "findOne", "(", "$", "id", ")", ")", "!==", "null", ")", "{", "return", "$", "model", ";", "}", "else", "{", "throw", "new",...
Finds the ProductTypeMeta model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown. @param integer $id @return ProductTypeMeta the loaded model @throws NotFoundHttpException if the model cannot be found
[ "Finds", "the", "ProductTypeMeta", "model", "based", "on", "its", "primary", "key", "value", ".", "If", "the", "model", "is", "not", "found", "a", "404", "HTTP", "exception", "will", "be", "thrown", "." ]
72e1237bba123faf671e44491bd93077b50adde9
https://github.com/thienhungho/yii2-product-management/blob/72e1237bba123faf671e44491bd93077b50adde9/src/modules/ProductManage/controllers/ProductTypeMetaController.php#L182-L189
21,528
xiewulong/yii2-fileupload
oss/libs/symfony/class-loader/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php
DebugUniversalClassLoader.enable
public static function enable() { if (!is_array($functions = spl_autoload_functions())) { return; } foreach ($functions as $function) { spl_autoload_unregister($function); } foreach ($functions as $function) { if (is_array($function) && $...
php
public static function enable() { if (!is_array($functions = spl_autoload_functions())) { return; } foreach ($functions as $function) { spl_autoload_unregister($function); } foreach ($functions as $function) { if (is_array($function) && $...
[ "public", "static", "function", "enable", "(", ")", "{", "if", "(", "!", "is_array", "(", "$", "functions", "=", "spl_autoload_functions", "(", ")", ")", ")", "{", "return", ";", "}", "foreach", "(", "$", "functions", "as", "$", "function", ")", "{", ...
Replaces all regular UniversalClassLoader instances by a DebugUniversalClassLoader ones.
[ "Replaces", "all", "regular", "UniversalClassLoader", "instances", "by", "a", "DebugUniversalClassLoader", "ones", "." ]
3e75b17a4a18dd8466e3f57c63136de03470ca82
https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/symfony/class-loader/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php#L24-L48
21,529
Danack/GithubArtaxService
lib/GithubService/Model/RepoStatsPunchCardInfo.php
RepoStatsPunchCardInfo.createFromData
static function createFromData($data) { $instance = new static(); $instance->day = $data[0]; $instance->hour = $data[1]; $instance->numberCommits = $data[2]; return $instance; }
php
static function createFromData($data) { $instance = new static(); $instance->day = $data[0]; $instance->hour = $data[1]; $instance->numberCommits = $data[2]; return $instance; }
[ "static", "function", "createFromData", "(", "$", "data", ")", "{", "$", "instance", "=", "new", "static", "(", ")", ";", "$", "instance", "->", "day", "=", "$", "data", "[", "0", "]", ";", "$", "instance", "->", "hour", "=", "$", "data", "[", "1...
Number of commits
[ "Number", "of", "commits" ]
9f62b5be4f413207d4012e7fa084d0ae505680eb
https://github.com/Danack/GithubArtaxService/blob/9f62b5be4f413207d4012e7fa084d0ae505680eb/lib/GithubService/Model/RepoStatsPunchCardInfo.php#L22-L30
21,530
raideer/twitch-api
src/Wrapper.php
Wrapper.registerResource
public function registerResource(Resources\Resource $resource) { $this->resources[strtolower($resource->getName())] = $resource; }
php
public function registerResource(Resources\Resource $resource) { $this->resources[strtolower($resource->getName())] = $resource; }
[ "public", "function", "registerResource", "(", "Resources", "\\", "Resource", "$", "resource", ")", "{", "$", "this", "->", "resources", "[", "strtolower", "(", "$", "resource", "->", "getName", "(", ")", ")", "]", "=", "$", "resource", ";", "}" ]
Registers a resource. @param ResourcesResource $resource @return void
[ "Registers", "a", "resource", "." ]
27ebf1dcb0315206300d507600b6a82ebe33d57e
https://github.com/raideer/twitch-api/blob/27ebf1dcb0315206300d507600b6a82ebe33d57e/src/Wrapper.php#L71-L74
21,531
raideer/twitch-api
src/Wrapper.php
Wrapper.authorize
public function authorize($args) { $numArgs = func_num_args(); if ($numArgs === 0) { throw new \InvalidArgumentException('Wrapper->authorize expects atleast 1 argument!'); return; } if ($numArgs === 1) { $arg1 = func_get_arg(0); if ($arg1 instanceof O...
php
public function authorize($args) { $numArgs = func_num_args(); if ($numArgs === 0) { throw new \InvalidArgumentException('Wrapper->authorize expects atleast 1 argument!'); return; } if ($numArgs === 1) { $arg1 = func_get_arg(0); if ($arg1 instanceof O...
[ "public", "function", "authorize", "(", "$", "args", ")", "{", "$", "numArgs", "=", "func_num_args", "(", ")", ";", "if", "(", "$", "numArgs", "===", "0", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'Wrapper->authorize expects atleast 1 a...
Enables the authorized requests. @param string $args Access token OR @param OAuthResponse $args Object returned by OAuth->getResponse() OR @param string $arg1 Access Token @param array $arg2 Array of registered scopes @return void
[ "Enables", "the", "authorized", "requests", "." ]
27ebf1dcb0315206300d507600b6a82ebe33d57e
https://github.com/raideer/twitch-api/blob/27ebf1dcb0315206300d507600b6a82ebe33d57e/src/Wrapper.php#L118-L158
21,532
raideer/twitch-api
src/Wrapper.php
Wrapper.hasScope
public function hasScope($name, $strict = true) { if (!$strict) { if (empty($this->registeredScopes)) { return true; } } return in_array($name, $this->registeredScopes); }
php
public function hasScope($name, $strict = true) { if (!$strict) { if (empty($this->registeredScopes)) { return true; } } return in_array($name, $this->registeredScopes); }
[ "public", "function", "hasScope", "(", "$", "name", ",", "$", "strict", "=", "true", ")", "{", "if", "(", "!", "$", "strict", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "registeredScopes", ")", ")", "{", "return", "true", ";", "}", "}"...
Checks if scope is registered. @param string $name Scope name @param bool $strict If false and registeredScopes array is empty, function will return true. Used by Resources. If an array of registered scopes is passed in Wrapper->authorize() function, authorized requests will check if scope is registered without ...
[ "Checks", "if", "scope", "is", "registered", "." ]
27ebf1dcb0315206300d507600b6a82ebe33d57e
https://github.com/raideer/twitch-api/blob/27ebf1dcb0315206300d507600b6a82ebe33d57e/src/Wrapper.php#L171-L180
21,533
raideer/twitch-api
src/Wrapper.php
Wrapper.checkScope
public function checkScope($name, $strict = false) { if (!$this->hasScope($name, $strict)) { throw new Exceptions\OutOfScopeException("Scope $name is not registered!"); } }
php
public function checkScope($name, $strict = false) { if (!$this->hasScope($name, $strict)) { throw new Exceptions\OutOfScopeException("Scope $name is not registered!"); } }
[ "public", "function", "checkScope", "(", "$", "name", ",", "$", "strict", "=", "false", ")", "{", "if", "(", "!", "$", "this", "->", "hasScope", "(", "$", "name", ",", "$", "strict", ")", ")", "{", "throw", "new", "Exceptions", "\\", "OutOfScopeExcep...
Checks if scope is registered Throws an exception if scope doesn't exist. @param string $name Scope name @param bool $strict @return void
[ "Checks", "if", "scope", "is", "registered", "Throws", "an", "exception", "if", "scope", "doesn", "t", "exist", "." ]
27ebf1dcb0315206300d507600b6a82ebe33d57e
https://github.com/raideer/twitch-api/blob/27ebf1dcb0315206300d507600b6a82ebe33d57e/src/Wrapper.php#L191-L196
21,534
raideer/twitch-api
src/Wrapper.php
Wrapper.resource
public function resource($name) { if (!isset($this->resources[$name])) { throw new Exceptions\ResourceException("Resource $name does not exist!"); return; } return $this->resources[$name]; }
php
public function resource($name) { if (!isset($this->resources[$name])) { throw new Exceptions\ResourceException("Resource $name does not exist!"); return; } return $this->resources[$name]; }
[ "public", "function", "resource", "(", "$", "name", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "resources", "[", "$", "name", "]", ")", ")", "{", "throw", "new", "Exceptions", "\\", "ResourceException", "(", "\"Resource $name does not exist...
Returns an API resource. @param string $name Name of the resource @return Raideer\TwitchApi\Resources\Resource
[ "Returns", "an", "API", "resource", "." ]
27ebf1dcb0315206300d507600b6a82ebe33d57e
https://github.com/raideer/twitch-api/blob/27ebf1dcb0315206300d507600b6a82ebe33d57e/src/Wrapper.php#L223-L232
21,535
raideer/twitch-api
src/Wrapper.php
Wrapper.request
public function request($type, $target, $options = [], $authorized = false) { $headers = [ 'Accept' => 'application/vnd.twitchtv.v3+json', ]; if ($authorized) { $headers['Authorization'] = 'OAuth '.$this->accessToken; } $options = array_merge_recursive(['headers' => $head...
php
public function request($type, $target, $options = [], $authorized = false) { $headers = [ 'Accept' => 'application/vnd.twitchtv.v3+json', ]; if ($authorized) { $headers['Authorization'] = 'OAuth '.$this->accessToken; } $options = array_merge_recursive(['headers' => $head...
[ "public", "function", "request", "(", "$", "type", ",", "$", "target", ",", "$", "options", "=", "[", "]", ",", "$", "authorized", "=", "false", ")", "{", "$", "headers", "=", "[", "'Accept'", "=>", "'application/vnd.twitchtv.v3+json'", ",", "]", ";", ...
Makes a GuzzleHttp request. @param requestType $type GET, POST, PUT, DELETE @param string $target Target URL @param array $options Request options @param bool $authorized Attach Authorization headers @return array JsonDecoded body contents
[ "Makes", "a", "GuzzleHttp", "request", "." ]
27ebf1dcb0315206300d507600b6a82ebe33d57e
https://github.com/raideer/twitch-api/blob/27ebf1dcb0315206300d507600b6a82ebe33d57e/src/Wrapper.php#L268-L297
21,536
krakphp/job
src/Queue/Doctrine/JobRepository.php
JobRepository.addJob
public function addJob(Job\WrappedJob $job, $queue) { $qb = $this->conn->createQueryBuilder(); $qb->insert($this->table_name); $qb->values([ 'status' => ':status', 'job' => ':job', 'name' => ':name', 'queue' => ':queue', 'created_at' =>...
php
public function addJob(Job\WrappedJob $job, $queue) { $qb = $this->conn->createQueryBuilder(); $qb->insert($this->table_name); $qb->values([ 'status' => ':status', 'job' => ':job', 'name' => ':name', 'queue' => ':queue', 'created_at' =>...
[ "public", "function", "addJob", "(", "Job", "\\", "WrappedJob", "$", "job", ",", "$", "queue", ")", "{", "$", "qb", "=", "$", "this", "->", "conn", "->", "createQueryBuilder", "(", ")", ";", "$", "qb", "->", "insert", "(", "$", "this", "->", "table...
add a new wrapped job
[ "add", "a", "new", "wrapped", "job" ]
0c16020c1baa13d91f819ecba8334861ba7c4d6c
https://github.com/krakphp/job/blob/0c16020c1baa13d91f819ecba8334861ba7c4d6c/src/Queue/Doctrine/JobRepository.php#L32-L61
21,537
krakphp/job
src/Queue/Doctrine/JobRepository.php
JobRepository.getAvailableJobs
public function getAvailableJobs($queue, $max = 10) { $qb = $this->conn->createQueryBuilder(); $qb->select('*'); $qb->from($this->table_name); $qb->where('status = :status AND queue = :queue AND available_at <= :now'); $qb->orderBy('status'); $qb->setParameters([ ...
php
public function getAvailableJobs($queue, $max = 10) { $qb = $this->conn->createQueryBuilder(); $qb->select('*'); $qb->from($this->table_name); $qb->where('status = :status AND queue = :queue AND available_at <= :now'); $qb->orderBy('status'); $qb->setParameters([ ...
[ "public", "function", "getAvailableJobs", "(", "$", "queue", ",", "$", "max", "=", "10", ")", "{", "$", "qb", "=", "$", "this", "->", "conn", "->", "createQueryBuilder", "(", ")", ";", "$", "qb", "->", "select", "(", "'*'", ")", ";", "$", "qb", "...
get available jobs
[ "get", "available", "jobs" ]
0c16020c1baa13d91f819ecba8334861ba7c4d6c
https://github.com/krakphp/job/blob/0c16020c1baa13d91f819ecba8334861ba7c4d6c/src/Queue/Doctrine/JobRepository.php#L96-L110
21,538
alevilar/ristorantino-vendor
Risto/Controller/Component/RistoAuthComponent.php
RistoAuthComponent.initialize
public function initialize(Controller $controller) { parent::initialize($controller); $loginUrl = array( 'plugin' => 'users', 'controller' => 'users', 'action' => 'login', 'admin' => false, ); if ( !empty( $controller->reque...
php
public function initialize(Controller $controller) { parent::initialize($controller); $loginUrl = array( 'plugin' => 'users', 'controller' => 'users', 'action' => 'login', 'admin' => false, ); if ( !empty( $controller->reque...
[ "public", "function", "initialize", "(", "Controller", "$", "controller", ")", "{", "parent", "::", "initialize", "(", "$", "controller", ")", ";", "$", "loginUrl", "=", "array", "(", "'plugin'", "=>", "'users'", ",", "'controller'", "=>", "'users'", ",", ...
Initializes AuthComponent for use in the controller. @param Controller $controller A reference to the instantiating controller object @return void
[ "Initializes", "AuthComponent", "for", "use", "in", "the", "controller", "." ]
6b91a1e20cc0ba09a1968d77e3de6512cfa2d966
https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Risto/Controller/Component/RistoAuthComponent.php#L57-L72
21,539
alevilar/ristorantino-vendor
Risto/Controller/Component/RistoAuthComponent.php
RistoAuthComponent.isAuthorized
public function isAuthorized($user = null, CakeRequest $request = null) { if (empty($user) && !$this->user()) { return false; } if (empty($user)) { $user = $this->user(); } if (empty($request)) { $request = $this->request; } if (empty($this->_authorizeObjects)) { $this->constructAuthorize(); ...
php
public function isAuthorized($user = null, CakeRequest $request = null) { if (empty($user) && !$this->user()) { return false; } if (empty($user)) { $user = $this->user(); } if (empty($request)) { $request = $this->request; } if (empty($this->_authorizeObjects)) { $this->constructAuthorize(); ...
[ "public", "function", "isAuthorized", "(", "$", "user", "=", "null", ",", "CakeRequest", "$", "request", "=", "null", ")", "{", "if", "(", "empty", "(", "$", "user", ")", "&&", "!", "$", "this", "->", "user", "(", ")", ")", "{", "return", "false", ...
Al contrario que el isAuthorized que viene en CakePhp este se fija si algun Adapter retorna false, y entonces retorna false. el orioginal de Cake hace al reves: con que venga un true. ya le da acceso a todos @param array|null $user The user to check the authorization of. If empty the user in the session will be used....
[ "Al", "contrario", "que", "el", "isAuthorized", "que", "viene", "en", "CakePhp", "este", "se", "fija", "si", "algun", "Adapter", "retorna", "false", "y", "entonces", "retorna", "false", "." ]
6b91a1e20cc0ba09a1968d77e3de6512cfa2d966
https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Risto/Controller/Component/RistoAuthComponent.php#L86-L105
21,540
raideer/twitch-api
src/Resources/Streams.php
Streams.getStreams
public function getStreams($params = []) { $defaults = [ 'game' => null, 'channel' => null, 'limit' => 25, 'offset' => 0, 'client_id' => null, 'stream_type' => 'all', ]; $types = [ 'stream_type' => ['all',...
php
public function getStreams($params = []) { $defaults = [ 'game' => null, 'channel' => null, 'limit' => 25, 'offset' => 0, 'client_id' => null, 'stream_type' => 'all', ]; $types = [ 'stream_type' => ['all',...
[ "public", "function", "getStreams", "(", "$", "params", "=", "[", "]", ")", "{", "$", "defaults", "=", "[", "'game'", "=>", "null", ",", "'channel'", "=>", "null", ",", "'limit'", "=>", "25", ",", "'offset'", "=>", "0", ",", "'client_id'", "=>", "nul...
Returns a list of stream objects that are queried by a number of parameters sorted by number of viewers descending. Learn more: https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md#get-streams @param array $params Optional params @return array
[ "Returns", "a", "list", "of", "stream", "objects", "that", "are", "queried", "by", "a", "number", "of", "parameters", "sorted", "by", "number", "of", "viewers", "descending", "." ]
27ebf1dcb0315206300d507600b6a82ebe33d57e
https://github.com/raideer/twitch-api/blob/27ebf1dcb0315206300d507600b6a82ebe33d57e/src/Resources/Streams.php#L47-L63
21,541
gedex/php-janrain-api
lib/Janrain/Api/Capture/Versions.php
Versions.entity
public function entity($entityType, $id, $timestamp) { $params = array( 'type_name' => $entityType, 'id' => $id, 'timestamp' => $timestamp, ); return $this->post('versions/entity', $params); }
php
public function entity($entityType, $id, $timestamp) { $params = array( 'type_name' => $entityType, 'id' => $id, 'timestamp' => $timestamp, ); return $this->post('versions/entity', $params); }
[ "public", "function", "entity", "(", "$", "entityType", ",", "$", "id", ",", "$", "timestamp", ")", "{", "$", "params", "=", "array", "(", "'type_name'", "=>", "$", "entityType", ",", "'id'", "=>", "$", "id", ",", "'timestamp'", "=>", "$", "timestamp",...
Retrieve a past value of single entity by primary key and timestamp. @param string $entityType @param string $id @param string $timestamp
[ "Retrieve", "a", "past", "value", "of", "single", "entity", "by", "primary", "key", "and", "timestamp", "." ]
6283f68454e0ad5211ac620f1d337df38cd49597
https://github.com/gedex/php-janrain-api/blob/6283f68454e0ad5211ac620f1d337df38cd49597/lib/Janrain/Api/Capture/Versions.php#L17-L26
21,542
WScore/Validation
src/Utils/HelperSameWith.php
HelperSameWith.get_sameWith_value
private static function get_sameWith_value($dio, $rules) { $sub_name = $rules['sameWith']; if ($rules instanceof Rules) { $sub_filter = clone $rules; } else { $sub_filter = $rules; } $sub_filter['sameWith'] = false; $sub_filter['required'] = fa...
php
private static function get_sameWith_value($dio, $rules) { $sub_name = $rules['sameWith']; if ($rules instanceof Rules) { $sub_filter = clone $rules; } else { $sub_filter = $rules; } $sub_filter['sameWith'] = false; $sub_filter['required'] = fa...
[ "private", "static", "function", "get_sameWith_value", "(", "$", "dio", ",", "$", "rules", ")", "{", "$", "sub_name", "=", "$", "rules", "[", "'sameWith'", "]", ";", "if", "(", "$", "rules", "instanceof", "Rules", ")", "{", "$", "sub_filter", "=", "clo...
find the same with value. @param Dio $dio @param array|Rules $rules @return mixed
[ "find", "the", "same", "with", "value", "." ]
25c0dca37d624bb0bb22f8e79ba54db2f69e0950
https://github.com/WScore/Validation/blob/25c0dca37d624bb0bb22f8e79ba54db2f69e0950/src/Utils/HelperSameWith.php#L42-L56
21,543
vhraban/Overture
src/ProviderFoundation/TraversableValueContainer.php
TraversableValueContainer.get
public function get($key) { $ret = $this->traverseTree($key); if(!is_scalar($ret)) { throw new UnexpectedValueException("The {$key} configuration value is not scalar"); } return $ret; }
php
public function get($key) { $ret = $this->traverseTree($key); if(!is_scalar($ret)) { throw new UnexpectedValueException("The {$key} configuration value is not scalar"); } return $ret; }
[ "public", "function", "get", "(", "$", "key", ")", "{", "$", "ret", "=", "$", "this", "->", "traverseTree", "(", "$", "key", ")", ";", "if", "(", "!", "is_scalar", "(", "$", "ret", ")", ")", "{", "throw", "new", "UnexpectedValueException", "(", "\"...
Get a value for a configuration key @param string $key The configuration key @throws MissingKeyException if the path is unreachable @throws UnexpectedValueException if the path is key is missing @return string
[ "Get", "a", "value", "for", "a", "configuration", "key" ]
4749f2631c9517bc0f6449185d5adb62b85ff4f5
https://github.com/vhraban/Overture/blob/4749f2631c9517bc0f6449185d5adb62b85ff4f5/src/ProviderFoundation/TraversableValueContainer.php#L37-L45
21,544
vhraban/Overture
src/ProviderFoundation/TraversableValueContainer.php
TraversableValueContainer.traverseTree
protected function traverseTree($path) { // before the travel current node is the root $currentNode = $this->tree; $pathElements = explode(static::KEY_NODE_DELIMITER, $path); foreach($pathElements as $node) { // Ensure the next child exists if(!isset(...
php
protected function traverseTree($path) { // before the travel current node is the root $currentNode = $this->tree; $pathElements = explode(static::KEY_NODE_DELIMITER, $path); foreach($pathElements as $node) { // Ensure the next child exists if(!isset(...
[ "protected", "function", "traverseTree", "(", "$", "path", ")", "{", "// before the travel current node is the root", "$", "currentNode", "=", "$", "this", "->", "tree", ";", "$", "pathElements", "=", "explode", "(", "static", "::", "KEY_NODE_DELIMITER", ",", "$",...
Traverse a tree until the end of path is reached $path can be separated with a dot . In an array [ "section" => ["a => "b"], ["b" => "B"] value B can be accessed by giving section.b key @param string $path The path @throws MissingKeyException if the path is unreachable @return string
[ "Traverse", "a", "tree", "until", "the", "end", "of", "path", "is", "reached" ]
4749f2631c9517bc0f6449185d5adb62b85ff4f5
https://github.com/vhraban/Overture/blob/4749f2631c9517bc0f6449185d5adb62b85ff4f5/src/ProviderFoundation/TraversableValueContainer.php#L62-L81
21,545
madkom/regex
src/Matcher.php
Matcher.match
public function match(string $subject, int $flags = 0, int $offset = 0) : array { preg_match($this->pattern->getPattern() . $this->modifier, $subject, $matches, $flags, $offset); if (($errno = preg_last_error()) !== PREG_NO_ERROR) { $message = array_flip(get_defined_constants(true)['pcr...
php
public function match(string $subject, int $flags = 0, int $offset = 0) : array { preg_match($this->pattern->getPattern() . $this->modifier, $subject, $matches, $flags, $offset); if (($errno = preg_last_error()) !== PREG_NO_ERROR) { $message = array_flip(get_defined_constants(true)['pcr...
[ "public", "function", "match", "(", "string", "$", "subject", ",", "int", "$", "flags", "=", "0", ",", "int", "$", "offset", "=", "0", ")", ":", "array", "{", "preg_match", "(", "$", "this", "->", "pattern", "->", "getPattern", "(", ")", ".", "$", ...
Retrieve match from subject with Pattern @param string $subject @param int $flags @param int $offset @return array @throws BacktrackLimitException @throws BadUtf8Exception @throws BadUtf8OffsetException @throws InternalException @throws JitStackLimitException @throws RecursionLimitException
[ "Retrieve", "match", "from", "subject", "with", "Pattern" ]
798c1124805b130b1110ee6e8dcc9a88d8aaffa8
https://github.com/madkom/regex/blob/798c1124805b130b1110ee6e8dcc9a88d8aaffa8/src/Matcher.php#L57-L80
21,546
heidelpay/PhpDoc
src/phpDocumentor/Command/Command.php
Command.setHelperSet
public function setHelperSet(HelperSet $helperSet) { parent::setHelperSet($helperSet); $this->getHelper('phpdocumentor_logger')->addOptions($this); }
php
public function setHelperSet(HelperSet $helperSet) { parent::setHelperSet($helperSet); $this->getHelper('phpdocumentor_logger')->addOptions($this); }
[ "public", "function", "setHelperSet", "(", "HelperSet", "$", "helperSet", ")", "{", "parent", "::", "setHelperSet", "(", "$", "helperSet", ")", ";", "$", "this", "->", "getHelper", "(", "'phpdocumentor_logger'", ")", "->", "addOptions", "(", "$", "this", ")"...
Registers the current command. @param HelperSet $helperSet
[ "Registers", "the", "current", "command", "." ]
5ac9e842cbd4cbb70900533b240c131f3515ee02
https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Command/Command.php#L32-L37
21,547
creolab/resources
src/Collection.php
Collection.toArray
public function toArray() { $response = array(); foreach ($this->items as $key => $item) { $response[] = $item->toArray(); } return $response; }
php
public function toArray() { $response = array(); foreach ($this->items as $key => $item) { $response[] = $item->toArray(); } return $response; }
[ "public", "function", "toArray", "(", ")", "{", "$", "response", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "items", "as", "$", "key", "=>", "$", "item", ")", "{", "$", "response", "[", "]", "=", "$", "item", "->", "toArray",...
Return collection as array @return array
[ "Return", "collection", "as", "array" ]
6e1bdd266aa373f6dafd2408b230f7d2fa05a637
https://github.com/creolab/resources/blob/6e1bdd266aa373f6dafd2408b230f7d2fa05a637/src/Collection.php#L29-L39
21,548
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/expression.php
ezcQueryExpression.lOr
public function lOr() { $args = func_get_args(); if ( count( $args ) < 1 ) { throw new ezcQueryVariableParameterException( 'lOr', count( $args ), 1 ); } $elements = ezcQuerySelect::arrayFlatten( $args ); if ( count( $elements ) == 1 ) { ...
php
public function lOr() { $args = func_get_args(); if ( count( $args ) < 1 ) { throw new ezcQueryVariableParameterException( 'lOr', count( $args ), 1 ); } $elements = ezcQuerySelect::arrayFlatten( $args ); if ( count( $elements ) == 1 ) { ...
[ "public", "function", "lOr", "(", ")", "{", "$", "args", "=", "func_get_args", "(", ")", ";", "if", "(", "count", "(", "$", "args", ")", "<", "1", ")", "{", "throw", "new", "ezcQueryVariableParameterException", "(", "'lOr'", ",", "count", "(", "$", "...
Returns the SQL to bind logical expressions together using a logical or. lOr() accepts an arbitrary number of parameters. Each parameter must contain a logical expression or an array with logical expressions. Example: <code> $q = ezcDbInstance::get()->createSelectQuery(); $e = $q->expr; $q->select( '*' )->from( 'tabl...
[ "Returns", "the", "SQL", "to", "bind", "logical", "expressions", "together", "using", "a", "logical", "or", "." ]
b0afc661105f0a2f65d49abac13956cc93c5188d
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/expression.php#L222-L239
21,549
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/expression.php
ezcQueryExpression.eq
public function eq( $value1, $value2 ) { $value1 = $this->getIdentifier( $value1 ); $value2 = $this->getIdentifier( $value2 ); return "{$value1} = {$value2}"; }
php
public function eq( $value1, $value2 ) { $value1 = $this->getIdentifier( $value1 ); $value2 = $this->getIdentifier( $value2 ); return "{$value1} = {$value2}"; }
[ "public", "function", "eq", "(", "$", "value1", ",", "$", "value2", ")", "{", "$", "value1", "=", "$", "this", "->", "getIdentifier", "(", "$", "value1", ")", ";", "$", "value2", "=", "$", "this", "->", "getIdentifier", "(", "$", "value2", ")", ";"...
Returns the SQL to check if two values are equal. Example: <code> $q = ezcDbInstance::get()->createSelectQuery(); $q->select( '*' )->from( 'table' ) ->where( $q->expr->eq( 'id', $q->bindValue( 1 ) ) ); </code> @param string $value1 logical expression to compare @param string $value2 logical expression to compare with...
[ "Returns", "the", "SQL", "to", "check", "if", "two", "values", "are", "equal", "." ]
b0afc661105f0a2f65d49abac13956cc93c5188d
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/expression.php#L442-L447
21,550
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/expression.php
ezcQueryExpression.neq
public function neq( $value1, $value2 ) { $value1 = $this->getIdentifier( $value1 ); $value2 = $this->getIdentifier( $value2 ); return "{$value1} <> {$value2}"; }
php
public function neq( $value1, $value2 ) { $value1 = $this->getIdentifier( $value1 ); $value2 = $this->getIdentifier( $value2 ); return "{$value1} <> {$value2}"; }
[ "public", "function", "neq", "(", "$", "value1", ",", "$", "value2", ")", "{", "$", "value1", "=", "$", "this", "->", "getIdentifier", "(", "$", "value1", ")", ";", "$", "value2", "=", "$", "this", "->", "getIdentifier", "(", "$", "value2", ")", ";...
Returns the SQL to check if two values are unequal. Example: <code> $q = ezcDbInstance::get()->createSelectQuery(); $q->select( '*' )->from( 'table' ) ->where( $q->expr->neq( 'id', $q->bindValue( 1 ) ) ); </code> @param string $value1 logical expression to compare @param string $value2 logical expression to compare w...
[ "Returns", "the", "SQL", "to", "check", "if", "two", "values", "are", "unequal", "." ]
b0afc661105f0a2f65d49abac13956cc93c5188d
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/expression.php#L463-L468
21,551
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/expression.php
ezcQueryExpression.gt
public function gt( $value1, $value2 ) { $value1 = $this->getIdentifier( $value1 ); $value2 = $this->getIdentifier( $value2 ); return "{$value1} > {$value2}"; }
php
public function gt( $value1, $value2 ) { $value1 = $this->getIdentifier( $value1 ); $value2 = $this->getIdentifier( $value2 ); return "{$value1} > {$value2}"; }
[ "public", "function", "gt", "(", "$", "value1", ",", "$", "value2", ")", "{", "$", "value1", "=", "$", "this", "->", "getIdentifier", "(", "$", "value1", ")", ";", "$", "value2", "=", "$", "this", "->", "getIdentifier", "(", "$", "value2", ")", ";"...
Returns the SQL to check if one value is greater than another value. Example: <code> $q = ezcDbInstance::get()->createSelectQuery(); $q->select( '*' )->from( 'table' ) ->where( $q->expr->gt( 'id', $q->bindValue( 1 ) ) ); </code> @param string $value1 logical expression to compare @param string $value2 logical express...
[ "Returns", "the", "SQL", "to", "check", "if", "one", "value", "is", "greater", "than", "another", "value", "." ]
b0afc661105f0a2f65d49abac13956cc93c5188d
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/expression.php#L484-L489
21,552
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/expression.php
ezcQueryExpression.gte
public function gte( $value1, $value2 ) { $value1 = $this->getIdentifier( $value1 ); $value2 = $this->getIdentifier( $value2 ); return "{$value1} >= {$value2}"; }
php
public function gte( $value1, $value2 ) { $value1 = $this->getIdentifier( $value1 ); $value2 = $this->getIdentifier( $value2 ); return "{$value1} >= {$value2}"; }
[ "public", "function", "gte", "(", "$", "value1", ",", "$", "value2", ")", "{", "$", "value1", "=", "$", "this", "->", "getIdentifier", "(", "$", "value1", ")", ";", "$", "value2", "=", "$", "this", "->", "getIdentifier", "(", "$", "value2", ")", ";...
Returns the SQL to check if one value is greater than or equal to another value. Example: <code> $q = ezcDbInstance::get()->createSelectQuery(); $q->select( '*' )->from( 'table' ) ->where( $q->expr->gte( 'id', $q->bindValue( 1 ) ) ); </code> @param string $value1 logical expression to compare @param string $value2 lo...
[ "Returns", "the", "SQL", "to", "check", "if", "one", "value", "is", "greater", "than", "or", "equal", "to", "another", "value", "." ]
b0afc661105f0a2f65d49abac13956cc93c5188d
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/expression.php#L506-L511
21,553
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/expression.php
ezcQueryExpression.lt
public function lt( $value1, $value2 ) { $value1 = $this->getIdentifier( $value1 ); $value2 = $this->getIdentifier( $value2 ); return "{$value1} < {$value2}"; }
php
public function lt( $value1, $value2 ) { $value1 = $this->getIdentifier( $value1 ); $value2 = $this->getIdentifier( $value2 ); return "{$value1} < {$value2}"; }
[ "public", "function", "lt", "(", "$", "value1", ",", "$", "value2", ")", "{", "$", "value1", "=", "$", "this", "->", "getIdentifier", "(", "$", "value1", ")", ";", "$", "value2", "=", "$", "this", "->", "getIdentifier", "(", "$", "value2", ")", ";"...
Returns the SQL to check if one value is less than another value. Example: <code> $q = ezcDbInstance::get()->createSelectQuery(); $q->select( '*' )->from( 'table' ) ->where( $q->expr->lt( 'id', $q->bindValue( 1 ) ) ); </code> @param string $value1 logical expression to compare @param string $value2 logical expression...
[ "Returns", "the", "SQL", "to", "check", "if", "one", "value", "is", "less", "than", "another", "value", "." ]
b0afc661105f0a2f65d49abac13956cc93c5188d
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/expression.php#L527-L532
21,554
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/expression.php
ezcQueryExpression.lte
public function lte( $value1, $value2 ) { $value1 = $this->getIdentifier( $value1 ); $value2 = $this->getIdentifier( $value2 ); return "{$value1} <= {$value2}"; }
php
public function lte( $value1, $value2 ) { $value1 = $this->getIdentifier( $value1 ); $value2 = $this->getIdentifier( $value2 ); return "{$value1} <= {$value2}"; }
[ "public", "function", "lte", "(", "$", "value1", ",", "$", "value2", ")", "{", "$", "value1", "=", "$", "this", "->", "getIdentifier", "(", "$", "value1", ")", ";", "$", "value2", "=", "$", "this", "->", "getIdentifier", "(", "$", "value2", ")", ";...
Returns the SQL to check if one value is less than or equal to another value. Example: <code> $q = ezcDbInstance::get()->createSelectQuery(); $q->select( '*' )->from( 'table' ) ->where( $q->expr->lte( 'id', $q->bindValue( 1 ) ) ); </code> @param string $value1 logical expression to compare @param string $value2 logic...
[ "Returns", "the", "SQL", "to", "check", "if", "one", "value", "is", "less", "than", "or", "equal", "to", "another", "value", "." ]
b0afc661105f0a2f65d49abac13956cc93c5188d
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/expression.php#L549-L554
21,555
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/expression.php
ezcQueryExpression.between
public function between( $expression, $value1, $value2 ) { $expression = $this->getIdentifier( $expression ); $value1 = $this->getIdentifier( $value1 ); $value2 = $this->getIdentifier( $value2 ); return "{$expression} BETWEEN {$value1} AND {$value2}"; }
php
public function between( $expression, $value1, $value2 ) { $expression = $this->getIdentifier( $expression ); $value1 = $this->getIdentifier( $value1 ); $value2 = $this->getIdentifier( $value2 ); return "{$expression} BETWEEN {$value1} AND {$value2}"; }
[ "public", "function", "between", "(", "$", "expression", ",", "$", "value1", ",", "$", "value2", ")", "{", "$", "expression", "=", "$", "this", "->", "getIdentifier", "(", "$", "expression", ")", ";", "$", "value1", "=", "$", "this", "->", "getIdentifi...
Returns SQL that checks if an expression evaluates to a value between two values. The parameter $expression is checked if it is between $value1 and $value2. Note: There is a slight difference in the way BETWEEN works on some databases. http://www.w3schools.com/sql/sql_between.asp. If you want complete database indepe...
[ "Returns", "SQL", "that", "checks", "if", "an", "expression", "evaluates", "to", "a", "value", "between", "two", "values", "." ]
b0afc661105f0a2f65d49abac13956cc93c5188d
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/expression.php#L678-L684
21,556
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/expression.php
ezcQueryExpression.bitAnd
public function bitAnd( $value1, $value2 ) { $value1 = $this->getIdentifier( $value1 ); $value2 = $this->getIdentifier( $value2 ); return "( {$value1} & {$value2} )"; }
php
public function bitAnd( $value1, $value2 ) { $value1 = $this->getIdentifier( $value1 ); $value2 = $this->getIdentifier( $value2 ); return "( {$value1} & {$value2} )"; }
[ "public", "function", "bitAnd", "(", "$", "value1", ",", "$", "value2", ")", "{", "$", "value1", "=", "$", "this", "->", "getIdentifier", "(", "$", "value1", ")", ";", "$", "value2", "=", "$", "this", "->", "getIdentifier", "(", "$", "value2", ")", ...
Returns the SQL that performs the bitwise AND on two values. @param string $value1 @param string $value2 @return string
[ "Returns", "the", "SQL", "that", "performs", "the", "bitwise", "AND", "on", "two", "values", "." ]
b0afc661105f0a2f65d49abac13956cc93c5188d
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/expression.php#L948-L953
21,557
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/expression.php
ezcQueryExpression.bitOr
public function bitOr( $value1, $value2 ) { $value1 = $this->getIdentifier( $value1 ); $value2 = $this->getIdentifier( $value2 ); return "( {$value1} | {$value2} )"; }
php
public function bitOr( $value1, $value2 ) { $value1 = $this->getIdentifier( $value1 ); $value2 = $this->getIdentifier( $value2 ); return "( {$value1} | {$value2} )"; }
[ "public", "function", "bitOr", "(", "$", "value1", ",", "$", "value2", ")", "{", "$", "value1", "=", "$", "this", "->", "getIdentifier", "(", "$", "value1", ")", ";", "$", "value2", "=", "$", "this", "->", "getIdentifier", "(", "$", "value2", ")", ...
Returns the SQL that performs the bitwise OR on two values. @param string $value1 @param string $value2 @return string
[ "Returns", "the", "SQL", "that", "performs", "the", "bitwise", "OR", "on", "two", "values", "." ]
b0afc661105f0a2f65d49abac13956cc93c5188d
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/expression.php#L962-L967
21,558
SergioMadness/query-builder
src/adapters/SQL/ConditionBuilder.php
ConditionBuilder.prepareArray
protected function prepareArray(array $conditions) { switch (count($conditions)) { case 1: $result = $conditions[0]; break; case 2: if (is_array($conditions[1])) { $result = $conditions[0].' IN ('.implode(',', $condi...
php
protected function prepareArray(array $conditions) { switch (count($conditions)) { case 1: $result = $conditions[0]; break; case 2: if (is_array($conditions[1])) { $result = $conditions[0].' IN ('.implode(',', $condi...
[ "protected", "function", "prepareArray", "(", "array", "$", "conditions", ")", "{", "switch", "(", "count", "(", "$", "conditions", ")", ")", "{", "case", "1", ":", "$", "result", "=", "$", "conditions", "[", "0", "]", ";", "break", ";", "case", "2",...
Array to string @param array $conditions @return string @throws \Exception
[ "Array", "to", "string" ]
95b7a46bba4c4d369101c6f0d37f133fecb3956d
https://github.com/SergioMadness/query-builder/blob/95b7a46bba4c4d369101c6f0d37f133fecb3956d/src/adapters/SQL/ConditionBuilder.php#L17-L49
21,559
SporkCode/Spork
src/Mvc/Listener/EmailVerificationStrategy.php
EmailVerificationStrategy.checkEmailVerification
public function checkEmailVerification(MvcEvent $event) { $services = $event->getApplication()->getServiceManager(); $appConfig = $services->get('config'); $config = $this->defaultConfig; if (array_key_exists(self::CONFIG_KEY, $appConfig)) { $config = $appConfig[...
php
public function checkEmailVerification(MvcEvent $event) { $services = $event->getApplication()->getServiceManager(); $appConfig = $services->get('config'); $config = $this->defaultConfig; if (array_key_exists(self::CONFIG_KEY, $appConfig)) { $config = $appConfig[...
[ "public", "function", "checkEmailVerification", "(", "MvcEvent", "$", "event", ")", "{", "$", "services", "=", "$", "event", "->", "getApplication", "(", ")", "->", "getServiceManager", "(", ")", ";", "$", "appConfig", "=", "$", "services", "->", "get", "(...
Check if the email address is verified and if not redirects to a specified route. @param MvcEvent $event
[ "Check", "if", "the", "email", "address", "is", "verified", "and", "if", "not", "redirects", "to", "a", "specified", "route", "." ]
7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a
https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/Mvc/Listener/EmailVerificationStrategy.php#L60-L98
21,560
ekuiter/feature-php
FeaturePhp/Specification/DirectorySpecification.php
DirectorySpecification.fromArrayAndSettings
public static function fromArrayAndSettings($cfg, $settings) { $directorySpecification = new self($cfg, $settings->getDirectory()); $directorySpecification->set("source", $settings->getPath($directorySpecification->getSource())); $directorySpecification->set("baseTarget", $settings->getOptional(...
php
public static function fromArrayAndSettings($cfg, $settings) { $directorySpecification = new self($cfg, $settings->getDirectory()); $directorySpecification->set("source", $settings->getPath($directorySpecification->getSource())); $directorySpecification->set("baseTarget", $settings->getOptional(...
[ "public", "static", "function", "fromArrayAndSettings", "(", "$", "cfg", ",", "$", "settings", ")", "{", "$", "directorySpecification", "=", "new", "self", "(", "$", "cfg", ",", "$", "settings", "->", "getDirectory", "(", ")", ")", ";", "$", "directorySpec...
Creates a directory specification from a plain settings array. The settings context is taken into consideration to generate paths relative to the settings. @param array $cfg a plain settings array @param \FeaturePhp\Settings $settings the settings context @return DirectorySpecification
[ "Creates", "a", "directory", "specification", "from", "a", "plain", "settings", "array", ".", "The", "settings", "context", "is", "taken", "into", "consideration", "to", "generate", "paths", "relative", "to", "the", "settings", "." ]
daf4a59098802fedcfd1f1a1d07847fcf2fea7bf
https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Specification/DirectorySpecification.php#L48-L57
21,561
ekuiter/feature-php
FeaturePhp/Specification/DirectorySpecification.php
DirectorySpecification.getFileSpecifications
public function getFileSpecifications() { $fileSpecifications = array(); foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->getSource())) as $entry) if (!fphp\Helper\Path::isDot($entry)) { $fileSource = $entry->getPathName(); ...
php
public function getFileSpecifications() { $fileSpecifications = array(); foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->getSource())) as $entry) if (!fphp\Helper\Path::isDot($entry)) { $fileSource = $entry->getPathName(); ...
[ "public", "function", "getFileSpecifications", "(", ")", "{", "$", "fileSpecifications", "=", "array", "(", ")", ";", "foreach", "(", "new", "\\", "RecursiveIteratorIterator", "(", "new", "\\", "RecursiveDirectoryIterator", "(", "$", "this", "->", "getSource", "...
Returns the file specifications this directory specification applies to. The entire source directory tree is considered, except for excluded files. @return FileSpecification[]
[ "Returns", "the", "file", "specifications", "this", "directory", "specification", "applies", "to", ".", "The", "entire", "source", "directory", "tree", "is", "considered", "except", "for", "excluded", "files", "." ]
daf4a59098802fedcfd1f1a1d07847fcf2fea7bf
https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Specification/DirectorySpecification.php#L73-L102
21,562
bit3archive/php-remote-objects
src/RemoteObjects/Client.php
Client.getRemoteObject
public function getRemoteObject($key, $interface = null) { if ($interface) { if ( $this->logger !== null && $this->logger->isHandling(\Monolog\Logger::DEBUG) ) { $this->logger->addDebug( 'Create new virtual remote object proxy', array( 'interface' => $interface, 'path' ...
php
public function getRemoteObject($key, $interface = null) { if ($interface) { if ( $this->logger !== null && $this->logger->isHandling(\Monolog\Logger::DEBUG) ) { $this->logger->addDebug( 'Create new virtual remote object proxy', array( 'interface' => $interface, 'path' ...
[ "public", "function", "getRemoteObject", "(", "$", "key", ",", "$", "interface", "=", "null", ")", "{", "if", "(", "$", "interface", ")", "{", "if", "(", "$", "this", "->", "logger", "!==", "null", "&&", "$", "this", "->", "logger", "->", "isHandling...
Get a named remote object proxy. @param string $key @param string|null $interface @return RemoteObject
[ "Get", "a", "named", "remote", "object", "proxy", "." ]
0a917cdb261d83b1e89bdbdce3627584823bff5f
https://github.com/bit3archive/php-remote-objects/blob/0a917cdb261d83b1e89bdbdce3627584823bff5f/src/RemoteObjects/Client.php#L128-L161
21,563
neat-php/database
classes/Query.php
Query.join
public function join($table, $alias = null, $on = null, $type = 'INNER JOIN') { $table = $this->connection->quoteIdentifier($table); $this->joins[$alias] = "$type $table $alias ON $on"; return $this; }
php
public function join($table, $alias = null, $on = null, $type = 'INNER JOIN') { $table = $this->connection->quoteIdentifier($table); $this->joins[$alias] = "$type $table $alias ON $on"; return $this; }
[ "public", "function", "join", "(", "$", "table", ",", "$", "alias", "=", "null", ",", "$", "on", "=", "null", ",", "$", "type", "=", "'INNER JOIN'", ")", "{", "$", "table", "=", "$", "this", "->", "connection", "->", "quoteIdentifier", "(", "$", "t...
Join a table @param string $table @param string $alias @param string $on @param string $type @return $this
[ "Join", "a", "table" ]
7b4b66c8f1bc63e50925f12712b9eedcfb2a98ff
https://github.com/neat-php/database/blob/7b4b66c8f1bc63e50925f12712b9eedcfb2a98ff/classes/Query.php#L235-L242
21,564
neat-php/database
classes/Query.php
Query.leftJoin
public function leftJoin($table, $alias = null, $on = null) { return $this->join($table, $alias, $on, 'LEFT JOIN'); }
php
public function leftJoin($table, $alias = null, $on = null) { return $this->join($table, $alias, $on, 'LEFT JOIN'); }
[ "public", "function", "leftJoin", "(", "$", "table", ",", "$", "alias", "=", "null", ",", "$", "on", "=", "null", ")", "{", "return", "$", "this", "->", "join", "(", "$", "table", ",", "$", "alias", ",", "$", "on", ",", "'LEFT JOIN'", ")", ";", ...
LEFT OUTER Join a table @param string $table @param string $alias @param string $on @return $this
[ "LEFT", "OUTER", "Join", "a", "table" ]
7b4b66c8f1bc63e50925f12712b9eedcfb2a98ff
https://github.com/neat-php/database/blob/7b4b66c8f1bc63e50925f12712b9eedcfb2a98ff/classes/Query.php#L252-L255
21,565
neat-php/database
classes/Query.php
Query.rightJoin
public function rightJoin($table, $alias = null, $on = null) { return $this->join($table, $alias, $on, 'RIGHT JOIN'); }
php
public function rightJoin($table, $alias = null, $on = null) { return $this->join($table, $alias, $on, 'RIGHT JOIN'); }
[ "public", "function", "rightJoin", "(", "$", "table", ",", "$", "alias", "=", "null", ",", "$", "on", "=", "null", ")", "{", "return", "$", "this", "->", "join", "(", "$", "table", ",", "$", "alias", ",", "$", "on", ",", "'RIGHT JOIN'", ")", ";",...
RIGHT OUTER Join a table @param string $table @param string $alias @param string $on @return $this
[ "RIGHT", "OUTER", "Join", "a", "table" ]
7b4b66c8f1bc63e50925f12712b9eedcfb2a98ff
https://github.com/neat-php/database/blob/7b4b66c8f1bc63e50925f12712b9eedcfb2a98ff/classes/Query.php#L265-L268
21,566
neat-php/database
classes/Query.php
Query.innerJoin
public function innerJoin($table, $alias = null, $on = null) { return $this->join($table, $alias, $on, 'INNER JOIN'); }
php
public function innerJoin($table, $alias = null, $on = null) { return $this->join($table, $alias, $on, 'INNER JOIN'); }
[ "public", "function", "innerJoin", "(", "$", "table", ",", "$", "alias", "=", "null", ",", "$", "on", "=", "null", ")", "{", "return", "$", "this", "->", "join", "(", "$", "table", ",", "$", "alias", ",", "$", "on", ",", "'INNER JOIN'", ")", ";",...
INNER Join a table @param string $table @param string $alias @param string $on @return $this
[ "INNER", "Join", "a", "table" ]
7b4b66c8f1bc63e50925f12712b9eedcfb2a98ff
https://github.com/neat-php/database/blob/7b4b66c8f1bc63e50925f12712b9eedcfb2a98ff/classes/Query.php#L278-L281
21,567
neat-php/database
classes/Query.php
Query.getLimit
public function getLimit() { if ($this->offset && $this->limit) { return $this->offset . ',' . $this->limit; } return (string)$this->limit; }
php
public function getLimit() { if ($this->offset && $this->limit) { return $this->offset . ',' . $this->limit; } return (string)$this->limit; }
[ "public", "function", "getLimit", "(", ")", "{", "if", "(", "$", "this", "->", "offset", "&&", "$", "this", "->", "limit", ")", "{", "return", "$", "this", "->", "offset", ".", "','", ".", "$", "this", "->", "limit", ";", "}", "return", "(", "str...
Get limit query part @return string
[ "Get", "limit", "query", "part" ]
7b4b66c8f1bc63e50925f12712b9eedcfb2a98ff
https://github.com/neat-php/database/blob/7b4b66c8f1bc63e50925f12712b9eedcfb2a98ff/classes/Query.php#L521-L528
21,568
neat-php/database
classes/Query.php
Query.getSelectQuery
public function getSelectQuery() { $sql = 'SELECT ' . $this->getSelect(); $sql .= "\nFROM " . $this->getFrom(); if ($this->where) { $sql .= "\nWHERE " . $this->getWhere(); } if ($this->groupBy) { $sql .= "\nGROUP BY " . $this->getGroupBy(); } ...
php
public function getSelectQuery() { $sql = 'SELECT ' . $this->getSelect(); $sql .= "\nFROM " . $this->getFrom(); if ($this->where) { $sql .= "\nWHERE " . $this->getWhere(); } if ($this->groupBy) { $sql .= "\nGROUP BY " . $this->getGroupBy(); } ...
[ "public", "function", "getSelectQuery", "(", ")", "{", "$", "sql", "=", "'SELECT '", ".", "$", "this", "->", "getSelect", "(", ")", ";", "$", "sql", ".=", "\"\\nFROM \"", ".", "$", "this", "->", "getFrom", "(", ")", ";", "if", "(", "$", "this", "->...
Get SQL select query @return string
[ "Get", "SQL", "select", "query" ]
7b4b66c8f1bc63e50925f12712b9eedcfb2a98ff
https://github.com/neat-php/database/blob/7b4b66c8f1bc63e50925f12712b9eedcfb2a98ff/classes/Query.php#L535-L556
21,569
neat-php/database
classes/Query.php
Query.getInsertQuery
public function getInsertQuery() { $sql = 'INSERT INTO ' . $this->getTable(); $sql .= "\n" . $this->getColumns(); $sql .= "\nVALUES " . $this->getValues(); return $sql; }
php
public function getInsertQuery() { $sql = 'INSERT INTO ' . $this->getTable(); $sql .= "\n" . $this->getColumns(); $sql .= "\nVALUES " . $this->getValues(); return $sql; }
[ "public", "function", "getInsertQuery", "(", ")", "{", "$", "sql", "=", "'INSERT INTO '", ".", "$", "this", "->", "getTable", "(", ")", ";", "$", "sql", ".=", "\"\\n\"", ".", "$", "this", "->", "getColumns", "(", ")", ";", "$", "sql", ".=", "\"\\nVAL...
Get SQL insert query @return string
[ "Get", "SQL", "insert", "query" ]
7b4b66c8f1bc63e50925f12712b9eedcfb2a98ff
https://github.com/neat-php/database/blob/7b4b66c8f1bc63e50925f12712b9eedcfb2a98ff/classes/Query.php#L563-L570
21,570
neat-php/database
classes/Query.php
Query.getUpdateQuery
public function getUpdateQuery() { $sql = 'UPDATE ' . $this->getTable(); $sql .= "\nSET " . $this->getSet(); if ($this->where) { $sql .= "\nWHERE " . $this->getWhere(); } if ($this->orderBy) { $sql .= "\nORDER BY " . $this->getOrderBy(); } ...
php
public function getUpdateQuery() { $sql = 'UPDATE ' . $this->getTable(); $sql .= "\nSET " . $this->getSet(); if ($this->where) { $sql .= "\nWHERE " . $this->getWhere(); } if ($this->orderBy) { $sql .= "\nORDER BY " . $this->getOrderBy(); } ...
[ "public", "function", "getUpdateQuery", "(", ")", "{", "$", "sql", "=", "'UPDATE '", ".", "$", "this", "->", "getTable", "(", ")", ";", "$", "sql", ".=", "\"\\nSET \"", ".", "$", "this", "->", "getSet", "(", ")", ";", "if", "(", "$", "this", "->", ...
Get SQL update query @return string
[ "Get", "SQL", "update", "query" ]
7b4b66c8f1bc63e50925f12712b9eedcfb2a98ff
https://github.com/neat-php/database/blob/7b4b66c8f1bc63e50925f12712b9eedcfb2a98ff/classes/Query.php#L577-L592
21,571
neat-php/database
classes/Query.php
Query.getDeleteQuery
public function getDeleteQuery() { $sql = 'DELETE FROM ' . $this->getTable(); if ($this->where) { $sql .= "\nWHERE " . $this->getWhere(); } if ($this->limit) { $sql .= "\nLIMIT " . $this->getLimit(); } return $sql; }
php
public function getDeleteQuery() { $sql = 'DELETE FROM ' . $this->getTable(); if ($this->where) { $sql .= "\nWHERE " . $this->getWhere(); } if ($this->limit) { $sql .= "\nLIMIT " . $this->getLimit(); } return $sql; }
[ "public", "function", "getDeleteQuery", "(", ")", "{", "$", "sql", "=", "'DELETE FROM '", ".", "$", "this", "->", "getTable", "(", ")", ";", "if", "(", "$", "this", "->", "where", ")", "{", "$", "sql", ".=", "\"\\nWHERE \"", ".", "$", "this", "->", ...
Get SQL delete query @return string
[ "Get", "SQL", "delete", "query" ]
7b4b66c8f1bc63e50925f12712b9eedcfb2a98ff
https://github.com/neat-php/database/blob/7b4b66c8f1bc63e50925f12712b9eedcfb2a98ff/classes/Query.php#L599-L610
21,572
m4grio/bangkok-insurance-php
src/Client/BeansTrait.php
BeansTrait.mergeParams
public function mergeParams($method, Array $params = []) { $newParams = []; $preparedParams = $this->defaultParams; $preparedParams['bean'] = $params; $newParams[$method] = $preparedParams; return $newParams; }
php
public function mergeParams($method, Array $params = []) { $newParams = []; $preparedParams = $this->defaultParams; $preparedParams['bean'] = $params; $newParams[$method] = $preparedParams; return $newParams; }
[ "public", "function", "mergeParams", "(", "$", "method", ",", "Array", "$", "params", "=", "[", "]", ")", "{", "$", "newParams", "=", "[", "]", ";", "$", "preparedParams", "=", "$", "this", "->", "defaultParams", ";", "$", "preparedParams", "[", "'bean...
Group params in a bean @param $method @param array $params @return array
[ "Group", "params", "in", "a", "bean" ]
400266d043abe6b7cacb9da36064cbb169149c2a
https://github.com/m4grio/bangkok-insurance-php/blob/400266d043abe6b7cacb9da36064cbb169149c2a/src/Client/BeansTrait.php#L28-L37
21,573
i-lateral/silverstripe-modeladminplus
src/SearchContext.php
SearchContext.getSearchFields
public function getSearchFields() { $fields = parent::getSearchFields(); $class = $this->modelClass; $use_autocomplete = $this->getConvertToAutocomplete(); $db = Config::inst()->get($class, "db"); $has_one = Config::inst()->get($class, "has_one"); $has_many = Config:...
php
public function getSearchFields() { $fields = parent::getSearchFields(); $class = $this->modelClass; $use_autocomplete = $this->getConvertToAutocomplete(); $db = Config::inst()->get($class, "db"); $has_one = Config::inst()->get($class, "has_one"); $has_many = Config:...
[ "public", "function", "getSearchFields", "(", ")", "{", "$", "fields", "=", "parent", "::", "getSearchFields", "(", ")", ";", "$", "class", "=", "$", "this", "->", "modelClass", ";", "$", "use_autocomplete", "=", "$", "this", "->", "getConvertToAutocomplete"...
Extend default search fields and add extra functionality. @return \SilverStripe\Forms\FieldList
[ "Extend", "default", "search", "fields", "and", "add", "extra", "functionality", "." ]
c5209d9610cdb36ddc7b9231fad342df7e75ffc0
https://github.com/i-lateral/silverstripe-modeladminplus/blob/c5209d9610cdb36ddc7b9231fad342df7e75ffc0/src/SearchContext.php#L25-L87
21,574
nabab/bbn
src/bbn/file/ftp.php
ftp.scan
public function scan(string $dir, string $type = null, &$res = [], int $timeout = 0): array { $res = []; if ( $dirs = $this->listFiles($dir) ){ foreach ( $dirs as $d ){ if ( $type && (strpos($type, 'file') === 0) && !isset($d['num']) ){ $res[] = $d['name...
php
public function scan(string $dir, string $type = null, &$res = [], int $timeout = 0): array { $res = []; if ( $dirs = $this->listFiles($dir) ){ foreach ( $dirs as $d ){ if ( $type && (strpos($type, 'file') === 0) && !isset($d['num']) ){ $res[] = $d['name...
[ "public", "function", "scan", "(", "string", "$", "dir", ",", "string", "$", "type", "=", "null", ",", "&", "$", "res", "=", "[", "]", ",", "int", "$", "timeout", "=", "0", ")", ":", "array", "{", "$", "res", "=", "[", "]", ";", "if", "(", ...
Scans all the content from a directory, including the subdirectories <code> bbn\file\dir::scan("/home/me"); bbn\file\dir::delete("C:\Documents\Test"); </code> @param string $dir The directory path. @param string $type The type of item to return ('file', 'dir', default is both) @return array
[ "Scans", "all", "the", "content", "from", "a", "directory", "including", "the", "subdirectories" ]
439fea2faa0de22fdaae2611833bab8061f40c37
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/file/ftp.php#L164-L188
21,575
nabab/bbn
src/bbn/file/ftp.php
ftp.delete
public function delete($item){ self::log('delete:'.$item); if ( $this->checkFilePath($item) && ftp_delete($this->cn,$item) ){ return true; } return false; }
php
public function delete($item){ self::log('delete:'.$item); if ( $this->checkFilePath($item) && ftp_delete($this->cn,$item) ){ return true; } return false; }
[ "public", "function", "delete", "(", "$", "item", ")", "{", "self", "::", "log", "(", "'delete:'", ".", "$", "item", ")", ";", "if", "(", "$", "this", "->", "checkFilePath", "(", "$", "item", ")", "&&", "ftp_delete", "(", "$", "this", "->", "cn", ...
Deletes a file from the server @return boolean
[ "Deletes", "a", "file", "from", "the", "server" ]
439fea2faa0de22fdaae2611833bab8061f40c37
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/file/ftp.php#L323-L330
21,576
nabab/bbn
src/bbn/file/ftp.php
ftp.put
public function put($src, $dest){ if ( file_exists($src) && ($dest = $this->checkFilePath($dest)) && ftp_put($this->cn,$dest,$src,FTP_BINARY) ){ return true; } return false; }
php
public function put($src, $dest){ if ( file_exists($src) && ($dest = $this->checkFilePath($dest)) && ftp_put($this->cn,$dest,$src,FTP_BINARY) ){ return true; } return false; }
[ "public", "function", "put", "(", "$", "src", ",", "$", "dest", ")", "{", "if", "(", "file_exists", "(", "$", "src", ")", "&&", "(", "$", "dest", "=", "$", "this", "->", "checkFilePath", "(", "$", "dest", ")", ")", "&&", "ftp_put", "(", "$", "t...
Puts a file on the server @return boolean
[ "Puts", "a", "file", "on", "the", "server" ]
439fea2faa0de22fdaae2611833bab8061f40c37
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/file/ftp.php#L337-L344
21,577
nabab/bbn
src/bbn/file/ftp.php
ftp.get
public function get($src, $dest){ if ( $src = $this->checkFilePath($src) && ftp_get($this->cn, $dest, $src, FTP_BINARY) ){ return true; } return false; }
php
public function get($src, $dest){ if ( $src = $this->checkFilePath($src) && ftp_get($this->cn, $dest, $src, FTP_BINARY) ){ return true; } return false; }
[ "public", "function", "get", "(", "$", "src", ",", "$", "dest", ")", "{", "if", "(", "$", "src", "=", "$", "this", "->", "checkFilePath", "(", "$", "src", ")", "&&", "ftp_get", "(", "$", "this", "->", "cn", ",", "$", "dest", ",", "$", "src", ...
Gets a file from the server @return boolean
[ "Gets", "a", "file", "from", "the", "server" ]
439fea2faa0de22fdaae2611833bab8061f40c37
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/file/ftp.php#L351-L357
21,578
nabab/bbn
src/bbn/file/ftp.php
ftp.move
public function move(string $old, string $new){ if ( !empty($old) && !empty($new) && ($old = $this->checkFilePath($old)) && ftp_rename($this->cn, $old, $new) ){ return true; } return false; }
php
public function move(string $old, string $new){ if ( !empty($old) && !empty($new) && ($old = $this->checkFilePath($old)) && ftp_rename($this->cn, $old, $new) ){ return true; } return false; }
[ "public", "function", "move", "(", "string", "$", "old", ",", "string", "$", "new", ")", "{", "if", "(", "!", "empty", "(", "$", "old", ")", "&&", "!", "empty", "(", "$", "new", ")", "&&", "(", "$", "old", "=", "$", "this", "->", "checkFilePath...
Moves or renames a file on the server @param string $old The old file full path @param string $new The new file full path @return bool
[ "Moves", "or", "renames", "a", "file", "on", "the", "server" ]
439fea2faa0de22fdaae2611833bab8061f40c37
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/file/ftp.php#L373-L383
21,579
nabab/bbn
src/bbn/file/ftp.php
ftp.exists
public function exists(string $path){ if ( !empty($path) ){ $dir = dirname($path); $ext = \bbn\str::file_ext($path); $file = basename($path); if ( \is_array($files = $this->listFiles($dir)) ){ foreach ( $files as $f ){ if ( $f['basename'] === $file ){ return tru...
php
public function exists(string $path){ if ( !empty($path) ){ $dir = dirname($path); $ext = \bbn\str::file_ext($path); $file = basename($path); if ( \is_array($files = $this->listFiles($dir)) ){ foreach ( $files as $f ){ if ( $f['basename'] === $file ){ return tru...
[ "public", "function", "exists", "(", "string", "$", "path", ")", "{", "if", "(", "!", "empty", "(", "$", "path", ")", ")", "{", "$", "dir", "=", "dirname", "(", "$", "path", ")", ";", "$", "ext", "=", "\\", "bbn", "\\", "str", "::", "file_ext",...
Checks if a file is present in a folder on the server @param string $path The file or dir relative or full path @return bool
[ "Checks", "if", "a", "file", "is", "present", "in", "a", "folder", "on", "the", "server" ]
439fea2faa0de22fdaae2611833bab8061f40c37
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/file/ftp.php#L391-L405
21,580
j-d/draggy
src/Draggy/Utils/Indenter/AbstractLineIndenter.php
AbstractLineIndenter.findEndStandardBlock
protected function findEndStandardBlock($name, $lineNumber, $maxLine, $targetStepsInto = 0) { $stepsInto = 0; for ($i = $lineNumber; $i <= $maxLine; $i++) { if ($this->lineTypes['end' . $name][$i] && $i > $lineNumber) { $stepsInto--; if ($stepsInto === $...
php
protected function findEndStandardBlock($name, $lineNumber, $maxLine, $targetStepsInto = 0) { $stepsInto = 0; for ($i = $lineNumber; $i <= $maxLine; $i++) { if ($this->lineTypes['end' . $name][$i] && $i > $lineNumber) { $stepsInto--; if ($stepsInto === $...
[ "protected", "function", "findEndStandardBlock", "(", "$", "name", ",", "$", "lineNumber", ",", "$", "maxLine", ",", "$", "targetStepsInto", "=", "0", ")", "{", "$", "stepsInto", "=", "0", ";", "for", "(", "$", "i", "=", "$", "lineNumber", ";", "$", ...
Generic algorithm to find the end of a block @param string $name Name of the block @param int $lineNumber Starting line @param int $maxLine Max line @param int $targetStepsInto Targets steps into the source code, used as a stop criteria @return int @throws \RuntimeException
[ "Generic", "algorithm", "to", "find", "the", "end", "of", "a", "block" ]
97ffc66e1aacb5f685d7aac5251c4abb8888d4bb
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Utils/Indenter/AbstractLineIndenter.php#L72-L91
21,581
mothership-ec/composer
src/Composer/DependencyResolver/Rule.php
Rule.equals
public function equals(Rule $rule) { if ($this->ruleHash !== $rule->ruleHash) { return false; } if (count($this->literals) != count($rule->literals)) { return false; } for ($i = 0, $n = count($this->literals); $i < $n; $i++) { if ($this->...
php
public function equals(Rule $rule) { if ($this->ruleHash !== $rule->ruleHash) { return false; } if (count($this->literals) != count($rule->literals)) { return false; } for ($i = 0, $n = count($this->literals); $i < $n; $i++) { if ($this->...
[ "public", "function", "equals", "(", "Rule", "$", "rule", ")", "{", "if", "(", "$", "this", "->", "ruleHash", "!==", "$", "rule", "->", "ruleHash", ")", "{", "return", "false", ";", "}", "if", "(", "count", "(", "$", "this", "->", "literals", ")", ...
Checks if this rule is equal to another one Ignores whether either of the rules is disabled. @param Rule $rule The rule to check against @return bool Whether the rules are equal
[ "Checks", "if", "this", "rule", "is", "equal", "to", "another", "one" ]
fa6ad031a939d8d33b211e428fdbdd28cfce238c
https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/DependencyResolver/Rule.php#L115-L132
21,582
inhere/php-librarys
src/Helpers/FormatHelper.php
FormatHelper.convertBytes
public static function convertBytes($value) { if (is_numeric($value)) { return $value; } $value_length = \strlen($value); $qty = (int)substr($value, 0, $value_length - 1); $unit = Str::strtolower(substr($value, $value_length - 1)); switch ($unit) { ...
php
public static function convertBytes($value) { if (is_numeric($value)) { return $value; } $value_length = \strlen($value); $qty = (int)substr($value, 0, $value_length - 1); $unit = Str::strtolower(substr($value, $value_length - 1)); switch ($unit) { ...
[ "public", "static", "function", "convertBytes", "(", "$", "value", ")", "{", "if", "(", "is_numeric", "(", "$", "value", ")", ")", "{", "return", "$", "value", ";", "}", "$", "value_length", "=", "\\", "strlen", "(", "$", "value", ")", ";", "$", "q...
Convert a shorthand byte value from a PHP configuration directive to an integer value @param string $value value to convert @return int
[ "Convert", "a", "shorthand", "byte", "value", "from", "a", "PHP", "configuration", "directive", "to", "an", "integer", "value" ]
e6ca598685469794f310e3ab0e2bc19519cd0ae6
https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Helpers/FormatHelper.php#L142-L164
21,583
rattfieldnz/url-validation
src/RattfieldNz/UrlValidation/ExternalSources/Jmathai/PhpMultiCurl/EpiCurl.php
EpiCurl.addURL
public function addURL($url,$options=array()) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); foreach($options as $option=>$value) { curl_setopt($ch, $option, $value); } return $this->addCurl($ch); }
php
public function addURL($url,$options=array()) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); foreach($options as $option=>$value) { curl_setopt($ch, $option, $value); } return $this->addCurl($ch); }
[ "public", "function", "addURL", "(", "$", "url", ",", "$", "options", "=", "array", "(", ")", ")", "{", "$", "ch", "=", "curl_init", "(", "$", "url", ")", ";", "curl_setopt", "(", "$", "ch", ",", "CURLOPT_RETURNTRANSFER", ",", "1", ")", ";", "forea...
simplifies example and allows for additional curl options to be passed in via array
[ "simplifies", "example", "and", "allows", "for", "additional", "curl", "options", "to", "be", "passed", "in", "via", "array" ]
ff44a463a9119fa3bea9bd7fef3d44b7e6f9a44c
https://github.com/rattfieldnz/url-validation/blob/ff44a463a9119fa3bea9bd7fef3d44b7e6f9a44c/src/RattfieldNz/UrlValidation/ExternalSources/Jmathai/PhpMultiCurl/EpiCurl.php#L38-L45
21,584
Litecms/Team
src/Policies/TeamPolicy.php
TeamPolicy.update
public function update(UserPolicy $user, Team $team) { if ($user->canDo('team.team.edit') && $user->isAdmin()) { return true; } return $team->user_id == user_id() && $team->user_type == user_type(); }
php
public function update(UserPolicy $user, Team $team) { if ($user->canDo('team.team.edit') && $user->isAdmin()) { return true; } return $team->user_id == user_id() && $team->user_type == user_type(); }
[ "public", "function", "update", "(", "UserPolicy", "$", "user", ",", "Team", "$", "team", ")", "{", "if", "(", "$", "user", "->", "canDo", "(", "'team.team.edit'", ")", "&&", "$", "user", "->", "isAdmin", "(", ")", ")", "{", "return", "true", ";", ...
Determine if the given user can update the given team. @param UserPolicy $user @param Team $team @return bool
[ "Determine", "if", "the", "given", "user", "can", "update", "the", "given", "team", "." ]
a444a6a6604c969df138ac0eb57ed5f4696b0f00
https://github.com/Litecms/Team/blob/a444a6a6604c969df138ac0eb57ed5f4696b0f00/src/Policies/TeamPolicy.php#L49-L56
21,585
Litecms/Team
src/Policies/TeamPolicy.php
TeamPolicy.destroy
public function destroy(UserPolicy $user, Team $team) { return $team->user_id == user_id() && $team->user_type == user_type(); }
php
public function destroy(UserPolicy $user, Team $team) { return $team->user_id == user_id() && $team->user_type == user_type(); }
[ "public", "function", "destroy", "(", "UserPolicy", "$", "user", ",", "Team", "$", "team", ")", "{", "return", "$", "team", "->", "user_id", "==", "user_id", "(", ")", "&&", "$", "team", "->", "user_type", "==", "user_type", "(", ")", ";", "}" ]
Determine if the given user can delete the given team. @param UserPolicy $user @param Team $team @return bool
[ "Determine", "if", "the", "given", "user", "can", "delete", "the", "given", "team", "." ]
a444a6a6604c969df138ac0eb57ed5f4696b0f00
https://github.com/Litecms/Team/blob/a444a6a6604c969df138ac0eb57ed5f4696b0f00/src/Policies/TeamPolicy.php#L66-L69
21,586
surebert/surebert-framework
src/sb/Controller/HTML/HTML5.php
HTML5.includeJavascript
public function includeJavascript($scripts) { $src = (!is_array($scripts)) ? Array($scripts) : $scripts; $html = ''; foreach ($scripts as $s) { if (!strstr($s, '/')) { $s = '/js/' . $s; } $html .= "\n" . '<script type="text/javascript" src...
php
public function includeJavascript($scripts) { $src = (!is_array($scripts)) ? Array($scripts) : $scripts; $html = ''; foreach ($scripts as $s) { if (!strstr($s, '/')) { $s = '/js/' . $s; } $html .= "\n" . '<script type="text/javascript" src...
[ "public", "function", "includeJavascript", "(", "$", "scripts", ")", "{", "$", "src", "=", "(", "!", "is_array", "(", "$", "scripts", ")", ")", "?", "Array", "(", "$", "scripts", ")", ":", "$", "scripts", ";", "$", "html", "=", "''", ";", "foreach"...
Creates a javascript include tag @param $scripts array/string The file names or an array of file names to include
[ "Creates", "a", "javascript", "include", "tag" ]
f2f32eb693bd39385ceb93355efb5b2a429f27ce
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Controller/HTML/HTML5.php#L72-L85
21,587
surebert/surebert-framework
src/sb/Controller/HTML/HTML5.php
HTML5.htmlHead
public function htmlHead($custom_head_markup = '') { if (!empty($custom_head_markup)) { $this->custom_head_markup = $custom_head_markup; } $html = $this->doc_type . "\n"; $html .= $this->opening_html_tag . "\n"; $html .= '<head>' . "\n"; $html .= '<meta ...
php
public function htmlHead($custom_head_markup = '') { if (!empty($custom_head_markup)) { $this->custom_head_markup = $custom_head_markup; } $html = $this->doc_type . "\n"; $html .= $this->opening_html_tag . "\n"; $html .= '<head>' . "\n"; $html .= '<meta ...
[ "public", "function", "htmlHead", "(", "$", "custom_head_markup", "=", "''", ")", "{", "if", "(", "!", "empty", "(", "$", "custom_head_markup", ")", ")", "{", "$", "this", "->", "custom_head_markup", "=", "$", "custom_head_markup", ";", "}", "$", "html", ...
Renders the HTML head @param $custom_head_markup string A string of data to include in the HTML head, right before </head>
[ "Renders", "the", "HTML", "head" ]
f2f32eb693bd39385ceb93355efb5b2a429f27ce
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Controller/HTML/HTML5.php#L91-L128
21,588
loevgaard/altapay-php-sdk
src/Payload/Payload.php
Payload.simplePayload
public static function simplePayload(array $payload) : array { $payload = array_filter($payload, function ($val) { if ($val instanceof PayloadInterface) { $val = $val->getPayload(); } // this will effectively remove empty arrays if (is_array($...
php
public static function simplePayload(array $payload) : array { $payload = array_filter($payload, function ($val) { if ($val instanceof PayloadInterface) { $val = $val->getPayload(); } // this will effectively remove empty arrays if (is_array($...
[ "public", "static", "function", "simplePayload", "(", "array", "$", "payload", ")", ":", "array", "{", "$", "payload", "=", "array_filter", "(", "$", "payload", ",", "function", "(", "$", "val", ")", "{", "if", "(", "$", "val", "instanceof", "PayloadInte...
If the input array contains objects of PayloadInterface it will convert these to simple arrays Also it will remove values that are null, empty string or empty arrays @param array $payload @return array
[ "If", "the", "input", "array", "contains", "objects", "of", "PayloadInterface", "it", "will", "convert", "these", "to", "simple", "arrays", "Also", "it", "will", "remove", "values", "that", "are", "null", "empty", "string", "or", "empty", "arrays" ]
476664e8725407249c04ca7ae76f92882e4f4583
https://github.com/loevgaard/altapay-php-sdk/blob/476664e8725407249c04ca7ae76f92882e4f4583/src/Payload/Payload.php#L21-L53
21,589
InactiveProjects/limoncello-illuminate
app/Database/Migrations/Runner.php
Runner.rollback
public static function rollback() { foreach (array_reverse(self::$migrationClasses) as $migrationClass) { /** @var Migration $instance */ $instance = new $migrationClass; $instance->rollback(); } }
php
public static function rollback() { foreach (array_reverse(self::$migrationClasses) as $migrationClass) { /** @var Migration $instance */ $instance = new $migrationClass; $instance->rollback(); } }
[ "public", "static", "function", "rollback", "(", ")", "{", "foreach", "(", "array_reverse", "(", "self", "::", "$", "migrationClasses", ")", "as", "$", "migrationClass", ")", "{", "/** @var Migration $instance */", "$", "instance", "=", "new", "$", "migrationCla...
Rollback application migrations. @return void
[ "Rollback", "application", "migrations", "." ]
cae6fc26190efcf090495a5c3582c10fa2430897
https://github.com/InactiveProjects/limoncello-illuminate/blob/cae6fc26190efcf090495a5c3582c10fa2430897/app/Database/Migrations/Runner.php#L39-L46
21,590
skmetaly/laravel-twitch-restful-api
src/API/Search.php
Search.streamsChannel
public function streamsChannel($channel) { $response = $this->client->get(config('twitch-api.api_url') . '/kraken/streams/' . $channel); return $response->json(); }
php
public function streamsChannel($channel) { $response = $this->client->get(config('twitch-api.api_url') . '/kraken/streams/' . $channel); return $response->json(); }
[ "public", "function", "streamsChannel", "(", "$", "channel", ")", "{", "$", "response", "=", "$", "this", "->", "client", "->", "get", "(", "config", "(", "'twitch-api.api_url'", ")", ".", "'/kraken/streams/'", ".", "$", "channel", ")", ";", "return", "$",...
Returns a stream object if live. @param $channel @return json
[ "Returns", "a", "stream", "object", "if", "live", "." ]
70c83e441deb411ade2e343ad5cb0339c90dc6c2
https://github.com/skmetaly/laravel-twitch-restful-api/blob/70c83e441deb411ade2e343ad5cb0339c90dc6c2/src/API/Search.php#L109-L114
21,591
heidelpay/PhpDoc
src/phpDocumentor/Descriptor/MethodDescriptor.php
MethodDescriptor.getInheritedElement
public function getInheritedElement() { if ($this->inheritedElement !== null) { return $this->inheritedElement; } /** @var ClassDescriptor|InterfaceDescriptor|null $associatedClass */ $associatedClass = $this->getParent(); if (!$associatedClass instanceof ClassDe...
php
public function getInheritedElement() { if ($this->inheritedElement !== null) { return $this->inheritedElement; } /** @var ClassDescriptor|InterfaceDescriptor|null $associatedClass */ $associatedClass = $this->getParent(); if (!$associatedClass instanceof ClassDe...
[ "public", "function", "getInheritedElement", "(", ")", "{", "if", "(", "$", "this", "->", "inheritedElement", "!==", "null", ")", "{", "return", "$", "this", "->", "inheritedElement", ";", "}", "/** @var ClassDescriptor|InterfaceDescriptor|null $associatedClass */", "...
Returns the Method from which this method should inherit its information, if any. The inheritance scheme for a method is more complicated than for most elements; the following business rules apply: 1. if the parent class/interface extends another class or other interfaces (interfaces have multiple inheritance!) then:...
[ "Returns", "the", "Method", "from", "which", "this", "method", "should", "inherit", "its", "information", "if", "any", "." ]
5ac9e842cbd4cbb70900533b240c131f3515ee02
https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/MethodDescriptor.php#L239-L286
21,592
GrupaZero/api
src/Gzero/Api/Transformer/ContentTranslationTransformer.php
ContentTranslationTransformer.transform
public function transform($translation) { $translation = $this->entityToArray(ContentTranslation::class, $translation); return [ 'id' => (int) $translation['id'], 'langCode' => $translation['lang_code'], 'title' => $translation['title'],...
php
public function transform($translation) { $translation = $this->entityToArray(ContentTranslation::class, $translation); return [ 'id' => (int) $translation['id'], 'langCode' => $translation['lang_code'], 'title' => $translation['title'],...
[ "public", "function", "transform", "(", "$", "translation", ")", "{", "$", "translation", "=", "$", "this", "->", "entityToArray", "(", "ContentTranslation", "::", "class", ",", "$", "translation", ")", ";", "return", "[", "'id'", "=>", "(", "int", ")", ...
Transforms content translation entity @param ContentTranslation|array $translation ContentTranslation entity @return array
[ "Transforms", "content", "translation", "entity" ]
fc544bb6057274e9d5e7b617346c3f854ea5effd
https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Transformer/ContentTranslationTransformer.php#L26-L41
21,593
oroinc/OroLayoutComponent
LayoutBuilder.php
LayoutBuilder.processBlockViewData
protected function processBlockViewData( BlockView $blockView, ContextInterface $context, DataAccessor $data, $deferred, $encoding ) { if ($deferred) { $this->expressionProcessor->processExpressions($blockView->vars, $context, $data, true, $encoding); ...
php
protected function processBlockViewData( BlockView $blockView, ContextInterface $context, DataAccessor $data, $deferred, $encoding ) { if ($deferred) { $this->expressionProcessor->processExpressions($blockView->vars, $context, $data, true, $encoding); ...
[ "protected", "function", "processBlockViewData", "(", "BlockView", "$", "blockView", ",", "ContextInterface", "$", "context", ",", "DataAccessor", "$", "data", ",", "$", "deferred", ",", "$", "encoding", ")", "{", "if", "(", "$", "deferred", ")", "{", "$", ...
Processes expressions that work with data @param BlockView $blockView @param ContextInterface $context @param DataAccessor $data @param bool $deferred @param string $encoding
[ "Processes", "expressions", "that", "work", "with", "data" ]
682a96672393d81c63728e47c4a4c3618c515be0
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/LayoutBuilder.php#L282-L302
21,594
ekuiter/feature-php
FeaturePhp/Specification/FileSpecification.php
FileSpecification.fromArrayAndSettings
public static function fromArrayAndSettings($cfg, $settings, $artifact = null) { $fileSpecification = new static($cfg, $settings->getDirectory(), $artifact); $fileSpecification->set("relativeSource", $fileSpecification->getSource()); $fileSpecification->set("source", $settings->getPath($fileSpec...
php
public static function fromArrayAndSettings($cfg, $settings, $artifact = null) { $fileSpecification = new static($cfg, $settings->getDirectory(), $artifact); $fileSpecification->set("relativeSource", $fileSpecification->getSource()); $fileSpecification->set("source", $settings->getPath($fileSpec...
[ "public", "static", "function", "fromArrayAndSettings", "(", "$", "cfg", ",", "$", "settings", ",", "$", "artifact", "=", "null", ")", "{", "$", "fileSpecification", "=", "new", "static", "(", "$", "cfg", ",", "$", "settings", "->", "getDirectory", "(", ...
Creates a file specification from a plain settings array. The settings context is taken into consideration to generate paths relative to the settings. @param array $cfg a plain settings array @param \FeaturePhp\Settings $settings the settings context @param \FeaturePhp\Artifact\Artifact $artifact @return FileSpecificat...
[ "Creates", "a", "file", "specification", "from", "a", "plain", "settings", "array", ".", "The", "settings", "context", "is", "taken", "into", "consideration", "to", "generate", "paths", "relative", "to", "the", "settings", "." ]
daf4a59098802fedcfd1f1a1d07847fcf2fea7bf
https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Specification/FileSpecification.php#L56-L67
21,595
SporkCode/Spork
src/Mvc/Listener/Limit/Limit.php
Limit.setInterval
public function setInterval($interval) { $this->interval = $interval instanceof DateInterval ? $interval : new DateInterval($interval); return $this; }
php
public function setInterval($interval) { $this->interval = $interval instanceof DateInterval ? $interval : new DateInterval($interval); return $this; }
[ "public", "function", "setInterval", "(", "$", "interval", ")", "{", "$", "this", "->", "interval", "=", "$", "interval", "instanceof", "DateInterval", "?", "$", "interval", ":", "new", "DateInterval", "(", "$", "interval", ")", ";", "return", "$", "this",...
Set the limit interval @param string|DateInterval $interval @return \Spork\Mvc\Listener\Limit\Limit
[ "Set", "the", "limit", "interval" ]
7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a
https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/Mvc/Listener/Limit/Limit.php#L115-L119
21,596
SporkCode/Spork
src/Mvc/Controller/Plugin/Back.php
Back.redirect
public function redirect($default = 'home') { $redirect = $this->getController()->plugin('redirect'); $route = $this->getSession()->route; if (null === $route) { return $redirect->toRoute($default); } return $redirect->toRoute($route->getMatchedRouteName(), ...
php
public function redirect($default = 'home') { $redirect = $this->getController()->plugin('redirect'); $route = $this->getSession()->route; if (null === $route) { return $redirect->toRoute($default); } return $redirect->toRoute($route->getMatchedRouteName(), ...
[ "public", "function", "redirect", "(", "$", "default", "=", "'home'", ")", "{", "$", "redirect", "=", "$", "this", "->", "getController", "(", ")", "->", "plugin", "(", "'redirect'", ")", ";", "$", "route", "=", "$", "this", "->", "getSession", "(", ...
Redirect to last route @param string $default Default route to use if previous route not found
[ "Redirect", "to", "last", "route" ]
7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a
https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/Mvc/Controller/Plugin/Back.php#L116-L125
21,597
SporkCode/Spork
src/Mvc/Controller/Plugin/Back.php
Back.url
public function url($default = 'home') { $url = $this->getController()->plugin('url'); $route = $this->getSession()->route; if (null === $route) { return $url->fromRoute($default); } return $url->fromRoute($route->getMatchedRouteName(), $route->getPar...
php
public function url($default = 'home') { $url = $this->getController()->plugin('url'); $route = $this->getSession()->route; if (null === $route) { return $url->fromRoute($default); } return $url->fromRoute($route->getMatchedRouteName(), $route->getPar...
[ "public", "function", "url", "(", "$", "default", "=", "'home'", ")", "{", "$", "url", "=", "$", "this", "->", "getController", "(", ")", "->", "plugin", "(", "'url'", ")", ";", "$", "route", "=", "$", "this", "->", "getSession", "(", ")", "->", ...
Get last route URL @param string $default
[ "Get", "last", "route", "URL" ]
7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a
https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/Mvc/Controller/Plugin/Back.php#L132-L141
21,598
SporkCode/Spork
src/Mvc/Controller/Plugin/Back.php
Back.storeRoute
public function storeRoute(MvcEvent $event) { if ($this->ignore) { return; } $request = $event->getRequest(); if ($request->isXmlHttpRequest()) { return; } $appConfig = $event->getApplication() ->getServiceManager(...
php
public function storeRoute(MvcEvent $event) { if ($this->ignore) { return; } $request = $event->getRequest(); if ($request->isXmlHttpRequest()) { return; } $appConfig = $event->getApplication() ->getServiceManager(...
[ "public", "function", "storeRoute", "(", "MvcEvent", "$", "event", ")", "{", "if", "(", "$", "this", "->", "ignore", ")", "{", "return", ";", "}", "$", "request", "=", "$", "event", "->", "getRequest", "(", ")", ";", "if", "(", "$", "request", "->"...
Store route in session so it can be returned to later. @param MvcEvent $event
[ "Store", "route", "in", "session", "so", "it", "can", "be", "returned", "to", "later", "." ]
7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a
https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/Mvc/Controller/Plugin/Back.php#L162-L188
21,599
brightmarch/rest-easy
src/Brightmarch/RestEasy/Controller/Controller.php
Controller.resourceSupports
public function resourceSupports() { $this->supportedTypes = array_merge(func_get_args(), $this->supportedTypes); $this->canClientAcceptThisResponse(); return $this; }
php
public function resourceSupports() { $this->supportedTypes = array_merge(func_get_args(), $this->supportedTypes); $this->canClientAcceptThisResponse(); return $this; }
[ "public", "function", "resourceSupports", "(", ")", "{", "$", "this", "->", "supportedTypes", "=", "array_merge", "(", "func_get_args", "(", ")", ",", "$", "this", "->", "supportedTypes", ")", ";", "$", "this", "->", "canClientAcceptThisResponse", "(", ")", ...
Set a list of content types that this resource supports. @param [string, string, ...] @return Controller
[ "Set", "a", "list", "of", "content", "types", "that", "this", "resource", "supports", "." ]
a6903cdff0a5de2e4466d3e3438c59b9903049f4
https://github.com/brightmarch/rest-easy/blob/a6903cdff0a5de2e4466d3e3438c59b9903049f4/src/Brightmarch/RestEasy/Controller/Controller.php#L42-L48