Skip to content

Commit

Permalink
Client - fixed property names with small fixies
Browse files Browse the repository at this point in the history
  • Loading branch information
pekral committed May 31, 2020
1 parent 8b87538 commit 1d6836b
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 65 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ $companyCode,
$restApiUserName,
$restApiPassword,
$evidenceName,
$enableSelfSignedCertificate,
$disableSelfSignedCertificate,
$authSessionId,
$logPath,
);
```
`$enableSelfSignedCertificate - Vyžadání self signed certifikátu`
`$disableSelfSignedCertificate - Vypnutí self signed certifikátu`

`$authSessionId - Hodnota authentikačního id pro Flexibee`

Expand Down
4 changes: 2 additions & 2 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(
string $user,
string $password,
string $evidence,
bool $selfSignedCertificate,
bool $disableSelfSignedCertificate,
?string $authSessionId = null,
?string $logFilePath = null
)
Expand All @@ -38,7 +38,7 @@ public function __construct(
$user,
$password,
$evidence,
$selfSignedCertificate,
$disableSelfSignedCertificate,
$authSessionId,
$logFilePath,
);
Expand Down
2 changes: 1 addition & 1 deletion src/CompanyClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function __construct(Config $config)
$config->getUser(),
$config->getPassword(),
self::EVIDENCE,
$config->isSelfSignedCertificate(),
$config->isDisableSelfSignedCertificate(),
$config->getAuthSessionId(),
);
}
Expand Down
17 changes: 5 additions & 12 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,12 @@ final class Config
{

private string $url;

private string $company;

private string $user;

private string $password;

private string $evidence;

private bool $selfSignedCertificate;

private bool $disableSelfSignedCertificate;
private ?string $authSessionId;

private ?string $logFilePath;

public function __construct(
Expand All @@ -27,7 +20,7 @@ public function __construct(
string $user,
string $password,
string $evidence,
bool $selfSignedCertificate,
bool $disableSelfSignedCertificate,
?string $authSessionId = null,
?string $logFilePath = null
)
Expand All @@ -37,7 +30,7 @@ public function __construct(
$this->user = $user;
$this->password = $password;
$this->evidence = $evidence;
$this->selfSignedCertificate = $selfSignedCertificate;
$this->disableSelfSignedCertificate = $disableSelfSignedCertificate;
$this->authSessionId = $authSessionId;
$this->logFilePath = $logFilePath;
}
Expand Down Expand Up @@ -67,9 +60,9 @@ public function getEvidence(): string
return $this->evidence;
}

public function isSelfSignedCertificate(): bool
public function isDisableSelfSignedCertificate(): bool
{
return $this->selfSignedCertificate;
return $this->disableSelfSignedCertificate;
}

public function getAuthSessionId(): ?string
Expand Down
1 change: 0 additions & 1 deletion src/Http/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ final class HttpClient
{

private \EcomailFlexibee\Http\UrlNormalizer $urlNormalizer;

private \EcomailFlexibee\Http\HttpCurlBuilder $httpCurlBuilder;

public function __construct() {
Expand Down
2 changes: 1 addition & 1 deletion src/Http/HttpCurlBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function build(string $url, Method $httpMethod, array $postFields, array
\curl_setopt($ch, \CURLOPT_CUSTOMREQUEST, $httpMethod->getValue());
\curl_setopt($ch, \CURLOPT_USERAGENT, 'Ecomail.cz Flexibee client (https://github.com/Ecomailcz/flexibee-client)');

if ($config->isSelfSignedCertificate() || $config->getAuthSessionId() !== null) {
if ($config->isDisableSelfSignedCertificate() || $config->getAuthSessionId() !== null) {
\curl_setopt($ch, \CURLOPT_SSL_VERIFYPEER, FALSE);
\curl_setopt($ch, \CURLOPT_SSL_VERIFYHOST, FALSE);
}
Expand Down
46 changes: 0 additions & 46 deletions tests/CompanyClientTest.php

This file was deleted.

0 comments on commit 1d6836b

Please sign in to comment.