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
4 changes: 2 additions & 2 deletions src/Access/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function __construct(PolicyInterface $policy)
*
* @return mixed
*/
public function beforeDispatch(Event $event, Dispatcher $dispatcher, array $data = null)
public function beforeDispatch(Event $event, Dispatcher $dispatcher, ?array $data = null)
{
$controller = $dispatcher->getControllerName();

Expand All @@ -75,7 +75,7 @@ public function beforeDispatch(Event $event, Dispatcher $dispatcher, array $data
* @param array $data Data. [Optional]
* @return bool
*/
public function isAllowedAccess(string $resourceName, array $data = null): bool
public function isAllowedAccess(string $resourceName, ?array $data = null): bool
{
return $resourceName == 'error' || $this->policy->isAllowedAccess($resourceName, $data);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Access/Policy/Ip.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct(string $ip)
* @param array $data Data. [Optional]
* @return bool
*/
public function isAllowedAccess(string $resourceName, array $data = null): bool
public function isAllowedAccess(string $resourceName, ?array $data = null): bool
{
$ip = $this->request->getClientAddress();

Expand Down
2 changes: 1 addition & 1 deletion src/Access/PolicyInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ interface PolicyInterface
* @param array $data Data. [Optional]
* @return bool
*/
public function isAllowedAccess(string $resourceName, array $data = null): bool;
public function isAllowedAccess(string $resourceName, ?array $data = null): bool;
}
2 changes: 1 addition & 1 deletion src/Builder/Component/Scaffold.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public function build(): bool
*
* @return string
*/
private function captureFilterInput(string $var, $fields, bool $useGetSetters, string $identityField = null): string
private function captureFilterInput(string $var, $fields, bool $useGetSetters, ?string $identityField = null): string
{
$code = '';
foreach ($fields as $field => $dataType) {
Expand Down
2 changes: 1 addition & 1 deletion src/Builder/Path.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Path
*/
protected $rootPath = null;

public function __construct(string $rootPath = null)
public function __construct(?string $rootPath = null)
{
$this->rootPath = $rootPath ?: realpath('.') . DIRECTORY_SEPARATOR;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Generator/Snippet.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public static function findFirst(\$parameters = null): ?\Phalcon\Mvc\ModelInterf
* @param array $options
* @return string PHP syntax
*/
public function getRelationOptions(array $options = null)
public function getRelationOptions(?array $options = null)
{
if (empty($options)) {
return 'NULL';
Expand Down
8 changes: 4 additions & 4 deletions templates/module/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Module implements ModuleDefinitionInterface
*
* @param DiInterface $di
*/
public function registerAutoloaders(DiInterface $di = null)
public function registerAutoloaders(?DiInterface $di = null)
{
$loader = new Loader();

Expand All @@ -41,9 +41,9 @@ public function registerServices(DiInterface $di)
* Try to load local configuration
*/
if (file_exists(@@configName@@)) {

$config = $di['config'];

$override = @@configLoader@@;

if ($config instanceof Config) {
Expand All @@ -61,7 +61,7 @@ public function registerServices(DiInterface $di)

$view = new View();
$view->setViewsDir($config->get('application')->viewsDir);

$view->registerEngines([
'.volt' => 'voltShared',
'.phtml' => PhpEngine::class
Expand Down
2 changes: 1 addition & 1 deletion templates/project/modules/Module_cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Module implements ModuleDefinitionInterface
*
* @param DiInterface $di
*/
public function registerAutoloaders(DiInterface $di = null)
public function registerAutoloaders(?DiInterface $di = null)
{
$loader = new Loader();

Expand Down
2 changes: 1 addition & 1 deletion templates/project/modules/Module_web.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Module implements ModuleDefinitionInterface
*
* @param DiInterface $di
*/
public function registerAutoloaders(DiInterface $di = null)
public function registerAutoloaders(?DiInterface $di = null)
{
$loader = new Loader();

Expand Down