Skip to content

Commit

Permalink
Adding PHP 8.2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
gxgpet committed Nov 6, 2022
1 parent 9b8f2b7 commit fb1256a
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 7 deletions.
20 changes: 19 additions & 1 deletion .github/workflows/test-phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,28 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ '8.1', '8.0', '7.4', '7.3', '7.2', '7.1', '7.0', '5.6', '5.5', '5.4']
php: [ '8.2', '8.1', '8.0', '7.4', '7.3', '7.2', '7.1', '7.0', '5.6', '5.5', '5.4']
DB: [ 'pdo/mysql', 'pdo/pgsql', 'pdo/sqlite', 'mysqli', 'pgsql', 'sqlite' ]
compiler: [ default ]
include:
- php: '8.2'
DB: 'pdo/mysql'
compiler: jit
- php: '8.2'
DB: 'pdo/pgsql'
compiler: jit
- php: '8.2'
DB: 'pdo/sqlite'
compiler: jit
- php: '8.2'
DB: 'mysqli'
compiler: jit
- php: '8.2'
DB: 'pgsql'
compiler: jit
- php: '8.2'
DB: 'sqlite'
compiler: jit
- php: '8.1'
DB: 'pdo/mysql'
compiler: jit
Expand Down
1 change: 1 addition & 0 deletions system/core/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
* @author EllisLab Dev Team
* @link https://codeigniter.com/userguide3/libraries/loader.html
*/
#[AllowDynamicProperties]
class CI_Loader {

// All these are set automatically. Don't mess with them.
Expand Down
7 changes: 7 additions & 0 deletions system/core/URI.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@
*/
class CI_URI {

/**
* CI_Config instance
*
* @var CI_Config
*/
public $config;

/**
* List of cached URI segments
*
Expand Down
1 change: 1 addition & 0 deletions system/database/DB_driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
* @author EllisLab Dev Team
* @link https://codeigniter.com/userguide3/database/
*/
#[AllowDynamicProperties]
abstract class CI_DB_driver {

/**
Expand Down
1 change: 1 addition & 0 deletions system/libraries/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
* @author EllisLab Dev Team
* @link
*/
#[AllowDynamicProperties]
class CI_Driver_Library {

/**
Expand Down
4 changes: 2 additions & 2 deletions system/libraries/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -490,12 +490,12 @@ protected function _compile_template()
return;
}

$this->temp = $this->_default_template();
$temp = $this->_default_template();
foreach (array('table_open', 'thead_open', 'thead_close', 'heading_row_start', 'heading_row_end', 'heading_cell_start', 'heading_cell_end', 'tbody_open', 'tbody_close', 'row_start', 'row_end', 'cell_start', 'cell_end', 'row_alt_start', 'row_alt_end', 'cell_alt_start', 'cell_alt_end', 'table_close') as $val)
{
if ( ! isset($this->template[$val]))
{
$this->template[$val] = $this->temp[$val];
$this->template[$val] = $temp[$val];
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/codeigniter/core/Loader_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function test_library_config()
// Create library in VFS
$lib = 'unit_test_config_lib';
$class = 'CI_'.ucfirst($lib);
$content = '<?php class '.$class.' { public function __construct($params) { $this->config = $params; } }';
$content = "<?php \n#[AllowDynamicProperties]\nclass ".$class.' { public function __construct($params) { $this->config = $params; } }';
$this->ci_vfs_create(ucfirst($lib), $content, $this->ci_base_root, 'libraries');

// Create config file
Expand Down
7 changes: 4 additions & 3 deletions tests/codeigniter/libraries/Upload_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ function test_data()
$data = array(
'file_name' => 'hello.txt',
'file_type' => 'text/plain',
'file_path' => '/tmp/',
'full_path' => '/tmp/hello.txt',
'raw_name' => 'hello',
'orig_name' => 'hello.txt',
'client_name' => '',
'file_ext' => '.txt',
Expand All @@ -80,6 +77,10 @@ function test_data()
$this->upload->{$k} = $v;
}

$data['file_path'] = '/tmp/';
$data['full_path'] = '/tmp/hello.txt';
$data['raw_name'] = 'hello';

$this->assertEquals('hello.txt', $this->upload->data('file_name'));
$this->assertEquals($data, $this->upload->data());
}
Expand Down
1 change: 1 addition & 0 deletions tests/mocks/ci_testcase.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php

#[AllowDynamicProperties]
class CI_TestCase extends \PHPUnit\Framework\TestCase {

public $ci_vfs_root;
Expand Down

0 comments on commit fb1256a

Please sign in to comment.