/** * Retrieves the line the specified constant starts at. * * @param string $filename * @param string $name * * @return int|null */ protected function getStartLineIn($filename, $name) { if (!$filename) { return null; } $parser = new FileParser($filename); return $parser->getLineForRegex("/const\\s+{$name}/"); }
/** * Retrieves the line the specified property starts at. * * @param string $filename * @param string $name * * @return int|null */ protected function getStartLineForPropertyIn($filename, $name) { if (!$filename) { return null; } $parser = new FileParser($filename); return $parser->getLineForRegex("/(?:protected|public|private|static)\\s+\\\${$name}/"); }