Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright ©2024 Robert Landers
*
Expand All @@ -23,7 +24,7 @@

// example bootstrap file

return new class () implements \Psr\Container\ContainerInterface {
return new class implements \Psr\Container\ContainerInterface {
public function get(string $id)
{
return new $id();
Expand Down
16 changes: 14 additions & 2 deletions pint.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{
"preset": "per",
"exclude": ["cli"],
"exclude": [
"cli"
],
"rules": {
"array_push": true,
"attribute_empty_parentheses": {
"use_parentheses": false
},
"backtick_to_shell_exec": true,
"combine_consecutive_issets": true,
"combine_consecutive_unsets": true,
"combine_nested_dirname": true,
Expand All @@ -22,6 +28,12 @@
"single_quote": true,
"strict_param": true,
"use_arrow_functions": true,
"void_return": true
"void_return": true,
"no_unused_imports": true,
"ordered_interfaces": true,
"ordered_types": {
"null_adjustment": "always_last"
},
"simplified_if_return": true
}
}
1 change: 1 addition & 0 deletions src/ActivityInfo.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright ©2024 Robert Landers
*
Expand Down
2 changes: 1 addition & 1 deletion src/DurableClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@

namespace Bottledcode\DurablePhp;

interface DurableClientInterface extends OrchestrationClientInterface, EntityClientInterface {}
interface DurableClientInterface extends EntityClientInterface, OrchestrationClientInterface {}
19 changes: 10 additions & 9 deletions src/DurableLogger.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright ©2024 Robert Landers
*
Expand Down Expand Up @@ -97,55 +98,55 @@ public function formatBatch(array $records): string
}

#[\Override]
public function info(\Stringable|string $message, array $context = []): void
public function info(string|\Stringable $message, array $context = []): void
{
$this->logger->info($message, $context);
}

#[\Override]
public function error(\Stringable|string $message, array $context = []): void
public function error(string|\Stringable $message, array $context = []): void
{
$this->logger->error($message, $context);
}

#[\Override]
public function emergency(\Stringable|string $message, array $context = []): void
public function emergency(string|\Stringable $message, array $context = []): void
{
$this->logger->emergency($message, $context);
}

#[\Override]
public function alert(\Stringable|string $message, array $context = []): void
public function alert(string|\Stringable $message, array $context = []): void
{
$this->logger->alert($message, $context);
}

#[\Override]
public function critical(\Stringable|string $message, array $context = []): void
public function critical(string|\Stringable $message, array $context = []): void
{
$this->logger->critical($message, $context);
}

#[\Override]
public function warning(\Stringable|string $message, array $context = []): void
public function warning(string|\Stringable $message, array $context = []): void
{
$this->logger->warning($message, $context);
}

#[\Override]
public function notice(\Stringable|string $message, array $context = []): void
public function notice(string|\Stringable $message, array $context = []): void
{
$this->logger->notice($message, $context);
}

#[\Override]
public function debug(\Stringable|string $message, array $context = []): void
public function debug(string|\Stringable $message, array $context = []): void
{
$this->logger->debug($message, $context);
}

#[\Override]
public function log($level, \Stringable|string $message, array $context = []): void
public function log($level, string|\Stringable $message, array $context = []): void
{
$this->logger->log($level, $message, $context);
}
Expand Down
1 change: 1 addition & 0 deletions src/Events/External.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright ©2024 Robert Landers
*
Expand Down
1 change: 1 addition & 0 deletions src/Events/GiveOwnership.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright ©2024 Robert Landers
*
Expand Down
2 changes: 1 addition & 1 deletion src/Events/RaiseEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static function forOperation(string $operation, array $input): static

public static function forCustom(string $name, array $eventData): static
{
return new static(Uuid::uuid7(), ltrim($name, '_'), $eventData);
return new static(Uuid::uuid7(), mb_ltrim($name, '_'), $eventData);
}

public static function forLock(string $owner): static
Expand Down
1 change: 1 addition & 0 deletions src/Events/ShareOwnership.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright ©2024 Robert Landers
*
Expand Down
1 change: 1 addition & 0 deletions src/Events/ShareWithRole.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright ©2024 Robert Landers
*
Expand Down
1 change: 1 addition & 0 deletions src/Events/ShareWithUser.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright ©2024 Robert Landers
*
Expand Down
1 change: 1 addition & 0 deletions src/Events/Shares/Mode.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright ©2024 Robert Landers
*
Expand Down
1 change: 1 addition & 0 deletions src/Events/Shares/NeedsSource.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright ©2024 Robert Landers
*
Expand Down
1 change: 1 addition & 0 deletions src/Events/Shares/NeedsTarget.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright ©2024 Robert Landers
*
Expand Down
1 change: 1 addition & 0 deletions src/Events/Shares/Operation.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright ©2024 Robert Landers
*
Expand Down
1 change: 1 addition & 0 deletions src/Events/TargetType.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright ©2024 Robert Landers
*
Expand Down
1 change: 1 addition & 0 deletions src/Events/WithPriority.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright ©2024 Robert Landers
*
Expand Down
2 changes: 1 addition & 1 deletion src/Gateway/Graph/AstType.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public static function fromArray(array $types): self
return new self(array_filter($types, static fn($s) => $s !== 'null'), $isNullable);
}

public function getUnionOrType(): Union|string
public function getUnionOrType(): string|Union
{
if (count($this->types) > 1) {
return new Union($this->types);
Expand Down
4 changes: 2 additions & 2 deletions src/Gateway/Graph/AstVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ private function extractAttributes(Node\AttributeGroup ...$group): array
return $attributes;
}

private function extractValue(Node\Arg $arg): string|int|float
private function extractValue(Node\Arg $arg): float|int|string
{
$value = $arg->value;
return match (true) {
Expand Down Expand Up @@ -337,7 +337,7 @@ private function determineKind(): void
}

private function extractTypes(
null|Node|Node\ComplexType|Node\Identifier|Node\Name|string $node,
Node|Node\ComplexType|Node\Identifier|Node\Name|string|null $node,
): array {
$types = match (true) {
is_string($node) => [$this->deUse($node)],
Expand Down
4 changes: 2 additions & 2 deletions src/Gateway/Graph/GraphGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private function deUse(string $name): string
return $this->uses[$name] ?? $name;
}

private function extractValue(Node\Arg $arg): string|int|float
private function extractValue(Node\Arg $arg): float|int|string
{
$value = $arg->value;
return match (true) {
Expand Down Expand Up @@ -79,7 +79,7 @@ private function extractAttributes(Node\AttributeGroup ...$group): array
}

private function extractTypes(
null|Node|Node\ComplexType|Node\Identifier|Node\Name|string $node,
Node|Node\ComplexType|Node\Identifier|Node\Name|string|null $node,
bool $deuse = true,
): string {
$uses = $deuse ? $this->deUse(...) : static fn($x) => $x;
Expand Down
1 change: 1 addition & 0 deletions src/Gateway/Graph/MetaParser.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright ©2024 Robert Landers
*
Expand Down
1 change: 1 addition & 0 deletions src/Gateway/Graph/Mode.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright ©2024 Robert Landers
*
Expand Down
1 change: 1 addition & 0 deletions src/Gateway/Graph/SchemaGenerator.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright ©2024 Robert Landers
*
Expand Down
6 changes: 3 additions & 3 deletions src/Gateway/Graph/TypeManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public function renderTypes(): string
foreach ($mutationTypes as $type => $part) {
$lines = implode("\n\t", $part);
$typeType = explode(':', $type);
$typeType = trim(end($typeType));
$typeType = mb_trim(end($typeType));
$final[] = <<<QQL
type {$typeType} {
\t{$lines}
Expand All @@ -144,7 +144,7 @@ public function renderTypes(): string
foreach ($queryTypes as $type => $part) {
$lines = implode("\n\t", $part);
$typeType = explode(':', $type);
$typeType = trim(end($typeType));
$typeType = mb_trim(end($typeType));
if ($this->knownTypes[$typeType] ?? false) {
$type =
str_replace($typeType, $this->lookupType($typeType)?->getGraphQlType(nullable: true), $type);
Expand All @@ -164,7 +164,7 @@ public function renderTypes(): string
GQL;
}

return trim(implode("\n", array_filter($final))) . "\n";
return mb_trim(implode("\n", array_filter($final))) . "\n";
}

public function lookupType(string|Union $type): SchemaRendererInterface|null
Expand Down
1 change: 1 addition & 0 deletions src/Glue/Provenance.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright ©2024 Robert Landers
*
Expand Down
7 changes: 4 additions & 3 deletions src/Glue/autoload.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Copyright ©2024 Robert Landers
*
Expand All @@ -25,13 +26,13 @@
use Bottledcode\DurablePhp\DurableLogger;
use Monolog\Level;

if(file_exists(__DIR__ . '/../../vendor/autoload.php')) {
if (file_exists(__DIR__ . '/../../vendor/autoload.php')) {
require_once __DIR__ . '/../../vendor/autoload.php';
goto verify_protocol;
}

// fast check for standard installs
if(file_exists(__DIR__ . '/../../../../autoload.php')) {
if (file_exists(__DIR__ . '/../../../../autoload.php')) {
require_once __DIR__ . '/../../../../autoload.php';
goto verify_protocol;
}
Expand All @@ -47,7 +48,7 @@
default => Level::Error,
});

if(($_SERVER['SERVER_PROTOCOL'] ?? null) !== 'DPHP/1.0') {
if (($_SERVER['SERVER_PROTOCOL'] ?? null) !== 'DPHP/1.0') {
http_response_code(400);
$logger->critical('Invalid request protocol', [$_SERVER['SERVER_PROTOCOL'] ?? null]);
die();
Expand Down
Loading