Skip to content
Open
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
6 changes: 3 additions & 3 deletions src/php/FreeBeeGeeAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ public function cleanupTableJSON(
public function cleanupTable(
array $table,
bool $assignIds = false,
object $library = null
?object $library = null
): array {
$clean = [];
foreach ($table as $piece) {
Expand Down Expand Up @@ -1279,7 +1279,7 @@ public function cleanupPieceJSON(
public function cleanupPiece(
object $piece,
bool $assignId = false,
object $library = null
?object $library = null
): object {
$out = new \stdClass();

Expand Down Expand Up @@ -3010,7 +3010,7 @@ private function setExpiration(
* @returns {String} A random ID.
*/
public static function generateId(
int $seed = null
? int $seed = null
) {
return JSONRestAPI::id64($seed);
}
Expand Down
10 changes: 5 additions & 5 deletions src/php/JSONRestAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -928,8 +928,8 @@ public function sendError(
public function sendReply(
int $code = 200,
?string $body = '',
string $location = null,
string $digest = null
?string $location = null,
?string $digest = null
): void {
if ($this->http) { // regular mode uses HTTP replies
http_response_code($code);
Expand Down Expand Up @@ -1113,7 +1113,7 @@ public function filePutContentsLocked(
* @return string A UUID, e.g. '8b8deba5-640b-4388-a2cc-3a4c56af9fb8'.
*/
public static function uuid(
string $seed = null
?string $seed = null
): string {
$data = $seed ?? random_bytes(16);
$data[6] = chr(ord($data[6]) & 0x0f | 0x40);
Expand Down Expand Up @@ -1147,7 +1147,7 @@ public static function touchAndReadJSON(
* @return string 16-digit hex string, e.g. 'a2cc3a4c56af9fb8'.
*/
public static function id(
string $seed = null
?string $seed = null
): string {
if ($seed) {
$data = substr($seed . '1234567890', 0, 8);
Expand All @@ -1167,7 +1167,7 @@ public static function id(
* @return string 8-digit base-64 string, e.g. 'a2-Jc5Xe'.
*/
public static function id64(
int $seed = null
?int $seed = null
): string {
$letters = 'abcdefghijklmnopqrstuvwxyz'
. 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
Expand Down