mirror of
https://github.com/sitelease/sugar-cube-client.git
synced 2025-11-01 12:32:29 +01:00
Using camelcase instead of all caps for constants
This commit is contained in:
@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## Version [0.3.0](https://github.com/sab-international/gitea.php/compare/v0.2.0...v0.3.0)
|
||||||
|
- Breaking change: removed `__toString()` methods from the model classes.
|
||||||
|
- Breaking change: using camelcase instead of all caps for constants.
|
||||||
|
- Modified the package layout.
|
||||||
|
- Updated the package dependencies.
|
||||||
|
|
||||||
## Version [0.2.0](https://github.com/sab-international/gitea.php/compare/v0.1.1...v0.2.0)
|
## Version [0.2.0](https://github.com/sab-international/gitea.php/compare/v0.1.1...v0.2.0)
|
||||||
- Added `__toString()` methods to the model classes.
|
- Added `__toString()` methods to the model classes.
|
||||||
- Added the `TrackedTime` model.
|
- Added the `TrackedTime` model.
|
||||||
|
|||||||
@ -8,17 +8,17 @@ final class StatusState {
|
|||||||
use EnumTrait;
|
use EnumTrait;
|
||||||
|
|
||||||
/** @var string The status is an error. */
|
/** @var string The status is an error. */
|
||||||
const ERROR = 'error';
|
const error = 'error';
|
||||||
|
|
||||||
/** @var string The status is a failure. */
|
/** @var string The status is a failure. */
|
||||||
const FAILURE = 'failure';
|
const failure = 'failure';
|
||||||
|
|
||||||
/** @var string The status is pending. */
|
/** @var string The status is pending. */
|
||||||
const PENDING = 'pending';
|
const pending = 'pending';
|
||||||
|
|
||||||
/** @var string The status is a success. */
|
/** @var string The status is a success. */
|
||||||
const SUCCESS = 'success';
|
const success = 'success';
|
||||||
|
|
||||||
/** @var string The status is a warning. */
|
/** @var string The status is a warning. */
|
||||||
const WARNING = 'warning';
|
const warning = 'warning';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,7 @@ class Team implements \JsonSerializable {
|
|||||||
private $name;
|
private $name;
|
||||||
|
|
||||||
/** @var string The team permission. */
|
/** @var string The team permission. */
|
||||||
private $permission = TeamPermission::NONE;
|
private $permission = TeamPermission::none;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new team.
|
* Creates a new team.
|
||||||
@ -34,7 +34,7 @@ class Team implements \JsonSerializable {
|
|||||||
static function fromJson(object $map): self {
|
static function fromJson(object $map): self {
|
||||||
return (new static(isset($map->id) && is_int($map->id) ? $map->id : -1, isset($map->name) && is_string($map->name) ? $map->name : ''))
|
return (new static(isset($map->id) && is_int($map->id) ? $map->id : -1, isset($map->name) && is_string($map->name) ? $map->name : ''))
|
||||||
->setDescription(isset($map->description) && is_string($map->description) ? $map->description : '')
|
->setDescription(isset($map->description) && is_string($map->description) ? $map->description : '')
|
||||||
->setPermission(isset($map->permission) && is_string($map->permission) ? $map->permission : TeamPermission::NONE);
|
->setPermission(isset($map->permission) && is_string($map->permission) ? $map->permission : TeamPermission::none);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -108,7 +108,7 @@ class Team implements \JsonSerializable {
|
|||||||
* @return $this This instance.
|
* @return $this This instance.
|
||||||
*/
|
*/
|
||||||
function setPermission(string $value): self {
|
function setPermission(string $value): self {
|
||||||
$this->permission = TeamPermission::coerce($value, TeamPermission::NONE);
|
$this->permission = TeamPermission::coerce($value, TeamPermission::none);
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,17 +8,17 @@ final class TeamPermission {
|
|||||||
use EnumTrait;
|
use EnumTrait;
|
||||||
|
|
||||||
/** @var string The team has the administrator permission. */
|
/** @var string The team has the administrator permission. */
|
||||||
const ADMIN = 'admin';
|
const admin = 'admin';
|
||||||
|
|
||||||
/** @var string The team doesn't have any permission. */
|
/** @var string The team doesn't have any permission. */
|
||||||
const NONE = 'none';
|
const none = 'none';
|
||||||
|
|
||||||
/** @var string The team has the owner permission. */
|
/** @var string The team has the owner permission. */
|
||||||
const OWNER = 'owner';
|
const owner = 'owner';
|
||||||
|
|
||||||
/** @var string The team has the read permission. */
|
/** @var string The team has the read permission. */
|
||||||
const READ = 'read';
|
const read = 'read';
|
||||||
|
|
||||||
/** @var string The team has the write permission. */
|
/** @var string The team has the write permission. */
|
||||||
const WRITE = 'write';
|
const write = 'write';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user