PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 6.3.0
Defender Security – Malware Scanner, Login Security & Firewall v6.3.0
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
← All changes | src/class-db.php +19 -3 6.2.1 → 6.3.0 View file →
@@ -29,12 +29,28 @@
29 29 /**
30 30 * Save the current instance.
31 31 *
32 32 * @return false|int
33 - * @throws ReflectionException If class is not defined.
34 33 */
35 - public function save() {
36 - return self::get_orm()->save( $this );
34 + public function save(): bool|int {
35 + try {
36 + return self::get_orm()->save( $this );
37 + } catch ( \Throwable $e ) {
38 + if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
39 + $this->log(
40 + sprintf(
41 + 'Failed to save %s: %s in %s:%d',
42 + static::class,
43 + $e->getMessage(),
44 + $e->getFile(),
45 + $e->getLine()
46 + ),
47 + 'db-save-error.log'
48 + );
49 + }
50 +
51 + return false;
52 + }
37 53 }
38 54
39 55 /**
40 56 * Retrieves the ORM instance from the dependency injection container.