2014-03-02 21:00:43 +01:00
|
|
|
<?php
|
|
|
|
return function (PHPCI\Plugin\Util\Factory $factory) {
|
|
|
|
$factory->registerResource(
|
|
|
|
// This function will be called when the resource is needed.
|
|
|
|
function() {
|
|
|
|
return array(
|
|
|
|
'Foo' => "Stuff",
|
|
|
|
'Bar' => "More Stuff"
|
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
// In addition to the function for building the resource the system
|
|
|
|
// also needs to be told when to load the resource. Either or both
|
|
|
|
// of the following arguments can be used (null to ignore)
|
|
|
|
|
|
|
|
// This resource will only be given when the argument name is:
|
|
|
|
"ResourceArray",
|
|
|
|
|
|
|
|
// The resource will only be given when the type hint is:
|
|
|
|
PHPCI\Plugin\Util\Factory::TYPE_ARRAY
|
|
|
|
);
|
2015-02-12 15:11:58 +01:00
|
|
|
};
|