ClassFilter.php 672 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php

/*
 * © 2016 IRSTEA
 * Guillaume Perréal <guillaume.perreal@irstea.fr>
 * Tous droits réservés.
 */

namespace Irstea\PlantUmlBundle\Model\Filter;

use ReflectionClass;

/**
 * Description of DirectoryFilter
 *
 * @author Guillaume Perréal <guillaume.perreal@irstea.fr>
 */
18
class ClassFilter extends AbstractListFilter
19
{
20
21
    const CONF_TYPE = 'classes';

22
23
24
25
    protected function extract(ReflectionClass $class)
    {
        return $class->getName();
    }
26

27
    protected function matches($tested, $reference)
28
    {
29
        return $tested === $reference;
30
31
    }

32
    protected function normalize($className)
33
    {
34
         return trim($className, '\\');
35
36
    }
}