Skip to content

Commit

Permalink
Merge branch 'phpdoc-improvements' into 'master'
Browse files Browse the repository at this point in the history
Improved php doc

See merge request transip/restapi-php-library!161
  • Loading branch information
samihsoylu committed Dec 23, 2021
2 parents 8ded616 + 735d6eb commit 5d42430
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 38 deletions.
39 changes: 15 additions & 24 deletions src/Entity/OpenStackProject.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,37 @@
class OpenStackProject extends AbstractEntity
{
/**
* @description Identifier
* @example `7a7a3bcb46c6450f95c53edb8dcebc7b`
* @type string
* @readonly
* Identifier
*
* @var string
*/
protected $id;

/**
* @description Name of the project
* @example `hosting101-datacenter`
* @type string
* Name of the project
*
* @var string
*/
protected $name;

/**
* @description Describes this project
* @example This is an example project
* @type string
* Describes this project
*
* @var string
*/
protected $description;

/**
* @description When an ongoing process blocks the project from being modified, this is set to `true`
* @example false
* @type boolean
* @readonly
* When an ongoing process blocks the project from being modified, this is set to `true`
*
* @var bool
*/
protected $isLocked;

/**
* @description Set to `true` when a project has been administratively blocked
* @example false
* @type boolean
* @readonly
* Set to `true` when a project has been administratively blocked
*
* @var bool
*/
protected $isBlocked;

Expand Down Expand Up @@ -67,17 +64,11 @@ public function isBlocked(): bool
return $this->isBlocked;
}

/**
* @param string $name
*/
public function setName(string $name): void
{
$this->name = $name;
}

/**
* @param string $description
*/
public function setDescription(string $description): void
{
$this->description = $description;
Expand Down
19 changes: 9 additions & 10 deletions src/Entity/OpenStackUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,23 @@ class OpenStackUser extends AbstractEntity
protected $id;

/**
* @description Login name
* @example `hosting101-support`
* @readonly
* @type string
* Login name
*
* @var string
*/
protected $username;

/**
* @description Description
* @example `Supporter account`
* @type string
* Description
*
* @var string
*/
protected $description;

/**
* @description Email address
* @example `[email protected]`
* @type string
* Email address
*
* @var string
*/
protected $email;

Expand Down
4 changes: 2 additions & 2 deletions src/Repository/OpenStack/ProjectRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ProjectRepository extends ApiRepository
{
public const RESOURCE_NAME = 'openstack/projects';

public const RESOURCE_PARAMETER_SINGUlAR = 'project';
public const RESOURCE_PARAMETER_SINGULAR = 'project';
public const RESOURCE_PARAMETER_PLURAL = 'projects';

protected function getRepositoryResourceNames(): array
Expand Down Expand Up @@ -49,7 +49,7 @@ public function create(string $name, string $description): void
public function getByProjectId(string $projectId): OpenStackProject
{
$response = $this->httpClient->get($this->getResourceUrl($projectId));
$projectArray = $this->getParameterFromResponse($response, self::RESOURCE_PARAMETER_SINGUlAR);
$projectArray = $this->getParameterFromResponse($response, self::RESOURCE_PARAMETER_SINGULAR);

return new OpenStackProject($projectArray);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Repository/OpenStack/UserRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class UserRepository extends ApiRepository
{
public const RESOURCE_NAME = 'openstack/users';

public const RESOURCE_PARAMETER_SINGUlAR = 'user';
public const RESOURCE_PARAMETER_SINGULAR = 'user';
public const RESOURCE_PARAMETER_PLURAL = 'users';

protected function getRepositoryResourceNames(): array
Expand All @@ -36,7 +36,7 @@ public function getAll(): array
public function getByUserId(string $userId): OpenStackUser
{
$response = $this->httpClient->get($this->getResourceUrl($userId));
$userArray = $this->getParameterFromResponse($response, self::RESOURCE_PARAMETER_SINGUlAR);
$userArray = $this->getParameterFromResponse($response, self::RESOURCE_PARAMETER_SINGULAR);

return new OpenStackUser($userArray);
}
Expand Down

0 comments on commit 5d42430

Please sign in to comment.