~ballot/wordpress/openstack-objectstorage-bis

« back to all changes in this revision

Viewing changes to vendor/phpunit/phpunit/src/Util/Filesystem.php

  • Committer: Jacek Nykis
  • Date: 2015-02-11 15:35:31 UTC
  • Revision ID: jacek.nykis@canonical.com-20150211153531-hmy6zi0ov2qfkl0b
Initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/*
 
3
 * This file is part of PHPUnit.
 
4
 *
 
5
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 
6
 *
 
7
 * For the full copyright and license information, please view the LICENSE
 
8
 * file that was distributed with this source code.
 
9
 */
 
10
 
 
11
/**
 
12
 * Filesystem helpers.
 
13
 *
 
14
 * @package    PHPUnit
 
15
 * @subpackage Util
 
16
 * @author     Sebastian Bergmann <sebastian@phpunit.de>
 
17
 * @copyright  Sebastian Bergmann <sebastian@phpunit.de>
 
18
 * @license    http://www.opensource.org/licenses/BSD-3-Clause  The BSD 3-Clause License
 
19
 * @link       http://www.phpunit.de/
 
20
 * @since      Class available since Release 3.0.0
 
21
 */
 
22
class PHPUnit_Util_Filesystem
 
23
{
 
24
    /**
 
25
     * @var array
 
26
     */
 
27
    protected static $buffer = array();
 
28
 
 
29
    /**
 
30
     * Maps class names to source file names:
 
31
     *   - PEAR CS:   Foo_Bar_Baz -> Foo/Bar/Baz.php
 
32
     *   - Namespace: Foo\Bar\Baz -> Foo/Bar/Baz.php
 
33
     *
 
34
     * @param  string $className
 
35
     * @return string
 
36
     * @since  Method available since Release 3.4.0
 
37
     */
 
38
    public static function classNameToFilename($className)
 
39
    {
 
40
        return str_replace(
 
41
            array('_', '\\'),
 
42
            DIRECTORY_SEPARATOR,
 
43
            $className
 
44
        ) . '.php';
 
45
    }
 
46
}