سلام و احترام به همگی
من تو پکیجها و یا فریم ورکها تعداد زیادی متدهایی میبینم که شکل زیرو داره
private function withTracking(PromiseInterface $promise, string $uri, int $statusCode): PromiseInterface
{
return $promise->then(
static function (ResponseInterface $response) use ($uri, $statusCode) {
// Note that we are pushing to the front of the list as this
// would be an earlier response than what is currently present
// in the history header.
$historyHeader = $response->getHeader(self::HISTORY_HEADER);
$statusHeader = $response->getHeader(self::STATUS_HISTORY_HEADER);
\array_unshift($historyHeader, $uri);
\array_unshift($statusHeader, (string) $statusCode);
return $response->withHeader(self::HISTORY_HEADER, $historyHeader)
->withHeader(self::STATUS_HISTORY_HEADER, $statusHeader);
}
);
}
کاری با کدای داخل تابع ندارم، به نوع ورودی تابع دقت کنید، پشت متغیری که به عنوان پارامتر تابع قرار داده، اسم یک کلاس رو آورده. معنی این چیه؟؟ دقیقا چیکار میکنه؟؟ آیا داره نوع ورودی رو با یک کلاس دیگه مقایسه میکنه؟