Skip to content

Commit 91423db

Browse files
authored
Fix deprecations (#59)
* Fix deprecations * Raise minimum support to 8.2+
1 parent 8cf54ab commit 91423db

File tree

11 files changed

+16
-16
lines changed

11 files changed

+16
-16
lines changed

.github/workflows/unit-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ jobs:
1212
strategy:
1313
matrix:
1414
os: [ ubuntu-latest, windows-latest ]
15-
php: [ '8.0', '8.1', '8.2', '8.3', '8.4' ]
15+
php: [ '8.2', '8.3', '8.4' ]
1616

1717
runs-on: ${{matrix.os}}
1818

1919
steps:
20-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@v5
2121
- uses: shivammathur/setup-php@v2
2222
with:
2323
php-version: ${{matrix.php}}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"optimize-autoloader": true
1919
},
2020
"require": {
21-
"php": "^8.0",
21+
"php": "^8.2",
2222
"ext-json": "*",
2323
"packaged/config": "~1.5",
2424
"packaged/context": "^1.11",

src/Cache/EphemeralCache.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static function instance(): self
2525
*
2626
* @return mixed
2727
*/
28-
public function retrieve($key, callable $producer, int $ttl = null)
28+
public function retrieve($key, callable $producer, ?int $ttl = null)
2929
{
3030
if(!$this->has($key))
3131
{
@@ -39,7 +39,7 @@ public function has($key)
3939
return isset($this->_cache[$key]) && ($this->_cache[$key]['t'] === null || $this->_cache[$key]['t'] >= time());
4040
}
4141

42-
public function set($key, $value, int $ttl = null)
42+
public function set($key, $value, ?int $ttl = null)
4343
{
4444
$this->_cache[$key] = ['v' => $value, 't' => time() + $ttl];
4545
return $this;

src/Console/Events/ConsoleEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ abstract class ConsoleEvent extends ContextEvent
99
{
1010
private $_console;
1111

12-
public static function i(Context $ctx, Console $console = null)
12+
public static function i(Context $ctx, ?Console $console = null)
1313
{
1414
$event = parent::i($ctx);
1515
$event->_console = $console;

src/Console/Events/ConsolePrepareEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class ConsolePrepareEvent extends ConsoleEvent
1212
private $_output;
1313

1414
public static function i(
15-
Context $ctx, Console $console = null, InputInterface $input = null, OutputInterface $output = null
15+
Context $ctx, ?Console $console = null, ?InputInterface $input = null, ?OutputInterface $output = null
1616
)
1717
{
1818
$event = parent::i($ctx, $console);

src/Context/Events/ConsoleLaunchedEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class ConsoleLaunchedEvent extends AbstractEvent
1010
private $_input;
1111
private $_output;
1212

13-
public function __construct(InputInterface $input = null, OutputInterface $output = null)
13+
public function __construct(?InputInterface $input = null, ?OutputInterface $output = null)
1414
{
1515
parent::__construct();
1616
$this->_input = $input;

src/Cubex.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class Cubex extends DependencyInjector implements LoggerAwareInterface
5757
*/
5858
private $_hasShutdown;
5959

60-
public function __construct($projectRoot, ClassLoader $loader = null, $global = true)
60+
public function __construct($projectRoot, ?ClassLoader $loader = null, $global = true)
6161
{
6262
$this->_projectRoot = $projectRoot;
6363
$this->_eventChannel = new Channel('cubex');
@@ -72,7 +72,7 @@ public function __construct($projectRoot, ClassLoader $loader = null, $global =
7272
}
7373
}
7474

75-
public static function withCustomContext(string $ctxClass, $projectRoot, ClassLoader $loader = null, $global = true)
75+
public static function withCustomContext(string $ctxClass, $projectRoot, ?ClassLoader $loader = null, $global = true)
7676
{
7777
$c = new static($projectRoot, $loader, $global);
7878
$c->_contextClass = $ctxClass;
@@ -213,7 +213,7 @@ public static function fromContext(Context $ctx, $fallbackToGlobal = true)
213213
* @return int
214214
* @throws Exception
215215
*/
216-
public function cli(InputInterface $input = null, OutputInterface $output = null)
216+
public function cli(?InputInterface $input = null, ?OutputInterface $output = null)
217217
{
218218
$input = $input ?? new ArgvInput();
219219
$output = $output ?? new ConsoleOutput();
@@ -422,7 +422,7 @@ protected function _getSystemEnvironment()
422422
* @return bool true if shutdown has processed, false if shutdown has already been called.
423423
* @throws Exception
424424
*/
425-
public function shutdown(bool $throwExceptions = null)
425+
public function shutdown(?bool $throwExceptions = null)
426426
{
427427
if(!$this->_hasShutdown)
428428
{

src/Events/Handle/HandlerEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ abstract class HandlerEvent extends ContextEvent
99
{
1010
private $_handler;
1111

12-
public static function i(Context $context, Handler $handler = null)
12+
public static function i(Context $context, ?Handler $handler = null)
1313
{
1414
$event = parent::i($context);
1515
$event->_handler = $handler;

src/Events/Handle/ResponseEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ abstract class ResponseEvent extends HandlerEvent
99
{
1010
private $_response;
1111

12-
public static function i(Context $context, Handler $handler = null, Response $response = null)
12+
public static function i(Context $context, ?Handler $handler = null, ?Response $response = null)
1313
{
1414
$event = parent::i($context, $handler);
1515
$event->_response = $response;

src/ViewModel/TemplatedViewModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ protected function _attemptTemplateExtensions()
4242
return array_filter(array_merge($this->_variants, ['phtml']));
4343
}
4444

45-
public function createView(string $overrideViewClass = null): ?View
45+
public function createView(?string $overrideViewClass = null): ?View
4646
{
4747
if($overrideViewClass === null && empty($this->_defaultView))
4848
{

0 commit comments

Comments
 (0)