Source of file UnderscoreToDash.php

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

../src/Filter/UnderscoreToDash.php

123456789101112131415161718192021222324252627282930313233
Covered by 6 test(s):
  • MvcLite\CacheTest::testGetCacheKey with data set "simple testing"
  • MvcLite\FilterUnderscoreToDashTest::testFilter with data set #0
  • MvcLite\FilterUnderscoreToDashTest::testFilter with data set #1
  • MvcLite\FilterUnderscoreToDashTest::testFilter with data set #2
  • MvcLite\FilterUnderscoreToDashTest::testFilter with data set #3
  • MvcLite\RequestTest::testGetContentType with data set "has no content type, but has accept headers"
343536
<?php
/**
 * underscore to dash 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;

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