Skip to content

Commit e48c6b1

Browse files
committed
Improve autoloading code and bump to 0.1.1
1 parent 2c216ad commit e48c6b1

File tree

4 files changed

+12
-50
lines changed

4 files changed

+12
-50
lines changed

DataValuesInterfaces.classes.php

-20
This file was deleted.

DataValuesInterfaces.php

+2-16
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,13 @@
1515
return 1;
1616
}
1717

18-
define( 'DATAVALUES_INTERFACES_VERSION', '0.1' );
18+
define( 'DATAVALUES_INTERFACES_VERSION', '0.1.1' );
1919

2020
/**
2121
* @deprecated
2222
*/
2323
define( 'DataValuesInterfaces_VERSION', DATAVALUES_INTERFACES_VERSION );
2424

25-
spl_autoload_register( function ( $className ) {
26-
$className = ltrim( $className, '\\' );
27-
28-
static $classes = false;
29-
30-
if ( $classes === false ) {
31-
$classes = include( __DIR__ . '/' . 'DataValuesInterfaces.classes.php' );
32-
}
33-
34-
if ( array_key_exists( $className, $classes ) ) {
35-
include_once __DIR__ . '/' . $classes[$className];
36-
}
37-
} );
38-
3925
if ( defined( 'MEDIAWIKI' ) ) {
4026
$GLOBALS['wgExtensionCredits']['datavalues'][] = array(
4127
'path' => __DIR__,
@@ -44,7 +30,7 @@
4430
'author' => array(
4531
'[https://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw]',
4632
),
47-
'url' => 'https://github.com/wikimedia/mediawiki-extensions-DataValuesInterfaces',
33+
'url' => 'https://github.com/DataValues/Interfaces',
4834
'description' => 'Defines interfaces for ValueParsers, ValueFormatters and ValueValidators',
4935
);
5036
}

composer.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@
2424
},
2525
"autoload": {
2626
"files" : [
27-
"DataValuesInterfaces.php"
28-
]
27+
"DataValuesInterfaces.php",
28+
"tests/ValueFormatters/ValueFormatterTestBase.php"
29+
],
30+
"psr-0": {
31+
"ValueFormatters\\": "src",
32+
"ValueParsers\\": "src",
33+
"ValueValidators\\": "src"
34+
}
2935
}
3036
}

tests/bootstrap.php

+2-12
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
<?php
22

3-
/**
4-
* PHPUnit test bootstrap file for the DataValuesInterfaces library.
5-
*
6-
* @since 0.1
7-
*
8-
* @file
9-
* @ingroup DataValues
10-
*
11-
* @licence GNU GPL v2+
12-
* @author Jeroen De Dauw < [email protected] >
13-
*/
3+
echo exec( 'composer update' ) . "\n";
144

15-
require_once( __DIR__ . '/../DataValuesInterfaces.php' );
5+
require_once( __DIR__ . '/../vendor/autoload.php' );

0 commit comments

Comments
 (0)