Skip to content

Commit b3c176d

Browse files
authored
Merge pull request #91 from BeAPI/compat/fix-method-decla
compat/fix-singleton-funcions-declaration
2 parents bd2c852 + 82f8a3b commit b3c176d

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog ##
22

3+
## 2.1.3 - 21 Sept 2023
4+
* Compat to PHP 8.1 change singleton functions declarations
5+
36
## 2.1.2 - 19 May 2023
47
* Fix final function must have public visibility.
58

bea-media-analytics.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?php
22
/*
33
Plugin Name: BEA - Media Analytics
4-
Version: 2.1.2
4+
Version: 2.1.3
55
Plugin URI: https://github.com/BeAPI/bea-media-analytics
66
Description: Find where and how media are used across your site.
77
Author: Be API Technical team
88
Author URI: https://beapi.fr
99
Domain Path: languages
1010
Text Domain: bea-media-analytics
11-
Contributors: Maxime Culea, Amaury Balmer
11+
Contributors: Maxime Culea, Amaury Balmer, Ingrid Azéma, François de Cambourg
1212
1313
----
1414
@@ -35,7 +35,7 @@
3535
}
3636

3737
// Plugin constants
38-
define( 'BEA_MEDIA_ANALYTICS_VERSION', '2.1.2' );
38+
define( 'BEA_MEDIA_ANALYTICS_VERSION', '2.1.3' );
3939
define( 'BEA_MEDIA_ANALYTICS_MIN_PHP_VERSION', '5.6' );
4040

4141
// Plugin URL and PATH

classes/singleton.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,18 @@ protected function init() {}
4646
/**
4747
* prevent the instance from being cloned
4848
*
49-
* @return void
49+
* @throws \LogicException
5050
*/
51-
final public function __clone() {
52-
}
51+
final public function __clone() {
52+
throw new \LogicException( 'A singleton must not be unserialized!' );
53+
}
5354

5455
/**
5556
* prevent from being unserialized
5657
*
57-
* @return void
58+
* @throws \LogicException
5859
*/
59-
final public function __wakeup() {
60-
}
60+
final public function __wakeup() {
61+
throw new \LogicException( 'A singleton must not be unserialized!' );
62+
}
6163
}

0 commit comments

Comments
 (0)