Skip to content

Commit a382731

Browse files
committed
Merge pull request #111 from thekid/rfc/remove-ensure
Remove ensure()
2 parents 9128a8b + 0c6ccd1 commit a382731

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

ChangeLog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ XP Framework Core ChangeLog
33

44
## ?.?.? / ????-??-??
55

6+
## 6.9.0 / ????-??-??
7+
8+
### Heads up!
9+
10+
* **Heads up: Removed deprecated ensure()**, which has been replaced
11+
by the `finally` statement.
12+
(@thekid)
13+
614
### Bugfixes
715

816
* Fixed xp-framework/core#110: Fatal error location swallowed - @thekid

src/main/php/lang.base.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,6 @@ function __error($code, $msg, $file, $line) {
281281
}
282282
// }}}
283283

284-
// {{{ proto deprecated void ensure ($t)
285-
// Replacement for finally() which clashes with PHP 5.5.0's finally
286-
function ensure(&$t) {
287-
if (!isset($t)) $t= null;
288-
}
289-
// }}}
290-
291284
// {{{ proto Generic cast (var arg, var type[, bool nullsafe= true])
292285
// Casts an arg NULL-safe
293286
function cast($arg, $type, $nullsafe= true) {
@@ -370,9 +363,7 @@ function with() {
370363
if (($block= array_pop($args)) instanceof \Closure) {
371364
try {
372365
call_user_func_array($block, $args);
373-
} catch (\lang\Throwable $e) {
374-
// Fall through
375-
} ensure($e); {
366+
} finally {
376367
foreach ($args as $arg) {
377368
if (!($arg instanceof \lang\Closeable)) continue;
378369
try {
@@ -381,7 +372,6 @@ function with() {
381372
//
382373
}
383374
}
384-
if ($e) throw($e);
385375
}
386376
}
387377
}

src/main/resources/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.8.1-dev
1+
6.9.0-dev

0 commit comments

Comments
 (0)