Source of file DashToUnderscore.php

Size: 0,742 Bytes - Last Modified: 2015-12-22T09:12:14-05:00

../src/Filter/DashToUnderscore.php

123456789101112131415161718192021222324252627282930313233
Covered by 5 test(s):
  • MvcLite\FilterDashToUnderscoreTest::testFilter with data set #0
  • MvcLite\FilterDashToUnderscoreTest::testFilter with data set #1
  • MvcLite\FilterDashToUnderscoreTest::testFilter with data set #2
  • MvcLite\FilterDashToUnderscoreTest::testFilter with data set #3
  • MvcLite\FilterDashToUnderscoreTest::testFilter with data set #4
343536
<?php
/**
 * dash to underscore filter
 *
 * @category    PHP
 * @package     MvcLite
 * @subpackage  Filter
 * @since       File available since release 1.1.x
 * @author      Cory Collier <corycollier@corycollier.com>
 */

namespace MvcLite\Filter;

use MvcLite\FilterAbstract as FilterAbstract;

/**
 * dash to underscore filter
 *
 * @category    PHP
 * @package     MvcLite
 * @subpackage  Filter
 * @since       Class available since release 1.1.x
 * @author      Cory Collier <corycollier@corycollier.com>
 */
class DashToUnderscore extends FilterAbstract
{
    /**
     * (non-PHPdoc)
     * @see \MvcLite\FilterAbstract::filter()
     */
    public function filter($word = '')
    {
        return strtr($word, ['-' => '_']);
    }
}