Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Uid] Use more concrete exception classes#60154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Show file tree
Hide file tree
Changes from1 commit
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
PrevPrevious commit
feat: add InvalidUidException
  • Loading branch information
@rela589n
rela589n committedApr 10, 2025
commitd163d4fb9df590c5de5326e92b87c3eee37d2959
27 changes: 27 additions & 0 deletionssrc/Symfony/Component/Uid/InvalidUidException.php
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\Uid;

abstract class InvalidUidException extends \InvalidArgumentException
{
public function __construct(
private readonly string $value,
string $message,
) {
parent::__construct($message);
}

public function getValue(): string
{
return $this->value;
}
}
12 changes: 3 additions & 9 deletionssrc/Symfony/Component/Uid/InvalidUlidException.php
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,16 +11,10 @@

namespace Symfony\Component\Uid;

final class InvalidUlidException extends\InvalidArgumentException
final class InvalidUlidException extendsInvalidUidException
{
public function __construct(
private readonly string $value,
) {
parent::__construct(\sprintf('Invalid ULID: "%s".', $this->value));
}

public function getValue(): string
public function __construct(string $value)
{
return $this->value;
parent::__construct($value, \sprintf('Invalid ULID: "%s".', $value));
}
}
18 changes: 3 additions & 15 deletionssrc/Symfony/Component/Uid/InvalidUuidException.php
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,22 +11,10 @@

namespace Symfony\Component\Uid;

final class InvalidUuidException extends\InvalidArgumentException
final class InvalidUuidException extendsInvalidUidException
{
public function __construct(
private readonly int $type,
private readonly string $value,
) {
parent::__construct(\sprintf('Invalid UUID%s: "%s".', $this->type ? 'v'.$this->type : '', $this->value));
}

public function getType(): int
{
return $this->type;
}

public function getValue(): string
public function __construct(int $type, string $value)
{
return $this->value;
parent::__construct($value, \sprintf('Invalid UUID%s: "%s".', $type ? 'v'.$type : '', $value));
}
}
Loading

[8]ページ先頭

©2009-2025 Movatter.jp