1: <?php
2: /**
3: * Horde_Pear_Package_Contents_Ignore_Composite:: combines several ignore
4: * handlers.
5: *
6: * PHP version 5
7: *
8: * @category Horde
9: * @package Pear
10: * @author Gunnar Wrobel <wrobel@pardus.de>
11: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
12: * @link http://pear.horde.org/index.php?package=Pear
13: */
14:
15: /**
16: * Horde_Pear_Package_Contents_Ignore_Composite:: combines several ignore
17: * handlers.
18: *
19: * Copyright 2011-2012 Horde LLC (http://www.horde.org/)
20: *
21: * See the enclosed file COPYING for license information (LGPL). If you
22: * did not receive this file, see http://www.horde.org/licenses/lgpl21.
23: *
24: * @category Horde
25: * @package Pear
26: * @author Gunnar Wrobel <wrobel@pardus.de>
27: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
28: * @link http://pear.horde.org/index.php?package=Pear
29: */
30: class Horde_Pear_Package_Contents_Ignore_Composite
31: implements Horde_Pear_Package_Contents_Ignore
32: {
33: /**
34: * The ignore handlers.
35: *
36: * @var array
37: */
38: private $_ignores;
39:
40: /**
41: * Constructor.
42: *
43: * @param array $ignores The ignore handlers.
44: */
45: public function __construct($ignores)
46: {
47: $this->_ignores = $ignores;
48: }
49:
50: /**
51: * Tell whether to ignore the element.
52: *
53: * @param SplFileInfo $element The element to check.
54: *
55: * @return bool True if the element should be ignored, false otherwise.
56: */
57: public function isIgnored(SplFileInfo $element)
58: {
59: foreach ($this->_ignores as $ignore) {
60: if ($ignore->isIgnored($element)) {
61: return true;
62: }
63: }
64: return false;
65: }
66: }