Inspekt\Inspekt::noPath PHP Method

noPath() public static method

Returns basename(value).
public static noPath ( mixed $value ) : mixed
$value mixed
return mixed
    public static function noPath($value)
    {
        if (Inspekt::isArrayOrArrayObject($value)) {
            return Inspekt::walkArray($value, 'noPath');
        } else {
            return basename($value);
        }
    }

Usage Example

コード例 #1
0
ファイル: InspektTest.php プロジェクト: funkatron/inspekt
 /**
  *
  */
 public function testNoPath()
 {
     $input = './../../../../../../../../../etc/passwd';
     $expect = 'passwd';
     $this->assertSame($expect, Inspekt::noPath($input));
 }