Files
projectsend/app/Modules/Identity/Social/SocialResolution.php
ignacionelson 6e47d76ba6 ProjectSend 2.0.0
Client file sharing, rebuilt from the ground up: a private area per
client, resumable uploads, folders, groups and categories, sharing with
expiry dates and download limits, comments, file versions, an activity
log, a REST API, and sixteen languages.

This repository begins here. ProjectSend 2 was developed privately, and
that development history is not published — the previous generation
remains available, with its own history, at projectsend/legacy.

Free software under the GNU General Public License v2, or (at your
option) any later version.
2026-08-14 01:38:12 -03:00

49 lines
1.3 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Modules\Identity\Social;
use App\Models\User;
/**
* What a provider identity turned out to mean.
*
* A value rather than an exception, because "we will not sign you in" is
* an ordinary outcome here — most refusals are configuration, not error —
* and because the controller needs to know *which* of these happened to
* decide what to write to the activity log.
*/
final readonly class SocialResolution
{
private function __construct(
public ?User $user,
public ?string $refusal,
public bool $linked,
public bool $provisioned,
) {}
/** An account this identity was already bound to. */
public static function existing(User $user): self
{
return new self($user, null, false, false);
}
/** An account this identity has just been bound to. */
public static function linked(User $user): self
{
return new self($user, null, true, false);
}
/** An account that did not exist until now. */
public static function provisioned(User $user): self
{
return new self($user, null, true, true);
}
public static function refuse(string $reason): self
{
return new self(null, $reason, false, false);
}
}