ClassFilter.php 601 Bytes
Newer Older
1
<?php declare(strict_types=1);
2
/*
Guillaume Perréal's avatar
CS.    
Guillaume Perréal committed
3
4
 * Copyright (C) 2016-2017 IRSTEA
 * All rights reserved.
5
6
7
8
9
10
11
 */

namespace Irstea\PlantUmlBundle\Model\Filter;

use ReflectionClass;

/**
Guillaume Perréal's avatar
CS.    
Guillaume Perréal committed
12
 * Description of DirectoryFilter.
13
 */
14
class ClassFilter extends AbstractListFilter
15
{
16
    public const CONF_TYPE = 'classes';
17

18
19
20
21
    protected function extract(ReflectionClass $class)
    {
        return $class->getName();
    }
22

23
    protected function matches($tested, $reference)
24
    {
25
        return $tested === $reference;
26
27
    }

28
    protected function normalize($className)
29
    {
Guillaume Perréal's avatar
CS.    
Guillaume Perréal committed
30
        return trim($className, '\\');
31
32
    }
}