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