Skip to content

Commit 9437dda

Browse files
Merge pull request #17761 from kamil-tekiela/indent
Fix indentation
2 parents 23995b3 + 99fb81b commit 9437dda

1 file changed

Lines changed: 44 additions & 44 deletions

File tree

libraries/classes/FieldMetadata.php

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -227,50 +227,50 @@ final class FieldMetadata
227227

228228
public function __construct(int $fieldType, int $fieldFlags, object $field)
229229
{
230-
$this->mappedType = $this->getTypeMap()[$fieldType] ?? null;
231-
232-
$this->isMultipleKey = (bool) ($fieldFlags & MYSQLI_MULTIPLE_KEY_FLAG);
233-
$this->isPrimaryKey = (bool) ($fieldFlags & MYSQLI_PRI_KEY_FLAG);
234-
$this->isUniqueKey = (bool) ($fieldFlags & MYSQLI_UNIQUE_KEY_FLAG);
235-
$this->isNotNull = (bool) ($fieldFlags & MYSQLI_NOT_NULL_FLAG);
236-
$this->isUnsigned = (bool) ($fieldFlags & MYSQLI_UNSIGNED_FLAG);
237-
$this->isZerofill = (bool) ($fieldFlags & MYSQLI_ZEROFILL_FLAG);
238-
239-
// as flags 32768 can be NUM_FLAG or GROUP_FLAG
240-
// reference: https://www.php.net/manual/en/mysqli-result.fetch-fields.php
241-
// so check field type instead of flags
242-
// but if no or unknown field type then check flags
243-
$this->isNumeric = $this->isType(self::TYPE_INT)
244-
|| ($fieldType <= 0 && ($fieldFlags & MYSQLI_NUM_FLAG));
245-
246-
$this->isBlob = (bool) ($fieldFlags & MYSQLI_BLOB_FLAG);
247-
$this->isEnum = (bool) ($fieldFlags & MYSQLI_ENUM_FLAG);
248-
$this->isSet = (bool) ($fieldFlags & MYSQLI_SET_FLAG);
249-
250-
/*
251-
MYSQLI_PART_KEY_FLAG => 'part_key',
252-
MYSQLI_TIMESTAMP_FLAG => 'timestamp',
253-
MYSQLI_AUTO_INCREMENT_FLAG => 'auto_increment',
254-
*/
255-
256-
$this->isMappedTypeBit = $this->isType(self::TYPE_BIT);
257-
$this->isMappedTypeGeometry = $this->isType(self::TYPE_GEOMETRY);
258-
$this->isMappedTypeTimestamp = $this->isType(self::TYPE_TIMESTAMP);
259-
260-
$this->name = property_exists($field, 'name') ? $field->name : '';
261-
$this->orgname = property_exists($field, 'orgname') ? $field->orgname : '';
262-
$this->table = property_exists($field, 'table') ? $field->table : '';
263-
$this->orgtable = property_exists($field, 'orgtable') ? $field->orgtable : '';
264-
$this->charsetnr = property_exists($field, 'charsetnr') ? $field->charsetnr : -1;
265-
$this->decimals = property_exists($field, 'decimals') ? $field->decimals : 0;
266-
$this->length = property_exists($field, 'length') ? $field->length : 0;
267-
268-
// 63 is the number for the MySQL charset "binary"
269-
$this->isBinary = (
270-
$fieldType === MYSQLI_TYPE_TINY_BLOB || $fieldType === MYSQLI_TYPE_BLOB
271-
|| $fieldType === MYSQLI_TYPE_MEDIUM_BLOB || $fieldType === MYSQLI_TYPE_LONG_BLOB
272-
|| $fieldType === MYSQLI_TYPE_VAR_STRING || $fieldType === MYSQLI_TYPE_STRING
273-
) && $this->charsetnr == 63;
230+
$this->mappedType = $this->getTypeMap()[$fieldType] ?? null;
231+
232+
$this->isMultipleKey = (bool) ($fieldFlags & MYSQLI_MULTIPLE_KEY_FLAG);
233+
$this->isPrimaryKey = (bool) ($fieldFlags & MYSQLI_PRI_KEY_FLAG);
234+
$this->isUniqueKey = (bool) ($fieldFlags & MYSQLI_UNIQUE_KEY_FLAG);
235+
$this->isNotNull = (bool) ($fieldFlags & MYSQLI_NOT_NULL_FLAG);
236+
$this->isUnsigned = (bool) ($fieldFlags & MYSQLI_UNSIGNED_FLAG);
237+
$this->isZerofill = (bool) ($fieldFlags & MYSQLI_ZEROFILL_FLAG);
238+
239+
// as flags 32768 can be NUM_FLAG or GROUP_FLAG
240+
// reference: https://www.php.net/manual/en/mysqli-result.fetch-fields.php
241+
// so check field type instead of flags
242+
// but if no or unknown field type then check flags
243+
$this->isNumeric = $this->isType(self::TYPE_INT)
244+
|| ($fieldType <= 0 && ($fieldFlags & MYSQLI_NUM_FLAG));
245+
246+
$this->isBlob = (bool) ($fieldFlags & MYSQLI_BLOB_FLAG);
247+
$this->isEnum = (bool) ($fieldFlags & MYSQLI_ENUM_FLAG);
248+
$this->isSet = (bool) ($fieldFlags & MYSQLI_SET_FLAG);
249+
250+
/*
251+
MYSQLI_PART_KEY_FLAG => 'part_key',
252+
MYSQLI_TIMESTAMP_FLAG => 'timestamp',
253+
MYSQLI_AUTO_INCREMENT_FLAG => 'auto_increment',
254+
*/
255+
256+
$this->isMappedTypeBit = $this->isType(self::TYPE_BIT);
257+
$this->isMappedTypeGeometry = $this->isType(self::TYPE_GEOMETRY);
258+
$this->isMappedTypeTimestamp = $this->isType(self::TYPE_TIMESTAMP);
259+
260+
$this->name = property_exists($field, 'name') ? $field->name : '';
261+
$this->orgname = property_exists($field, 'orgname') ? $field->orgname : '';
262+
$this->table = property_exists($field, 'table') ? $field->table : '';
263+
$this->orgtable = property_exists($field, 'orgtable') ? $field->orgtable : '';
264+
$this->charsetnr = property_exists($field, 'charsetnr') ? $field->charsetnr : -1;
265+
$this->decimals = property_exists($field, 'decimals') ? $field->decimals : 0;
266+
$this->length = property_exists($field, 'length') ? $field->length : 0;
267+
268+
// 63 is the number for the MySQL charset "binary"
269+
$this->isBinary = (
270+
$fieldType === MYSQLI_TYPE_TINY_BLOB || $fieldType === MYSQLI_TYPE_BLOB
271+
|| $fieldType === MYSQLI_TYPE_MEDIUM_BLOB || $fieldType === MYSQLI_TYPE_LONG_BLOB
272+
|| $fieldType === MYSQLI_TYPE_VAR_STRING || $fieldType === MYSQLI_TYPE_STRING
273+
) && $this->charsetnr == 63;
274274
}
275275

276276
/**

0 commit comments

Comments
 (0)