1: <?php
2: /**
3: * Pinoco: makes existing static web site dynamic transparently.
4: * Copyright 2010-2012, Hisateru Tanaka <tanakahisateru@gmail.com>
5: *
6: * Licensed under The MIT License
7: * Redistributions of files must retain the above copyright notice.
8: *
9: * PHP Version 5
10: *
11: * @author Hisateru Tanaka <tanakahisateru@gmail.com>
12: * @copyright Copyright 2010-2012, Hisateru Tanaka <tanakahisateru@gmail.com>
13: * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
14: * @package Pinoco
15: */
16:
17: /**
18: * Optional parameter placeholder.
19: *
20: * @package Pinoco
21: */
22: class Pinoco_OptionalParam {
23:
24: const UNSPECIFIED = 'c62c4c3f7fa57c7acfcc93073527c490-OptionalParameterUnspecified-d5210620220db619214dd7421301cbf7';
25:
26: public static function trim($params)
27: {
28: $params = array_reverse($params);
29: while(!empty($params) && $params[0] instanceof self) {
30: array_shift($params);
31: }
32: return array_reverse($params);
33: }
34:
35: public static function isSpecifiedBy($value)
36: {
37: return $value !== self::UNSPECIFIED;
38: }
39:
40: }
41: