Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 4
CRAP
0.00% covered (danger)
0.00%
0 / 6
Link
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 4
30
0.00% covered (danger)
0.00%
0 / 6
 __construct
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 3
 getTarget
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 getLabel
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 equals
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
<?php
namespace ProofreadPage;
use Title;
/**
 * @license GPL-2.0-or-later
 *
 * A link to a MediaWiki page. It is composed by a target and a label
 */
class Link {
    /** @var Title */
    private $target;
    /** @var string */
    private $label;
    /**
     * @param Title $target
     * @param string $label
     */
    public function __construct( Title $target, $label ) {
        $this->target = $target;
        $this->label = $label;
    }
    /**
     * @return Title
     */
    public function getTarget() {
        return $this->target;
    }
    /**
     * @return string
     */
    public function getLabel() {
        return $this->label;
    }
    /**
     * @param Link $other
     * @return bool
     */
    public function equals( Link $other ) {
        return $this->target->equals( $other->target ) && $this->label === $other->label;
    }
}