_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
83
13k
language
stringclasses
1 value
meta_information
dict
q265300
Result.getSettingsAsArray
test
public function getSettingsAsArray($groups = null, $flag = null) { return $this->getFilteredAsArray($this->settings, $groups, $flag); }
php
{ "resource": "" }
q265301
Result.getCachableSettingsAsArray
test
public function getCachableSettingsAsArray($groups = null, $flag = null) { return $this->getFilteredAsArray($this->cachable_settings, $groups, $flag); }
php
{ "resource": "" }
q265302
Result.getFiltered
test
protected function getFiltered(array $all_settings = array(), $groups = null, $flag = null) { $settings = array(); foreach ($all_settings as $setting) { if ($setting->matchesGroup($groups) && $setting->matchesFlag($flag)) { $settings[] = $setting; } }...
php
{ "resource": "" }
q265303
Result.getFilteredAsArray
test
protected function getFilteredAsArray(array $all_settings, $groups = null, $flag = null) { $settings = array(); foreach ($all_settings as $setting) { if ($setting->matchesGroup($groups) && $setting->matchesFlag($flag)) { $settings[] = $setting->toArray(); } ...
php
{ "resource": "" }
q265304
HTMLTree.render
test
public function render() { // preload images $sHTML = "<script language=\"JavaScript\">\n". " minus = new Image();\n minus.src = \"".Openbizx::$app->getImageUrl()."/minus.gif\";\n". " plus = new Image();\n plus.src = \"".Openbizx::$app->getImageUrl()."/plus.gif\";\n"....
php
{ "resource": "" }
q265305
HTMLTree.renderNodeItems
test
protected function renderNodeItems(&$nodeItemArray) { $sHTML = ""; if (isset($nodeItemArray["ATTRIBUTES"])) { $sHTML .= $this->renderSingleNodeItem($nodeItemArray); } else { foreach ($nodeItemArray as $nodeItem) { $s...
php
{ "resource": "" }
q265306
HTMLTree.renderSingleNodeItem
test
protected function renderSingleNodeItem(&$nodeItem) { $url = $nodeItem["ATTRIBUTES"]["URL"]; $caption = $this->translate($nodeItem["ATTRIBUTES"]["CAPTION"]); $target = $nodeItem["ATTRIBUTES"]["TARGET"]; //$img = $nodeItem["ATTRIBUTES"]["IMAGE"]; if ($nodeItem["NODE"]) { ...
php
{ "resource": "" }
q265307
BundlesAutoloader.run
test
protected function run() { if (! $this->bootstrapped) { $this->autoloaderCollection = new JsonAutoloaderCollection($this->vendorDir, $this->searchFolders); $this->retrieveInstalledBundles(); $this->install(); $this->uninstall(); $this->arrangeBundl...
php
{ "resource": "" }
q265308
BundlesAutoloader.register
test
protected function register($environment) { if (isset($this->environmentsBundles[$environment])) { foreach ($this->environmentsBundles[$environment] as $bundle) { $bundleClass = $bundle->getClass(); if (empty($this->instantiatedBundles) || !in_array($bundleClass, ...
php
{ "resource": "" }
q265309
BundlesAutoloader.install
test
protected function install() { foreach ($this->autoloaderCollection as $dir => $jsonAutoloader) { $bundleName = $jsonAutoloader->getBundleName(); $this->installPackage($dir, $jsonAutoloader); unset($this->installedBundles[$bundleName]); } }
php
{ "resource": "" }
q265310
Command.initialize
test
protected function initialize(InputInterface $input, OutputInterface $output) { parent::initialize($input, $output); $this->input = $input; $this->output = $output; // prepend include_path if demanded $path = $input->getOption('include-path'); if (!empty($path)) { ...
php
{ "resource": "" }
q265311
Command.autoload
test
protected function autoload($class) { $class = str_replace('\\', DIRECTORY_SEPARATOR, $class); $autoload_dir = $this->getInput()->getOption('autoload-dir'); if (empty($autoload_dir)) { $autoload_dir = $this->getCurrentWorkingDirectory(); } $file_path = $autoload...
php
{ "resource": "" }
q265312
Helpers.load
test
public static function load($id): bool { $loaded = false; if (isset(static::$files[$id])) { $loaded = static::$files[$id] === true; if (! $loaded) { assert(file_exists(static::$files[$id])); include static::$files[$id]; $loade...
php
{ "resource": "" }
q265313
Controller.forward
test
public function forward($route, array $attributes = [], array $query = []) { return $this->getKernel()->forward($route, $attributes, $query); }
php
{ "resource": "" }
q265314
ActiveField.glyphIcon
test
public function glyphIcon($glyphIcon) { if (empty($this->parts['{input}'])) { throw new InternalErrorException('Firstly you must set field type!'); } if (empty($glyphIcon) || !$this->_glyphIconAllowed) { $this->parts['{glyphIcon}'] = ''; return $this; ...
php
{ "resource": "" }
q265315
BizDataObj_Abstract.setQueryParameters
test
public function setQueryParameters($paramValues) { foreach ($paramValues as $param => $value) $this->queryParams[$param] = $value; }
php
{ "resource": "" }
q265316
BizDataObj_Abstract.setLimit
test
public function setLimit($count, $offset = 0) { if ($count < 0) { $count = 0; } if ($offset < 0) { $offset = 0; } $this->queryLimit['count'] = $count; $this->queryLimit['offset'] = $offset; }
php
{ "resource": "" }
q265317
BizDataObj_Abstract.getDBConnection
test
public function getDBConnection($type = 'default') { switch (strtolower($type)) { case "default": case "read": if (isset($this->databaseAliasNameforRead)) { $dbName = $this->databaseAliasNameforRead; } else { $db...
php
{ "resource": "" }
q265318
BizDataObj_Abstract.getProperty
test
public function getProperty($propertyName) { $ret = parent::getProperty($propertyName); if ($ret) return $ret; if ($propertyName == "Table") return $this->table; if ($propertyName == "SearchRule") return $this->searchRule; // get control ob...
php
{ "resource": "" }
q265319
BizDataObj_Abstract.getRefObject
test
public function getRefObject($objName) { // see if there is such object in the ObjReferences $objRef = $this->objReferences->get($objName); if (!$objRef) return null; // apply association on the object // $assc = $this->EvaluateExpression($objRef->association); ...
php
{ "resource": "" }
q265320
BizDataObj_Abstract.setAssociation
test
protected function setAssociation($objRef, $asscObj) { $this->association["AsscObjName"] = $asscObj->objectName; $this->association["Relationship"] = $objRef->relationship; $this->association["Table"] = $objRef->table; $this->association["Column"] = $objRef->column; $this->as...
php
{ "resource": "" }
q265321
DefaultReader.fromDocblock
test
protected function fromDocblock($docblock, array $context=array()) { $annotations = $this->getParser()->parse($docblock); $col = $this->getCollection(); $rv = array(); foreach ($annotations as $annot) { list($name, $positional, $named) = $annot; if ($obj = $...
php
{ "resource": "" }
q265322
SqliteConnection.fromMemory
test
public static function fromMemory(string $prefix = ''): SqliteConnection { $pdo = new \PDO('sqlite::memory:'); $pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); $pdo->exec("PRAGMA foreign_keys = ON"); return new static($pdo, $prefix); }
php
{ "resource": "" }
q265323
SqliteConnection.fromFile
test
public static function fromFile(string $file, string $prefix = ''): SqliteConnection { $pdo = new \PDO('sqlite:' . $file); $pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); $pdo->exec("PRAGMA foreign_keys = ON"); return new static($pdo, $prefix); ...
php
{ "resource": "" }
q265324
aModel.getField
test
protected function getField(string $f) : ?iField { $r = null; if ($this->hasField($f)) { $r = $this->fieldsCollection[strtolower($f)]; } return $r; }
php
{ "resource": "" }
q265325
aModel.hasField
test
public function hasField(string $f) : bool { return (isset($this->fieldsCollection[strtolower($f)]) === true); }
php
{ "resource": "" }
q265326
aModel.getFieldNames
test
public function getFieldNames() : array { $r = []; foreach ($this->fieldsCollection as $fieldName => $field) { $r[] = $field->getName(); } return $r; }
php
{ "resource": "" }
q265327
aModel.getInitialDataModel
test
public function getInitialDataModel() : array { $r = []; foreach ($this->fieldsCollection as $fieldName => $field) { $r[$field->getName()] = $field->getDefault(); } return $r; }
php
{ "resource": "" }
q265328
ChildCrudController.authorizeIndex
test
protected function authorizeIndex(Request $request) { $this->authorizeCrudRequest(Action::INDEX, null, $this->getParent($request)); }
php
{ "resource": "" }
q265329
ChildCrudController.authorizeCreate
test
protected function authorizeCreate(Request $request) { $this->authorizeCrudRequest(Action::CREATE, null, $this->getParent($request)); }
php
{ "resource": "" }
q265330
Nestis.getNestedItem
test
public function getNestedItem($pattern, $object, $default = null) { $parts = explode("/", $pattern); $lastObject = $object; $nr = 0; $totalParts = count($parts); $item = null; foreach ($parts as $part) { $item = null; $nr++; $found ...
php
{ "resource": "" }
q265331
UserAgent.init
test
public function init() { $device = ''; $style = ''; if (!isset($_SERVER['HTTP_USER_AGENT'])) { return; } if (stristr($_SERVER['HTTP_USER_AGENT'], 'ipad')) { $device = "ipad"; $style = "touch"; } else if (stristr($_SERVER['HTTP_USER_...
php
{ "resource": "" }
q265332
Config.getExportImplementor
test
public function getExportImplementor() { $export = new Parameters($this->config->get('export', array())); return $export->get(self::PARAM_CLASS, 'Environaut\Export\Export'); }
php
{ "resource": "" }
q265333
Config.getReportImplementor
test
public function getReportImplementor() { $report = new Parameters($this->config->get('report', array())); return $report->get(self::PARAM_CLASS, 'Environaut\Report\Report'); }
php
{ "resource": "" }
q265334
Config.getRunnerImplementor
test
public function getRunnerImplementor() { $runner = new Parameters($this->config->get('runner', array())); return $runner->get(self::PARAM_CLASS, 'Environaut\Runner\Runner'); }
php
{ "resource": "" }
q265335
Config.getCacheImplementor
test
public function getCacheImplementor() { $cache = new Parameters($this->config->get('cache', array())); return $cache->get(self::PARAM_CLASS, 'Environaut\Cache\Cache'); }
php
{ "resource": "" }
q265336
BizDataObj_SQLHelper.buildUpdateSQL
test
public function buildUpdateSQL($dataObj) { // generate column value pairs. ignore those whose inputValue=fieldValue $sqlFlds = $dataObj->bizRecord->getToSaveFields('UPDATE'); $colval_pairs = null; foreach ($sqlFlds as $field) { $col = $field->column; // ignor...
php
{ "resource": "" }
q265337
BizDataObj_SQLHelper.buildDeleteSQL
test
public function buildDeleteSQL($dataObj) { $sql = "DELETE FROM `" . $dataObj->mainTableName . "`"; $whereStr = $dataObj->bizRecord->getKeySearchRule(false, true); // use cur value and column name $sql .= " WHERE " . $whereStr; // append DataPerm in the WHERE clause if ($data...
php
{ "resource": "" }
q265338
EditCombobox.getStyle
test
protected function getStyle() { $htmlClass = $this->cssClass ? "class='" . $this->cssClass . "' " : "class='editcombobox'"; /* $width = $this->width ? $this->width : 146; $this->widthInput = ($width-18).'px'; $this->width = $width.'px'; $style = "position: abs...
php
{ "resource": "" }
q265339
DomElement.getChildNodes
test
public function getChildNodes() { $prefix = $this->ownerDocument->getDefaultNamespacePrefix(); if ($prefix) { return $this->ownerDocument->getXpath()->query(sprintf('child::%s:*', $prefix), $this); } else { return $this->ownerDocument->getXpath()->query('child::*', $...
php
{ "resource": "" }
q265340
DomElement.getAttributeValue
test
public function getAttributeValue($name, $default_value = null) { $value = parent::getAttribute($name); if ($value === '') { $value = $default_value; } return $value; }
php
{ "resource": "" }
q265341
DomElement.getAttributes
test
public function getAttributes() { $attributes = array(); foreach ($this->ownerDocument->getXpath()->query('@*', $this) as $attribute) { $attributes[$attribute->localName] = $attribute->nodeValue; } return $attributes; }
php
{ "resource": "" }
q265342
DomElement.getChild
test
public function getChild($name) { $query = 'self::node()[count(child::*[local-name() = "%1$s" and namespace-uri() = "%2$s"]) = 1]/*' . '[local-name() = "%1$s" and namespace-uri() = "%2$s"]'; $node = $this->ownerDocument->getXpath()->query( sprintf($query, $name, $this->o...
php
{ "resource": "" }
q265343
DomElement.getLiteralValue
test
protected function getLiteralValue($element) { $value = $element->getValue(); $trimmed_value = trim($value); $preserve_whitespace = $element->getAttributeValue('space', 'default') === 'preserve'; $literalize_value = self::literalize($element->getAttributeValue('literalize')) !== fal...
php
{ "resource": "" }
q265344
MenuComposer.cacheIfConfigured
test
private function cacheIfConfigured($closure) { if (config('menu.cache.enable')) { $key = config('menu.cache.key'); $minutes = config('menu.cache.minutes'); return Cache::remember($key, $minutes, function () use ($closure) { return call_user_func($closure)...
php
{ "resource": "" }
q265345
Middleware.handle
test
public function handle(array &$arguments, string $callType = Caller::TYPE_DEFAULT) { if ($this->isValid()) { $this->callType = $callType; $method = $this->getMethod(); $context = $this->getContext(); return $context->$method(...$arguments); } }
php
{ "resource": "" }
q265346
Middleware.isValid
test
public function isValid(string $method = null): bool { if ($method === null) { $method = $this->getMethod(); } return $this->isEnabled() && $this->methodIsCallable($method); }
php
{ "resource": "" }
q265347
Middleware.isGetter
test
protected function isGetter(): bool { $isExternalObject = is_object($this->context) && $this->context instanceof static === false; return $this->callType === Caller::TYPE_GETTER && $isExternalObject; }
php
{ "resource": "" }
q265348
Middleware.isSetter
test
protected function isSetter(): bool { $isExternalObject = is_object($this->context) && $this->context instanceof static === false; return $this->callType === Caller::TYPE_SETTER && $isExternalObject; }
php
{ "resource": "" }
q265349
BaseConnector.prepareCall
test
public function prepareCall( Client $client = null ) { // Set the default client: $this->curlClient = null; $client = null; $this->log( 'prepare ' . __CLASS__ . ' GuzzleRequest: base_uri(' . $this->getBaseUri() . '), client(' . ( (bool) is_null( $client ) ) . '), timeout(' . $...
php
{ "resource": "" }
q265350
BaseConnector.getResponse
test
public function getResponse( $type = self::RESPONSE_TYPE_JSON ) { // Check if response is set if ( $this->response === null ) { return null; } try { // Get the stream from the response getBody() method returns a stream instead of a string. $stream = $...
php
{ "resource": "" }
q265351
BaseConnector.getResponseJSON
test
private function getResponseJSON( $body ) { try { return json_decode( (string) $body, true ); } catch ( \Exception $e ) { throw new \RuntimeException( 'Invalid JSON ' . $e->getMessage(), 0, $body ); } }
php
{ "resource": "" }
q265352
SessionContext.saveObjVar
test
public function saveObjVar($objName, $varName, &$value, $stateful = false) { if (preg_match('/\./si', $objName)) { $objName = $this->getNamespace() . '#' . $objName; } if (!$stateful) { $this->_sessObjArr[$objName][$varName] = $value; } else { $thi...
php
{ "resource": "" }
q265353
SessionContext.loadObjVar
test
public function loadObjVar($objName, $varName, &$value, $stateful = false) { //Openbizx::$app->getLog()->log(LOG_ALERT, __METHOD__, ' | name : ' . $varName . ' | value : ' . $value); //Openbizx::$app->getClientProxy()->showClientAlert( __METHOD__ . ' | name : ' . $varName . ' | value : ' . $value); ...
php
{ "resource": "" }
q265354
SessionContext.saveSessionObjects
test
public function saveSessionObjects() { // loop all objects (bizview, bizform, bizdataobj) collect their session vars $allobjs = Openbizx::objectFactory()->getAllObjects(); foreach ($allobjs as $obj) { if (method_exists($obj, "saveStatefullVars")) { //after calling...
php
{ "resource": "" }
q265355
SessionContext.clearSessionObjects
test
public function clearSessionObjects($keepObjects = false) { if ($keepObjects == false) { unset($this->_sessObjArr); $this->_sessObjArr = array(); } else { // add previous view's session object names in to a map if (isset($this->_sessObjArr)) { fore...
php
{ "resource": "" }
q265356
SessionContext.saveJSONArray
test
public function saveJSONArray($jsonValue, $jsonName = NULL) { $jsonArray = json_decode($jsonValue); if ((bool) $jsonName) { //If I want save all array in session I send the name of the array in session $this->setVar($jsonName, $jsonArray); } else {//I save each value in session ...
php
{ "resource": "" }
q265357
SessionContext.setViewHistory
test
public function setViewHistory($formName, $historyInfo) { $view = Openbizx::$app->getCurrentViewName(); $view_form = $formName; //$view."_".$formname; if (!$historyInfo) { unset($this->_viewHistory[$view_form]); } else { $this->_viewHistory[$view_form] = $hist...
php
{ "resource": "" }
q265358
Timer.tic
test
public function tic($flag = self::RESET_COUNTER) { $this->start = microtime(true); if ($flag) { $this->count = 0; } }
php
{ "resource": "" }
q265359
Timer.toc
test
public function toc($message = '') { $this->stop = microtime(true); ++$this->count; $this->elapsed = ($this->stop - $this->start ) * 1e6 - $this->calib; print $this; if ($message) { print $message . "\n"; } }
php
{ "resource": "" }
q265360
Timer.tac
test
public function tac($flag = self::ADD_LAP) { $this->stop = microtime(true); if ($flag) { $this->elapsed = ($this->stop - $this->start) * 1e6 - $this->calib; } else { $this->elapsed += ($this->stop - $this->start) * 1e6 - $this->calib; }...
php
{ "resource": "" }
q265361
Timer.reset
test
public function reset() { $this->count = 0; $this->elapsed = 0; $this->start = 0; $this->stop = 0; return $this; }
php
{ "resource": "" }
q265362
ExecutableCheck.validExecutable
test
public function validExecutable($value) { $val = trim($value); if (empty($val)) { throw new \InvalidArgumentException( 'Not a valid executable path. Please specify a command (like "ls") or a path (like "/usr/bin/ls").' ); } $executable = trim...
php
{ "resource": "" }
q265363
FormHelper.getRedirectPage
test
public function getRedirectPage() { // get the control that issues the call // __this is elementName:eventHandlerName list($element, $eventHandler) = $this->getInvokingElement(); $eventHandlerName = $eventHandler->objectName; $redirectPage = $element->getRedirectPage($eventHa...
php
{ "resource": "" }
q265364
FormHelper.processDataException
test
public function processDataException($e) { $errorMsg = $e->getMessage(); Openbizx::$app->getLog()->log(LOG_ERR, "DATAOBJ", "DataObj error = ".$errorMsg); //Openbizx::$app->getClientProxy()->showClientAlert($errorMsg); //showErrorMessage($errorMsg); //Openbizx::$app->getClientProxy(...
php
{ "resource": "" }
q265365
DynaView.processURL
test
protected function processURL() { // if url has form=... $paramForm = isset($_GET['form']) ? $_GET['form'] : null; $paramCForm = isset($_GET['cform']) ? $_GET['cform'] : null; if (!$paramForm) return; // add the form in FormRefs if ($paramForm) {...
php
{ "resource": "" }
q265366
WebUtils.baseURI
test
public static function baseURI() { // Check if uri contains a query. $uri = $_SERVER['REQUEST_URI']; $qmIsHere = strpos($uri, '?'); $uri = ($qmIsHere === false) ? $uri : substr($uri, 0, $qmIsHere); // Get file name return pathinfo($uri)['filename']; ...
php
{ "resource": "" }
q265367
ObjectRepository.validateIdentity
test
protected function validateIdentity($identity) { $credentialProperty = $this->options->getCredentialProperty(); $getter = 'get' . ucfirst($credentialProperty); $documentCredential = null; if (method_exists($identity, $getter)) { $documentCredential = $identit...
php
{ "resource": "" }
q265368
ObjectRepository.setup
test
protected function setup() { if (null === $this->identity) { throw new Exception\RuntimeException( 'A value for the identity was not provided prior to authentication with ObjectRepository ' . 'authentication adapter' ); } if (null === ...
php
{ "resource": "" }
q265369
SetsAttributes.setVisibleAttribute
test
protected function setVisibleAttribute(string $name, $value) { $method = "set" . ucfirst($name); if (method_exists($this, $method)) { $value = $this->$method($value); } elseif (PublicReflection::hasAttribute(get_class($this), $name)) { $value = $this->setAttribute($n...
php
{ "resource": "" }
q265370
EloquentBuilder.firstHumpArray
test
public function firstHumpArray(...$parameters){ $res = $this->firstHump(...$parameters); if ($res instanceof EloquentModel){ $res = $res->toArray(); } return $res; }
php
{ "resource": "" }
q265371
OptionElement.getFromList
test
public function getFromList(&$list, $selectFrom = null) { if (!$selectFrom) { $selectFrom = $this->getSelectFrom(); } if (!$selectFrom) { return $this->getSQLFromList($list); } $this->getXMLFromList($list, $selectFrom); if ($list != null) ...
php
{ "resource": "" }
q265372
ConsoleMessageFormatter.format
test
public function format(IReport $report) { $output = ''; $format = $this->getParameters()->get('format', self::DEFAULT_FORMAT); $results = $report->getResults(); foreach ($results as $result) { $messages = $result->getMessages(); foreach ($messages as $message...
php
{ "resource": "" }
q265373
HasMiddleware.callMiddleware
test
protected function callMiddleware( $middleware, string $method = "", array &$arguments = [], string $type = Caller::TYPE_DEFAULT, $result = null ) { if (! $this->skipMiddleware) { $result = $this->middlewareCaller($middleware, $result) ->as...
php
{ "resource": "" }
q265374
HasMiddleware.callProxyGetters
test
protected function callProxyGetters(string $name, $result = null) { if ($this->getMiddlewareGroup(Caller::TYPE_GETTER)->isNotEmpty()) { $middleware = $this->getMiddlewareGroup(Caller::TYPE_GETTER); $arguments = [$name]; $result = $this->callMiddleware($middleware, "get", ...
php
{ "resource": "" }
q265375
HasMiddleware.callProxyMethods
test
protected function callProxyMethods(string $name, array &$arguments, $result = null) { if ($this->getMiddlewareGroup(Caller::TYPE_CALLER)->isNotEmpty()) { $middleware = $this->getMiddlewareGroup(Caller::TYPE_CALLER); $result = $this->callMiddleware($middleware, $name, $arguments, Cal...
php
{ "resource": "" }
q265376
HasMiddleware.callProxySetters
test
protected function callProxySetters(string $name, $value, $result = null) { $result = null; if ($this->getMiddlewareGroup(Caller::TYPE_SETTER)->isNotEmpty()) { $middleware = $this->getMiddlewareGroup(Caller::TYPE_SETTER); $arguments = [$name, $value]; $result = $t...
php
{ "resource": "" }
q265377
HasMiddleware.catchHaltedMiddleware
test
protected function catchHaltedMiddleware(bool $setting = null) { if ($setting === null) { return $this->catchHaltExceptions; } $this->catchHaltExceptions = $setting; return $this; }
php
{ "resource": "" }
q265378
HasMiddleware.clearMiddleware
test
protected function clearMiddleware(string $group = null) { if ($group === null) { $this->middleware = new Group; } else { unset($this->middleware[$group]); } return $this; }
php
{ "resource": "" }
q265379
HasMiddleware.disableMiddleware
test
protected function disableMiddleware(string $key = '', string $group = null) { $middleware = $this->getMiddleware($key, $group); if ($middleware instanceof Disableable) { $middleware->disable(); } return $this; }
php
{ "resource": "" }
q265380
HasMiddleware.enableMiddleware
test
protected function enableMiddleware(string $key = '', string $group = null) { $middleware = $this->getMiddleware($key, $group); if ($middleware instanceof Enableable) { $middleware->enable(); } return $this; }
php
{ "resource": "" }
q265381
HasMiddleware.getMiddleware
test
protected function getMiddleware(string $key = "", string $group = null, $default = null) { return $this->getMiddlewareGroup($group ?: $this->middlewareGroupId)->get($key, $default); }
php
{ "resource": "" }
q265382
HasMiddleware.getMiddlewareGroup
test
protected function getMiddlewareGroup(string $id = Group::DEFAULT_ID): MiddlewareCollection { if (! isset($this->middleware[$id]) || $this->middleware[$id] instanceof MiddlewareCollection === false) { $this->middleware[$id] = $this->middlewareCollection($id); } return $this->midd...
php
{ "resource": "" }
q265383
HasMiddleware.groupMiddleware
test
protected function groupMiddleware(string $name = null, Closure $closure = null) { if ($name === null) { return $this->middlewareGroupId; } else { $previousGroup = $this->middlewareGroupId; $this->middlewareGroupId = $name; if ($closure !== null) { ...
php
{ "resource": "" }
q265384
HasMiddleware.hasMiddleware
test
protected function hasMiddleware(string $key, string $group = null): bool { return $this->getMiddlewareGroup($group ?: $this->middlewareGroupId)->has($key); }
php
{ "resource": "" }
q265385
HasMiddleware.isMiddlewareDisabled
test
protected function isMiddlewareDisabled(string $key = '', string $group = null): bool { $middleware = $this->getMiddleware($key, $group); return $middleware instanceof Disableable ? $middleware->isDisabled() : false; }
php
{ "resource": "" }
q265386
HasMiddleware.isMiddlewareEnabled
test
protected function isMiddlewareEnabled(string $key = '', string $group = null): bool { $middleware = $this->getMiddleware($key, $group); return $middleware instanceof Enableable ? $middleware->isEnabled() : false; }
php
{ "resource": "" }
q265387
HasMiddleware.middleware
test
protected function middleware(string $key = null, string $group = Group::DEFAULT_ID) { $middleware = $this->middleMan->getGroup($group)->get($key); if ($middleware) { $this->result = $this->then($middleware); } return $this->resultUnlessChainable(); }
php
{ "resource": "" }
q265388
HasMiddleware.middlewareCollection
test
protected function middlewareCollection(string $id = Group::DEFAULT_ID, $middleware = []): MiddlewareCollection { if (function_exists('collect_middleware')) { return collect_middleware($middleware, $id); } else { return new Group($middleware, $id); } }
php
{ "resource": "" }
q265389
HasMiddleware.prependMiddleware
test
protected function prependMiddleware($middleware, string $key = "", string $group = null) { $middleware = $this->middlewareResolver()->resolveOrFail($middleware, $key); $this->getMiddlewareGroup($group ?: $this->middlewareGroupId)->prepend($middleware, $key); return $this; }
php
{ "resource": "" }
q265390
HasMiddleware.pushMiddleware
test
protected function pushMiddleware($middleware, string $key = "", string $group = null) { $middleware = $this->middlewareResolver()->resolveOrFail($middleware, $key); $this->getMiddlewareGroup($group ?: $this->middlewareGroupId)->put($key, $middleware); return $this; }
php
{ "resource": "" }
q265391
HasMiddleware.setMiddlewareContext
test
protected function setMiddlewareContext($context, MiddlewareCollection &$group = null) { if ($group === null) { $group = $this->middleware; } if ($group) { foreach ($group as &$value) { if ($value instanceof MiddlewareCollection) { ...
php
{ "resource": "" }
q265392
HasMiddleware.thenCallMiddleware
test
protected function thenCallMiddleware($middleware) { if (function_exists('call_middleware')) { $this->result = call_middleware($middleware, $this->result); } else { $this->result = (new Caller($middleware))->call($this->result); } return $this->resultUnlessCha...
php
{ "resource": "" }
q265393
Cache.save
test
public function save() { $location = $this->location; // no location given from commandline -> use config values or fallback to default location if (empty($location)) { $location = $this->parameters->get( 'write_location', $this->parameters->get( ...
php
{ "resource": "" }
q265394
TabView._getForms
test
private function _getForms($forms) { $recArr = array(); if (count($forms) == 0) return $recArr; foreach ($forms as $form) { if (!is_null($form["ATTRIBUTES"])) $recArr[] = $form["ATTRIBUTES"]; else $recArr[] = $form; ...
php
{ "resource": "" }
q265395
JsonAutoloader.setup
test
protected function setup() { $autoloader = $this->decode($this->filename); if (null === $autoloader) { throw new InvalidJsonFormatException(sprintf('The json file %s is malformed. Please check the file syntax to fix the problem', $this->filename)); } if (empty($autoloade...
php
{ "resource": "" }
q265396
TakeTransitionCommand.findTransition
test
protected function findTransition(Execution $execution) { $out = (array) $execution->getProcessModel()->findOutgoingTransitions($execution->getNode()->getId()); $trans = null; if ($this->transitionId === null) { if (count($out) != 1) { throw new \RuntimeE...
php
{ "resource": "" }
q265397
JqueryAjaxExtension.remoteCall
test
public function remoteCall($options = array()) { return function ($options) { $type = isset($options['type']) ? $options['type'] : "POST"; $dataType = isset($options['dataType']) ? $options['dataType'] : "html"; $js = "$.ajax({ url: '" . $options['url'] . "', ...
php
{ "resource": "" }
q265398
JqueryAjaxExtension.submitCall
test
public function submitCall($options = array()) { return function ($options) { $type = isset($options['type']) ? $options['type'] : "POST"; $dataType = isset($options['dataType']) ? $options['dataType'] : "html"; $js = "$.ajax({ url: '" . $options['url'] . "', type: '" . $type ...
php
{ "resource": "" }
q265399
JqueryAjaxExtension.linkTag
test
public function linkTag($options = array()) { $jsRequest = $this->remoteCall(); return function ($options) use($jsRequest) { $confirm = ''; if (isset($options['confirm']) && $options['confirm'] === true) { $msg = "Are you sure...
php
{ "resource": "" }