Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace implicit nullable types in parameter declarations #687

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion demo/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// $debugbar->setStorage(new DebugBar\Storage\RedisStorage(new Predis\Client()));
// $debugbarRenderer->setOpenHandlerUrl('open.php');

function render_demo_page(Closure $callback = null)
function render_demo_page(?Closure $callback = null)
{
global $debugbarRenderer;
?>
Expand Down
2 changes: 1 addition & 1 deletion src/DebugBar/Bridge/CacheCacheCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class CacheCacheCollector extends MonologCollector
* @param bool $level
* @param bool $bubble
*/
public function __construct(Cache $cache = null, Logger $logger = null, $level = Logger::DEBUG, $bubble = true)
public function __construct(?Cache $cache = null, ?Logger $logger = null, $level = Logger::DEBUG, $bubble = true)
{
parent::__construct(null, $level, $bubble);

Expand Down
2 changes: 1 addition & 1 deletion src/DebugBar/Bridge/MonologCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class MonologCollector extends AbstractProcessingHandler implements DataCollecto
* @param boolean $bubble
* @param string $name
*/
public function __construct(Logger $logger = null, $level = Logger::DEBUG, $bubble = true, $name = 'monolog')
public function __construct(?Logger $logger = null, $level = Logger::DEBUG, $bubble = true, $name = 'monolog')
{
parent::__construct($level, $bubble);
$this->name = $name;
Expand Down
4 changes: 2 additions & 2 deletions src/DebugBar/Bridge/PropelCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class PropelCollector extends DataCollector implements BasicLogger, Renderable,
*
* @param PropelConfiguration $config Apply profiling on a specific config
*/
public static function enablePropelProfiling(PropelConfiguration $config = null)
public static function enablePropelProfiling(?PropelConfiguration $config = null)
{
if ($config === null) {
$config = Propel::getConfiguration(PropelConfiguration::TYPE_OBJECT);
Expand All @@ -74,7 +74,7 @@ public static function enablePropelProfiling(PropelConfiguration $config = null)
* @param LoggerInterface $logger A logger to forward non-query log lines to
* @param PropelPDO $conn Bound this collector to a connection only
*/
public function __construct(LoggerInterface $logger = null, PropelPDO $conn = null)
public function __construct(?LoggerInterface $logger = null, ?PropelPDO $conn = null)
{
if ($conn) {
$conn->setLogger($this);
Expand Down
2 changes: 1 addition & 1 deletion src/DebugBar/Bridge/Twig/TimeableTwigExtensionProfiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function setTimeDataCollector(TimeDataCollector $timeDataCollector)
$this->timeDataCollector = $timeDataCollector;
}

public function __construct(Profile $profile, TimeDataCollector $timeDataCollector = null)
public function __construct(Profile $profile, ?TimeDataCollector $timeDataCollector = null)
{
parent::__construct($profile);

Expand Down
4 changes: 2 additions & 2 deletions src/DebugBar/Bridge/Twig/TraceableTwigEnvironment.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

/**
* Wrapped a Twig Environment to provide profiling features
*
*
* @deprecated
*/
class TraceableTwigEnvironment extends Twig_Environment
Expand All @@ -39,7 +39,7 @@ class TraceableTwigEnvironment extends Twig_Environment
* @param Twig_Environment $twig
* @param TimeDataCollector $timeDataCollector
*/
public function __construct(Twig_Environment $twig, TimeDataCollector $timeDataCollector = null)
public function __construct(Twig_Environment $twig, ?TimeDataCollector $timeDataCollector = null)
{
$this->twig = $twig;
$this->timeDataCollector = $timeDataCollector;
Expand Down
4 changes: 2 additions & 2 deletions src/DebugBar/DataCollector/PDO/PDOCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class PDOCollector extends DataCollector implements Renderable, AssetProvider
* @param \PDO $pdo
* @param TimeDataCollector $timeCollector
*/
public function __construct(\PDO $pdo = null, TimeDataCollector $timeCollector = null)
public function __construct(?\PDO $pdo = null, ?TimeDataCollector $timeCollector = null)
{
$this->timeCollector = $timeCollector;
if ($pdo !== null) {
Expand Down Expand Up @@ -138,7 +138,7 @@ public function collect()
* @param string|null $connectionName the pdo connection (eg default | read | write)
* @return array
*/
protected function collectPDO(TraceablePDO $pdo, TimeDataCollector $timeCollector = null, $connectionName = null)
protected function collectPDO(TraceablePDO $pdo, ?TimeDataCollector $timeCollector = null, $connectionName = null)
{
if (empty($connectionName) || $connectionName == 'default') {
$connectionName = 'pdo';
Expand Down
2 changes: 1 addition & 1 deletion src/DebugBar/DataCollector/PDO/TracedStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function start($startTime = null, $startMemory = null) : void
* @param float $endTime
* @param int $endMemory
*/
public function end(\Exception $exception = null, int $rowCount = 0, float $endTime = null, int $endMemory = null) : void
public function end(?\Exception $exception = null, int $rowCount = 0, ?float $endTime = null, ?int $endMemory = null) : void
{
$this->endTime = $endTime ?: microtime(true);
$this->duration = $this->endTime - $this->startTime;
Expand Down
2 changes: 1 addition & 1 deletion src/DebugBar/DebugBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function getCurrentRequestId()
* @param StorageInterface $storage
* @return $this
*/
public function setStorage(StorageInterface $storage = null)
public function setStorage(?StorageInterface $storage = null)
{
$this->storage = $storage;
return $this;
Expand Down