forked from ppy/osu-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into contest-judging
- Loading branch information
Showing
1,034 changed files
with
12,604 additions
and
6,370 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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,31 @@ | ||
<?php | ||
|
||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the GNU Affero General Public License v3.0. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Docs\Strategies; | ||
|
||
use Knuckles\Camel\Extraction\ExtractedEndpointData; | ||
use Knuckles\Scribe\Extracting\RouteDocBlocker; | ||
use Knuckles\Scribe\Extracting\Strategies\Strategy; | ||
|
||
class UsesCursor extends Strategy | ||
{ | ||
public function __invoke(ExtractedEndpointData $endpointData, array $routeRules = []): ?array | ||
{ | ||
$docBlock = RouteDocBlocker::getDocBlocksFromRoute($endpointData->route)['method']; | ||
$tags = $docBlock->getTagsByName('usesCursor'); | ||
|
||
return empty($tags) | ||
? [] | ||
: [ | ||
'cursor_string' => [ | ||
'description' => '[CursorString](#cursorstring) for pagination.', | ||
'required' => false, | ||
'example' => null, | ||
], | ||
]; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
|
||
declare(strict_types=1); | ||
|
||
namespace App\Libraries; | ||
namespace App\Enums; | ||
|
||
enum Ip: string | ||
{ | ||
|
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,44 @@ | ||
<?php | ||
|
||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the GNU Affero General Public License v3.0. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Enums; | ||
|
||
enum Ruleset: int | ||
{ | ||
case osu = 0; | ||
case taiko = 1; | ||
case catch = 2; | ||
case mania = 3; | ||
|
||
// for usage with tryFrom when the parameter may be null. | ||
public const NULL = -1; | ||
|
||
public static function tryFromName(?string $ruleset): ?self | ||
{ | ||
if ($ruleset === null) { | ||
return null; | ||
} | ||
|
||
static $lookupMap; | ||
if ($lookupMap === null) { | ||
$lookupMap = []; | ||
foreach (self::cases() as $r) { | ||
$lookupMap[$r->name] = $r; | ||
} | ||
$lookupMap['fruits'] = self::catch; | ||
} | ||
|
||
return $lookupMap[$ruleset] ?? null; | ||
} | ||
|
||
public function legacyName() | ||
{ | ||
return $this === self::catch | ||
? 'fruits' | ||
: $this->name; | ||
} | ||
} |
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
Oops, something went wrong.