Shift with red gradient lettering

Adopt Type Hints

Premium
PHP 8

Enforce type safety by automatically adding PHP type definitions where it may be inferred from DocBlock @param, @return, and @var tags and code context.

Before

/**
* This returns the sum of two integers.
*
* @param int $a
* @param int $b
* @return int
*/
public function add($a, $b)
{
/** @var int */
$sum = $a + $b;
 
return $sum;
}

After

/**
* This returns the sum of two integers.
*/
public function add(int $a, int $b): int
{
$sum = $a + $b;
 
return $sum;
}

← Back to the Workbench Tasks

Sign in with any of the following services to connect Shift with your Laravel project.


Don't use one of these services?

Temporarily push your project to a free, private repository on one of these cloud-based services or upgrade your project locally with Shift for Docker.