Skip to content

Commit

Permalink
Cleanup and some small bugfixes
Browse files Browse the repository at this point in the history
- Args are now lower cased
- Methods mimicking go package are now capitalized to keep things more
  consistent
- Updated test cases for this
- Some misc cleanup, some more efficient array object testing and
  constructing in some models, probably missed some.
- Fixing KVClient::Acquire and Release methods
- Adding basic test for SessionClient and KVClient::Acquire and Release
  - KVClient tests need to be improved.
  • Loading branch information
dcarbone committed May 15, 2018
1 parent 983c115 commit 7c69b71
Show file tree
Hide file tree
Showing 60 changed files with 1,089 additions and 890 deletions.
3 changes: 3 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
<testsuite name="usage-operator">
<directory>./tests/Usage/Operator</directory>
</testsuite>
<testsuite name="usage-session">
<directory>./tests/Usage/Session</directory>
</testsuite>
</testsuites>

<filter>
Expand Down
36 changes: 18 additions & 18 deletions src/ACL/ACLEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ public function getCreateIndex(): int {
}

/**
* @param int $CreateIndex
* @param int $createIndex
*/
public function setCreateIndex(int $CreateIndex) {
$this->CreateIndex = $CreateIndex;
public function setCreateIndex(int $createIndex) {
$this->CreateIndex = $createIndex;
}

/**
Expand All @@ -58,10 +58,10 @@ public function getModifyIndex(): int {
}

/**
* @param int $ModifyIndex
* @param int $modifyIndex
*/
public function setModifyIndex(int $ModifyIndex) {
$this->ModifyIndex = $ModifyIndex;
public function setModifyIndex(int $modifyIndex) {
$this->ModifyIndex = $modifyIndex;
}

/**
Expand All @@ -72,10 +72,10 @@ public function getID(): string {
}

/**
* @param string $ID
* @param string $id
*/
public function setID(string $ID) {
$this->ID = $ID;
public function setID(string $id) {
$this->ID = $id;
}

/**
Expand All @@ -86,10 +86,10 @@ public function getName(): string {
}

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

/**
Expand All @@ -100,10 +100,10 @@ public function getType(): string {
}

/**
* @param string $Type
* @param string $type
*/
public function setType(string $Type) {
$this->Type = $Type;
public function setType(string $type) {
$this->Type = $type;
}

/**
Expand All @@ -114,9 +114,9 @@ public function getRules(): string {
}

/**
* @param string $Rules
* @param string $rules
*/
public function setRules(string $Rules) {
$this->Rules = $Rules;
public function setRules(string $rules) {
$this->Rules = $rules;
}
}
48 changes: 24 additions & 24 deletions src/Agent/AgentCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ public function getNode(): string {
}

/**
* @param string $Node
* @param string $node
* @return \DCarbone\PHPConsulAPI\Agent\AgentCheck
*/
public function setNode(string $Node): AgentCheck {
$this->Node = $Node;
public function setNode(string $node): AgentCheck {
$this->Node = $node;
return $this;
}

Expand All @@ -64,11 +64,11 @@ public function getCheckID(): string {
}

/**
* @param string $CheckID
* @param string $checkID
* @return \DCarbone\PHPConsulAPI\Agent\AgentCheck
*/
public function setCheckID(string $CheckID): AgentCheck {
$this->CheckID = $CheckID;
public function setCheckID(string $checkID): AgentCheck {
$this->CheckID = $checkID;
return $this;
}

Expand All @@ -80,11 +80,11 @@ public function getName(): string {
}

/**
* @param string $Name
* @param string $name
* @return \DCarbone\PHPConsulAPI\Agent\AgentCheck
*/
public function setName(string $Name): AgentCheck {
$this->Name = $Name;
public function setName(string $name): AgentCheck {
$this->Name = $name;
return $this;
}

Expand All @@ -96,11 +96,11 @@ public function getStatus(): string {
}

/**
* @param string $Status
* @param string $status
* @return \DCarbone\PHPConsulAPI\Agent\AgentCheck
*/
public function setStatus(string $Status): AgentCheck {
$this->Status = $Status;
public function setStatus(string $status): AgentCheck {
$this->Status = $status;
return $this;
}

Expand All @@ -112,11 +112,11 @@ public function getNotes(): string {
}

/**
* @param string $Notes
* @param string $notes
* @return \DCarbone\PHPConsulAPI\Agent\AgentCheck
*/
public function setNotes(string $Notes): AgentCheck {
$this->Notes = $Notes;
public function setNotes(string $notes): AgentCheck {
$this->Notes = $notes;
return $this;
}

Expand All @@ -128,11 +128,11 @@ public function getOutput(): string {
}

/**
* @param string $Output
* @param string $output
* @return \DCarbone\PHPConsulAPI\Agent\AgentCheck
*/
public function setOutput(string $Output): AgentCheck {
$this->Output = $Output;
public function setOutput(string $output): AgentCheck {
$this->Output = $output;
return $this;
}

Expand All @@ -144,11 +144,11 @@ public function getServiceID(): string {
}

/**
* @param string $ServiceID
* @param string $serviceID
* @return \DCarbone\PHPConsulAPI\Agent\AgentCheck
*/
public function setServiceID(string $ServiceID): AgentCheck {
$this->ServiceID = $ServiceID;
public function setServiceID(string $serviceID): AgentCheck {
$this->ServiceID = $serviceID;
return $this;
}

Expand All @@ -160,11 +160,11 @@ public function getServiceName(): string {
}

/**
* @param string $ServiceName
* @param string $serviceName
* @return \DCarbone\PHPConsulAPI\Agent\AgentCheck
*/
public function setServiceName(string $ServiceName): AgentCheck {
$this->ServiceName = $ServiceName;
public function setServiceName(string $serviceName): AgentCheck {
$this->ServiceName = $serviceName;
return $this;
}

Expand Down
30 changes: 6 additions & 24 deletions src/Agent/AgentCheckRegistration.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ class AgentCheckRegistration extends AgentServiceCheck {
/** @var string */
public $ID = '';
/** @var string */
public $Name = '';
/** @var string */
public $ServiceID = '';

/**
Expand All @@ -36,27 +34,11 @@ public function getID(): string {
}

/**
* @param string $ID
* @return \DCarbone\PHPConsulAPI\Agent\AgentCheckRegistration
*/
public function setID(string $ID): AgentCheckRegistration {
$this->ID = $ID;
return $this;
}

/**
* @return string
*/
public function getName(): string {
return $this->Name;
}

/**
* @param string $Name
* @param string $id
* @return \DCarbone\PHPConsulAPI\Agent\AgentCheckRegistration
*/
public function setName(string $Name): AgentCheckRegistration {
$this->Name = $Name;
public function setID(string $id): AgentCheckRegistration {
$this->ID = $id;
return $this;
}

Expand All @@ -68,11 +50,11 @@ public function getServiceID(): string {
}

/**
* @param string $ServiceID
* @param string $serviceID
* @return \DCarbone\PHPConsulAPI\Agent\AgentCheckRegistration
*/
public function setServiceID(string $ServiceID): AgentCheckRegistration {
$this->ServiceID = $ServiceID;
public function setServiceID(string $serviceID): AgentCheckRegistration {
$this->ServiceID = $serviceID;
return $this;
}

Expand Down
12 changes: 6 additions & 6 deletions src/Agent/AgentCheckUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ public function getStatus(): string {
}

/**
* @param string $Status
* @param string $status
* @return \DCarbone\PHPConsulAPI\Agent\AgentCheckUpdate
*/
public function setStatus(string $Status): AgentCheckUpdate {
$this->Status = $Status;
public function setStatus(string $status): AgentCheckUpdate {
$this->Status = $status;
return $this;
}

Expand All @@ -52,11 +52,11 @@ public function getOutput(): string {
}

/**
* @param string $Output
* @param string $output
* @return \DCarbone\PHPConsulAPI\Agent\AgentCheckUpdate
*/
public function setOutput(string $Output): AgentCheckUpdate {
$this->Output = $Output;
public function setOutput(string $output): AgentCheckUpdate {
$this->Output = $output;
return $this;
}
}
Loading

0 comments on commit 7c69b71

Please sign in to comment.