ProfessionalWiki / AutomatedValues

Wikibase extension that allows defining rules to automatically set labels or aliases based on Statement values
https://wikibase.consulting/automating-values-in-wikibase
GNU General Public License v2.0
6 stars 3 forks source link

Add WB 38+ compat #20

Closed JeroenDeDauw closed 1 year ago

JeroenDeDauw commented 2 years ago
use Wikibase\DataModel\Entity\NumericPropertyId;
use Wikibase\DataModel\Entity\PropertyId;

class Compat {

    public static function newPId( string $id ): PropertyId {
        if ( class_exists( NumericPropertyId::class ) ) {
            return new NumericPropertyId( $id );
        }

        return new PropertyId( $id );
    }

}