Mercurial > hg > isophonics-drupal-site
annotate vendor/phpdocumentor/reflection-common/src/Location.php @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | 7a779792577d |
children |
rev | line source |
---|---|
Chris@12 | 1 <?php |
Chris@12 | 2 /** |
Chris@12 | 3 * This file is part of phpDocumentor. |
Chris@12 | 4 * |
Chris@12 | 5 * For the full copyright and license information, please view the LICENSE |
Chris@12 | 6 * file that was distributed with this source code. |
Chris@12 | 7 * |
Chris@12 | 8 * @copyright 2010-2015 Mike van Riel<mike@phpdoc.org> |
Chris@12 | 9 * @license http://www.opensource.org/licenses/mit-license.php MIT |
Chris@12 | 10 * @link http://phpdoc.org |
Chris@12 | 11 */ |
Chris@12 | 12 |
Chris@12 | 13 namespace phpDocumentor\Reflection; |
Chris@12 | 14 |
Chris@12 | 15 /** |
Chris@12 | 16 * The location where an element occurs within a file. |
Chris@12 | 17 */ |
Chris@12 | 18 final class Location |
Chris@12 | 19 { |
Chris@12 | 20 /** @var int */ |
Chris@12 | 21 private $lineNumber = 0; |
Chris@12 | 22 |
Chris@12 | 23 /** @var int */ |
Chris@12 | 24 private $columnNumber = 0; |
Chris@12 | 25 |
Chris@12 | 26 /** |
Chris@12 | 27 * Initializes the location for an element using its line number in the file and optionally the column number. |
Chris@12 | 28 * |
Chris@12 | 29 * @param int $lineNumber |
Chris@12 | 30 * @param int $columnNumber |
Chris@12 | 31 */ |
Chris@12 | 32 public function __construct($lineNumber, $columnNumber = 0) |
Chris@12 | 33 { |
Chris@12 | 34 $this->lineNumber = $lineNumber; |
Chris@12 | 35 $this->columnNumber = $columnNumber; |
Chris@12 | 36 } |
Chris@12 | 37 |
Chris@12 | 38 /** |
Chris@12 | 39 * Returns the line number that is covered by this location. |
Chris@12 | 40 * |
Chris@12 | 41 * @return integer |
Chris@12 | 42 */ |
Chris@12 | 43 public function getLineNumber() |
Chris@12 | 44 { |
Chris@12 | 45 return $this->lineNumber; |
Chris@12 | 46 } |
Chris@12 | 47 |
Chris@12 | 48 /** |
Chris@12 | 49 * Returns the column number (character position on a line) for this location object. |
Chris@12 | 50 * |
Chris@12 | 51 * @return integer |
Chris@12 | 52 */ |
Chris@12 | 53 public function getColumnNumber() |
Chris@12 | 54 { |
Chris@12 | 55 return $this->columnNumber; |
Chris@12 | 56 } |
Chris@12 | 57 } |