_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
83
13k
language
stringclasses
1 value
meta_information
dict
q251400
Xls.readLabel
validation
private function readLabel() { $length = self::getUInt2d($this->data, $this->pos + 2); $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); // move stream pointer to next record $this->pos += 4 + $length; // offset: 0; size: 2; index to row $ro...
php
{ "resource": "" }
q251401
Xls.readMsoDrawing
validation
private function readMsoDrawing() { $length = self::getUInt2d($this->data, $this->pos + 2); // get spliced record data $splicedRecordData = $this->getSplicedRecordData(); $recordData = $splicedRecordData['recordData']; $this->drawingData .= $recordData; }
php
{ "resource": "" }
q251402
Xls.readPane
validation
private function readPane() { $length = self::getUInt2d($this->data, $this->pos + 2); $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); // move stream pointer to next record $this->pos += 4 + $length; if (!$this->readDataOnly) { // offse...
php
{ "resource": "" }
q251403
Xls.readSelection
validation
private function readSelection() { $length = self::getUInt2d($this->data, $this->pos + 2); $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); // move stream pointer to next record $this->pos += 4 + $length; if (!$this->readDataOnly) { // ...
php
{ "resource": "" }
q251404
Xls.readSheetLayout
validation
private function readSheetLayout() { $length = self::getUInt2d($this->data, $this->pos + 2); $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); // move stream pointer to next record $this->pos += 4 + $length; // local pointer in record data $...
php
{ "resource": "" }
q251405
Xls.readRangeProtection
validation
private function readRangeProtection() { $length = self::getUInt2d($this->data, $this->pos + 2); $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); // move stream pointer to next record $this->pos += 4 + $length; // local pointer in record data ...
php
{ "resource": "" }
q251406
Xls.readContinue
validation
private function readContinue() { $length = self::getUInt2d($this->data, $this->pos + 2); $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); // check if we are reading drawing data // this is in case a free CONTINUE record occurs in other circumstances we are...
php
{ "resource": "" }
q251407
Xls.readBIFF8CellAddressB
validation
private function readBIFF8CellAddressB($cellAddressStructure, $baseCell = 'A1') { list($baseCol, $baseRow) = Coordinate::coordinateFromString($baseCell); $baseCol = Coordinate::columnIndexFromString($baseCol) - 1; // offset: 0; size: 2; index to row (0... 65535) (or offset (-32768... 32767)...
php
{ "resource": "" }
q251408
Xls.readBIFF8CellRangeAddressB
validation
private function readBIFF8CellRangeAddressB($subData, $baseCell = 'A1') { list($baseCol, $baseRow) = Coordinate::coordinateFromString($baseCell); $baseCol = Coordinate::columnIndexFromString($baseCol) - 1; // TODO: if cell range is just a single cell, should this funciton // not jus...
php
{ "resource": "" }
q251409
Xls.getInt4d
validation
public static function getInt4d($data, $pos) { // FIX: represent numbers correctly on 64-bit system // http://sourceforge.net/tracker/index.php?func=detail&aid=1487372&group_id=99160&atid=623334 // Changed by Andreas Rehm 2006 to ensure correct result of the <<24 block on 32 and 64bit system...
php
{ "resource": "" }
q251410
Settings.write
validation
public function write(Spreadsheet $spreadsheet = null) { $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { $objWriter = new XMLWrit...
php
{ "resource": "" }
q251411
Borders.setDiagonalDirection
validation
public function setDiagonalDirection($pValue) { if ($pValue == '') { $pValue = self::DIAGONAL_NONE; } if ($this->isSupervisor) { $styleArray = $this->getStyleArray(['diagonalDirection' => $pValue]); $this->getActiveSheet()->getStyle($this->getSelectedCells...
php
{ "resource": "" }
q251412
CustomFields.fromXML
validation
function fromXML($xmlElement) { foreach ($xmlElement->children() as $field) { $this->custom_fields[trim($field->name)] = $field->type; // The trim is required to make a safer string from the object } }
php
{ "resource": "" }
q251413
CustomFields.toString
validation
function toString() { // Generate custom field string $customfields = ""; if (isset($this->custom_fields)) { foreach ($this->custom_fields as $index => $type) { $customfields .= $index . "=" . $type . ", "; } $customfields = rtrim...
php
{ "resource": "" }
q251414
Cells.has
validation
public function has($pCoord) { if ($pCoord === $this->currentCoordinate) { return true; } // Check if the requested entry exists in the index return isset($this->index[$pCoord]); }
php
{ "resource": "" }
q251415
Cells.delete
validation
public function delete($pCoord) { if ($pCoord === $this->currentCoordinate && $this->currentCell !== null) { $this->currentCell->detach(); $this->currentCoordinate = null; $this->currentCell = null; $this->currentCellIsDirty = false; } unset($...
php
{ "resource": "" }
q251416
Cells.getHighestColumn
validation
public function getHighestColumn($row = null) { if ($row == null) { $colRow = $this->getHighestRowAndColumn(); return $colRow['column']; } $columnList = [1]; foreach ($this->getCoordinates() as $coord) { sscanf($coord, '%[A-Z]%d', $c, $r); ...
php
{ "resource": "" }
q251417
Cells.getHighestRow
validation
public function getHighestRow($column = null) { if ($column == null) { $colRow = $this->getHighestRowAndColumn(); return $colRow['row']; } $rowList = [0]; foreach ($this->getCoordinates() as $coord) { sscanf($coord, '%[A-Z]%d', $c, $r); ...
php
{ "resource": "" }
q251418
Cells.cloneCellCollection
validation
public function cloneCellCollection(Worksheet $parent) { $this->storeCurrentCell(); $newCollection = clone $this; $newCollection->parent = $parent; if (($newCollection->currentCell !== null) && (is_object($newCollection->currentCell))) { $newCollection->currentCell->atta...
php
{ "resource": "" }
q251419
Cells.removeRow
validation
public function removeRow($row) { foreach ($this->getCoordinates() as $coord) { sscanf($coord, '%[A-Z]%d', $c, $r); if ($r == $row) { $this->delete($coord); } } }
php
{ "resource": "" }
q251420
Cells.removeColumn
validation
public function removeColumn($column) { foreach ($this->getCoordinates() as $coord) { sscanf($coord, '%[A-Z]%d', $c, $r); if ($c == $column) { $this->delete($coord); } } }
php
{ "resource": "" }
q251421
Cells.storeCurrentCell
validation
private function storeCurrentCell() { if ($this->currentCellIsDirty && !empty($this->currentCoordinate)) { $this->currentCell->detach(); $stored = $this->cache->set($this->cachePrefix . $this->currentCoordinate, $this->currentCell); if (!$stored) { $this-...
php
{ "resource": "" }
q251422
Cells.add
validation
public function add($pCoord, Cell $cell) { if ($pCoord !== $this->currentCoordinate) { $this->storeCurrentCell(); } $this->index[$pCoord] = true; $this->currentCoordinate = $pCoord; $this->currentCell = $cell; $this->currentCellIsDirty = true; re...
php
{ "resource": "" }
q251423
Cells.unsetWorksheetCells
validation
public function unsetWorksheetCells() { if ($this->currentCell !== null) { $this->currentCell->detach(); $this->currentCell = null; $this->currentCoordinate = null; } // Flush the cache $this->__destruct(); $this->index = []; // ...
php
{ "resource": "" }
q251424
Cells.getAllCacheKeys
validation
private function getAllCacheKeys() { $keys = []; foreach ($this->getCoordinates() as $coordinate) { $keys[] = $this->cachePrefix . $coordinate; } return $keys; }
php
{ "resource": "" }
q251425
ContactfiltersService.createContactFilter
validation
function createContactFilter($newFilterObject, $createTargetGroup, $version = 1.0) { if ($version == 1.0) { $queryParameters = array( 'createTargetGroup' => ($createTargetGroup) ? "true" : "false" ); return $this->put("contactfilters/contactfilter", ...
php
{ "resource": "" }
q251426
JSONDeserializer.json_decode
validation
static function json_decode($jsonString, $deserializationType = null) { if(is_array($deserializationType) && count($deserializationType) > 1) { $type = $deserializationType[0]; $innerType = $deserializationType[1]; } else { $type = $deserializationType; ...
php
{ "resource": "" }
q251427
JSONDeserializer.fromArray
validation
private static function fromArray($object, $type = null, $innerType = null) { if($type == 'array') { foreach ($object as $element) { // call this method on each element $result[]= self::fromArray($element, $innerType); } // ...
php
{ "resource": "" }
q251428
Authentication.buildAuthorizationHeader
validation
protected static function buildAuthorizationHeader(string $method, string $token, string $password = null) { switch ($method) { case Client::AUTH_HTTP_PASSWORD: return 'Basic '.base64_encode("$token:$password"); case Client::AUTH_OAUTH_TOKEN: return "B...
php
{ "resource": "" }
q251429
ContactEventType.fromXML
validation
function fromXML($xmlElement) { if (isset($xmlElement->id)) $this->id = $xmlElement->id; if (isset($xmlElement->name)) $this->name = $xmlElement->name; if (isset($xmlElement->active)) $this->active = $xmlElement->active; if (isset($xmlElement->anonymizable)) $this->anonymizable ...
php
{ "resource": "" }
q251430
RelsVBA.writeVBARelationships
validation
public function writeVBARelationships(Spreadsheet $spreadsheet) { // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else ...
php
{ "resource": "" }
q251431
SpgrContainer.getAllSpContainers
validation
public function getAllSpContainers() { $allSpContainers = []; foreach ($this->children as $child) { if ($child instanceof self) { $allSpContainers = array_merge($allSpContainers, $child->getAllSpContainers()); } else { $allSpContainers[] = $ch...
php
{ "resource": "" }
q251432
AbstractRequest.validate
validation
public function validate() { foreach (func_get_args() as $key) { $value = $this->parameters->get($key); if (! isset($value)) { throw new InvalidRequestException("The $key parameter is required"); } } }
php
{ "resource": "" }
q251433
Database.parseDsn
validation
public static function parseDsn($string = null) { $opts = null; if (!empty($string)) { $dsn = (object) DsnParser::parseUrl($string)->toArray(); $opts = [ 'driver' => $dsn->driver, 'host' => $dsn->host, 'database' => $dsn->dbname, 'username' => $dsn->user, 'password' => isset($dsn->pass...
php
{ "resource": "" }
q251434
Database.getQueryPreview
validation
public static function getQueryPreview(QueryBuilder $query = null) { if (empty($query)) { return ""; } $sql = str_replace('?', "'%s'", $query->toSql()); $bindings = $query->getBindings(); return vsprintf($sql, $bindings); }
php
{ "resource": "" }
q251435
Database.getLastQuery
validation
public static function getLastQuery($connection = "") { $last_query = ""; $pretty_queries = self::getPrettyQueryLog($connection); if (!empty($pretty_queries)) { $last_query = $pretty_queries[ count($pretty_queries) - 1 ]; } return $last_query; }
php
{ "resource": "" }
q251436
Database.getPrettyQueryLog
validation
public static function getPrettyQueryLog($connection = "") { $return_queries = []; $queries = Capsule::connection($connection)->getQueryLog(); foreach ($queries as $query) { $query_pattern = str_replace('?', "'%s'", $query['query']); $return_queries[] = vsprintf($query_pattern, $query['bindings']); } ...
php
{ "resource": "" }
q251437
StringTable.createStringTable
validation
public function createStringTable(Worksheet $pSheet, $pExistingTable = null) { // Create string lookup table $aStringTable = []; $cellCollection = null; $aFlippedStringTable = null; // For faster lookup // Is an existing table given? if (($pExistingTable !== null) &&...
php
{ "resource": "" }
q251438
StringTable.writeStringTable
validation
public function writeStringTable(array $pStringTable) { // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { ...
php
{ "resource": "" }
q251439
Content.writeRows
validation
private function writeRows(XMLWriter $objWriter, Worksheet $sheet) { $numberRowsRepeated = self::NUMBER_ROWS_REPEATED_MAX; $span_row = 0; $rows = $sheet->getRowIterator(); while ($rows->valid()) { --$numberRowsRepeated; $row = $rows->current(); if ...
php
{ "resource": "" }
q251440
Content.writeCellSpan
validation
private function writeCellSpan(XMLWriter $objWriter, $curColumn, $prevColumn) { $diff = $curColumn - $prevColumn - 1; if (1 === $diff) { $objWriter->writeElement('table:table-cell'); } elseif ($diff > 1) { $objWriter->startElement('table:table-cell'); $obj...
php
{ "resource": "" }
q251441
Content.writeXfStyles
validation
private function writeXfStyles(XMLWriter $writer, Spreadsheet $spreadsheet) { foreach ($spreadsheet->getCellXfCollection() as $style) { $writer->startElement('style:style'); $writer->writeAttribute('style:name', self::CELL_STYLE_PREFIX . $style->getIndex()); $writer->writ...
php
{ "resource": "" }
q251442
Content.writeCellMerge
validation
private function writeCellMerge(XMLWriter $objWriter, Cell $cell) { if (!$cell->isMergeRangeValueCell()) { return; } $mergeRange = Coordinate::splitRange($cell->getMergeRange()); list($startCell, $endCell) = $mergeRange[0]; $start = Coordinate::coordinateFromStri...
php
{ "resource": "" }
q251443
Alignment.setHorizontal
validation
public function setHorizontal($pValue) { if ($pValue == '') { $pValue = self::HORIZONTAL_GENERAL; } if ($this->isSupervisor) { $styleArray = $this->getStyleArray(['horizontal' => $pValue]); $this->getActiveSheet()->getStyle($this->getSelectedCells())->app...
php
{ "resource": "" }
q251444
Alignment.setVertical
validation
public function setVertical($pValue) { if ($pValue == '') { $pValue = self::VERTICAL_BOTTOM; } if ($this->isSupervisor) { $styleArray = $this->getStyleArray(['vertical' => $pValue]); $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromA...
php
{ "resource": "" }
q251445
Alignment.setShrinkToFit
validation
public function setShrinkToFit($pValue) { if ($pValue == '') { $pValue = false; } if ($this->isSupervisor) { $styleArray = $this->getStyleArray(['shrinkToFit' => $pValue]); $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($style...
php
{ "resource": "" }
q251446
Alignment.setIndent
validation
public function setIndent($pValue) { if ($pValue > 0) { if ($this->getHorizontal() != self::HORIZONTAL_GENERAL && $this->getHorizontal() != self::HORIZONTAL_LEFT && $this->getHorizontal() != self::HORIZONTAL_RIGHT) { $pValue = 0; // indent not supp...
php
{ "resource": "" }
q251447
Alignment.setReadOrder
validation
public function setReadOrder($pValue) { if ($pValue < 0 || $pValue > 2) { $pValue = 0; } if ($this->isSupervisor) { $styleArray = $this->getStyleArray(['readOrder' => $pValue]); $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($...
php
{ "resource": "" }
q251448
AbstractMaileonService.get
validation
public function get($resourcePath, $queryParameters = array(), $mimeType = 'application/vnd.maileon.api+xml', $deserializationType = null) { $curlSession = $this->prepareSession($resourcePath, $queryParameters, $mimeType); return $this->performRequest(...
php
{ "resource": "" }
q251449
AbstractMaileonService.delete
validation
public function delete($resourcePath, $queryParameters = array(), $mimeType = 'application/vnd.maileon.api+xml', $deserializationType = null) { $curlSession = $this->prepareSession($resourcePath, $queryParameters, $mimeType); curl_setopt($curlSession, ...
php
{ "resource": "" }
q251450
AbstractMaileonService.performRequest
validation
private function performRequest($curlSession, $deserializationType = null) { $response = curl_exec($curlSession); // coerce all false values to null $response = $response ? $response : null; try { $result = new MaileonAPIResult($response, $curlSession, $this->throwExcepti...
php
{ "resource": "" }
q251451
CommandController.createAction
validation
public function createAction() { /** @var \Zend\Http\PhpEnvironment\Request $request */ $request = $this->getRequest(); $prg = $this->prg($request->getRequestUri(), true); if ($prg instanceof ResponseInterface) { return $prg; } elseif ($prg === false) { ...
php
{ "resource": "" }
q251452
Contact.fromXML
validation
function fromXML($xmlElement) { if (isset($xmlElement->id)) $this->id = $xmlElement->id; $this->email = (string)$xmlElement->email; if (isset($xmlElement->permission)) $this->permission = Permission::getPermission((string)$xmlElement->permission); if (isset($xmlElement->external_id)...
php
{ "resource": "" }
q251453
Contact.toCsvString
validation
function toCsvString() { // Generate standard field string $standard_fields = "{"; if (isset($this->standard_fields)) { foreach ($this->standard_fields as $index => $value) { $standard_fields .= $index . "=" . $value . ","; } $standard_fie...
php
{ "resource": "" }
q251454
Border.getSharedComponent
validation
public function getSharedComponent() { switch ($this->parentPropertyName) { case 'allBorders': case 'horizontal': case 'inside': case 'outline': case 'vertical': throw new PhpSpreadsheetException('Cannot get shared component for a p...
php
{ "resource": "" }
q251455
Border.setColor
validation
public function setColor(Color $pValue) { // make sure parameter is a real color and not a supervisor $color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue; if ($this->isSupervisor) { $styleArray = $this->getColor()->getStyleArray(['argb' => $color->getAR...
php
{ "resource": "" }
q251456
Ods.scanElementForText
validation
protected function scanElementForText(\DOMNode $element) { $str = ''; foreach ($element->childNodes as $child) { /** @var \DOMNode $child */ if ($child->nodeType == XML_TEXT_NODE) { $str .= $child->nodeValue; } elseif ($child->nodeType == XML_ELEME...
php
{ "resource": "" }
q251457
HashTable.addFromSource
validation
public function addFromSource(array $pSource = null) { // Check if an array was passed if ($pSource == null) { return; } foreach ($pSource as $item) { $this->add($item); } }
php
{ "resource": "" }
q251458
HashTable.add
validation
public function add(IComparable $pSource) { $hash = $pSource->getHashCode(); if (!isset($this->items[$hash])) { $this->items[$hash] = $pSource; $this->keyMap[count($this->items) - 1] = $hash; } }
php
{ "resource": "" }
q251459
Engineering.cleanComplex
validation
private static function cleanComplex($complexNumber) { if ($complexNumber[0] == '+') { $complexNumber = substr($complexNumber, 1); } if ($complexNumber[0] == '0') { $complexNumber = substr($complexNumber, 1); } if ($complexNumber[0] == '.') { ...
php
{ "resource": "" }
q251460
Engineering.nbrConversionFormat
validation
private static function nbrConversionFormat($xVal, $places) { if ($places !== null) { if (is_numeric($places)) { $places = (int) $places; } else { return Functions::VALUE(); } if ($places < 0) { return Functions:...
php
{ "resource": "" }
q251461
Engineering.getConversionGroups
validation
public static function getConversionGroups() { $conversionGroups = []; foreach (self::$conversionUnits as $conversionUnit) { $conversionGroups[] = $conversionUnit['Group']; } return array_merge(array_unique($conversionGroups)); }
php
{ "resource": "" }
q251462
Engineering.getConversionGroupUnits
validation
public static function getConversionGroupUnits($group = null) { $conversionGroups = []; foreach (self::$conversionUnits as $conversionUnit => $conversionGroup) { if (($group === null) || ($conversionGroup['Group'] == $group)) { $conversionGroups[$conversionGroup['Group']]...
php
{ "resource": "" }
q251463
Auja.authenticationForm
validation
public function authenticationForm($title, $target) { $formFactory = $this->app->make('Label305\AujaLaravel\Factory\AuthenticationFormFactory'); /* @var $formFactory AuthenticationFormFactory */ return $formFactory->create($title, $target); }
php
{ "resource": "" }
q251464
Auja.menuFor
validation
public function menuFor($model, $modelId = 0, ModelConfig $config = null) { if (is_null($this->aujaConfigurator)) { throw new \LogicException('Auja not initialized. Call Auja::init first.'); } $modelName = $this->resolveModelName($model); if ($modelId == 0) { $m...
php
{ "resource": "" }
q251465
Auja.buildComplexIndexMenu
validation
private function buildComplexIndexMenu($modelName, $modelId, ModelConfig $config = null) { $model = $this->aujaConfigurator->getModel($modelName); $relations = $this->aujaConfigurator->getRelationsForModel($model); $associationRelations = array(); foreach ($relations as $relation) { ...
php
{ "resource": "" }
q251466
Auja.itemsFor
validation
public function itemsFor($model, $items = null, $targetUrl = null, $nextPageUrl = null, $offset = -1, ModelConfig $config = null) { $modelName = $this->resolveModelName($model); if ($items == null) { $items = call_user_func(array($modelName, 'simplePaginate'), 10); } $facto...
php
{ "resource": "" }
q251467
Auja.noAssociationsMenuFor
validation
public function noAssociationsMenuFor($model, ModelConfig $config = null) { $modelName = $this->resolveModelName($model); $menuFactory = $this->app->make('Label305\AujaLaravel\Factory\NoAssociationsIndexMenuFactory'); /* @var $menuFactory NoAssociationsIndexMenuFactory */ return $menuFa...
php
{ "resource": "" }
q251468
Auja.pageFor
validation
public function pageFor($model, $itemId = 0, ModelConfig $config = null) { $modelName = $this->resolveModelName($model); $item = $this->findItem($modelName, $itemId); $pageFactory = $this->app->make('Label305\AujaLaravel\Factory\PageFactory'); /* @var $pageFactory PageFactory */ ...
php
{ "resource": "" }
q251469
Auja.resolveModelName
validation
private function resolveModelName($model) { if ($model instanceof Controller) { $exploded = explode('\\', get_class($model)); $controllerName = array_pop($exploded); return str_singular(str_replace('Controller', '', $controllerName)); } else if ($model instanceof Eloq...
php
{ "resource": "" }
q251470
Launcher.set_language
validation
public function set_language() { $plugin_slug = App::EFG()->getOption( 'slug' ); $module_slug = Module::CustomImagesGrifus()->getOption( 'slug' ); $path = $plugin_slug . '/modules/' . $module_slug . '/languages/'; load_plugin_textdomain( $plugin_slug . '-images', false, $path ); }
php
{ "resource": "" }
q251471
MD5.getContext
validation
public function getContext() { $s = ''; foreach (['a', 'b', 'c', 'd'] as $i) { $v = $this->{$i}; $s .= chr($v & 0xff); $s .= chr(($v >> 8) & 0xff); $s .= chr(($v >> 16) & 0xff); $s .= chr(($v >> 24) & 0xff); } return $s; ...
php
{ "resource": "" }
q251472
Meta.write
validation
public function write(Spreadsheet $spreadsheet = null) { if (!$spreadsheet) { $spreadsheet = $this->getParentWriter()->getSpreadsheet(); } $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { $objWriter = new XMLWriter(XMLWriter::STORAGE_DI...
php
{ "resource": "" }
q251473
Csv.writeLine
validation
private function writeLine($pFileHandle, array $pValues) { // No leading delimiter $writeDelimiter = false; // Build the line $line = ''; foreach ($pValues as $element) { // Escape enclosures $element = str_replace($this->enclosure, $this->enclosure ...
php
{ "resource": "" }
q251474
UsersController.edit
validation
public function edit($id) { $user = User::findOrFail($id); $roles = Role::lists('name', 'id'); return view('intothesource.usersmanager.users.edit', compact('user', 'roles')); }
php
{ "resource": "" }
q251475
DefaultSupportController.main
validation
public function main() { $config = $this->app['config']['auja'] ?: $this->app['config']['auja-laravel::config']; $authenticationForm = $this->app['auja']->authenticationForm( $config['title'], $this->app['url']->route('auja.support.login', [], false) ); $userna...
php
{ "resource": "" }
q251476
ContentTypes.getImageMimeType
validation
private function getImageMimeType($pFile) { if (File::fileExists($pFile)) { $image = getimagesize($pFile); return image_type_to_mime_type($image[2]); } throw new WriterException("File $pFile does not exist"); }
php
{ "resource": "" }
q251477
ContentTypes.writeDefaultContentType
validation
private function writeDefaultContentType(XMLWriter $objWriter, $pPartname, $pContentType) { if ($pPartname != '' && $pContentType != '') { // Write content type $objWriter->startElement('Default'); $objWriter->writeAttribute('Extension', $pPartname); $objWrite...
php
{ "resource": "" }
q251478
Calculation.getInstance
validation
public static function getInstance(Spreadsheet $spreadsheet = null) { if ($spreadsheet !== null) { $instance = $spreadsheet->getCalculationEngine(); if (isset($instance)) { return $instance; } } if (!isset(self::$instance) || (self::$insta...
php
{ "resource": "" }
q251479
Calculation.wrapResult
validation
public static function wrapResult($value) { if (is_string($value)) { // Error values cannot be "wrapped" if (preg_match('/^' . self::CALCULATION_REGEXP_ERROR . '$/i', $value, $match)) { // Return Excel errors "as is" return $value; } ...
php
{ "resource": "" }
q251480
Calculation.unwrapResult
validation
public static function unwrapResult($value) { if (is_string($value)) { if ((isset($value[0])) && ($value[0] == '"') && (substr($value, -1) == '"')) { return substr($value, 1, -1); } // Convert numeric errors to NAN error } elseif ((is_float($val...
php
{ "resource": "" }
q251481
Calculation.calculateCellValue
validation
public function calculateCellValue(Cell $pCell = null, $resetLog = true) { if ($pCell === null) { return null; } $returnArrayAsType = self::$returnArrayAsType; if ($resetLog) { // Initialise the logging settings if requested $this->formulaError...
php
{ "resource": "" }
q251482
Calculation.calculateFormula
validation
public function calculateFormula($formula, $cellID = null, Cell $pCell = null) { // Initialise the logging settings $this->formulaError = null; $this->debugLog->clearLog(); $this->cyclicReferenceStack->clear(); if ($this->spreadsheet !== null && $cellID === null && $pCell...
php
{ "resource": "" }
q251483
Calculation.getMatrixDimensions
validation
public static function getMatrixDimensions(array &$matrix) { $matrixRows = count($matrix); $matrixColumns = 0; foreach ($matrix as $rowKey => $rowValue) { if (!is_array($rowValue)) { $matrix[$rowKey] = [$rowValue]; $matrixColumns = max(1, $matrixCo...
php
{ "resource": "" }
q251484
Calculation.isImplemented
validation
public function isImplemented($pFunction) { $pFunction = strtoupper($pFunction); $notImplemented = !isset(self::$phpSpreadsheetFunctions[$pFunction]) || (is_array(self::$phpSpreadsheetFunctions[$pFunction]['functionCall']) && self::$phpSpreadsheetFunctions[$pFunction]['functionCall'][1] === 'DUMMY')...
php
{ "resource": "" }
q251485
Calculation.getImplementedFunctionNames
validation
public function getImplementedFunctionNames() { $returnValue = []; foreach (self::$phpSpreadsheetFunctions as $functionName => $function) { if ($this->isImplemented($functionName)) { $returnValue[] = $functionName; } } return $returnValue; ...
php
{ "resource": "" }
q251486
UniqueBounce.fromXML
validation
function fromXML($xmlElement) { $this->contact = new ReportContact(); $this->contact->fromXML($xmlElement->contact); if (isset($xmlElement->mailing_id)) $this->mailingId = $xmlElement->mailing_id; if (isset($xmlElement->timestamp)) $this->timestamp = $xmlElement->timestamp; ...
php
{ "resource": "" }
q251487
OLE.ascToUcs
validation
public static function ascToUcs($ascii) { $rawname = ''; $iMax = strlen($ascii); for ($i = 0; $i < $iMax; ++$i) { $rawname .= $ascii[$i] . "\x00"; } return $rawname; }
php
{ "resource": "" }
q251488
Generator.getString
validation
public function getString($type = 'letter', $desired_length = null) { if (empty($desired_length)) { $desired_length = $this->getInteger(1, 50); } $result = ''; while (strlen($result) < $desired_length) { if ($type == 'letter') { $result .= $this->getLetter(); } elseif ($type == 'number') { ...
php
{ "resource": "" }
q251489
Generator.getGuid
validation
public function getGuid() { return sprintf( '%04x%04x-%04x-%03x4-%04x-%04x%04x%04x', mt_rand(0, 65535), mt_rand(0, 65535), // 32 bits for "time_low" mt_rand(0, 65535), // 16 bits for "time_mid" mt_rand(0, 4095), // 12 bits before the 0100 of (version) 4 for "time_hi_and_version" b...
php
{ "resource": "" }
q251490
Generator.getDate
validation
public function getDate($params = [], $format = 'Y-m-d') { foreach ($params as $k => $v) { $$k = $v; } if (!isset($min_year)) { $min_year = date('Y') - 2; } if (!isset($max_year)) { $max_year = date('Y'); } if (!isset($min_month)) { $min_month = 1; } if (!isset($max_month)) { $...
php
{ "resource": "" }
q251491
Generator.getDln
validation
public function getDln($state_code = null, $min = 900000001, $max = 999999999) { $dln = new Entities\DriverLicense(); $dln->number = rand($min, $max); $dln->state = !empty($state_code) ? $state_code : $this->getState(); $dln->expiration = $this->getExpiration(); return $dln; }
php
{ "resource": "" }
q251492
Generator.getFirstName
validation
public function getFirstName($gender = null) { if (empty($gender)) { $gender = $this->getGender(); } return FirstName::where('gender', $gender)->where('rank', '<=', 250)->orderByRaw(Database::random())->first()->name; }
php
{ "resource": "" }
q251493
Generator.getLastName
validation
public function getLastName($max = 250) { return LastName::where('rank', '<=', $max)->orderByRaw(Database::random())->first()->name; }
php
{ "resource": "" }
q251494
Generator.getFullName
validation
public function getFullName($gender = null) { if (empty($gender)) { $gender = $this->getGender(); } $person_name = new Entities\FullName; $person_name->first = $this->getFirstName($gender); $person_name->middle = $this->getMiddleName($gender); $person_name->last = $this->getLastName(); $person_na...
php
{ "resource": "" }
q251495
Generator.getStreet
validation
public function getStreet() { $number = rand(100, 9999); $street_name = Street::orderByRaw(Database::random())->first()->name; return $number . ' ' . $street_name; }
php
{ "resource": "" }
q251496
Generator.getApartment
validation
public function getApartment() { $types = ['Apt.', 'Apartment', 'Ste.', 'Suite', 'Box']; // @codeCoverageIgnoreStart if ($this->getBool(true, false)) { $extra = $this->getLetter(); } else { $extra = $this->getInteger(1, 9999); } // @codeCoverageIgnoreEnd $type = $this->fromArray($types); return...
php
{ "resource": "" }
q251497
Generator.getState
validation
public function getState($state_code = null) { if (!empty($state_code)) { $res = Zipcode::where('state_code', $state_code)->orderByRaw(Database::random())->first(); } else { $res = Zipcode::orderByRaw(Database::random())->first(); } $State = new Entities\State; $State->code = $res->state_code; ...
php
{ "resource": "" }
q251498
Generator.getAddress
validation
public function getAddress($state_code = null, $zip = null) { $address = new Entities\Address; if (!empty($zip) && !empty($state_code)) { $result = Zipcode::where('zip', $zip)->where('state_code', $state_code)->orderByRaw(Database::random())->first(); } elseif (!empty($zip)) { $result = Zipcode::where('zi...
php
{ "resource": "" }
q251499
Generator.getCompanyName
validation
public function getCompanyName($base_name = null) { $suffixes = ['Corporation', 'Company', 'Company, Limited', 'Computer Repair', 'Incorporated', 'and Sons', 'Group', 'Group, PLC', 'Furniture', 'Flowers', 'Sales', 'Systems', 'Tire', 'Auto', 'Plumbing', 'Roofing', 'Realty', 'Foods', 'Books']; if (empty($base_nam...
php
{ "resource": "" }