Skip to content

Commit

Permalink
Merge pull request #33 from expectedbehavior/psr4-compatibility
Browse files Browse the repository at this point in the history
PSR-4 Compatibility
  • Loading branch information
janxious committed Jun 4, 2015
2 parents e5b4624 + b740bf1 commit 320f0c4
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ composer.phar

# ignore the composer lock file because this is a library rather than a project
composer.lock

# ignore the output file for phpunit
test.txt
8 changes: 6 additions & 2 deletions CHANGELOG.markdown
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# DocRaptor API PHP Wrapper

## 1.1.0
* Add documentation for submitting issues and PRs
* [fix psr-4 compatibility](https://github.com/expectedbehavior/php-docraptor/pull/33). Could be a breaking bug so we are minor version bumping.

## 1.0.1
* Added this changelog
* Added custom User Agent - `expectedbehavior_php-docraptor/<version> PHP/<php-version>`
* Added `Config` object for future refactoring and (right now) control of user agent reporting
* [Added custom User Agent](https://github.com/expectedbehavior/php-docraptor/pull/31) - `expectedbehavior_php-docraptor/<version> PHP/<php-version>`
* Added `Config` object for future refactoring and (right now) enable/disable of user agent reporting

## 1.0.0
* First official release
Expand Down
8 changes: 7 additions & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ At the moment, this library still works with PHP 5.3, but we don't guarantee tha
This library is PSR-4 autoloading compliant and you can install it via composer. Just require it in your `composer.json`.
```javascript
"require": {
"expectedbehavior/php-docraptor": "1.0.1"
"expectedbehavior/php-docraptor": "1.1.0"
}
```

Expand Down Expand Up @@ -65,3 +65,9 @@ $docRaptor->setSecure(false);
```

NB! It IS not secure, you're basically broadcasting your api key over the network.

## Contributing

If you find a bug, please make a [new GitHub issue](https://github.com/expectedbehavior/php-docraptor/issues/new). If you know how to solve it, make a branch and once you're done make a [new pull request](https://github.com/expectedbehavior/php-docraptor/compare).

When submitting a PR, you will need to [install composer](https://getcomposer.org/doc/00-intro.md) to run the tests. Once you have it installed, in the project root, run `composer install`. To run the tests from the project root, run `vendor/bin/phpunit`. They should all pass! Also we have travis and scrutinizer integration, so you can check those in your PR for things that could be better or don't work.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"keywords": ["princexml", "php", "pdf", "xhtml", "xls", "xlsx", "docraptor"],
"homepage": "https://github.com/expectedbehavior/php-docraptor",
"type": "library",
"version": "1.0.1",
"version": "1.1.0",
"license": "BSD-3-Clause",
"require-dev": {
"phpunit/phpunit": "4.5.*",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
final class Config
{
// The library version
protected static $version = '1.0.1';
protected static $version = '1.1.0';

// Statistics reporting
protected $reportUserAgent;
Expand Down
7 changes: 4 additions & 3 deletions tests/DocRaptorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ public function testCanSetApiKeyViaConstructor()

public function testVersion()
{
$this->assertEquals('1.0.1', (new Config())->getVersion());
$this->assertRegExp('/\A\d+\.\d+\.\d+\z/', (new Config())->getVersion());
}

public function testUserAgent()
{
$client = new HttpClient();
$config = new Config();
$client = new HttpClient($config);
$this->assertEquals($client->userAgent(),
sprintf('expectedbehavior_php-docraptor/1.0.1 PHP/%s', phpversion()));
sprintf('expectedbehavior_php-docraptor/%s PHP/%s', $config->getVersion(), phpversion()));
}

public function testCanConstructWithoutApiKey()
Expand Down
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php

require_once( __DIR__ . '/../src/DocRaptor.php');
// Add things here that need to be run before the tests

0 comments on commit 320f0c4

Please sign in to comment.