<?php
/**
* Basic artifact
* TODO: Remove matches hard-coding; planned to separate an artifact class per artifact type so
* each one knows how to parse itself
* @author jgonzalez
*
*/
class UML_Artifact {
private $source_code = NULL;
private $regexp = NULL;
public function __construct($source_code, $regexp = NULL) {
$this->source_code = $source_code;
$this->regexp = $regexp;
}
public function getId() {
$matches = array();
preg_match($this->regexp, $this->source_code, $matches);
return $matches[1];
}
public function getName() {
$matches = array();
preg_match($this->regexp, $this->source_code, $matches);
return $matches[2];
}
public function getSourceCode() {
return $this->source_code;
}
public function getRegExp() {
return $this->regexp;
}
}