Skip to content

Commit 34c1df1

Browse files
authored
Merge pull request #1026 from oat-sa/release-15.22
Release 15.22
2 parents 7bebeea + c3ce5f8 commit 34c1df1

File tree

10 files changed

+37
-35
lines changed

10 files changed

+37
-35
lines changed

.github/workflows/continuous-integration.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
operating-system: [ ubuntu-latest ]
17-
php-version: [ '7.2', '7.3', '7.4', '8.0', '8.1' ]
17+
php-version: [ '7.4', '8.0', '8.1' ]
1818
include:
19-
- php-version: '7.2'
19+
- php-version: '8.1'
2020
coverage: true
2121

2222
steps:

common/cache/class.SingletonCache.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ public static function singleton()
5555
{
5656
$returnValue = null;
5757

58-
58+
5959
$cacheName = get_called_class();
6060
if (!isset(self::$instances[$cacheName])) {
6161
self::$instances[$cacheName] = new $cacheName();
6262
}
63-
63+
6464
$returnValue = self::$instances[$cacheName];
65-
65+
6666

6767
return $returnValue;
6868
}
@@ -78,7 +78,7 @@ public static function getCached($function)
7878
{
7979
$returnValue = null;
8080

81-
81+
8282
$args = func_get_args();
8383
array_shift($args);
8484
if (!is_string($function)) {
@@ -94,10 +94,10 @@ public static function getCached($function)
9494
if (static::singleton()->has($serial)) {
9595
$returnValue = static::singleton()->has($serial);
9696
} else {
97-
$returnValue = call_user_func_array($fn, $args);
97+
$returnValue = call_user_func_array($function, $args);
9898
static::singleton()->put($serial, $returnValue);
9999
}
100-
100+
101101

102102
return $returnValue;
103103
}

common/oatbox/log/VerboseLogger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class VerboseLogger extends AbstractLogger
5353
*/
5454
public function __construct($minimumLevel)
5555
{
56-
if (! in_array($minimumLevel, array_keys($this->levels))) {
56+
if (!in_array($minimumLevel, $this->levels, true)) {
5757
throw new \common_Exception('Level "' . $minimumLevel . '" is not managed by verbose logger');
5858
}
5959
$this->levelPosition = array_search($minimumLevel, $this->levels);

common/persistence/class.PhpFileDriver.php

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ class common_persistence_PhpFileDriver implements common_persistence_KvDriver, c
5252
* @var string
5353
*/
5454
private $directory;
55-
55+
5656
/**
5757
* Nr of subfolder levels in order to prevent filesystem bottlenecks
5858
* Only used in non human readable mode
5959
*
6060
* @var int
6161
*/
6262
private $levels;
63-
63+
6464
/**
6565
* Whenever or not the filenames should be human readable
6666
* FALSE by default for performance issues with many keys
@@ -81,7 +81,7 @@ class common_persistence_PhpFileDriver implements common_persistence_KvDriver, c
8181
* @var int
8282
*/
8383
const DEFAULT_LEVELS = 3;
84-
84+
8585
const DEFAULT_MASK = 0700;
8686

8787
/**
@@ -103,7 +103,7 @@ public function connect($id, array $params)
103103

104104
return new common_persistence_KeyValuePersistence($params, $this);
105105
}
106-
106+
107107
/**
108108
* (non-PHPdoc)
109109
* @see common_persistence_KvDriver::set()
@@ -239,7 +239,13 @@ public function get($id)
239239
*/
240240
private function readFile($id)
241241
{
242-
return @include $this->getPath($id);
242+
$path = $this->getPath($id);
243+
244+
if (is_readable($path)) {
245+
return @include $path;
246+
}
247+
248+
return false;
243249
}
244250

245251
/**
@@ -264,7 +270,7 @@ public function exists($id)
264270
return $this->get($id) !== false;
265271
}
266272
}
267-
273+
268274
/**
269275
* (non-PHPdoc)
270276
* @see common_persistence_KvDriver::del()
@@ -386,7 +392,7 @@ protected function getPath($key)
386392
}
387393
return $this->directory . $path . '.php';
388394
}
389-
395+
390396
/**
391397
* Cannot use helpers_File::sanitizeInjectively() because
392398
* of backwards compatibility
@@ -402,7 +408,7 @@ protected function sanitizeReadableFileName($key)
402408
}
403409
return $path;
404410
}
405-
411+
406412
/**
407413
* Generate the php code that returns the provided value
408414
*

composer.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,10 @@
5454
"tao-extension-name": "generis"
5555
},
5656
"require": {
57-
"php": "^7.1",
5857
"clearfw/clearfw": "~1.2.0",
5958
"easyrdf/easyrdf": "^1.1",
60-
"doctrine/dbal": "^2.10.1",
61-
"doctrine/annotations": "^1.6.0",
59+
"doctrine/dbal": "^2.12",
60+
"doctrine/annotations": "^1.13",
6261
"laminas/laminas-servicemanager": "~2.5.0",
6362
"league/flysystem": "~1.0",
6463
"league/flysystem-memory": "~1.0",
@@ -80,7 +79,7 @@
8079
"ext-pdo": "*"
8180
},
8281
"require-dev": {
83-
"mikey179/vfsstream": "1.4.0",
82+
"mikey179/vfsstream": "~1",
8483
"phpunit/phpunit": "^8.5",
8584
"php-mock/php-mock": "^2.0"
8685
},

test/integration/mutex/test_action.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,14 @@
1010
$sleep = (int) $argv[1];
1111
$timeout = (int) $argv[2];
1212

13-
$service = getInstance();
13+
$service = getLockServiceInstance();
1414
$factory = $service->getLockFactory();
1515
$lock = $factory->createLock($actionId, $timeout);
1616
$lock->acquire(true);
1717
sleep($sleep);
1818
$lock->release();
1919

20-
/**
21-
* @return LockService
22-
*/
23-
function getInstance()
20+
function getLockServiceInstance(): LockService
2421
{
2522
return ServiceManager::getServiceManager()->get(LockService::class);
2623
}

test/unit/ConfigurationTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function testPHPRuntime()
9999
$this->assertTrue($php->isOptional());
100100

101101
// max & min test.
102-
$php = new \common_configuration_PHPRuntime('5.3', '7.4.x');
102+
$php = new \common_configuration_PHPRuntime('7.4', '8.1.x');
103103
$report = $php->check();
104104

105105
$this->assertEquals($report->getStatus(), \common_configuration_Report::VALID);
@@ -169,7 +169,7 @@ function testPHPExtension()
169169
$report = $ext->check();
170170
$this->assertEquals($report->getStatus(), \common_configuration_Report::VALID);
171171

172-
$ext->setMax('7.5');
172+
$ext->setMax('8.2');
173173
$report = $ext->check();
174174
$this->assertEquals($report->getStatus(), \common_configuration_Report::VALID);
175175

@@ -310,7 +310,7 @@ public function testSimpleComponentCollection()
310310

311311
public function testComponentFactory()
312312
{
313-
$component = \common_configuration_ComponentFactory::buildPHPRuntime('5.0', '7.4.x', true);
313+
$component = \common_configuration_ComponentFactory::buildPHPRuntime('5.0', '8.1.x', true);
314314
$this->assertInstanceOf(\common_configuration_PHPRuntime::class, $component);
315315
$this->assertEquals($component->getMin(), '5.0');
316316
// 5.5.x will be replaced internally
@@ -353,7 +353,7 @@ public function testComponentFactory()
353353
$this->assertInstanceOf(\common_configuration_Report::class, $report);
354354
$this->assertEquals($report->getStatus(), \common_configuration_Report::VALID);
355355

356-
$array = ['type' => 'PHPRuntime', 'value' => ['min' => '5.0', 'max' => '7.4.x', 'optional' => true]];
356+
$array = ['type' => 'PHPRuntime', 'value' => ['min' => '5.0', 'max' => '8.1.x', 'optional' => true]];
357357
$component = \common_configuration_ComponentFactory::buildFromArray($array);
358358
$this->assertInstanceOf(\common_configuration_PHPRuntime::class, $component);
359359
$this->assertEquals($component->getMin(), '5.0');

test/unit/common/configuration/ComponentFactoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ public function testBuildFileSystemComponent()
9898
$this->assertTrue($output->isOptional());
9999
$this->assertTrue($output->getRecursive());
100100
$this->assertTrue($output->getMustCheckIfEmpty());
101-
$this->assertEquals('FileSystemComponentCheck_3', $output->getName());
101+
$this->assertStringStartsWith('FileSystemComponentCheck_', $output->getName());
102102

103103
$output2 = $this->subject->buildFileSystemComponent('/path2', 'rw');
104104

105-
$this->assertEquals('FileSystemComponentCheck_4', $output2->getName());
105+
$this->assertStringStartsWith('FileSystemComponentCheck_', $output2->getName());
106106
}
107107

108108
public function testBuildCustomFailureOnNonExistingExtension()

test/unit/core/Middleware/MiddlewareRequestHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function testAssertRoute(string $path, string $httpMethod, array $middlew
9494
$queue = array_merge(
9595
array_values($middlewaresMocks),
9696
[
97-
static function ($request, $next): ResponseInterface {
97+
function ($request, $next): ResponseInterface {
9898
return $this->originalResponse;
9999
}
100100
]
@@ -175,7 +175,7 @@ public function testAssertNoRoute(string $path, string $httpMethod): void
175175
{
176176
$queue = array_merge(
177177
[
178-
static function ($request, $next): ResponseInterface {
178+
function ($request, $next): ResponseInterface {
179179
return $this->originalResponse;
180180
}
181181
]

test/unit/oatbox/mutex/test_action.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use oat\oatbox\mutex\NoLockStorage;
77

88
// phpcs:disable
9-
require __DIR__ . '/../../../../../vendor/autoload.php';
9+
require __DIR__ . '/../../../bootstrap.php';
1010

1111
function getInstance($class, $dir): LockService
1212
{

0 commit comments

Comments
 (0)