| 1 |
218
|
mapi |
<?php |
|
| 2 |
↓
|
mapi |
/** |
|
| 3 |
↓
|
mapi |
* This file is part of PHP_Depend. |
|
| 4 |
537
|
mapi |
* |
|
| 5 |
218
|
mapi |
* PHP Version 5 |
|
| 6 |
↓
|
mapi |
* |
|
| 7 |
1030
|
mapi |
* Copyright (c) 2008-2010, Manuel Pichler <mapi@pdepend.org>. |
|
| 8 |
218
|
mapi |
* All rights reserved. |
|
| 9 |
↓
|
mapi |
* |
|
| 10 |
↓
|
mapi |
* Redistribution and use in source and binary forms, with or without |
|
| 11 |
↓
|
mapi |
* modification, are permitted provided that the following conditions |
|
| 12 |
↓
|
mapi |
* are met: |
|
| 13 |
↓
|
mapi |
* |
|
| 14 |
↓
|
mapi |
* * Redistributions of source code must retain the above copyright |
|
| 15 |
↓
|
mapi |
* notice, this list of conditions and the following disclaimer. |
|
| 16 |
↓
|
mapi |
* |
|
| 17 |
↓
|
mapi |
* * Redistributions in binary form must reproduce the above copyright |
|
| 18 |
↓
|
mapi |
* notice, this list of conditions and the following disclaimer in |
|
| 19 |
↓
|
mapi |
* the documentation and/or other materials provided with the |
|
| 20 |
↓
|
mapi |
* distribution. |
|
| 21 |
↓
|
mapi |
* |
|
| 22 |
↓
|
mapi |
* * Neither the name of Manuel Pichler nor the names of his |
|
| 23 |
↓
|
mapi |
* contributors may be used to endorse or promote products derived |
|
| 24 |
↓
|
mapi |
* from this software without specific prior written permission. |
|
| 25 |
↓
|
mapi |
* |
|
| 26 |
↓
|
mapi |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
|
| 27 |
↓
|
mapi |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
|
| 28 |
↓
|
mapi |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
|
| 29 |
↓
|
mapi |
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
|
| 30 |
↓
|
mapi |
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
|
| 31 |
↓
|
mapi |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
|
| 32 |
↓
|
mapi |
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
|
| 33 |
↓
|
mapi |
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
|
| 34 |
↓
|
mapi |
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
|
| 35 |
↓
|
mapi |
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
|
| 36 |
↓
|
mapi |
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
| 37 |
↓
|
mapi |
* POSSIBILITY OF SUCH DAMAGE. |
|
| 38 |
↓
|
mapi |
* |
|
| 39 |
↓
|
mapi |
* @category QualityAssurance |
|
| 40 |
↓
|
mapi |
* @package PHP_Depend |
|
| 41 |
↓
|
mapi |
* @subpackage Code |
|
| 42 |
269
|
mapi |
* @author Manuel Pichler <mapi@pdepend.org> |
|
| 43 |
1030
|
mapi |
* @copyright 2008-2010 Manuel Pichler. All rights reserved. |
|
| 44 |
218
|
mapi |
* @license http://www.opensource.org/licenses/bsd-license.php BSD License |
|
| 45 |
↓
|
mapi |
* @version SVN: $Id: DefaultVisitorDummy.php 1155 2010-03-10 07:28:29Z mapi $ |
|
| 46 |
824
|
mapi |
* @link http://pdepend.org/ |
|
| 47 |
218
|
mapi |
*/ |
|
| 48 |
↓
|
mapi |
|
|
| 49 |
583
|
mapi |
require_once 'PHP/Depend/Visitor/AbstractVisitor.php'; |
|
| 50 |
236
|
mapi |
|
|
| 51 |
218
|
mapi |
/** |
|
| 52 |
↓
|
mapi |
* Dummy implementation of the default visitor. |
|
| 53 |
↓
|
mapi |
* |
|
| 54 |
↓
|
mapi |
* @category QualityAssurance |
|
| 55 |
↓
|
mapi |
* @package PHP_Depend |
|
| 56 |
↓
|
mapi |
* @subpackage Code |
|
| 57 |
269
|
mapi |
* @author Manuel Pichler <mapi@pdepend.org> |
|
| 58 |
1030
|
mapi |
* @copyright 2008-2010 Manuel Pichler. All rights reserved. |
|
| 59 |
218
|
mapi |
* @license http://www.opensource.org/licenses/bsd-license.php BSD License |
|
| 60 |
↓
|
mapi |
* @version Release: @package_version@ |
|
| 61 |
824
|
mapi |
* @link http://pdepend.org/ |
|
| 62 |
218
|
mapi |
*/ |
|
| 63 |
583
|
mapi |
class PHP_Depend_Visitor_DefaultVisitorDummy |
|
| 64 |
↓
|
mapi |
extends PHP_Depend_Visitor_AbstractVisitor |
|
| 65 |
218
|
mapi |
{ |
|
| 66 |
↓
|
mapi |
/** |
|
| 67 |
↓
|
mapi |
* Collected visit order. |
|
| 68 |
↓
|
mapi |
* |
|
| 69 |
↓
|
mapi |
* @var array(string=>integer) |
|
| 70 |
↓
|
mapi |
*/ |
|
| 71 |
↓
|
mapi |
public $visits = array(); |
|
| 72 |
537
|
mapi |
|
|
| 73 |
218
|
mapi |
/** |
|
| 74 |
537
|
mapi |
* Visits a class node. |
|
| 75 |
218
|
mapi |
* |
|
| 76 |
↓
|
mapi |
* @param PHP_Depend_Code_Class $class The current class node. |
|
| 77 |
537
|
mapi |
* |
|
| 78 |
218
|
mapi |
* @return void |
|
| 79 |
582
|
mapi |
* @see PHP_Depend_VisitorI::visitClass() |
|
| 80 |
218
|
mapi |
*/ |
|
| 81 |
↓
|
mapi |
public function visitClass(PHP_Depend_Code_Class $class) |
|
| 82 |
↓
|
mapi |
{ |
|
| 83 |
↓
|
mapi |
$this->visits[] = $class->getName(); |
|
| 84 |
537
|
mapi |
|
|
| 85 |
218
|
mapi |
parent::visitClass($class); |
|
| 86 |
↓
|
mapi |
} |
|
| 87 |
537
|
mapi |
|
|
| 88 |
218
|
mapi |
/** |
|
| 89 |
537
|
mapi |
* Visits a file node. |
|
| 90 |
218
|
mapi |
* |
|
| 91 |
↓
|
mapi |
* @param PHP_Depend_Code_File $file The current file node. |
|
| 92 |
537
|
mapi |
* |
|
| 93 |
218
|
mapi |
* @return void |
|
| 94 |
582
|
mapi |
* @see PHP_Depend_VisitorI::visitFile() |
|
| 95 |
218
|
mapi |
*/ |
|
| 96 |
↓
|
mapi |
public function visitFile(PHP_Depend_Code_File $file) |
|
| 97 |
↓
|
mapi |
{ |
|
| 98 |
1155
|
mapi |
$this->visits[] = get_class($file); |
|
| 99 |
537
|
mapi |
|
|
| 100 |
218
|
mapi |
parent::visitFile($file); |
|
| 101 |
↓
|
mapi |
} |
|
| 102 |
537
|
mapi |
|
|
| 103 |
218
|
mapi |
/** |
|
| 104 |
537
|
mapi |
* Visits a function node. |
|
| 105 |
218
|
mapi |
* |
|
| 106 |
↓
|
mapi |
* @param PHP_Depend_Code_Function $function The current function node. |
|
| 107 |
537
|
mapi |
* |
|
| 108 |
218
|
mapi |
* @return void |
|
| 109 |
582
|
mapi |
* @see PHP_Depend_VisitorI::visitFunction() |
|
| 110 |
218
|
mapi |
*/ |
|
| 111 |
↓
|
mapi |
public function visitFunction(PHP_Depend_Code_Function $function) |
|
| 112 |
↓
|
mapi |
{ |
|
| 113 |
↓
|
mapi |
$this->visits[] = $function->getName(); |
|
| 114 |
537
|
mapi |
|
|
| 115 |
218
|
mapi |
parent::visitFunction($function); |
|
| 116 |
↓
|
mapi |
} |
|
| 117 |
537
|
mapi |
|
|
| 118 |
218
|
mapi |
/** |
|
| 119 |
↓
|
mapi |
* Visits a code interface object. |
|
| 120 |
↓
|
mapi |
* |
|
| 121 |
↓
|
mapi |
* @param PHP_Depend_Code_Interface $interface The context code interface. |
|
| 122 |
537
|
mapi |
* |
|
| 123 |
218
|
mapi |
* @return void |
|
| 124 |
582
|
mapi |
* @see PHP_Depend_VisitorI::visitInterface() |
|
| 125 |
218
|
mapi |
*/ |
|
| 126 |
↓
|
mapi |
public function visitInterface(PHP_Depend_Code_Interface $interface) |
|
| 127 |
↓
|
mapi |
{ |
|
| 128 |
↓
|
mapi |
$this->visits[] = $interface->getName(); |
|
| 129 |
537
|
mapi |
|
|
| 130 |
218
|
mapi |
parent::visitInterface($interface); |
|
| 131 |
↓
|
mapi |
} |
|
| 132 |
537
|
mapi |
|
|
| 133 |
218
|
mapi |
/** |
|
| 134 |
537
|
mapi |
* Visits a method node. |
|
| 135 |
218
|
mapi |
* |
|
| 136 |
↓
|
mapi |
* @param PHP_Depend_Code_Class $method The method class node. |
|
| 137 |
537
|
mapi |
* |
|
| 138 |
218
|
mapi |
* @return void |
|
| 139 |
582
|
mapi |
* @see PHP_Depend_VisitorI::visitMethod() |
|
| 140 |
218
|
mapi |
*/ |
|
| 141 |
↓
|
mapi |
public function visitMethod(PHP_Depend_Code_Method $method) |
|
| 142 |
↓
|
mapi |
{ |
|
| 143 |
↓
|
mapi |
$this->visits[] = $method->getName(); |
|
| 144 |
537
|
mapi |
|
|
| 145 |
218
|
mapi |
parent::visitMethod($method); |
|
| 146 |
↓
|
mapi |
} |
|
| 147 |
537
|
mapi |
|
|
| 148 |
218
|
mapi |
/** |
|
| 149 |
537
|
mapi |
* Visits a package node. |
|
| 150 |
218
|
mapi |
* |
|
| 151 |
↓
|
mapi |
* @param PHP_Depend_Code_Class $package The package class node. |
|
| 152 |
537
|
mapi |
* |
|
| 153 |
218
|
mapi |
* @return void |
|
| 154 |
582
|
mapi |
* @see PHP_Depend_VisitorI::visitPackage() |
|
| 155 |
218
|
mapi |
*/ |
|
| 156 |
↓
|
mapi |
public function visitPackage(PHP_Depend_Code_Package $package) |
|
| 157 |
↓
|
mapi |
{ |
|
| 158 |
↓
|
mapi |
$this->visits[] = $package->getName(); |
|
| 159 |
537
|
mapi |
|
|
| 160 |
218
|
mapi |
parent::visitPackage($package); |
|
| 161 |
↓
|
mapi |
} |
|
| 162 |
537
|
mapi |
|
|
| 163 |
218
|
mapi |
/** |
|
| 164 |
537
|
mapi |
* Visits a property node. |
|
| 165 |
218
|
mapi |
* |
|
| 166 |
↓
|
mapi |
* @param PHP_Depend_Code_Property $property The property class node. |
|
| 167 |
537
|
mapi |
* |
|
| 168 |
218
|
mapi |
* @return void |
|
| 169 |
582
|
mapi |
* @see PHP_Depend_VisitorI::visitProperty() |
|
| 170 |
218
|
mapi |
*/ |
|
| 171 |
↓
|
mapi |
public function visitProperty(PHP_Depend_Code_Property $property) |
|
| 172 |
↓
|
mapi |
{ |
|
| 173 |
↓
|
mapi |
$this->visits[] = $property->getName(); |
|
| 174 |
537
|
mapi |
|
|
| 175 |
218
|
mapi |
parent::visitProperty($property); |
|
| 176 |
↓
|
mapi |
} |
|
| 177 |
↓
|
mapi |
} |
|