From d374969adef8bc0cfe846b0941465134c074caa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Brala?= Date: Mon, 1 Aug 2016 14:54:29 +0200 Subject: [PATCH] Update readme --- README.MD | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README.MD b/README.MD index cb97c3a..b13dd8f 100644 --- a/README.MD +++ b/README.MD @@ -13,7 +13,8 @@ The reason i wanted to my own implementation for PHP was to help gamify testing You can inspect a remote repository as follows. This will create a local repository in the path specifiek in ``\Swis\GoT\Settings`` and use that to find the tests and test owners. ```php -$inspector = new \Swis\GoT\Inspector(); +$settings = \Swis\GoT\Settings\SettingsFactory::create(); +$inspector = new \Swis\GoT\Inspector($settings); $repository = $inspector->getRepositoryByUrl('git@github.com:swisnl/game-of-tests.git'); $results = $inspector->inspect($repository); ``` @@ -23,14 +24,21 @@ $results = $inspector->inspect($repository); If you have a local repository, you can also use that directly, for example if you have a set of base repositories as backups, that it fine. ```php -$inspector = new \Swis\GoT\Inspector(); +$settings = \Swis\GoT\Settings\SettingsFactory::create(); +$inspector = new \Swis\GoT\Inspector($settings); $repository = $inspector->getRepositoryByPath('/path/to/repos'); $results = $inspector->inspect($repository); ``` ### Settings -You can use the ``\Swis\GoT\Settings`` class to set some settings for the package. It lists the available parsers, some paths that are skipped by default and the path where the remote repositories are stored localy. +You can use the ``\Swis\GoT\Settings`` class set some settings for the package. It lists the available parsers, some paths that are skipped by default and the path where the remote repositories are stored localy. Just pass the settings to the incspector. If you want to get a bare Settings object from the factory, pass false to the create function. + +```php +// Create a bare settings object. +$settings = \Swis\GoT\Settings\SettingsFactory::create(false); +``` + ## Parsers