Skip to content
Merged
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 modules/backend/behaviors/ListController.php
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ public function listMakePartial($partial, $params = [])
*
* @return array The list element selector as the key, and the list contents are the value.
*/
public function listRefresh(string $definition = null)
public function listRefresh(?string $definition = null)
{
if (!count($this->listWidgets)) {
$this->makeLists();
Expand All @@ -439,7 +439,7 @@ public function listRefresh(string $definition = null)
* Returns the widget used by this behavior.
* @return \Backend\Classes\WidgetBase
*/
public function listGetWidget(string $definition = null)
public function listGetWidget(?string $definition = null)
{
if (!$definition) {
$definition = $this->primaryDefinition;
Expand All @@ -452,7 +452,7 @@ public function listGetWidget(string $definition = null)
* Returns the configuration used by this behavior.
* @return stdClass
*/
public function listGetConfig(string $definition = null)
public function listGetConfig(?string $definition = null)
{
if (!$definition) {
$definition = $this->primaryDefinition;
Expand Down
12 changes: 6 additions & 6 deletions modules/backend/facades/Backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

/**
* @method static string uri()
* @method static string url(string $path = null, array $parameters = [], bool $secure = null)
* @method static string baseUrl(string $path = null)
* @method static string skinAsset(string $path = null)
* @method static \Illuminate\Http\RedirectResponse redirect(string $path, int $status = 302, array $headers = [], bool $secure = null)
* @method static \Illuminate\Http\RedirectResponse redirectGuest(string $path, int $status = 302, array $headers = [], bool $secure = null)
* @method static \Illuminate\Http\RedirectResponse redirectIntended(string $path, int $status = 302, array $headers = [], bool $secure = null)
* @method static string url(?string $path = null, array $parameters = [], ?bool $secure = null)
* @method static string baseUrl(?string $path = null)
* @method static string skinAsset(?string $path = null)
* @method static \Illuminate\Http\RedirectResponse redirect(string $path, int $status = 302, array $headers = [], ?bool $secure = null)
* @method static \Illuminate\Http\RedirectResponse redirectGuest(string $path, int $status = 302, array $headers = [], ?bool $secure = null)
* @method static \Illuminate\Http\RedirectResponse redirectIntended(string $path, int $status = 302, array $headers = [], ?bool $secure = null)
* @method static string date($dateTime, array $options = [])
* @method static string dateTime($dateTime, array $options = [])
*
Expand Down
2 changes: 1 addition & 1 deletion modules/backend/traits/PreferenceMaker.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function putUserPreference(string $key, $value)
* @param mixed $default A default value to use when value is not found.
* @return mixed
*/
public function getUserPreference(string $key = null, $default = null)
public function getUserPreference(?string $key = null, $default = null)
{
$preferences = $this->getUserPreferences();

Expand Down
4 changes: 2 additions & 2 deletions modules/backend/widgets/MediaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ protected function getViewMode(): string
/**
* Returns thumbnail parameters
*/
protected function getThumbnailParams(string $viewMode = null): array
protected function getThumbnailParams(?string $viewMode = null): array
{
$result = [
'mode' => 'crop'
Expand Down Expand Up @@ -1316,7 +1316,7 @@ protected function getResizedImageUrl(string $path, array $params): string
*
* @todo Consider moving this into the File helper and accepting a $disk instance
*/
protected function deduplicatePath(string $path, string $suffix = null): string
protected function deduplicatePath(string $path, ?string $suffix = null): string
{
$parts = pathinfo($path);
$i = 1;
Expand Down
2 changes: 1 addition & 1 deletion modules/cms/classes/CmsException.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class CmsException extends ApplicationException
* Error 400: Mask the exception as Twig content.
* @param Throwable $previous Previous exception.
*/
public function __construct($message = null, $code = 100, Throwable $previous = null)
public function __construct($message = null, $code = 100, ?Throwable $previous = null)
{
if ($message instanceof CmsCompoundObject || $message instanceof ComponentPartial) {
$this->compoundObject = $message;
Expand Down
2 changes: 1 addition & 1 deletion modules/cms/classes/ComponentBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ abstract class ComponentBase extends Extendable
* @param null|CodeBase $cmsObject
* @param array $properties
*/
public function __construct(CodeBase $cmsObject = null, $properties = [])
public function __construct(?CodeBase $cmsObject = null, $properties = [])
{
if ($cmsObject !== null) {
$this->page = $cmsObject;
Expand Down
2 changes: 1 addition & 1 deletion modules/cms/classes/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -1586,7 +1586,7 @@ public function findComponentByPartial($partial)
* @param ComponentBase $component
* @return void
*/
public function setComponentContext(ComponentBase $component = null)
public function setComponentContext(?ComponentBase $component = null)
{
$this->componentContext = $component;
}
Expand Down
2 changes: 1 addition & 1 deletion modules/cms/classes/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function getLayoutOptions()

$layouts = Layout::listInTheme($theme, true);
$result = [];
$result[null] = Lang::get('cms::lang.page.no_layout');
$result[''] = Lang::get('cms::lang.page.no_layout');

foreach ($layouts as $layout) {
$baseName = $layout->getBaseFileName();
Expand Down
2 changes: 1 addition & 1 deletion modules/cms/controllers/ThemeOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function formExtendFieldsBefore($form)
* @param string $dirName
* @return string
*/
protected function getDirName(string $dirName = null)
protected function getDirName(?string $dirName = null)
{
/*
* Only the active theme can be managed without this permission
Expand Down
2 changes: 1 addition & 1 deletion modules/cms/facades/Cms.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use Winter\Storm\Support\Facade;

/**
* @method static string url(string $path = null)
* @method static string url(?string $path = null)
*
* @see \Cms\Helpers\Cms
*/
Expand Down
2 changes: 1 addition & 1 deletion modules/cms/models/ThemeExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ThemeExport extends Model
*
* @return void
*/
public function save(array $options = null, $sessionKey = null)
public function save(?array $options = null, $sessionKey = null)
{
throw new ApplicationException(sprintf("The % model is not intended to be saved, please use %s instead", get_class($this), 'ThemeData'));
}
Expand Down
2 changes: 1 addition & 1 deletion modules/cms/models/ThemeImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class ThemeImport extends Model
*
* @return void
*/
public function save(array $options = null, $sessionKey = null)
public function save(?array $options = null, $sessionKey = null)
{
throw new ApplicationException(sprintf("The % model is not intended to be saved, please use %s instead", get_class($this), 'ThemeData'));
}
Expand Down
6 changes: 3 additions & 3 deletions modules/cms/twig/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ public function componentFunction(string $name, array $parameters = []): string
/**
* Renders registered assets of a given type or all types if $type not provided
*/
public function assetsFunction(string $type = null): ?string
public function assetsFunction(?string $type = null): ?string
{
return $this->controller->makeAssets($type);
}

/**
* Renders placeholder content, without removing the block, must be called before the placeholder tag itself
*/
public function placeholderFunction(string $name, string $default = null): ?string
public function placeholderFunction(string $name, ?string $default = null): ?string
{
if (($result = Block::get($name)) === null) {
return null;
Expand Down Expand Up @@ -196,7 +196,7 @@ public function startBlock(string $name): void
/**
* Returns a layout block contents (or null if it doesn't exist) and removes the block.
*/
public function displayBlock(string $name, string $default = null): ?string
public function displayBlock(string $name, ?string $default = null): ?string
{
if (($result = Block::placeholder($name)) === null) {
return $default;
Expand Down
2 changes: 1 addition & 1 deletion modules/system/classes/FileManifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class FileManifest
/**
* Constructor.
*/
public function __construct(string $root = null, array $modules = null)
public function __construct(?string $root = null, ?array $modules = null)
{
$this->setRoot($root ?? base_path());
$this->setModules($modules ?? Config::get('cms.loadModules', ['System', 'Backend', 'Cms']));
Expand Down
2 changes: 1 addition & 1 deletion modules/system/classes/MarkupManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected function init()
/**
* Make an instance of the base TwigEnvironment to extend further
*/
public static function makeBaseTwigEnvironment(LoaderInterface $loader = null, array $options = []): TwigEnvironment
public static function makeBaseTwigEnvironment(?LoaderInterface $loader = null, array $options = []): TwigEnvironment
{
if (!$loader) {
$loader = new SystemTwigLoader();
Expand Down
2 changes: 1 addition & 1 deletion modules/system/classes/SourceManifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class SourceManifest
/**
* Constructor
*/
public function __construct(string $source = null, string $forks = null, bool $autoload = true)
public function __construct(?string $source = null, ?string $forks = null, bool $autoload = true)
{
$this->setSource($source ?? Config::get(
'cms.sourceManifestUrl',
Expand Down
2 changes: 1 addition & 1 deletion modules/system/console/PluginRollback.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function handle(): int
/**
* Suggest values for the optional version argument
*/
public function suggestVersionValues(string $value = null, array $allInput): array
public function suggestVersionValues(?string $value, array $allInput): array
{
// Get the currently selected plugin
$pluginName = $this->getPluginIdentifier($allInput['arguments']['plugin']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class Categories extends ComponentBase
{
public function __construct(CodeBase $cmsObject = null, $properties = [])
public function __construct(?CodeBase $cmsObject = null, $properties = [])
{
parent::__construct($cmsObject, $properties);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Comments extends ComponentBase
{
private $users;

public function __construct(CodeBase $cmsObject = null, $properties = [], Users $users = null)
public function __construct(?CodeBase $cmsObject = null, $properties = [], ?Users $users = null)
{
parent::__construct($cmsObject, $properties);
$this->users = $users;
Expand Down
Loading