Skip to content

Commit

Permalink
Merge branch 'feature/processing'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Wolf committed Jan 28, 2015
2 parents b6c18b1 + 567d3e3 commit 25c22dd
Show file tree
Hide file tree
Showing 73 changed files with 1,403 additions and 172 deletions.
5 changes: 4 additions & 1 deletion build/config/phpmd.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
<description>Ruleset for all DETAIL NET projects</description>

<rule ref="rulesets/unusedcode.xml" />
<rule ref="rulesets/design.xml" />

<rule ref="rulesets/design.xml">
<exclude name="CouplingBetweenObjects"/>
</rule>

<rule ref="rulesets/naming.xml">
<exclude name="ShortVariable"/>
Expand Down
10 changes: 7 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@
"zendframework/zend-stdlib": "~2.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.4.0",
"squizlabs/php_codesniffer" : "~2.0.0",
"phpunit/phpunit": "~4.4.4",
"squizlabs/php_codesniffer" : "~2.2.0",
"phpmd/phpmd": "~2.1.3",
"satooshi/php-coveralls": "dev-master"
"satooshi/php-coveralls": "dev-master",
"detailnet/blitline": "~0.3.3"
},
"suggest": {
"detailnet/blitline": "For usage of the Blitline adapter"
},
"autoload": {
"psr-0": {
Expand Down
4 changes: 2 additions & 2 deletions examples/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

$loader->add('Detail\FileConversion', $basePath . 'src');

if (!file_exists('config.php')) {
if (!file_exists(__DIR__ . '/config.php')) {
throw new RuntimeException(
'Missing configuration file "config.php"; make a copy of "config.php.dist" and update it'
);
}

return require 'config.php';
return require __DIR__ . '/config.php';
4 changes: 2 additions & 2 deletions examples/job-create.php → examples/client/job-create.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use Detail\FileConversion\Client\FileConversionClient;

$config = require 'bootstrap.php';
$config = require '../bootstrap.php';

$imageUrl = isset($_GET['imageUrl']) ? $_GET['imageUrl'] : null;

Expand All @@ -24,7 +24,7 @@

$client = FileConversionClient::factory($config);

/** @var \Detail\FileConversion\Job\JobBuilder $jobBuilder */
/** @var \Detail\FileConversion\Client\Job\JobBuilder $jobBuilder */
$jobBuilder = $client->getJobBuilder();
$jobBuilder->setDefaultOption(
'action.save',
Expand Down
2 changes: 1 addition & 1 deletion examples/job-info.php → examples/client/job-info.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use Detail\FileConversion\Client\FileConversionClient;

$config = require 'bootstrap.php';
$config = require '../bootstrap.php';

$jobId = isset($_GET['job_id']) ? $_GET['job_id'] : null;

Expand Down
2 changes: 1 addition & 1 deletion examples/job-list.php → examples/client/job-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use Detail\FileConversion\Client\FileConversionClient;

$config = require 'bootstrap.php';
$config = require '../bootstrap.php';
$params = array();

if (isset($_GET['page'])) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace Detail\FileConversion\Client\Exception;

use Detail\FileConversion\Exception\ExceptionInterface as BaseExceptionInterface;

interface ExceptionInterface extends BaseExceptionInterface
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Detail\FileConversion\Client\Exception;

class InvalidArgumentException extends \InvalidArgumentException implements
ExceptionInterface
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Detail\FileConversion\Client\Exception;

class RuntimeException extends \RuntimeException implements
ExceptionInterface
{
}
16 changes: 8 additions & 8 deletions src/Detail/FileConversion/Client/FileConversionClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
use Guzzle\Service\Client;
use Guzzle\Service\Description\ServiceDescription;

//use Detail\FileConversion\Exception\InvalidArgumentException;
use Detail\FileConversion\Job\Definition\DefinitionInterface;
use Detail\FileConversion\Job\JobBuilder;
use Detail\FileConversion\Job\JobBuilderInterface;
use Detail\FileConversion\Response;
//use Detail\FileConversion\Client\Exception\InvalidArgumentException;
use Detail\FileConversion\Client\Job\Definition\DefinitionInterface;
use Detail\FileConversion\Client\Job\JobBuilder;
use Detail\FileConversion\Client\Job\JobBuilderInterface;
use Detail\FileConversion\Client\Response;

/**
* FileConversion API client.
*
* @method Response\JobList listJobs(array $params = array())
* @method Response\Job fetchJob(array $params = array())
* @method Response\Job createJob(mixed $job = array())
* @method Response\Job submitJob(mixed $job = array())
*/
class FileConversionClient extends Client
{
const CLIENT_VERSION = '0.2.0';
const CLIENT_VERSION = '0.3.0';

/**
* @var JobBuilderInterface
Expand Down Expand Up @@ -58,7 +58,7 @@ public static function factory($options = array(), JobBuilderInterface $jobBuild
)
);
$client->setDescription(
ServiceDescription::factory(__DIR__ . '/../ServiceDescription/FileConversion.php')
ServiceDescription::factory(__DIR__ . '/ServiceDescription/FileConversion.php')
);
$client->setUserAgent('dfw-fileconversion/' . self::CLIENT_VERSION, true);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Detail\FileConversion\Job\Definition;
namespace Detail\FileConversion\Client\Job\Definition;

class ActionDefinition extends BaseDefinition implements
ActionDefinitionInterface
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Detail\FileConversion\Job\Definition;
namespace Detail\FileConversion\Client\Job\Definition;

interface ActionDefinitionInterface extends DefinitionInterface
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Detail\FileConversion\Job\Definition;
namespace Detail\FileConversion\Client\Job\Definition;

use ArrayObject;
use RecursiveIteratorIterator;
Expand Down Expand Up @@ -94,8 +94,9 @@ public function toArray()
}
}

// Helper function which recursively converts to a normal (recursive) array again
$toArray = function($data) use (&$toArray) { // Reference is required for "recursive closure"...
// Helper function which recursively converts to a normal (recursive) array again.
// Reference is required for "recursive closure"...
$toArray = function($data) use (&$toArray) {
if ($data instanceof ArrayObject) {
$data = (array) $data;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Detail\FileConversion\Job\Definition;
namespace Detail\FileConversion\Client\Job\Definition;

interface DefinitionInterface
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Detail\FileConversion\Job\Definition;
namespace Detail\FileConversion\Client\Job\Definition;

class JobDefinition extends BaseDefinition implements
JobDefinitionInterface
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Detail\FileConversion\Job\Definition;
namespace Detail\FileConversion\Client\Job\Definition;

interface JobDefinitionInterface extends DefinitionInterface
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Detail\FileConversion\Job\Definition;
namespace Detail\FileConversion\Client\Job\Definition;

class NotificationDefinition extends BaseDefinition implements
NotificationDefinitionInterface
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Detail\FileConversion\Job\Definition;
namespace Detail\FileConversion\Client\Job\Definition;

interface NotificationDefinitionInterface extends DefinitionInterface
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace Detail\FileConversion\Job;
namespace Detail\FileConversion\Client\Job;

use Detail\FileConversion\Exception\RuntimeException;
use Detail\FileConversion\Job\Definition\DefinitionInterface;
use Detail\FileConversion\Client\Exception\RuntimeException;
use Detail\FileConversion\Client\Job\Definition\DefinitionInterface;

class JobBuilder implements
JobBuilderInterface
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Detail\FileConversion\Job;
namespace Detail\FileConversion\Client\Job;

interface JobBuilderInterface
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Detail\FileConversion\Response;
namespace Detail\FileConversion\Client\Response;

class Action extends BaseResponse
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Detail\FileConversion\Response;
namespace Detail\FileConversion\Client\Response;

use DateTime;

use Detail\FileConversion\Exception\RuntimeException;
use Detail\FileConversion\Client\Exception\RuntimeException;

use Guzzle\Service\Command\OperationCommand;
use Guzzle\Service\Command\ResponseClassInterface as GuzzleResponseInterface;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Detail\FileConversion\Response;
namespace Detail\FileConversion\Client\Response;

use DateTime;

Expand Down Expand Up @@ -63,7 +63,7 @@ public function getActionCount()

/**
* @param boolean $asPlainResult
* @return array
* @return Action[]|array
*/
public function getActions($asPlainResult = false)
{
Expand All @@ -80,7 +80,7 @@ public function getNotificationCount()

/**
* @param boolean $asPlainResult
* @return array
* @return Notification[]|array
*/
public function getNotifications($asPlainResult = false)
{
Expand All @@ -97,7 +97,7 @@ public function getResultCount()

/**
* @param boolean $asPlainResult
* @return array
* @return Result[]|array
*/
public function getResults($asPlainResult = false)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Detail\FileConversion\Response;
namespace Detail\FileConversion\Client\Response;

class JobList extends ListResponse
{
Expand All @@ -11,7 +11,7 @@ class JobList extends ListResponse

/**
* @param boolean $asPlainResult
* @return array
* @return Job[]|array
*/
public function getItems($asPlainResult = false)
{
Expand All @@ -20,7 +20,7 @@ public function getItems($asPlainResult = false)

/**
* @param boolean $asPlainResult
* @return array
* @return Job[]|array
*/
protected function getJobs($asPlainResult = false)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Detail\FileConversion\Response;
namespace Detail\FileConversion\Client\Response;

abstract class ListResponse extends BaseResponse implements
ListResponseInterface
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Detail\FileConversion\Response;
namespace Detail\FileConversion\Client\Response;

interface ListResponseInterface
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Detail\FileConversion\Response;
namespace Detail\FileConversion\Client\Response;

class Notification extends BaseResponse
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Detail\FileConversion\Response;
namespace Detail\FileConversion\Client\Response;

class NotificationCall extends BaseResponse
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Detail\FileConversion\Response;
namespace Detail\FileConversion\Client\Response;

interface ResponseInterface
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Detail\FileConversion\Response;
namespace Detail\FileConversion\Client\Response;

class Result extends BaseResponse
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Detail\FileConversion\Response;
namespace Detail\FileConversion\Client\Response;

class SaveOptions extends BaseResponse
{
Expand Down
Loading

0 comments on commit 25c22dd

Please sign in to comment.