Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Filter / BaseName.php
blob5d2ed0db8919706c9315252b8e1dda9d04936e5b
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\Filter;
12 class BaseName extends AbstractFilter
14 /**
15 * Defined by Zend\Filter\FilterInterface
17 * Returns basename($value).
19 * If the value provided is non-scalar, the value will remain unfiltered
20 * and an E_USER_WARNING will be raised indicating it's unfilterable.
22 * @param string $value
23 * @return string|mixed
25 public function filter($value)
27 if (null === $value) {
28 return null;
31 if (!is_scalar($value)) {
32 trigger_error(
33 sprintf(
34 '%s expects parameter to be scalar, "%s" given; cannot filter',
35 __METHOD__,
36 (is_object($value) ? get_class($value) : gettype($value))
38 E_USER_WARNING
40 return $value;
43 return basename((string) $value);