Skip to content

Commit

Permalink
Merge pull request #10 from mittwald/chore/more-rector-rules
Browse files Browse the repository at this point in the history
Add more rector rules to remove unnecessary doccomment tags
  • Loading branch information
martin-helmich authored Mar 19, 2024
2 parents 2197927 + 0fe2bbd commit 2584d59
Show file tree
Hide file tree
Showing 2,297 changed files with 356 additions and 44,700 deletions.
8 changes: 8 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@

use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector;
use Rector\DeadCode\Rector\Property\RemoveUselessVarTagRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector;
use Rector\TypeDeclaration\Rector\StmtsAwareInterface\DeclareStrictTypesRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
__DIR__ . '/src',
]);

$rectorConfig->rule(ReturnNeverTypeRector::class);
$rectorConfig->rule(DeclareStrictTypesRector::class);
$rectorConfig->rule(RemoveUselessVarTagRector::class);
$rectorConfig->rule(RemoveUselessParamTagRector::class);
$rectorConfig->rule(RemoveUselessReturnTagRector::class);
$rectorConfig->importNames();
};
2 changes: 2 additions & 0 deletions src/Client/BaseClient.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Mittwald\ApiClient\Client;

use GuzzleHttp\Client;
Expand Down
2 changes: 2 additions & 0 deletions src/Client/EmptyResponse.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Mittwald\ApiClient\Client;

use Psr\Http\Message\ResponseInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/Client/ResponseTrait.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Mittwald\ApiClient\Client;

use Psr\Http\Message\ResponseInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/Client/StringResponse.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Mittwald\ApiClient\Client;

use Psr\Http\Message\ResponseInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/Client/UntypedResponse.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Mittwald\ApiClient\Client;

use Psr\Http\Message\ResponseInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/Generated/V2/Client.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Mittwald\ApiClient\Generated\V2;

use Mittwald\ApiClient\Generated\V2\Clients\App\AppClient;
Expand Down
2 changes: 2 additions & 0 deletions src/Generated/V2/ClientImpl.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Mittwald\ApiClient\Generated\V2;

use Mittwald\ApiClient\Client\BaseClient;
Expand Down
2 changes: 2 additions & 0 deletions src/Generated/V2/Clients/App/AppClient.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Mittwald\ApiClient\Generated\V2\Clients\App;

use GuzzleHttp\Exception\GuzzleException;
Expand Down
2 changes: 2 additions & 0 deletions src/Generated/V2/Clients/App/AppClientImpl.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Mittwald\ApiClient\Generated\V2\Clients\App;

use GuzzleHttp\Client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ class DeprecatedAppLinkDatabaseDefaultResponse implements ResponseContainer
{
/**
* Schema used to validate input for creating instances of this class
*
* @var array
*/
private static array $schema = [
'type' => 'object',
Expand All @@ -29,33 +27,20 @@ class DeprecatedAppLinkDatabaseDefaultResponse implements ResponseContainer
],
];

/**
* @var Error
*/
private Error $body;

private ResponseInterface|null $httpResponse = null;

/**
* @param Error $body
*/
public function __construct(Error $body)
{
$this->body = $body;
}

/**
* @return Error
*/
public function getBody(): Error
{
return $this->body;
}

/**
* @param Error $body
* @return self
*/
public function withBody(Error $body): self
{
$clone = clone $this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ class DeprecatedAppLinkDatabaseNotFoundResponse implements ResponseContainer
{
/**
* Schema used to validate input for creating instances of this class
*
* @var array
*/
private static array $schema = [
'type' => 'object',
Expand All @@ -29,33 +27,20 @@ class DeprecatedAppLinkDatabaseNotFoundResponse implements ResponseContainer
],
];

/**
* @var Error
*/
private Error $body;

private ResponseInterface|null $httpResponse = null;

/**
* @param Error $body
*/
public function __construct(Error $body)
{
$this->body = $body;
}

/**
* @return Error
*/
public function getBody(): Error
{
return $this->body;
}

/**
* @param Error $body
* @return self
*/
public function withBody(Error $body): self
{
$clone = clone $this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ class DeprecatedAppLinkDatabaseRequest

/**
* Schema used to validate input for creating instances of this class
*
* @var array
*/
private static array $schema = [
'type' => 'object',
Expand Down Expand Up @@ -57,50 +55,30 @@ class DeprecatedAppLinkDatabaseRequest
],
];

/**
* @var string
*/
private string $appInstallationId;

/**
* @var DeprecatedAppLinkDatabaseRequestBody
*/
private DeprecatedAppLinkDatabaseRequestBody $body;

private array $headers = [

];

/**
* @param string $appInstallationId
* @param DeprecatedAppLinkDatabaseRequestBody $body
*/
public function __construct(string $appInstallationId, DeprecatedAppLinkDatabaseRequestBody $body)
{
$this->appInstallationId = $appInstallationId;
$this->body = $body;
}

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

/**
* @return DeprecatedAppLinkDatabaseRequestBody
*/
public function getBody(): DeprecatedAppLinkDatabaseRequestBody
{
return $this->body;
}

/**
* @param string $appInstallationId
* @return self
*/
public function withAppInstallationId(string $appInstallationId): self
{
$validator = new Validator();
Expand All @@ -115,10 +93,6 @@ public function withAppInstallationId(string $appInstallationId): self
return $clone;
}

/**
* @param DeprecatedAppLinkDatabaseRequestBody $body
* @return self
*/
public function withBody(DeprecatedAppLinkDatabaseRequestBody $body): self
{
$clone = clone $this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ class DeprecatedAppLinkDatabaseRequestBody
{
/**
* Schema used to validate input for creating instances of this class
*
* @var array
*/
private static array $schema = [
'properties' => [
Expand Down Expand Up @@ -42,34 +40,21 @@ class DeprecatedAppLinkDatabaseRequestBody
'type' => 'object',
];

/**
* @var string
*/
private string $databaseId;

/**
* @var string[]|null
*/
private ?array $databaseUserIds = null;

/**
* @var DeprecatedAppLinkDatabaseRequestBodyPurpose
*/
private DeprecatedAppLinkDatabaseRequestBodyPurpose $purpose;

/**
* @param string $databaseId
* @param DeprecatedAppLinkDatabaseRequestBodyPurpose $purpose
*/
public function __construct(string $databaseId, DeprecatedAppLinkDatabaseRequestBodyPurpose $purpose)
{
$this->databaseId = $databaseId;
$this->purpose = $purpose;
}

/**
* @return string
*/
public function getDatabaseId(): string
{
return $this->databaseId;
Expand All @@ -83,18 +68,11 @@ public function getDatabaseUserIds(): ?array
return $this->databaseUserIds ?? null;
}

/**
* @return DeprecatedAppLinkDatabaseRequestBodyPurpose
*/
public function getPurpose(): DeprecatedAppLinkDatabaseRequestBodyPurpose
{
return $this->purpose;
}

/**
* @param string $databaseId
* @return self
*/
public function withDatabaseId(string $databaseId): self
{
$validator = new Validator();
Expand All @@ -111,7 +89,6 @@ public function withDatabaseId(string $databaseId): self

/**
* @param string[] $databaseUserIds
* @return self
*/
public function withDatabaseUserIds(array $databaseUserIds): self
{
Expand All @@ -127,9 +104,6 @@ public function withDatabaseUserIds(array $databaseUserIds): self
return $clone;
}

/**
* @return self
*/
public function withoutDatabaseUserIds(): self
{
$clone = clone $this;
Expand All @@ -138,10 +112,6 @@ public function withoutDatabaseUserIds(): self
return $clone;
}

/**
* @param DeprecatedAppLinkDatabaseRequestBodyPurpose $purpose
* @return self
*/
public function withPurpose(DeprecatedAppLinkDatabaseRequestBodyPurpose $purpose): self
{
$clone = clone $this;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Mittwald\ApiClient\Generated\V2\Clients\App\DeprecatedAppLinkDatabase;

enum DeprecatedAppLinkDatabaseRequestBodyPurpose: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ class ExecuteActionDefaultResponse implements ResponseContainer
{
/**
* Schema used to validate input for creating instances of this class
*
* @var array
*/
private static array $schema = [
'type' => 'object',
Expand All @@ -29,33 +27,20 @@ class ExecuteActionDefaultResponse implements ResponseContainer
],
];

/**
* @var Error
*/
private Error $body;

private ResponseInterface|null $httpResponse = null;

/**
* @param Error $body
*/
public function __construct(Error $body)
{
$this->body = $body;
}

/**
* @return Error
*/
public function getBody(): Error
{
return $this->body;
}

/**
* @param Error $body
* @return self
*/
public function withBody(Error $body): self
{
$clone = clone $this;
Expand Down
Loading

0 comments on commit 2584d59

Please sign in to comment.