Skip to content

Commit 546bbf6

Browse files
authored
Merge pull request #1550 from elcreator/fix-8.4-deprecations
Fix 8.4 deprecations
2 parents cba8251 + 1e5008b commit 546bbf6

9 files changed

Lines changed: 13 additions & 13 deletions

File tree

src/Access/Manager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function __construct(PolicyInterface $policy)
5050
*
5151
* @return mixed
5252
*/
53-
public function beforeDispatch(Event $event, Dispatcher $dispatcher, array $data = null)
53+
public function beforeDispatch(Event $event, Dispatcher $dispatcher, ?array $data = null)
5454
{
5555
$controller = $dispatcher->getControllerName();
5656

@@ -75,7 +75,7 @@ public function beforeDispatch(Event $event, Dispatcher $dispatcher, array $data
7575
* @param array $data Data. [Optional]
7676
* @return bool
7777
*/
78-
public function isAllowedAccess(string $resourceName, array $data = null): bool
78+
public function isAllowedAccess(string $resourceName, ?array $data = null): bool
7979
{
8080
return $resourceName == 'error' || $this->policy->isAllowedAccess($resourceName, $data);
8181
}

src/Access/Policy/Ip.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __construct(string $ip)
4545
* @param array $data Data. [Optional]
4646
* @return bool
4747
*/
48-
public function isAllowedAccess(string $resourceName, array $data = null): bool
48+
public function isAllowedAccess(string $resourceName, ?array $data = null): bool
4949
{
5050
$ip = $this->request->getClientAddress();
5151

src/Access/PolicyInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ interface PolicyInterface
2121
* @param array $data Data. [Optional]
2222
* @return bool
2323
*/
24-
public function isAllowedAccess(string $resourceName, array $data = null): bool;
24+
public function isAllowedAccess(string $resourceName, ?array $data = null): bool;
2525
}

src/Builder/Component/Scaffold.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ public function build(): bool
239239
*
240240
* @return string
241241
*/
242-
private function captureFilterInput(string $var, $fields, bool $useGetSetters, string $identityField = null): string
242+
private function captureFilterInput(string $var, $fields, bool $useGetSetters, ?string $identityField = null): string
243243
{
244244
$code = '';
245245
foreach ($fields as $field => $dataType) {

src/Builder/Path.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Path
2525
*/
2626
protected $rootPath = null;
2727

28-
public function __construct(string $rootPath = null)
28+
public function __construct(?string $rootPath = null)
2929
{
3030
$this->rootPath = $rootPath ?: realpath('.') . DIRECTORY_SEPARATOR;
3131
}

src/Generator/Snippet.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ public static function findFirst(\$parameters = null): ?\Phalcon\Mvc\ModelInterf
281281
* @param array $options
282282
* @return string PHP syntax
283283
*/
284-
public function getRelationOptions(array $options = null)
284+
public function getRelationOptions(?array $options = null)
285285
{
286286
if (empty($options)) {
287287
return 'NULL';

templates/module/Module.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Module implements ModuleDefinitionInterface
1818
*
1919
* @param DiInterface $di
2020
*/
21-
public function registerAutoloaders(DiInterface $di = null)
21+
public function registerAutoloaders(?DiInterface $di = null)
2222
{
2323
$loader = new Loader();
2424

@@ -41,9 +41,9 @@ public function registerServices(DiInterface $di)
4141
* Try to load local configuration
4242
*/
4343
if (file_exists(@@configName@@)) {
44-
44+
4545
$config = $di['config'];
46-
46+
4747
$override = @@configLoader@@;
4848

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

6262
$view = new View();
6363
$view->setViewsDir($config->get('application')->viewsDir);
64-
64+
6565
$view->registerEngines([
6666
'.volt' => 'voltShared',
6767
'.phtml' => PhpEngine::class

templates/project/modules/Module_cli.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Module implements ModuleDefinitionInterface
1414
*
1515
* @param DiInterface $di
1616
*/
17-
public function registerAutoloaders(DiInterface $di = null)
17+
public function registerAutoloaders(?DiInterface $di = null)
1818
{
1919
$loader = new Loader();
2020

templates/project/modules/Module_web.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Module implements ModuleDefinitionInterface
1616
*
1717
* @param DiInterface $di
1818
*/
19-
public function registerAutoloaders(DiInterface $di = null)
19+
public function registerAutoloaders(?DiInterface $di = null)
2020
{
2121
$loader = new Loader();
2222

0 commit comments

Comments
 (0)