Skip to content

Commit

Permalink
update phpdoc and remove unused parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Dec 27, 2015
1 parent f12c269 commit 3ae17a3
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 10 deletions.
1 change: 1 addition & 0 deletions library/PSX/Api/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ public function getAllowedMethods()
}

/**
* @param string $method
* @return boolean
*/
public function hasMethod($method)
Expand Down
1 change: 1 addition & 0 deletions library/PSX/Data/Importer.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public function import($source, MessageInterface $message, TransformerInterface
/**
* Returns an importer which understands the provided source
*
* @param mixed $source
* @return \PSX\Data\Record\ImporterInterface
*/
public function createBySource($source)
Expand Down
1 change: 1 addition & 0 deletions library/PSX/Data/Schema/Generator/JsonSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public function generate(SchemaInterface $schema)
/**
* Returns the jsonschema as array
*
* @param \PSX\Data\SchemaInterface $schema
* @return array
*/
public function toArray(SchemaInterface $schema)
Expand Down
2 changes: 2 additions & 0 deletions library/PSX/Data/Schema/Visitor/ValidationVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class ValidationVisitor implements VisitorInterface
* Sets an optional validator which can validate each value through custom
* filters. This should only be used for filters which can not be defined
* inside a JsonSchema like i.e. check whether a row exists in a database
*
* @param \PSX\Validate\ValidatorInterface $validator
*/
public function setValidator(ValidatorInterface $validator)
{
Expand Down
2 changes: 1 addition & 1 deletion library/PSX/Dispatch/Filter/ContentMd5.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ContentMd5 implements FilterInterface
{
public function handle(RequestInterface $request, ResponseInterface $response, FilterChainInterface $filterChain)
{
$filterChain->handle($request, $response, $filterChain);
$filterChain->handle($request, $response);

if (!$response->hasHeader('Content-MD5')) {
$response->setHeader('Content-MD5', md5(Util::toString($response->getBody())));
Expand Down
2 changes: 1 addition & 1 deletion library/PSX/Dispatch/Filter/DigestAccessAuthentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function handle(RequestInterface $request, ResponseInterface $response, F
}

if (strcmp($hash, $params['response']) === 0) {
$this->callSuccess($response, $hash);
$this->callSuccess($response);

$filterChain->handle($request, $response);
} else {
Expand Down
2 changes: 1 addition & 1 deletion library/PSX/Dispatch/FilterChain.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function handle(RequestInterface $request, ResponseInterface $response)
// if we have no filters check whether we have another filter chain
// which should be called next
if ($this->filterChain !== null) {
$this->filterChain->handle($request, $response, $this->filterChain);
$this->filterChain->handle($request, $response);
}
} elseif ($filter instanceof FilterInterface) {
if ($this->logger !== null) {
Expand Down
4 changes: 3 additions & 1 deletion library/PSX/LoaderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

use PSX\Http\RequestInterface;
use PSX\Http\ResponseInterface;
use PSX\Loader\Context;

/**
* LoaderInterface
Expand All @@ -39,7 +40,8 @@ interface LoaderInterface
*
* @param \PSX\Http\RequestInterface $request
* @param \PSX\Http\ResponseInterface $response
* @param \PSX\Loader\Context $context
* @return \PSX\ControllerInterface
*/
public function load(RequestInterface $request, ResponseInterface $response);
public function load(RequestInterface $request, ResponseInterface $response, Context $context = null);
}
3 changes: 2 additions & 1 deletion library/PSX/Sql/Condition.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public function addExpression(ExpressionInterface $expr)
/**
* Sets whether the expression is inverse
*
* @param boolean $inverse
* @param boolean $isInverse
* @return \PSX\Sql\Condition
*/
public function setInverse($isInverse)
Expand Down Expand Up @@ -378,6 +378,7 @@ public function hasCondition()
}

/**
* @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
* @return string
*/
public function getStatment(AbstractPlatform $platform = null)
Expand Down
6 changes: 2 additions & 4 deletions library/PSX/Sql/TableQueryAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,27 +89,25 @@ public function __call($method, $arguments)
if (substr($method, 0, 8) == 'getOneBy') {
$column = lcfirst(substr($method, 8));
$value = isset($arguments[0]) ? $arguments[0] : null;
$fields = isset($arguments[1]) ? $arguments[1] : null;

if (!empty($value)) {
$condition = new Condition(array($column, '=', $value));
} else {
throw new InvalidArgumentException('Value required');
}

return $this->getOneBy($condition, $fields);
return $this->getOneBy($condition);
} elseif (substr($method, 0, 5) == 'getBy') {
$column = lcfirst(substr($method, 5));
$value = isset($arguments[0]) ? $arguments[0] : null;
$fields = isset($arguments[1]) ? $arguments[1] : null;

if (!empty($value)) {
$condition = new Condition(array($column, '=', $value));
} else {
throw new InvalidArgumentException('Value required');
}

return $this->getBy($condition, $fields);
return $this->getBy($condition);
} else {
throw new BadMethodCallException('Undefined method ' . $method);
}
Expand Down
2 changes: 1 addition & 1 deletion library/PSX/Validate/ValidatorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function validate($data);
* Validates a specific property. Searches a fitting validation property
* inside the list of available rules and applies all filters to the data
*
* @param string $data
* @param string $path
* @param mixed $data
* @return mixed
*/
Expand Down

0 comments on commit 3ae17a3

Please sign in to comment.