Skip to content

Commit

Permalink
Merge pull request #523: Resolve deprecations, update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
roxblnfk authored Nov 7, 2024
2 parents ee90e67 + 9397729 commit a271938
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 17 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/run-test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,14 @@ jobs:
fail-fast: ${{ inputs.fail-fast }}
matrix:
php: [ 8.1, 8.2, 8.3 ]
os: [ ubuntu-latest, windows-latest ]
os: [ ubuntu-latest ]
extensions-suffix: [ '', ', protobuf' ]
dependencies: [ lowest , highest ]
timeout-minutes: [ '${{ inputs.test-timeout }}' ]
exclude:
- os: windows-latest
php: 8.2
include:
- os: windows-latest
extensions-suffix: ', protobuf'
- os: windows-latest
php: 8.3
php: 8.1
steps:
- name: Set Git To Use LF
run: |
Expand Down
6 changes: 6 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
stopOnFailure="false"
stopOnError="false"
stderr="true"
displayDetailsOnIncompleteTests="true"
displayDetailsOnSkippedTests="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerNotices="true"
displayDetailsOnTestsThatTriggerWarnings="true"
>
<testsuites>
<testsuite name="Acceptance">
Expand Down
16 changes: 6 additions & 10 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@
<code><![CDATA[$workflowType]]></code>
</PropertyNotSetInConstructor>
</file>
<file src="src/Client/Schedule/Spec/ScheduleSpec.php">
<DeprecatedProperty>
<code><![CDATA[$this->excludeCalendarList]]></code>
<code><![CDATA[$this->excludeCalendarList]]></code>
</DeprecatedProperty>
</file>
<file src="src/Client/Update/UpdateHandle.php">
<PossiblyNullArgument>
<code><![CDATA[$result->getSuccess()]]></code>
Expand Down Expand Up @@ -508,7 +514,6 @@
</file>
<file src="src/Internal/Declaration/Reader/WorkflowReader.php">
<ArgumentTypeCoercion>
<code><![CDATA[$class]]></code>
<code><![CDATA[$contextualRetry]]></code>
<code><![CDATA[$method]]></code>
<code><![CDATA[$name]]></code>
Expand Down Expand Up @@ -1218,10 +1223,6 @@
<InvalidOperand>
<code><![CDATA[$promisesOrValues]]></code>
</InvalidOperand>
<MissingParamType>
<code><![CDATA[$promiseOrValue]]></code>
<code><![CDATA[$promiseOrValue]]></code>
</MissingParamType>
<TooManyArguments>
<code><![CDATA[$reduce($c, $value, $i++, $total)]]></code>
</TooManyArguments>
Expand Down Expand Up @@ -1367,11 +1368,6 @@
<code><![CDATA[$method]]></code>
</ArgumentTypeCoercion>
</file>
<file src="src/Worker/Transport/RPCConnectionInterface.php">
<MissingParamType>
<code><![CDATA[$payload]]></code>
</MissingParamType>
</file>
<file src="src/Worker/Transport/RoadRunner.php">
<ArgumentTypeCoercion>
<code><![CDATA[$env->getRelayAddress()]]></code>
Expand Down
9 changes: 9 additions & 0 deletions src/Client/Schedule/Spec/ScheduleSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ final class ScheduleSpec
* Any timestamps matching any of exclude* will be skipped.
*
* @var list<CalendarSpec>
*
* @deprecated
*/
#[MarshalArray(name: 'exclude_calendar', of: CalendarSpec::class)]
public readonly array $excludeCalendarList;
Expand Down Expand Up @@ -245,18 +247,25 @@ public function withAddedInterval(mixed $interval): self

/**
* Returns a new instance with the replaced exclude calendar list.
*
* @deprecated This method is deprecated and will be removed in the next major release.
*/
public function withExcludeCalendarList(CalendarSpec ...$calendar): self
{
@\trigger_error('ScheduleSpec::withExcludeCalendarList() is deprecated', E_USER_DEPRECATED);

/** @see self::$excludeCalendarList */
return $this->with('excludeCalendarList', $calendar);
}

/**
* Any timestamps matching any of exclude* will be skipped.
*
* @deprecated This method is deprecated and will be removed in the next major release.
*/
public function withAddedExcludeCalendar(CalendarSpec $calendar): self
{
@\trigger_error('ScheduleSpec::withAddedExcludeCalendar() is deprecated', E_USER_DEPRECATED);
$value = $this->excludeCalendarList;
$value[] = $calendar;

Expand Down
6 changes: 5 additions & 1 deletion src/Exception/Client/ServiceClientException.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ public function __construct(\stdClass $status, \Throwable $previous = null)
$this->status->mergeFromString($status->metadata['grpc-status-details-bin'][0]);
}

parent::__construct($status->details . " (code: $status->code)", $status->code, $previous);
parent::__construct(\sprintf(
"%s (code: %d)",
isset($status->details) ? (string) $status->details : '',
$status->code,
), $status->code, $previous);
}

public function getStatus(): Status
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Router/InvokeActivityTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ final class InvokeActivityTestCase extends AbstractUnit
{
private ServiceContainer $services;
private InvokeActivity $router;
private ActivityContext $activityContext;

protected function setUp(): void
{
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Router/StartWorkflowTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ final class StartWorkflowTestCase extends AbstractUnit
{
private ServiceContainer $services;
private StartWorkflow $router;
private WorkflowContext $workflowContext;
private MarshallerInterface $marshaller;

protected function setUp(): void
{
Expand Down

0 comments on commit a271938

Please sign in to comment.