Skip to content

Commit

Permalink
Merge pull request #91 from vemaeg/feature/php-8.2-changes
Browse files Browse the repository at this point in the history
Add(php) Add PHP 8.2 support
  • Loading branch information
thePanz authored Jan 10, 2023
2 parents 6ff2997 + 0241c0b commit 0ee6863
Show file tree
Hide file tree
Showing 31 changed files with 84 additions and 15 deletions.
File renamed without changes.
1 change: 1 addition & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
- "7.4"
- "8.0"
- "8.1"
- "8.2"

steps:
- name: "Checkout"
Expand Down
13 changes: 10 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,24 +103,31 @@ services:
php74:
<<: *services_php54
build:
context: .docker/php74_81
context: .docker/php74_82
args:
PHP_VERSION: '7.4'

php80:
<<: *services_php54
build:
context: .docker/php74_81
context: .docker/php74_82
args:
PHP_VERSION: '8.0'

php81:
<<: *services_php54
build:
context: .docker/php74_81
context: .docker/php74_82
args:
PHP_VERSION: '8.1'

php82:
<<: *services_php54
build:
context: .docker/php74_82
args:
PHP_VERSION: '8.2'

db:
image: mysql:5.5.62
environment:
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/Cli/AnsiColorFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function formatSection($section, $text, $size = null)
{
$width = 9 + strlen($this->format('', 'INFO'));

return sprintf(">> %-${width}s %s", $this->format($section, 'INFO'), $this->excerpt($text, $size));
return sprintf(">> %-{$width}s %s", $this->format($section, 'INFO'), $this->excerpt($text, $size));
}

/**
Expand Down
1 change: 1 addition & 0 deletions lib/Doctrine/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
*/
protected $_tableCache;
protected $_tableCacheTTL;
protected $exported;

/**
* the constructor
Expand Down
4 changes: 3 additions & 1 deletion lib/Doctrine/Hydrator/Graph.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
*/
abstract class Doctrine_Hydrator_Graph extends Doctrine_Hydrator_Abstract
{
protected $_tables = array();
protected
$_tables = array(),
$_rootAlias = null;

/**
* Gets the custom field used for indexing for the specified component alias.
Expand Down
1 change: 1 addition & 0 deletions lib/Doctrine/Import/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
* @author Nicolas Bérard-Nault <[email protected]>
* @author Jonathan H. Wage <[email protected]>
*/
#[\AllowDynamicProperties]
class Doctrine_Import_Builder extends Doctrine_Builder
{
/**
Expand Down
4 changes: 4 additions & 0 deletions lib/Doctrine/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,10 @@ protected function _buildDsnPartsArray($dsn)
// silence any warnings
$parts = @parse_url($dsn);

if ($parts === false) {
$parts = array();
}

$names = array('dsn', 'scheme', 'host', 'port', 'user', 'pass', 'path', 'query', 'fragment');

foreach ($names as $name) {
Expand Down
5 changes: 0 additions & 5 deletions lib/Doctrine/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,6 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
*/
protected $_parsers = array();

/**
* @var array $_pendingJoinConditions an array containing pending joins
*/
protected $_pendingJoinConditions = array();

/**
* @var array
*/
Expand Down
5 changes: 5 additions & 0 deletions lib/Doctrine/Query/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,11 @@ abstract class Doctrine_Query_Abstract
*/
protected $_preQueried = false;

/**
* @var array $_pendingJoinConditions an array containing pending joins
*/
protected $_pendingJoinConditions = array();

/**
* Fix for http://www.doctrine-project.org/jira/browse/DC-701
*
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/RawSql.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function __construct(Doctrine_Connection $connection = null, Doctrine_Hydrator_A

protected function clear()
{
$this->_preQuery = false;
$this->_preQueried = false;
$this->_pendingJoinConditions = array();
}

Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/Sequence/Mssql.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
*/
class Doctrine_Sequence_Mssql extends Doctrine_Sequence
{
protected $warnings;

/**
* Returns the next free id of a sequence
*
Expand Down
1 change: 1 addition & 0 deletions lib/Doctrine/Task/BuildAll.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class Doctrine_Task_BuildAll extends Doctrine_Task
$optionalArguments = array();

protected $models,
$createDb,
$tables;

public function __construct($dispatcher = null)
Expand Down
3 changes: 3 additions & 0 deletions lib/Doctrine/Task/BuildAllLoad.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ class Doctrine_Task_BuildAllLoad extends Doctrine_Task
public $description = 'Calls build-all, and load-data',
$requiredArguments = array(),
$optionalArguments = array();

protected $buildAll,
$loadData;

public function __construct($dispatcher = null)
{
Expand Down
3 changes: 3 additions & 0 deletions lib/Doctrine/Task/BuildAllReload.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ class Doctrine_Task_BuildAllReload extends Doctrine_Task
public $description = 'Calls rebuild-db and load-data',
$requiredArguments = array(),
$optionalArguments = array();

protected $rebuildDb,
$loadData;

public function __construct($dispatcher = null)
{
Expand Down
4 changes: 4 additions & 0 deletions lib/Doctrine/Task/RebuildDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ class Doctrine_Task_RebuildDb extends Doctrine_Task
public $description = 'Drops and re-creates databases',
$requiredArguments = array(),
$optionalArguments = array();

protected $dropDb,
$createDb,
$createTables;

public function __construct($dispatcher = null)
{
Expand Down
2 changes: 2 additions & 0 deletions tests/Cache/DbTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
*/
class Doctrine_Cache_Db_TestCase extends Doctrine_Cache_Abstract_TestCase
{
protected $cache;

public function setUp()
{
parent::setUp();
Expand Down
3 changes: 3 additions & 0 deletions tests/Connection/CustomTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
*/
class Doctrine_Connection_Custom_TestCase extends Doctrine_UnitTestCase
{
protected $_conn;
protected $_dbh;

public function setUp()
{
$manager = Doctrine_Manager::getInstance();
Expand Down
6 changes: 5 additions & 1 deletion tests/DoctrineTest/Doctrine_UnitTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ class Doctrine_UnitTestCase extends UnitTestCase
protected $dataDict;
protected $transaction;
protected $_name;

protected $query;
protected $profiler;
protected $import;
protected $sequence;
protected $exc;

protected $init = false;

Expand Down
2 changes: 2 additions & 0 deletions tests/DoctrineTest/GroupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ class GroupTest extends UnitTestCase
protected $_title;
protected $_onlyRunFailed = false;

protected $_formatter;

public function __construct($title, $name)
{
$this->_title = $title;
Expand Down
6 changes: 6 additions & 0 deletions tests/ManagerTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
*/
class Doctrine_Manager_TestCase extends Doctrine_UnitTestCase
{
protected $conn1_database;
protected $conn2_database;

protected $conn1;
protected $conn2;

public function testGetInstance() {
$this->assertTrue(Doctrine_Manager::getInstance() instanceOf Doctrine_Manager);
}
Expand Down
2 changes: 2 additions & 0 deletions tests/Record/FromArrayTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
*/
class Doctrine_Record_FromArray_TestCase extends Doctrine_UnitTestCase
{
protected $previous_group;

public function prepareTables()
{
parent::prepareTables();
Expand Down
2 changes: 2 additions & 0 deletions tests/Record/SynchronizeTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
*/
class Doctrine_Record_Synchronize_TestCase extends Doctrine_UnitTestCase
{
private $previous_group;

public function prepareTables()
{
parent::prepareTables();
Expand Down
2 changes: 2 additions & 0 deletions tests/Search/FileTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
*/
class Doctrine_Search_File_TestCase extends Doctrine_UnitTestCase
{
protected $_search;

public function prepareData()
{ }
public function prepareTables()
Expand Down
4 changes: 2 additions & 2 deletions tests/TableTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ public function testGetData()

public function testSetSequenceName()
{
$this->objTable->sequenceName = 'test-seq';
$this->objTable->setOption('sequenceName', 'test-seq');
$this->assertEqual($this->objTable->sequenceName, 'test-seq');
$this->objTable->sequenceName = null;
$this->objTable->setOption('sequenceName', null);
}

public function testCreate()
Expand Down
2 changes: 2 additions & 0 deletions tests/Ticket/1106TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
*/
class Doctrine_Ticket_1106_TestCase extends Doctrine_UnitTestCase
{
protected $user_id;

public function prepareTables()
{
parent::prepareTables();
Expand Down
2 changes: 2 additions & 0 deletions tests/Ticket/1131TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
*/
class Doctrine_Ticket_1131_TestCase extends Doctrine_UnitTestCase
{
private $role_one, $role_two;

public function prepareTables()
{
//$this->tables = array();
Expand Down
4 changes: 4 additions & 0 deletions tests/Ticket/1436TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
*/
class Doctrine_Ticket_1436_TestCase extends Doctrine_UnitTestCase
{
protected $group_one;
protected $group_two;
protected $group_three;

public function prepareTables()
{
parent::prepareTables();
Expand Down
4 changes: 4 additions & 0 deletions tests/Ticket/1992TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
*/
class Doctrine_Ticket_1992_TestCase extends Doctrine_UnitTestCase
{
protected $person;
protected $profile1;
protected $profile2;

public function prepareTables()
{
$this->tables[] = 'Ticket_1992_Person';
Expand Down
2 changes: 2 additions & 0 deletions tests/Ticket/2158TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

class Doctrine_Ticket_2158_TestCase extends Doctrine_UnitTestCase
{
protected $myModel;

public function prepareTables()
{
$this->tables[] = "T2158_Model1";
Expand Down
5 changes: 4 additions & 1 deletion tests/Ticket/982TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
* Test to ensure LocalKey Relations allow 0 for id value
*/
class Doctrine_Ticket_982_TestCase extends Doctrine_UnitTestCase
{
{
protected $myModelOne;
protected $myModelTwo;

public function prepareTables()
{
$this->tables = array();
Expand Down

0 comments on commit 0ee6863

Please sign in to comment.