Skip to content

Commit 077a78c

Browse files
committed
Errors can't be hydrated so do an manual instantiation
1 parent 277cfa6 commit 077a78c

File tree

633 files changed

+1357
-1357
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

633 files changed

+1357
-1357
lines changed

src/Operation/Actions/AddCustomLabelsToSelfHostedRunnerForOrg.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ function createResponse(\Psr\Http\Message\ResponseInterface $response) : Schema\
5555
switch ($contentType) {
5656
case 'application/json':
5757
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
58-
throw $this->hydrator->hydrateObject(ErrorSchemas\BasicError::class, array('status' => 404, 'error' => $body));
58+
throw new ErrorSchemas\BasicError(404, $this->hydrator->hydrateObject(Schema\BasicError::class, $body));
5959
}
6060
break;
6161
/**Validation failed, or the endpoint has been spammed.**/
6262
case 422:
6363
switch ($contentType) {
6464
case 'application/json':
6565
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\ValidationErrorSimple::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
66-
throw $this->hydrator->hydrateObject(ErrorSchemas\ValidationErrorSimple::class, array('status' => 422, 'error' => $body));
66+
throw new ErrorSchemas\ValidationErrorSimple(422, $this->hydrator->hydrateObject(Schema\ValidationErrorSimple::class, $body));
6767
}
6868
break;
6969
}

src/Operation/Actions/AddCustomLabelsToSelfHostedRunnerForRepo.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ function createResponse(\Psr\Http\Message\ResponseInterface $response) : Schema\
5858
switch ($contentType) {
5959
case 'application/json':
6060
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
61-
throw $this->hydrator->hydrateObject(ErrorSchemas\BasicError::class, array('status' => 404, 'error' => $body));
61+
throw new ErrorSchemas\BasicError(404, $this->hydrator->hydrateObject(Schema\BasicError::class, $body));
6262
}
6363
break;
6464
/**Validation failed, or the endpoint has been spammed.**/
6565
case 422:
6666
switch ($contentType) {
6767
case 'application/json':
6868
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\ValidationErrorSimple::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
69-
throw $this->hydrator->hydrateObject(ErrorSchemas\ValidationErrorSimple::class, array('status' => 422, 'error' => $body));
69+
throw new ErrorSchemas\ValidationErrorSimple(422, $this->hydrator->hydrateObject(Schema\ValidationErrorSimple::class, $body));
7070
}
7171
break;
7272
}

src/Operation/Actions/ApproveWorkflowRun.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ function createResponse(\Psr\Http\Message\ResponseInterface $response) : Schema\
5555
switch ($contentType) {
5656
case 'application/json':
5757
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
58-
throw $this->hydrator->hydrateObject(ErrorSchemas\BasicError::class, array('status' => 404, 'error' => $body));
58+
throw new ErrorSchemas\BasicError(404, $this->hydrator->hydrateObject(Schema\BasicError::class, $body));
5959
}
6060
break;
6161
/**Forbidden**/
6262
case 403:
6363
switch ($contentType) {
6464
case 'application/json':
6565
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
66-
throw $this->hydrator->hydrateObject(ErrorSchemas\BasicError::class, array('status' => 403, 'error' => $body));
66+
throw new ErrorSchemas\BasicError(403, $this->hydrator->hydrateObject(Schema\BasicError::class, $body));
6767
}
6868
break;
6969
}

src/Operation/Actions/CancelWorkflowRun.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function createResponse(\Psr\Http\Message\ResponseInterface $response) : Schema\
5555
switch ($contentType) {
5656
case 'application/json':
5757
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
58-
throw $this->hydrator->hydrateObject(ErrorSchemas\BasicError::class, array('status' => 409, 'error' => $body));
58+
throw new ErrorSchemas\BasicError(409, $this->hydrator->hydrateObject(Schema\BasicError::class, $body));
5959
}
6060
break;
6161
}

src/Operation/Actions/CreateRequiredWorkflow.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function createResponse(\Psr\Http\Message\ResponseInterface $response) : Schema\
5252
switch ($contentType) {
5353
case 'application/json':
5454
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\ValidationErrorSimple::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
55-
throw $this->hydrator->hydrateObject(ErrorSchemas\ValidationErrorSimple::class, array('status' => 422, 'error' => $body));
55+
throw new ErrorSchemas\ValidationErrorSimple(422, $this->hydrator->hydrateObject(Schema\ValidationErrorSimple::class, $body));
5656
}
5757
break;
5858
}

src/Operation/Actions/DeleteWorkflowRunLogs.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ function createResponse(\Psr\Http\Message\ResponseInterface $response) : void
4444
switch ($contentType) {
4545
case 'application/json':
4646
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
47-
throw $this->hydrator->hydrateObject(ErrorSchemas\BasicError::class, array('status' => 403, 'error' => $body));
47+
throw new ErrorSchemas\BasicError(403, $this->hydrator->hydrateObject(Schema\BasicError::class, $body));
4848
}
4949
break;
5050
/**Internal Error**/
5151
case 500:
5252
switch ($contentType) {
5353
case 'application/json':
5454
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
55-
throw $this->hydrator->hydrateObject(ErrorSchemas\BasicError::class, array('status' => 500, 'error' => $body));
55+
throw new ErrorSchemas\BasicError(500, $this->hydrator->hydrateObject(Schema\BasicError::class, $body));
5656
}
5757
break;
5858
}

src/Operation/Actions/DownloadArtifact.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function createResponse(\Psr\Http\Message\ResponseInterface $response) : array
4949
switch ($contentType) {
5050
case 'application/json':
5151
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
52-
throw $this->hydrator->hydrateObject(ErrorSchemas\BasicError::class, array('status' => 410, 'error' => $body));
52+
throw new ErrorSchemas\BasicError(410, $this->hydrator->hydrateObject(Schema\BasicError::class, $body));
5353
}
5454
break;
5555
/**Response**/

src/Operation/Actions/DownloadArtifactStreaming.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function createResponse(\Psr\Http\Message\ResponseInterface $response) : \Rx\Obs
5151
switch ($contentType) {
5252
case 'application/json':
5353
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
54-
throw $this->hydrator->hydrateObject(ErrorSchemas\BasicError::class, array('status' => 410, 'error' => $body));
54+
throw new ErrorSchemas\BasicError(410, $this->hydrator->hydrateObject(Schema\BasicError::class, $body));
5555
}
5656
break;
5757
/**Response**/

src/Operation/Actions/GetCustomOidcSubClaimForRepo.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,18 @@ function createResponse(\Psr\Http\Message\ResponseInterface $response) : Schema\
5252
switch ($contentType) {
5353
case 'application/json':
5454
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
55-
throw $this->hydrator->hydrateObject(ErrorSchemas\BasicError::class, array('status' => 400, 'error' => $body));
55+
throw new ErrorSchemas\BasicError(400, $this->hydrator->hydrateObject(Schema\BasicError::class, $body));
5656
case 'application/scim+json':
5757
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\ScimError::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
58-
throw $this->hydrator->hydrateObject(ErrorSchemas\ScimError::class, array('status' => 400, 'error' => $body));
58+
throw new ErrorSchemas\ScimError(400, $this->hydrator->hydrateObject(Schema\ScimError::class, $body));
5959
}
6060
break;
6161
/**Resource not found**/
6262
case 404:
6363
switch ($contentType) {
6464
case 'application/json':
6565
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
66-
throw $this->hydrator->hydrateObject(ErrorSchemas\BasicError::class, array('status' => 404, 'error' => $body));
66+
throw new ErrorSchemas\BasicError(404, $this->hydrator->hydrateObject(Schema\BasicError::class, $body));
6767
}
6868
break;
6969
}

src/Operation/Actions/GetRepoRequiredWorkflow.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function createResponse(\Psr\Http\Message\ResponseInterface $response) : Schema\
5555
switch ($contentType) {
5656
case 'application/json':
5757
$this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\BasicError::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema'));
58-
throw $this->hydrator->hydrateObject(ErrorSchemas\BasicError::class, array('status' => 404, 'error' => $body));
58+
throw new ErrorSchemas\BasicError(404, $this->hydrator->hydrateObject(Schema\BasicError::class, $body));
5959
}
6060
break;
6161
}

0 commit comments

Comments
 (0)