1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-12 00:26:13 +01:00
phorge-phorge/src/applications/settings/storage/PhabricatorUserSSHKey.php
epriestley 03519c53bb Mark questionable column nullability for later
Summary:
Ref T1191. Ref T6203. While generating expected schemata, I ran into these columns which seem to have sketchy nullability.

  - Mark most of them for later resolution (T6203). They work fine today and don't need to block T1191. Changing them can break the application, so we can't autofix them.
  - Forgive a couple of them that are sort-of reasonable or going to get wiped out.

Test Plan: Saw 94 remaining warnings.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: hach-que, epriestley

Maniphest Tasks: T1191, T6203

Differential Revision: https://secure.phabricator.com/D10593
2014-10-01 07:59:44 -07:00

45 lines
1 KiB
PHP

<?php
final class PhabricatorUserSSHKey extends PhabricatorUserDAO {
protected $userPHID;
protected $name;
protected $keyType;
protected $keyBody;
protected $keyHash;
protected $keyComment;
public function getConfiguration() {
return array(
self::CONFIG_COLUMN_SCHEMA => array(
'keyHash' => 'bytes32',
'keyComment' => 'text255?',
// T6203/NULLABILITY
// These seem like they should not be nullable.
'name' => 'text255?',
'keyType' => 'text255?',
'keyBody' => 'text?',
),
self::CONFIG_KEY_SCHEMA => array(
'userPHID' => array(
'columns' => array('userPHID'),
),
'keyHash' => array(
'columns' => array('keyHash'),
'unique' => true,
),
),
) + parent::getConfiguration();
}
public function getEntireKey() {
$parts = array(
$this->getKeyType(),
$this->getKeyBody(),
$this->getKeyComment(),
);
return trim(implode(' ', $parts));
}
}