_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 83 13k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q250900 | IOFactory.createReader | validation | public static function createReader($readerType)
{
if (!isset(self::$readers[$readerType])) {
throw new Reader\Exception("No reader found for type $readerType");
}
// Instantiate reader
$className = self::$readers[$readerType];
$reader = new $className();
... | php | {
"resource": ""
} |
q250901 | IOFactory.identify | validation | public static function identify($pFilename)
{
$reader = self::createReaderForFile($pFilename);
$className = get_class($reader);
$classType = explode('\\', $className);
unset($reader);
return array_pop($classType);
} | php | {
"resource": ""
} |
q250902 | IOFactory.createReaderForFile | validation | public static function createReaderForFile($filename)
{
File::assertFile($filename);
// First, lucky guess by inspecting file extension
$guessedReader = self::getReaderTypeFromExtension($filename);
if ($guessedReader !== null) {
$reader = self::createReader($guessedReade... | php | {
"resource": ""
} |
q250903 | IOFactory.getReaderTypeFromExtension | validation | private static function getReaderTypeFromExtension($filename)
{
$pathinfo = pathinfo($filename);
if (!isset($pathinfo['extension'])) {
return null;
}
switch (strtolower($pathinfo['extension'])) {
case 'xlsx': // Excel (OfficeOpenXML) Spreadsheet
c... | php | {
"resource": ""
} |
q250904 | IOFactory.registerWriter | validation | public static function registerWriter($writerType, $writerClass)
{
if (!is_a($writerClass, Writer\IWriter::class, true)) {
throw new Writer\Exception('Registered writers must implement ' . Writer\IWriter::class);
}
self::$writers[$writerType] = $writerClass;
} | php | {
"resource": ""
} |
q250905 | IOFactory.registerReader | validation | public static function registerReader($readerType, $readerClass)
{
if (!is_a($readerClass, Reader\IReader::class, true)) {
throw new Reader\Exception('Registered readers must implement ' . Reader\IReader::class);
}
self::$readers[$readerType] = $readerClass;
} | php | {
"resource": ""
} |
q250906 | Client.setHeader | validation | public function setHeader($header, $value)
{
if (strlen($header) < 1) {
throw new Exception('Header must be a string.');
}
$this->customHeaders[$header] = $value;
return $this;
} | php | {
"resource": ""
} |
q250907 | Style.writeFill | validation | private function writeFill(XMLWriter $objWriter, Fill $pFill)
{
// Check if this is a pattern type or gradient type
if ($pFill->getFillType() === Fill::FILL_GRADIENT_LINEAR ||
$pFill->getFillType() === Fill::FILL_GRADIENT_PATH) {
// Gradient fill
$this->writeGradi... | php | {
"resource": ""
} |
q250908 | Style.writeGradientFill | validation | private function writeGradientFill(XMLWriter $objWriter, Fill $pFill)
{
// fill
$objWriter->startElement('fill');
// gradientFill
$objWriter->startElement('gradientFill');
$objWriter->writeAttribute('type', $pFill->getFillType());
$objWriter->writeAttribute('degree',... | php | {
"resource": ""
} |
q250909 | Style.writePatternFill | validation | private function writePatternFill(XMLWriter $objWriter, Fill $pFill)
{
// fill
$objWriter->startElement('fill');
// patternFill
$objWriter->startElement('patternFill');
$objWriter->writeAttribute('patternType', $pFill->getFillType());
if ($pFill->getFillType() !== F... | php | {
"resource": ""
} |
q250910 | Style.writeFont | validation | private function writeFont(XMLWriter $objWriter, Font $pFont)
{
// font
$objWriter->startElement('font');
// Weird! The order of these elements actually makes a difference when opening Xlsx
// files in Excel2003 with the compatibility pack. It's not documented behaviour,
... | php | {
"resource": ""
} |
q250911 | Style.writeBorder | validation | private function writeBorder(XMLWriter $objWriter, Borders $pBorders)
{
// Write border
$objWriter->startElement('border');
// Diagonal?
switch ($pBorders->getDiagonalDirection()) {
case Borders::DIAGONAL_UP:
$objWriter->writeAttribute('diagonalUp', 'true'... | php | {
"resource": ""
} |
q250912 | Style.writeCellStyleDxf | validation | private function writeCellStyleDxf(XMLWriter $objWriter, \PhpOffice\PhpSpreadsheet\Style\Style $pStyle)
{
// dxf
$objWriter->startElement('dxf');
// font
$this->writeFont($objWriter, $pStyle->getFont());
// numFmt
$this->writeNumFmt($objWriter, $pStyle->getNumberFor... | php | {
"resource": ""
} |
q250913 | Style.writeBorderPr | validation | private function writeBorderPr(XMLWriter $objWriter, $pName, Border $pBorder)
{
// Write BorderPr
if ($pBorder->getBorderStyle() != Border::BORDER_NONE) {
$objWriter->startElement($pName);
$objWriter->writeAttribute('style', $pBorder->getBorderStyle());
// color
... | php | {
"resource": ""
} |
q250914 | Style.writeNumFmt | validation | private function writeNumFmt(XMLWriter $objWriter, NumberFormat $pNumberFormat, $pId = 0)
{
// Translate formatcode
$formatCode = $pNumberFormat->getFormatCode();
// numFmt
if ($formatCode !== null) {
$objWriter->startElement('numFmt');
$objWriter->writeAttri... | php | {
"resource": ""
} |
q250915 | Style.allConditionalStyles | validation | public function allConditionalStyles(Spreadsheet $spreadsheet)
{
// Get an array of all styles
$aStyles = [];
$sheetCount = $spreadsheet->getSheetCount();
for ($i = 0; $i < $sheetCount; ++$i) {
foreach ($spreadsheet->getSheet($i)->getConditionalStylesCollection() as $con... | php | {
"resource": ""
} |
q250916 | Style.allFills | validation | public function allFills(Spreadsheet $spreadsheet)
{
// Get an array of unique fills
$aFills = [];
// Two first fills are predefined
$fill0 = new Fill();
$fill0->setFillType(Fill::FILL_NONE);
$aFills[] = $fill0;
$fill1 = new Fill();
$fill1->setFillTy... | php | {
"resource": ""
} |
q250917 | Style.allFonts | validation | public function allFonts(Spreadsheet $spreadsheet)
{
// Get an array of unique fonts
$aFonts = [];
$aStyles = $this->allStyles($spreadsheet);
/** @var \PhpOffice\PhpSpreadsheet\Style\Style $style */
foreach ($aStyles as $style) {
if (!isset($aFonts[$style->getFon... | php | {
"resource": ""
} |
q250918 | Style.allBorders | validation | public function allBorders(Spreadsheet $spreadsheet)
{
// Get an array of unique borders
$aBorders = [];
$aStyles = $this->allStyles($spreadsheet);
/** @var \PhpOffice\PhpSpreadsheet\Style\Style $style */
foreach ($aStyles as $style) {
if (!isset($aBorders[$style... | php | {
"resource": ""
} |
q250919 | Style.allNumberFormats | validation | public function allNumberFormats(Spreadsheet $spreadsheet)
{
// Get an array of unique number formats
$aNumFmts = [];
$aStyles = $this->allStyles($spreadsheet);
/** @var \PhpOffice\PhpSpreadsheet\Style\Style $style */
foreach ($aStyles as $style) {
if ($style->ge... | php | {
"resource": ""
} |
q250920 | Unsubscriber.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->source)) $this->source = $xmlElement->source;
if... | php | {
"resource": ""
} |
q250921 | ModelConfig.getColumnDisplayName | validation | public function getColumnDisplayName($columnName) {
return isset($this->columnDisplayNames[$columnName]) ? $this->columnDisplayNames[$columnName] : $columnName;
} | php | {
"resource": ""
} |
q250922 | Contacts.fromXML | validation | function fromXML($xmlElement)
{
if ($xmlElement->getName() == "contacts") {
foreach ($xmlElement->children() as $contactXml) {
$contact = new Contact();
$contact->fromXML($contactXml);
$this->contacts[] = $contact;
}
}
... | php | {
"resource": ""
} |
q250923 | Click.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": ""
} |
q250924 | AbstractResponse.getCountryName | validation | public function getCountryName($code)
{
$name = Intl::getRegionBundle()->getCountryName(strtoupper($code), $this->getRequest()->getLanguageCode() ? : 'en');
if($name) {
return $name;
}
return $code;
} | php | {
"resource": ""
} |
q250925 | MemorySharedManager.getStorage | validation | public function getStorage() {
if (null === $this->storage) {
$this->setStorage(new Storage\File(array('dir' => DATA_PATH)));
}
return $this->storage;
} | php | {
"resource": ""
} |
q250926 | MemorySharedManager.setStorage | validation | public function setStorage($storage, $options = null) {
if (!$storage instanceof Storage\StorageInterface) {
$storage = $this->getStoragePluginManager()->get($storage, $options);
}
$this->storage = $storage;
return $this;
} | php | {
"resource": ""
} |
q250927 | Collection.implode | validation | public function implode($value, $glue = null)
{
$new_collection = new Collection($this->toArray());
$first = $new_collection->first();
if (is_array($first) || is_object($first)) {
return implode($glue, $new_collection->pluck($value)->all());
}
return implode($va... | php | {
"resource": ""
} |
q250928 | Collection.jsonSerialize | validation | public function jsonSerialize()
{
return array_map(function ($value) {
if ($value instanceof JsonSerializable) {
return $value->jsonSerialize();
} elseif ($value instanceof JsonableInterface) {
return json_decode($value->toJson(), true);
} ... | php | {
"resource": ""
} |
q250929 | LUDecomposition.det | validation | public function det()
{
if ($this->m == $this->n) {
$d = $this->pivsign;
for ($j = 0; $j < $this->n; ++$j) {
$d *= $this->LU[$j][$j];
}
return $d;
}
throw new CalculationException(Matrix::MATRIX_DIMENSION_EXCEPTION);
} | php | {
"resource": ""
} |
q250930 | DataType.getDataType | validation | static function getDataType($value)
{
switch ($value) {
case "string":
return self::$STRING;
case "double":
return self::$DOUBLE;
case "float":
return self::$FLOAT;
case "integer":
return self::$I... | php | {
"resource": ""
} |
q250931 | Katar.render | validation | public function render($file, $env = array()) {
$file = $this->views_path . '/' . $file;
if(!file_exists($file)) {
throw new \Exception("Could not compile $file, file not found");
}
// Cache compiled HTML
$cacheHash = md5($file . serialize($env));
$cache_fil... | php | {
"resource": ""
} |
q250932 | Katar.compile | validation | private function compile($file) {
if(!file_exists($file)) {
throw new \Exception("Could not compile $file, file not found");
}
if(!file_exists($this->views_cache) && !mkdir($this->views_cache)) {
throw new \Exception("Could no create cache directory." .
... | php | {
"resource": ""
} |
q250933 | Katar.compileString | validation | private function compileString($str) {
$result = null;
try {
$result = $this->parser->compile($str);
} catch (\Exception $e) {
throw new SyntaxErrorException("Syntax error in $this->currFile: "
. $e->getMessage());
}
return $result;
} | php | {
"resource": ""
} |
q250934 | FormulaParser.getToken | validation | public function getToken($pId = 0)
{
if (isset($this->tokens[$pId])) {
return $this->tokens[$pId];
}
throw new Exception("Token with id $pId does not exist.");
} | php | {
"resource": ""
} |
q250935 | Html.canRead | validation | public function canRead($pFilename)
{
// Check if file exists
try {
$this->openFile($pFilename);
} catch (Exception $e) {
return false;
}
$beginning = $this->readBeginning();
$startWithTag = self::startsWithTag($beginning);
$containsTa... | php | {
"resource": ""
} |
q250936 | Html.applyInlineStyle | validation | private function applyInlineStyle(&$sheet, $row, $column, $attributeArray)
{
if (!isset($attributeArray['style'])) {
return;
}
$supported_styles = ['background-color', 'color'];
// add color styles (background & text) from dom element,currently support : td & th, using ... | php | {
"resource": ""
} |
q250937 | TransactionsService.createTransactions | validation | function createTransactions($transactions, $release = true, $ignoreInvalidEvents = false) {
$queryParameters = array(
'release' => ($release == true)?'true':'false',
'ignore_invalid_transactions' => ($ignoreInvalidEvents == true)?'true':'false'
);
$data = JSONSerializer::json_encode($transa... | php | {
"resource": ""
} |
q250938 | TransactionsService.findTransactionTypeByName | validation | function findTransactionTypeByName($type_name) {
//FIXME: more than 1000 transactions
$types = $this->getTransactionTypes(1, 1000)->getResult();
$type_name = mb_strtolower($type_name);
foreach($types as $type) {
if(strcmp(mb_strtolower($type->name), $type_name) == 0) {
return (int)$type->id;
}
}
... | php | {
"resource": ""
} |
q250939 | Client.html | validation | public function html($paragraphs = null)
{
$this->paragraphs = $paragraphs;
unset($this->params['plaintext']);
return $this->generate();
} | php | {
"resource": ""
} |
q250940 | Client.text | validation | public function text($paragraphs = null)
{
$this->paragraphs = $paragraphs;
$this->params['plaintext'] = true;
return $this->generate();
} | php | {
"resource": ""
} |
q250941 | Client.generate | validation | protected function generate()
{
$params = array_keys($this->params);
if ($this->paragraphs) {
$params[] = $this->paragraphs;
}
$url = self::API_URL . implode('/', $params);
return $this->conn->request($url);
} | php | {
"resource": ""
} |
q250942 | Workbook.addXfWriter | validation | public function addXfWriter(Style $style, $isStyleXf = false)
{
$xfWriter = new Xf($style);
$xfWriter->setIsStyleXf($isStyleXf);
// Add the font if not already added
$fontIndex = $this->addFont($style->getFont());
// Assign the font index to the xf record
$xfWriter-... | php | {
"resource": ""
} |
q250943 | Workbook.addFont | validation | public function addFont(\PhpOffice\PhpSpreadsheet\Style\Font $font)
{
$fontHashCode = $font->getHashCode();
if (isset($this->addedFonts[$fontHashCode])) {
$fontIndex = $this->addedFonts[$fontHashCode];
} else {
$countFonts = count($this->fontWriters);
$fon... | php | {
"resource": ""
} |
q250944 | Workbook.addColor | validation | private function addColor($rgb)
{
if (!isset($this->colors[$rgb])) {
$color =
[
hexdec(substr($rgb, 0, 2)),
hexdec(substr($rgb, 2, 2)),
hexdec(substr($rgb, 4)),
0,
];
$colo... | php | {
"resource": ""
} |
q250945 | Workbook.writeWorkbook | validation | public function writeWorkbook(array $pWorksheetSizes)
{
$this->worksheetSizes = $pWorksheetSizes;
// Calculate the number of selected worksheet tabs and call the finalization
// methods for each worksheet
$total_worksheets = $this->spreadsheet->getSheetCount();
// Add part ... | php | {
"resource": ""
} |
q250946 | Workbook.calcSheetOffsets | validation | private function calcSheetOffsets()
{
$boundsheet_length = 10; // fixed length for a BOUNDSHEET record
// size of Workbook globals part 1 + 3
$offset = $this->_datasize;
// add size of Workbook globals part 2, the length of the SHEET records
$total_worksheets = count($this-... | php | {
"resource": ""
} |
q250947 | Workbook.writeAllNumberFormats | validation | private function writeAllNumberFormats()
{
foreach ($this->numberFormats as $numberFormatIndex => $numberFormat) {
$this->writeNumberFormat($numberFormat->getFormatCode(), $numberFormatIndex);
}
} | php | {
"resource": ""
} |
q250948 | Workbook.writeDefinedNameBiff8 | validation | private function writeDefinedNameBiff8($name, $formulaData, $sheetIndex = 0, $isBuiltIn = false)
{
$record = 0x0018;
// option flags
$options = $isBuiltIn ? 0x20 : 0x00;
// length of the name, character count
$nlen = StringHelper::countCharacters($name);
// name wi... | php | {
"resource": ""
} |
q250949 | Workbook.writeShortNameBiff8 | validation | private function writeShortNameBiff8($name, $sheetIndex, $rangeBounds, $isHidden = false)
{
$record = 0x0018;
// option flags
$options = ($isHidden ? 0x21 : 0x00);
$extra = pack(
'Cvvvvv',
0x3B,
$sheetIndex - 1,
$rangeBounds[0][1] - 1... | php | {
"resource": ""
} |
q250950 | Workbook.writeCodepage | validation | private function writeCodepage()
{
$record = 0x0042; // Record identifier
$length = 0x0002; // Number of bytes to follow
$cv = $this->codepage; // The code page
$header = pack('vv', $record, $length);
$data = pack('v', $cv);
$this->append($header . $data);
} | php | {
"resource": ""
} |
q250951 | Workbook.writeWindow1 | validation | private function writeWindow1()
{
$record = 0x003D; // Record identifier
$length = 0x0012; // Number of bytes to follow
$xWn = 0x0000; // Horizontal position of window
$yWn = 0x0000; // Vertical position of window
$dxWn = 0x25BC; // Width of window
$dyWn = 0x1572; //... | php | {
"resource": ""
} |
q250952 | Workbook.writeBoundSheet | validation | private function writeBoundSheet($sheet, $offset)
{
$sheetname = $sheet->getTitle();
$record = 0x0085; // Record identifier
// sheet state
switch ($sheet->getSheetState()) {
case \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet::SHEETSTATE_VISIBLE:
$ss = 0x0... | php | {
"resource": ""
} |
q250953 | Workbook.writeSupbookInternal | validation | private function writeSupbookInternal()
{
$record = 0x01AE; // Record identifier
$length = 0x0004; // Bytes to follow
$header = pack('vv', $record, $length);
$data = pack('vv', $this->spreadsheet->getSheetCount(), 0x0401);
return $this->writeData($header . $data);
} | php | {
"resource": ""
} |
q250954 | Workbook.writeExternalsheetBiff8 | validation | private function writeExternalsheetBiff8()
{
$totalReferences = count($this->parser->references);
$record = 0x0017; // Record identifier
$length = 2 + 6 * $totalReferences; // Number of bytes to follow
$supbook_index = 0; // FIXME: only using internal SUPBOOK record
$header ... | php | {
"resource": ""
} |
q250955 | Workbook.writeStyle | validation | private function writeStyle()
{
$record = 0x0293; // Record identifier
$length = 0x0004; // Bytes to follow
$ixfe = 0x8000; // Index to cell style XF
$BuiltIn = 0x00; // Built-in style
$iLevel = 0xff; // Outline style level
$header = pack('vv', $record, $length);
... | php | {
"resource": ""
} |
q250956 | Workbook.writeNumberFormat | validation | private function writeNumberFormat($format, $ifmt)
{
$record = 0x041E; // Record identifier
$numberFormatString = StringHelper::UTF8toBIFF8UnicodeLong($format);
$length = 2 + strlen($numberFormatString); // Number of bytes to follow
$header = pack('vv', $record, $length);
$... | php | {
"resource": ""
} |
q250957 | Workbook.writeCountry | validation | private function writeCountry()
{
$record = 0x008C; // Record identifier
$length = 4; // Number of bytes to follow
$header = pack('vv', $record, $length);
// using the same country code always for simplicity
$data = pack('vv', $this->countryCode, $this->countryCode);
... | php | {
"resource": ""
} |
q250958 | Workbook.writeRecalcId | validation | private function writeRecalcId()
{
$record = 0x01C1; // Record identifier
$length = 8; // Number of bytes to follow
$header = pack('vv', $record, $length);
// by inspection of real Excel files, MS Office Excel 2007 writes this
$data = pack('VV', 0x000001C1, 0x00001E667);
... | php | {
"resource": ""
} |
q250959 | Workbook.writePalette | validation | private function writePalette()
{
$aref = $this->palette;
$record = 0x0092; // Record identifier
$length = 2 + 4 * count($aref); // Number of bytes to follow
$ccv = count($aref); // Number of RGB values to follow
$data = ''; // The RGB data
// Pack the RGB data
... | php | {
"resource": ""
} |
q250960 | Workbook.writeMsoDrawingGroup | validation | private function writeMsoDrawingGroup()
{
// write the Escher stream if necessary
if (isset($this->escher)) {
$writer = new Escher($this->escher);
$data = $writer->close();
$record = 0x00EB;
$length = strlen($data);
$header = pack('vv', $r... | php | {
"resource": ""
} |
q250961 | Workbook.setEscher | validation | public function setEscher(\PhpOffice\PhpSpreadsheet\Shared\Escher $pValue = null)
{
$this->escher = $pValue;
} | php | {
"resource": ""
} |
q250962 | Sample.getSamples | validation | public function getSamples()
{
// Populate samples
$baseDir = realpath(__DIR__ . '/../../../samples');
$directory = new RecursiveDirectoryIterator($baseDir);
$iterator = new RecursiveIteratorIterator($directory);
$regex = new RegexIterator($iterator, '/^.+\.php$/', RecursiveR... | php | {
"resource": ""
} |
q250963 | Sample.write | validation | public function write(Spreadsheet $spreadsheet, $filename, array $writers = ['Xlsx', 'Xls'])
{
// Set active sheet index to the first sheet, so Excel opens this as the first sheet
$spreadsheet->setActiveSheetIndex(0);
// Write documents
foreach ($writers as $writerType) {
... | php | {
"resource": ""
} |
q250964 | Sample.getTemporaryFolder | validation | private function getTemporaryFolder()
{
$tempFolder = sys_get_temp_dir() . '/phpspreadsheet';
if (!is_dir($tempFolder)) {
if (!mkdir($tempFolder) && !is_dir($tempFolder)) {
throw new \RuntimeException(sprintf('Directory "%s" was not created', $tempFolder));
}
... | php | {
"resource": ""
} |
q250965 | Sample.getFilename | validation | public function getFilename($filename, $extension = 'xlsx')
{
$originalExtension = pathinfo($filename, PATHINFO_EXTENSION);
return $this->getTemporaryFolder() . '/' . str_replace('.' . $originalExtension, '.' . $extension, basename($filename));
} | php | {
"resource": ""
} |
q250966 | Sample.getTemporaryFilename | validation | public function getTemporaryFilename($extension = 'xlsx')
{
$temporaryFilename = tempnam($this->getTemporaryFolder(), 'phpspreadsheet-');
unlink($temporaryFilename);
return $temporaryFilename . '.' . $extension;
} | php | {
"resource": ""
} |
q250967 | Sample.logWrite | validation | public function logWrite(IWriter $writer, $path, $callStartTime)
{
$callEndTime = microtime(true);
$callTime = $callEndTime - $callStartTime;
$reflection = new ReflectionClass($writer);
$format = $reflection->getShortName();
$message = "Write {$format} format to <code>{$path}... | php | {
"resource": ""
} |
q250968 | Sample.logRead | validation | public function logRead($format, $path, $callStartTime)
{
$callEndTime = microtime(true);
$callTime = $callEndTime - $callStartTime;
$message = "Read {$format} format from <code>{$path}</code> in " . sprintf('%.4f', $callTime) . ' seconds';
$this->log($message);
} | php | {
"resource": ""
} |
q250969 | Schedule.fromXML | validation | function fromXML($xmlElement) {
if (isset($xmlElement->minutes)) $this->minutes = $xmlElement->minutes;
if (isset($xmlElement->hours)) $this->hours = $xmlElement->hours;
if (isset($xmlElement->state)) $this->state = $xmlElement->state;
if (isset($xmlElement->date)) $this->date = $xmlElem... | php | {
"resource": ""
} |
q250970 | Schedule.toDateTime | validation | function toDateTime() {
return $this->date . " " . str_pad($this->hours, 2, '0', STR_PAD_LEFT) . ":" . str_pad($this->minutes, 2, '0', STR_PAD_LEFT);
} | php | {
"resource": ""
} |
q250971 | Office.setMaxParcelDimensions | validation | public function setMaxParcelDimensions($value = null)
{
if(is_array($value)) {
$value = new ParcelDimensions($value);
} elseif(!($value instanceof ParcelDimensions)) {
$value = null;
}
return $this->setParameter('max_parcel_dimensions', $value);
} | php | {
"resource": ""
} |
q250972 | Slk.canRead | validation | public function canRead($pFilename)
{
// Check if file exists
try {
$this->openFile($pFilename);
} catch (Exception $e) {
return false;
}
// Read sample data (first 2 KB will do)
$data = fread($this->fileHandle, 2048);
// Count delimi... | php | {
"resource": ""
} |
q250973 | Font.writeFont | validation | public function writeFont()
{
$font_outline = 0;
$font_shadow = 0;
$icv = $this->colorIndex; // Index to color palette
if ($this->font->getSuperscript()) {
$sss = 1;
} elseif ($this->font->getSubscript()) {
$sss = 2;
} else {
$sss ... | php | {
"resource": ""
} |
q250974 | Color.setARGB | validation | public function setARGB($pValue)
{
if ($pValue == '') {
$pValue = self::COLOR_BLACK;
}
if ($this->isSupervisor) {
$styleArray = $this->getStyleArray(['argb' => $pValue]);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleAr... | php | {
"resource": ""
} |
q250975 | Color.setRGB | validation | public function setRGB($pValue)
{
if ($pValue == '') {
$pValue = '000000';
}
if ($this->isSupervisor) {
$styleArray = $this->getStyleArray(['argb' => 'FF' . $pValue]);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray... | php | {
"resource": ""
} |
q250976 | Color.indexedColor | validation | public static function indexedColor($pIndex, $background = false)
{
// Clean parameter
$pIndex = (int) $pIndex;
// Indexed colors
if (self::$indexedColors === null) {
self::$indexedColors = [
1 => 'FF000000', // System Colour #1 - Black
2... | php | {
"resource": ""
} |
q250977 | BaseDrawing.setWorksheet | validation | public function setWorksheet(Worksheet $pValue = null, $pOverrideOld = false)
{
if ($this->worksheet === null) {
// Add drawing to \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet
$this->worksheet = $pValue;
$this->worksheet->getCell($this->coordinates);
$this->w... | php | {
"resource": ""
} |
q250978 | BaseDrawing.setWidth | validation | public function setWidth($pValue)
{
// Resize proportional?
if ($this->resizeProportional && $pValue != 0) {
$ratio = $this->height / ($this->width != 0 ? $this->width : 1);
$this->height = round($ratio * $pValue);
}
// Set width
$this->width = $pValu... | php | {
"resource": ""
} |
q250979 | PageSetup.setFitToHeight | validation | public function setFitToHeight($pValue, $pUpdate = true)
{
$this->fitToHeight = $pValue;
if ($pUpdate) {
$this->fitToPage = true;
}
return $this;
} | php | {
"resource": ""
} |
q250980 | PageSetup.setFitToWidth | validation | public function setFitToWidth($pValue, $pUpdate = true)
{
$this->fitToWidth = $pValue;
if ($pUpdate) {
$this->fitToPage = true;
}
return $this;
} | php | {
"resource": ""
} |
q250981 | PageSetup.getPrintArea | validation | public function getPrintArea($index = 0)
{
if ($index == 0) {
return $this->printArea;
}
$printAreas = explode(',', $this->printArea);
if (isset($printAreas[$index - 1])) {
return $printAreas[$index - 1];
}
throw new PhpSpreadsheetException('R... | php | {
"resource": ""
} |
q250982 | PageSetup.isPrintAreaSet | validation | public function isPrintAreaSet($index = 0)
{
if ($index == 0) {
return $this->printArea !== null;
}
$printAreas = explode(',', $this->printArea);
return isset($printAreas[$index - 1]);
} | php | {
"resource": ""
} |
q250983 | PageSetup.addPrintAreaByColumnAndRow | validation | public function addPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = -1)
{
return $this->setPrintArea(
Coordinate::stringFromColumnIndex($column1) . $row1 . ':' . Coordinate::stringFromColumnIndex($column2) . $row2,
$index,
self::SETPRINTRANGE_INSERT
... | php | {
"resource": ""
} |
q250984 | Address.setCountry | validation | public function setCountry($country)
{
if (!($country instanceof Country)) {
$country = new Country($country);
}
if ($country->isEmpty()) {
$this->invalidArguments('10001');
}
return $this->setParameter('country', $country);
} | php | {
"resource": ""
} |
q250985 | Address.setState | validation | public function setState($state)
{
if(!$state) {
return $this;
}
if (!($state instanceof State)) {
$state = new State($state);
}
if ($state->isEmpty()) {
$this->invalidArguments('10002');
}
return $this->setParameter('state'... | php | {
"resource": ""
} |
q250986 | Address.setCity | validation | public function setCity($city)
{
if (!($city instanceof City)) {
$city = new City($city);
}
if ($city->isEmpty()) {
$this->invalidArguments('10003');
}
return $this->setParameter('city', $city);
} | php | {
"resource": ""
} |
q250987 | Address.setQuarter | validation | public function setQuarter($quarter)
{
if(!$quarter) {
return $this;
}
if (!($quarter instanceof Quarter)) {
$quarter = new Quarter($quarter);
}
if ($quarter->isEmpty()) {
$this->invalidArguments('10005');
}
return $this->se... | php | {
"resource": ""
} |
q250988 | Address.setTimeZone | validation | public function setTimeZone($timezone)
{
if(!$timezone) {
return $this;
}
try {
Carbon::now($timezone);
} catch (\Exception $e) {
$this->invalidArguments('10004', sprintf('Invalid timezone set "%s"', $timezone));
}
return $this->set... | php | {
"resource": ""
} |
q250989 | Integration.checkOrderStatus | validation | public function checkOrderStatus( $orderId )
{
$function = 'CheckOrderStatus';
$parameters = [
'entityCode' => $this->connector->getEntityCode(),
'pedidoIDCliente' => $orderId
];
$response = $this->connector->doRequest( $function, $parameters );
... | php | {
"resource": ""
} |
q250990 | Root._calcSize | validation | public function _calcSize(&$raList)
{
// Calculate Basic Setting
list($iSBDcnt, $iBBcnt, $iPPScnt) = [0, 0, 0];
$iSmallLen = 0;
$iSBcnt = 0;
$iCount = count($raList);
for ($i = 0; $i < $iCount; ++$i) {
if ($raList[$i]->Type == OLE::OLE_PPS_TYPE_FILE) {
... | php | {
"resource": ""
} |
q250991 | Root._savePps | validation | public function _savePps(&$raList)
{
// Save each PPS WK
$iC = count($raList);
for ($i = 0; $i < $iC; ++$i) {
fwrite($this->fileHandle, $raList[$i]->_getPpsWk());
}
// Adjust for Block
$iCnt = count($raList);
$iBCnt = $this->bigBlockSize / OLE::OLE... | php | {
"resource": ""
} |
q250992 | Image.set_images | validation | public function set_images( $post_id ) {
if ( ! $post_id || is_null( $post_id ) ) {
return 0; }
update_post_meta( $post_id, 'custom_images_grifus', 'true' );
$count = 0;
$tmdb = 'image.tmdb.org';
$poster = get_post_meta( $post_id, 'poster_url', true );
if ( filter_var( $poster, FILTER_VALIDATE_URL ... | php | {
"resource": ""
} |
q250993 | Image.set_posts_to_review | validation | public function set_posts_to_review() {
$total_posts = wp_count_posts();
$total_posts = isset( $total_posts->publish ) ? $total_posts->publish : 0;
$posts = get_posts(
[
'post_type' => 'post',
'numberposts' => $total_posts,
'post_status' => 'publish',
]
);
foreach ( $posts as $post ) {
... | php | {
"resource": ""
} |
q250994 | File.sysGetTempDir | validation | public static function sysGetTempDir()
{
if (self::$useUploadTempDirectory) {
// use upload-directory when defined to allow running on environments having very restricted
// open_basedir configs
if (ini_get('upload_tmp_dir') !== false) {
if ($temp = ... | php | {
"resource": ""
} |
q250995 | File.assertFile | validation | public static function assertFile($filename)
{
if (!is_file($filename)) {
throw new InvalidArgumentException('File "' . $filename . '" does not exist.');
}
if (!is_readable($filename)) {
throw new InvalidArgumentException('Could not open "' . $filename . '" for readi... | php | {
"resource": ""
} |
q250996 | Assertion.a | validation | function a(string $type = ''): self {
return mb_strlen($type) ? $this->expect($this->target, isType($type)) : $this;
} | php | {
"resource": ""
} |
q250997 | Assertion.above | validation | function above($value): self {
$target = $this->hasFlag('length') ? $this->getLength($this->target) : $this->target;
return $this->expect($target, greaterThan($value));
} | php | {
"resource": ""
} |
q250998 | Assertion.below | validation | function below($value): self {
$target = $this->hasFlag('length') ? $this->getLength($this->target) : $this->target;
return $this->expect($target, lessThan($value));
} | php | {
"resource": ""
} |
q250999 | Assertion.closeTo | validation | function closeTo($value, float $delta): self {
return $this->expect($this->target, equalTo($value, $delta));
} | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.