-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
37 changed files
with
759 additions
and
407 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ protoc-gen-php-grpc* | |
.phpunit.result.cache | ||
.php-cs-fixer.cache | ||
.deptrac.cache | ||
.phpunit.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Modules\Projects\Domain\ValueObject; | ||
|
||
use App\Application\Domain\Assert; | ||
|
||
final readonly class Key implements \JsonSerializable, \Stringable | ||
{ | ||
public const MIN_LENGTH = 3; | ||
public const MAX_LENGTH = 36; | ||
public const ALLOWED_CHARACTERS = 'a-z0-9-_'; | ||
|
||
public static function create(string $key): self | ||
{ | ||
Assert::notEmpty( | ||
value: $key, | ||
message: 'Project key is required.', | ||
); | ||
|
||
Assert::minLength( | ||
value: $key, | ||
min: self::MIN_LENGTH, | ||
message: 'Invalid project key. Key must be at least 3 characters long.', | ||
); | ||
|
||
Assert::maxLength( | ||
value: $key, | ||
max: self::MAX_LENGTH, | ||
message: 'Invalid project key. Key must be less than 36 characters long.', | ||
); | ||
|
||
Assert::regex( | ||
value: $key, | ||
pattern: '/^[' . self::ALLOWED_CHARACTERS . ']+$/', | ||
message: 'Invalid project key. Key must contain only lowercase letters, numbers, hyphens and underscores.', | ||
); | ||
|
||
return new self($key); | ||
} | ||
|
||
/** | ||
* @internal | ||
* @private | ||
*/ | ||
public function __construct( | ||
public string $value, | ||
) { | ||
} | ||
|
||
/** | ||
* Create from data storage raw value | ||
*/ | ||
final public static function typecast(mixed $value): self | ||
{ | ||
return new self($value); | ||
} | ||
|
||
public function jsonSerialize(): string | ||
{ | ||
return $this->value; | ||
} | ||
|
||
public function __toString(): string | ||
{ | ||
return $this->value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,14 +9,22 @@ | |
use Spiral\Boot\EnvironmentInterface; | ||
use Spiral\Router\Annotation\Route; | ||
|
||
final class JavascriptAction | ||
final readonly class JavascriptAction | ||
{ | ||
#[Route(route: '/sentry/<id>.js', name: 'sentry.js', methods: 'GET', group: 'api')] | ||
public function __invoke(EnvironmentInterface $env, mixed $id): ResponseInterface | ||
#[Route(route: '/sentry/<project>.js', name: 'sentry.js', methods: 'GET', group: 'api')] | ||
public function __invoke(EnvironmentInterface $env, string $project): ResponseInterface | ||
{ | ||
$jsSdkUrl = $env->get('SENTRY_JS_SDK_URL', 'https://browser.sentry-cdn.com/7.69.0/bundle.tracing.replay.min.js'); | ||
$host = $env->get('SENTRY_DSN_HOST', 'http://[email protected]:8000'); | ||
$url = \rtrim($host, '/') . '/' . $id; | ||
$jsSdkUrl = $env->get( | ||
'SENTRY_JS_SDK_URL', | ||
'https://browser.sentry-cdn.com/7.69.0/bundle.tracing.replay.min.js', | ||
); | ||
|
||
$host = $env->get( | ||
'SENTRY_JS_DSN_HOST', | ||
'http://[email protected]:8000', | ||
); | ||
|
||
$url = \rtrim($host, '/') . '/' . $project; | ||
|
||
return new Response( | ||
status: 200, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Modules\VarDumper\Application\Dump; | ||
|
||
use Symfony\Component\VarDumper\Cloner\Data; | ||
|
||
final readonly class ParsedPayload | ||
{ | ||
public function __construct( | ||
public Data $data, | ||
public array $context, | ||
) { | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
app/modules/VarDumper/Exception/InvalidPayloadException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Modules\VarDumper\Exception; | ||
|
||
final class InvalidPayloadException extends VarDumperException | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Modules\VarDumper\Exception; | ||
|
||
class VarDumperException extends \DomainException | ||
{ | ||
|
||
} |
Oops, something went wrong.