Skip to content

Commit cf46b45

Browse files
committed
Code cosmetics: Remove docblocks that don't add value
1 parent cc2b9cd commit cf46b45

File tree

2 files changed

+1
-113
lines changed

2 files changed

+1
-113
lines changed

src/AssetsClient.php

Lines changed: 1 addition & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -65,59 +65,37 @@ public function __construct(
6565
}
6666

6767

68-
/**
69-
* @param bool $allowReLogin
70-
* @return self
71-
*/
7268
public function setAllowReLogin(bool $allowReLogin): self
7369
{
7470
$this->allowReLogin = $allowReLogin;
7571
return $this;
7672
}
7773

7874

79-
/**
80-
* @param int $authMethod
81-
*/
8275
public function setAuthMethod(int $authMethod): void
8376
{
8477
$this->authMethod = $authMethod;
8578
}
8679

8780

88-
/**
89-
* @return int
90-
*/
9181
public function getRequestTimeout(): int
9282
{
9383
return $this->requestTimeout;
9484
}
9585

9686

97-
/**
98-
* @param int $seconds
99-
* @return self
100-
*/
10187
public function setRequestTimeout(int $seconds): self
10288
{
10389
$this->requestTimeout = max($seconds, 1);
10490
return $this;
10591
}
10692

10793

108-
/**
109-
* @param string $method
110-
* @param string $url
111-
* @param array $data
112-
* @param bool $multipart - whether to send the data as multipart or application/json
113-
* @param bool $sendToken
114-
* @return ResponseInterface
115-
*/
11694
public function request(
11795
string $method,
11896
string $url,
11997
array $data = [],
120-
bool $multipart = true,
98+
bool $multipart = true, // Whether to send the data as multipart or application/json
12199
bool $sendToken = true
122100
): ResponseInterface {
123101
$options = [
@@ -256,13 +234,6 @@ public function serviceRequest(
256234
}
257235

258236

259-
/**
260-
* @param string $method
261-
* @param string $urlPath
262-
* @param array $data
263-
* @return array
264-
* @throws JsonException
265-
*/
266237
public function apiRequest(string $method, string $urlPath, array $data = []): array
267238
{
268239
$url = sprintf(
@@ -311,12 +282,6 @@ public function apiRequest(string $method, string $urlPath, array $data = []): a
311282
}
312283

313284

314-
/**
315-
* @param string $method
316-
* @param string $urlPath
317-
* @param array $data
318-
* @return ResponseInterface
319-
*/
320285
public function privateApiRequest(string $method, string $urlPath, array $data = []): ResponseInterface
321286
{
322287
$url = sprintf(
@@ -349,9 +314,6 @@ public function privateApiRequest(string $method, string $urlPath, array $data =
349314
}
350315

351316

352-
/**
353-
* @return Client
354-
*/
355317
protected function newHttpClient(): Client
356318
{
357319
$stack = HandlerStack::create();
@@ -368,9 +330,6 @@ protected function newHttpClient(): Client
368330
}
369331

370332

371-
/**
372-
* @return string
373-
*/
374333
protected function getDefaultHttpUserAgent(): string
375334
{
376335
return sprintf(
@@ -380,29 +339,19 @@ protected function getDefaultHttpUserAgent(): string
380339
}
381340

382341

383-
/**
384-
* @return string
385-
*/
386342
public function getHttpUserAgent(): string
387343
{
388344
return $this->httpUserAgent;
389345
}
390346

391347

392-
/**
393-
* @param string $httpUserAgent
394-
* @return self
395-
*/
396348
public function setHttpUserAgent(string $httpUserAgent): self
397349
{
398350
$this->httpUserAgent = $httpUserAgent;
399351
return $this;
400352
}
401353

402354

403-
/**
404-
* @return bool
405-
*/
406355
private function reLogin(): bool
407356
{
408357
try {
@@ -414,10 +363,6 @@ private function reLogin(): bool
414363
}
415364

416365

417-
/**
418-
* @param bool $force
419-
* @return string
420-
*/
421366
public function getToken(bool $force = false): string
422367
{
423368
return match ($this->authMethod) {
@@ -445,10 +390,6 @@ private function preventLoginLoops(): void
445390
}
446391

447392

448-
/**
449-
* @param array $data
450-
* @return array
451-
*/
452393
private function dataToMultipart(array $data): array
453394
{
454395
$multipart = [];
@@ -462,9 +403,6 @@ private function dataToMultipart(array $data): array
462403
}
463404

464405

465-
/**
466-
* @param string $bearerToken
467-
*/
468406
public function setBearerToken(string $bearerToken): void
469407
{
470408
$this->bearerToken = $bearerToken;
@@ -474,8 +412,6 @@ public function setBearerToken(string $bearerToken): void
474412

475413
/**
476414
* Perform API login and return Authorization token
477-
* @param bool $force
478-
* @return string
479415
*/
480416
public function getBearerToken(bool $force = false): string
481417
{
@@ -515,10 +451,6 @@ public function getBearerToken(bool $force = false): string
515451
}
516452

517453

518-
/**
519-
* @param string $csrfToken
520-
* @param array $cookies
521-
*/
522454
public function setCsrfToken(string $csrfToken, array $cookies = []): void
523455
{
524456
$this->csrfToken = $csrfToken;
@@ -527,38 +459,25 @@ public function setCsrfToken(string $csrfToken, array $cookies = []): void
527459
}
528460

529461

530-
/**
531-
* @return string
532-
*/
533462
public function getAuthCred(): string
534463
{
535464
return $this->authCred;
536465
}
537466

538467

539-
/**
540-
* @param string $authCred
541-
*/
542468
public function setAuthCred(string $authCred): void
543469
{
544470
$this->authCred = $authCred;
545471
$this->setAuthMethod(self::AUTH_METHOD_AUTHCRED);
546472
}
547473

548474

549-
/**
550-
* @return array
551-
*/
552475
public function getCookies(): array
553476
{
554477
return $this->cookies;
555478
}
556479

557480

558-
/**
559-
* @param bool $force
560-
* @return string
561-
*/
562481
public function getCsrfToken(bool $force = false): string
563482
{
564483
if ((strlen($this->csrfToken) > 0) && (!$force)) {
@@ -599,10 +518,6 @@ public function getCsrfToken(bool $force = false): string
599518
}
600519

601520

602-
/**
603-
* @param bool $cleanUpToken
604-
* @return LogoutResponse
605-
*/
606521
public function logout(bool $cleanUpToken = true): LogoutResponse
607522
{
608523
$httpResponse = $this->serviceRequest('POST', 'logout');
@@ -616,10 +531,6 @@ public function logout(bool $cleanUpToken = true): LogoutResponse
616531
}
617532

618533

619-
/**
620-
* @param string $url
621-
* @param string $targetPath
622-
*/
623534
public function downloadFileToPath(string $url, string $targetPath): void
624535
{
625536
try {
@@ -656,10 +567,6 @@ public function downloadFileToPath(string $url, string $targetPath): void
656567
}
657568

658569

659-
/**
660-
* @param ResponseInterface $httpResponse
661-
* @param string $targetPath
662-
*/
663570
public function writeResponseBodyToPath(ResponseInterface $httpResponse, string $targetPath): void
664571
{
665572
$fp = fopen($targetPath, 'wb');
@@ -698,10 +605,6 @@ public function writeResponseBodyToPath(ResponseInterface $httpResponse, string
698605
}
699606

700607

701-
/**
702-
* @param string $assetId
703-
* @return string
704-
*/
705608
public function buildOriginalFileUrl(string $assetId): string
706609
{
707610
return "{$this->config->url}file/$assetId/*/$assetId";

src/AssetsUtils.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ class AssetsUtils
2424
* Parse JSON response string into array, throw exception on error response
2525
*
2626
* @see https://helpcenter.woodwing.com/hc/en-us/articles/360041851272-Assets-Server-REST-API-error-handling
27-
* @param string $jsonString
28-
* @return array
2927
*/
3028
public static function parseJsonResponse(string $jsonString): array
3129
{
@@ -47,10 +45,6 @@ public static function buildGetUrl(string $url, array $data = []): string
4745
}
4846

4947

50-
/**
51-
* @param array $currentMetadata
52-
* @param array $updateMetadata
53-
*/
5448
public static function cleanUpUnchangedMetadataFields(array &$updateMetadata, array $currentMetadata): void
5549
{
5650
foreach ($updateMetadata as $key => $newValue) {
@@ -99,8 +93,6 @@ public static function cleanUpUnchangedMetadataFields(array &$updateMetadata, ar
9993
/**
10094
* Escape a query term for use with Elasticsearch
10195
*
102-
* @param string $queryTerm Query term
103-
* @return string Escaped query term
10496
* @see https://stackoverflow.com/questions/33845230/escape-elasticsearch-special-characters-in-php
10597
* @see https://www.elastic.co/guide/en/elasticsearch/reference/5.5/query-dsl-query-string-query.html#_reserved_characters
10698
*/
@@ -163,13 +155,6 @@ public static function replaceInvalidFilenameCharacters(string $subject, string
163155
* Get a Twig template for building an Assets query
164156
*
165157
* Call render($templateVariables) on the returned object to get the query string.
166-
*
167-
* @param string $templateString
168-
* @param array $allowedTags
169-
* @param array $allowedFilters
170-
* @return TemplateWrapper
171-
* @throws LoaderError
172-
* @throws SyntaxError
173158
*/
174159
public static function getQueryTemplate(string $templateString, array $allowedTags = [], array $allowedFilters = []): TemplateWrapper
175160
{

0 commit comments

Comments
 (0)