Skip to content

Commit

Permalink
Normalise const convention
Browse files Browse the repository at this point in the history
  • Loading branch information
PineappleIOnic committed Jun 21, 2023
1 parent 38d1235 commit 16c6c50
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 36 deletions.
42 changes: 21 additions & 21 deletions src/Transfer/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,55 +4,55 @@

abstract class Resource
{
public const STATUS_PENDING = 'PENDING';
public const STATUS_PENDING = 'pending';

public const STATUS_SUCCESS = 'SUCCESS';
public const STATUS_SUCCESS = 'success';

public const STATUS_ERROR = 'ERROR';
public const STATUS_ERROR = 'error';

public const STATUS_SKIPPED = 'SKIP';
public const STATUS_SKIPPED = 'skip';

public const STATUS_PROCESSING = 'PROCESSING';
public const STATUS_PROCESSING = 'processing';

public const STATUS_WARNING = 'WARNING';
public const STATUS_WARNING = 'warning';

/**
* For some transfers (namely Firebase) we have to keep resources in cache that do not necessarily need to be Transferred
* This status is used to mark resources that are not going to be transferred but are still needed for the transfer to work
* e.g Documents are required for Database transfers because of schema tracing in firebase
*/
public const STATUS_DISREGARDED = 'DISREGARDED';
public const STATUS_DISREGARDED = 'disregarded';

// Master Resources
public const TYPE_BUCKET = 'Bucket';
public const TYPE_BUCKET = 'bucket';

public const TYPE_COLLECTION = 'Collection';
public const TYPE_COLLECTION = 'collection';

public const TYPE_DATABASE = 'Database';
public const TYPE_DATABASE = 'database';

public const TYPE_DOCUMENT = 'Document';
public const TYPE_DOCUMENT = 'document';

public const TYPE_FILE = 'File';
public const TYPE_FILE = 'file';

public const TYPE_USER = 'User';
public const TYPE_USER = 'user';

public const TYPE_TEAM = 'Team';
public const TYPE_TEAM = 'team';

public const TYPE_MEMBERSHIP = 'Membership';
public const TYPE_MEMBERSHIP = 'membership';

public const TYPE_FUNCTION = 'Function';
public const TYPE_FUNCTION = 'function';

// Children (Resources that are created by other resources)

public const TYPE_ATTRIBUTE = 'Attribute';
public const TYPE_ATTRIBUTE = 'attribute';

public const TYPE_DEPLOYMENT = 'Deployment';
public const TYPE_DEPLOYMENT = 'deployment';

public const TYPE_HASH = 'Hash';
public const TYPE_HASH = 'hash';

public const TYPE_INDEX = 'Index';
public const TYPE_INDEX = 'index';

public const TYPE_ENVVAR = 'EnvVar';
public const TYPE_ENVVAR = 'envvar';

public const ALL_RESOURCES = [
self::TYPE_ATTRIBUTE,
Expand Down
18 changes: 9 additions & 9 deletions src/Transfer/Resources/Auth/Hash.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@
*/
class Hash extends Resource
{
public const SCRYPT_MODIFIED = 'ScryptModified';
public const ALGORITHM_SCRYPT_MODIFIED = 'scryptModified';

public const BCRYPT = 'Bcrypt';
public const ALGORITHM_BCRYPT = 'bcrypt';

public const MD5 = 'MD5';
public const ALGORITHM_MD5 = 'md5';

public const ARGON2 = 'Argon2';
public const ALGORITHM_ARGON2 = 'argon2';

public const SHA256 = 'SHA256';
public const ALGORITHM_SHA256 = 'sha256';

public const PHPASS = 'PHPass';
public const ALGORITHM_PHPASS = 'phpass';

public const SCRYPT = 'Scrypt';
public const ALGORITHM_SCRYPT = 'scrypt';

public const PLAINTEXT = 'PlainText';
public const ALGORITHM_PLAINTEXT = 'plainText';

private string $hash;

private string $salt = '';

private string $algorithm = self::SHA256;
private string $algorithm = self::ALGORITHM_SHA256;

private string $separator = '';

Expand Down
12 changes: 6 additions & 6 deletions src/Transfer/Transfer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

class Transfer
{
public const GROUP_GENERAL = 'General';
public const GROUP_GENERAL = 'general';

public const GROUP_AUTH = 'Auth';
public const GROUP_AUTH = 'auth';

public const GROUP_STORAGE = 'Storage';
public const GROUP_STORAGE = 'storage';

public const GROUP_FUNCTIONS = 'Functions';
public const GROUP_FUNCTIONS = 'functions';

public const GROUP_DATABASES = 'Databases';
public const GROUP_DATABASES = 'databases';

public const GROUP_SETTINGS = 'Settings';
public const GROUP_SETTINGS = 'settings';

public const GROUP_AUTH_RESOURCES = [Resource::TYPE_USER, Resource::TYPE_TEAM, Resource::TYPE_MEMBERSHIP, Resource::TYPE_HASH];

Expand Down

0 comments on commit 16c6c50

Please sign in to comment.