Skip to content

Commit c60cb3b

Browse files
committed
Migrated to PHP 8.0.
1 parent b7b6b13 commit c60cb3b

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
}
2525
],
2626
"require": {
27-
"php": "^7.1",
27+
"php": "^7.2|8.0.*",
2828
"tightenco/collect": "^5.6"
2929
},
3030
"require-dev": {

tests/InitialiseGenomeTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace PHPExperts\GAO\Tests;
44

55
use PHPUnit\Framework\TestCase;
6-
use PHPExperts\GAO\Tests\Solutions\Mixed;
6+
use PHPExperts\GAO\Tests\Solutions\MixedVars;
77
use PHPExperts\GAO\Tests\Solutions\Chars;
88
use PHPExperts\GAO\Tests\Solutions\Floats;
99
use PHPExperts\GAO\Tests\Solutions\Integers;
@@ -50,7 +50,7 @@ public function can_intialise_genome_as_floats()
5050
/** @test */
5151
public function can_intialise_genome_with_mixed_chromosome_types()
5252
{
53-
$solution = new Mixed();
53+
$solution = new MixedVars();
5454
$solution->initialise();
5555

5656
$this->assertEquals(3, sizeof($solution->chromosomes()));

tests/OptimiserTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
use PHPExperts\GAO\Breeder;
66
use PHPExperts\GAO\Population;
77
use PHPUnit\Framework\TestCase;
8-
use PHPExperts\GAO\Tests\Solutions\Mixed;
8+
use PHPExperts\GAO\Tests\Solutions\MixedVars;
99

1010
class BreederTest extends TestCase
1111
{
1212
/** @test */
1313
public function can_load_evaluation_data_after_gao_construction_and_run_optimiser()
1414
{
15-
$gao = new Breeder(new Population(Mixed::class, 10));
15+
$gao = new Breeder(new Population(MixedVars::class, 10));
1616
$gao->loadEvaluationData('anything');
1717
$gao->run();
1818
$this->addToAssertionCount(1);
@@ -21,27 +21,27 @@ public function can_load_evaluation_data_after_gao_construction_and_run_optimise
2121
/** @test */
2222
public function can_load_evaluation_data_during_gao_construction_and_run_optimiser()
2323
{
24-
$gao = new Breeder(new Population(Mixed::class, 10), ['evaluationData' => 'something']);
24+
$gao = new Breeder(new Population(MixedVars::class, 10), ['evaluationData' => 'something']);
2525
$gao->run();
2626
$this->addToAssertionCount(1);
2727
}
2828

2929
/** @test */
3030
public function running_optimiser_yields_results_for_each_generation()
3131
{
32-
$optimiser = new Breeder(new Population(Mixed::class, 10));
32+
$optimiser = new Breeder(new Population(MixedVars::class, 10));
3333
$optimiser->run();
3434

3535
$this->assertCount(10, $optimiser->results);
3636
foreach ($optimiser->results as $result) {
37-
$this->assertInstanceOf(Mixed::class, $result);
37+
$this->assertInstanceOf(MixedVars::class, $result);
3838
}
3939
}
4040

4141
/** @test */
4242
public function number_of_generations_is_controllable()
4343
{
44-
$optimiser = new Breeder(new Population(Mixed::class, 10), ['maxGenerations' => 5]);
44+
$optimiser = new Breeder(new Population(MixedVars::class, 10), ['maxGenerations' => 5]);
4545
$optimiser->run();
4646

4747
$this->assertCount(5, $optimiser->results);

tests/PopulationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use PHPExperts\GAO\Population;
66
use PHPUnit\Framework\TestCase;
7-
use PHPExperts\GAO\Tests\Solutions\Mixed;
7+
use PHPExperts\GAO\Tests\Solutions\MixedVars;
88
use PHPExperts\GAO\Tests\Solutions\Integers;
99

1010
class PopulationTest extends TestCase
@@ -32,7 +32,7 @@ public function can_initialise_new_population()
3232
/** @test */
3333
public function can_evaluate_a_population_without_evaluation_data()
3434
{
35-
$population = new Population(Mixed::class, 3);
35+
$population = new Population(MixedVars::class, 3);
3636
$population->evaluate(null);
3737
$best = $population->findBest();
3838

tests/Solutions/Mixed.php renamed to tests/Solutions/MixedVars.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use PHPExperts\GAO\Solution;
66

7-
class Mixed extends Solution
7+
class MixedVars extends Solution
88
{
99
public function genome()
1010
{

0 commit comments

Comments
 (0)