Commit 839042b0 authored by Tomas Lang's avatar Tomas Lang

Typo: add whitespaces between methods, add comments

parent 4486b466
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace LeanMapperWorkflow; namespace LeanMapperWorkflow;
abstract class AbstractRepository extends \LeanMapper\Repository abstract class AbstractRepository extends \LeanMapper\Repository
{ {
...@@ -10,6 +11,8 @@ abstract class AbstractRepository extends \LeanMapper\Repository ...@@ -10,6 +11,8 @@ abstract class AbstractRepository extends \LeanMapper\Repository
*/ */
abstract public function createRestriction(); abstract public function createRestriction();
/** /**
* @param \DibiFluent $statement * @param \DibiFluent $statement
* @param Restriction|null $restriction * @param Restriction|null $restriction
......
...@@ -2,15 +2,28 @@ ...@@ -2,15 +2,28 @@
namespace LeanMapperWorkflow; namespace LeanMapperWorkflow;
abstract class AbstractRestriction abstract class AbstractRestriction
{ {
const FLAG_COUNT = 'count'; const FLAG_COUNT = 'count';
protected $properties = array();
private $values = array();
/** @var array */
protected $properties = [];
/** @var array */
private $values = [];
/** @var \LeanMapper\IMapper */
protected $mapper; protected $mapper;
/**
* @param \LeanMapper\IMapper $mapper
*/
public function __construct(\LeanMapper\IMapper $mapper) public function __construct(\LeanMapper\IMapper $mapper)
{ {
$this->mapper = $mapper; $this->mapper = $mapper;
...@@ -35,10 +48,14 @@ abstract class AbstractRestriction ...@@ -35,10 +48,14 @@ abstract class AbstractRestriction
$this->initDefaults(); $this->initDefaults();
} }
protected function initDefaults() protected function initDefaults()
{ {
} }
/** /**
* @param string $property * @param string $property
* *
...@@ -54,6 +71,8 @@ abstract class AbstractRestriction ...@@ -54,6 +71,8 @@ abstract class AbstractRestriction
); );
} }
/** /**
* @param string $key * @param string $key
* *
...@@ -64,6 +83,8 @@ abstract class AbstractRestriction ...@@ -64,6 +83,8 @@ abstract class AbstractRestriction
return array_key_exists($key, $this->values); return array_key_exists($key, $this->values);
} }
/** /**
* @param string $key * @param string $key
*/ */
...@@ -73,6 +94,8 @@ abstract class AbstractRestriction ...@@ -73,6 +94,8 @@ abstract class AbstractRestriction
unset($this->values[$key]); unset($this->values[$key]);
} }
/** /**
* @param mixed $key * @param mixed $key
* *
...@@ -117,6 +140,8 @@ abstract class AbstractRestriction ...@@ -117,6 +140,8 @@ abstract class AbstractRestriction
$this->values[$key] = $value; $this->values[$key] = $value;
} }
/** /**
* @param string $key * @param string $key
* *
...@@ -132,6 +157,8 @@ abstract class AbstractRestriction ...@@ -132,6 +157,8 @@ abstract class AbstractRestriction
return $this->values[$key]; return $this->values[$key];
} }
/** /**
* @return array * @return array
*/ */
...@@ -140,6 +167,8 @@ abstract class AbstractRestriction ...@@ -140,6 +167,8 @@ abstract class AbstractRestriction
return $this->values; return $this->values;
} }
/** /**
* @param \DibiFluent $statement * @param \DibiFluent $statement
* @param string|null $flag * @param string|null $flag
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace LeanMapperWorkflow; namespace LeanMapperWorkflow;
abstract class Entity extends \LeanMapper\Entity abstract class Entity extends \LeanMapper\Entity
{ {
} }
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace LeanMapperWorkflow; namespace LeanMapperWorkflow;
class EntityFactory implements \LeanMapper\IEntityFactory class EntityFactory implements \LeanMapper\IEntityFactory
{ {
...@@ -13,6 +14,8 @@ class EntityFactory implements \LeanMapper\IEntityFactory ...@@ -13,6 +14,8 @@ class EntityFactory implements \LeanMapper\IEntityFactory
return new $entityClass($arg); return new $entityClass($arg);
} }
/* /*
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace LeanMapperWorkflow; namespace LeanMapperWorkflow;
/** /**
* Class Mapper * Class Mapper
*/ */
......
...@@ -5,6 +5,7 @@ namespace LeanMapperWorkflow; ...@@ -5,6 +5,7 @@ namespace LeanMapperWorkflow;
use InvalidArgumentException; use InvalidArgumentException;
use LogicException; use LogicException;
/** /**
* Class Repository * Class Repository
*/ */
...@@ -40,6 +41,8 @@ class Repository extends AbstractRepository ...@@ -40,6 +41,8 @@ class Repository extends AbstractRepository
return $this->createEntity($row); return $this->createEntity($row);
} }
/** /**
* @param Restriction|int[]|null $param * @param Restriction|int[]|null $param
* *
...@@ -70,6 +73,8 @@ class Repository extends AbstractRepository ...@@ -70,6 +73,8 @@ class Repository extends AbstractRepository
return $this->createEntities($statement->fetchAll()); return $this->createEntities($statement->fetchAll());
} }
/** /**
* @param Restriction|null $param * @param Restriction|null $param
* *
...@@ -95,6 +100,8 @@ class Repository extends AbstractRepository ...@@ -95,6 +100,8 @@ class Repository extends AbstractRepository
return (int) $statement->fetchSingle(); return (int) $statement->fetchSingle();
} }
/** /**
* @param string $key * @param string $key
* @param string $value * @param string $value
...@@ -120,6 +127,8 @@ class Repository extends AbstractRepository ...@@ -120,6 +127,8 @@ class Repository extends AbstractRepository
return $statement->fetchPairs($key, $value); return $statement->fetchPairs($key, $value);
} }
/** /**
* @return Restriction * @return Restriction
*/ */
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace LeanMapperWorkflow; namespace LeanMapperWorkflow;
/** /**
* @property array|int $id * @property array|int $id
* @property int $limit * @property int $limit
...@@ -10,8 +11,11 @@ namespace LeanMapperWorkflow; ...@@ -10,8 +11,11 @@ namespace LeanMapperWorkflow;
class Restriction extends AbstractRestriction class Restriction extends AbstractRestriction
{ {
/** @var array */
protected $joins = []; protected $joins = [];
/** /**
* @param \DibiFluent $statement * @param \DibiFluent $statement
* @param Repository $repository * @param Repository $repository
...@@ -38,6 +42,8 @@ class Restriction extends AbstractRestriction ...@@ -38,6 +42,8 @@ class Restriction extends AbstractRestriction
$statement->offset($this->offset); $statement->offset($this->offset);
} }
/** /**
* @param Repository $repository * @param Repository $repository
* @return string * @return string
...@@ -54,6 +60,8 @@ class Restriction extends AbstractRestriction ...@@ -54,6 +60,8 @@ class Restriction extends AbstractRestriction
} }
} }
/** /**
* @param string $name * @param string $name
* @param callback $callback callback($statement) * @param callback $callback callback($statement)
...@@ -71,6 +79,8 @@ class Restriction extends AbstractRestriction ...@@ -71,6 +79,8 @@ class Restriction extends AbstractRestriction
} }
} }
/** /**
* [applyJoins description] * [applyJoins description]
* @param [type] $statement [description] * @param [type] $statement [description]
......
...@@ -2,14 +2,19 @@ ...@@ -2,14 +2,19 @@
namespace LeanMapperWorkflow; namespace LeanMapperWorkflow;
class RestrictionWithOrdering extends Restriction class RestrictionWithOrdering extends Restriction
{ {
const ORDER_ID = 'id'; const ORDER_ID = 'id';
/** @var array(self::ORDER_* => "ASC"|"DESC"|mixed) */ /** @var array(self::ORDER_* => "ASC"|"DESC"|mixed) */
protected $orderBys = []; protected $orderBys = [];
/** /**
* @param \DibiFluent $statement * @param \DibiFluent $statement
* @param Repository $repository * @param Repository $repository
...@@ -26,6 +31,8 @@ class RestrictionWithOrdering extends Restriction ...@@ -26,6 +31,8 @@ class RestrictionWithOrdering extends Restriction
} }
} }
/** /**
* @param array $orderBys * @param array $orderBys
*/ */
...@@ -34,6 +41,8 @@ class RestrictionWithOrdering extends Restriction ...@@ -34,6 +41,8 @@ class RestrictionWithOrdering extends Restriction
$this->orderBys = $orderBys; $this->orderBys = $orderBys;
} }
/** /**
* @param string $order self::ORDER_* * @param string $order self::ORDER_*
* @param string $direction "ASC"|"DESC"|mixed * @param string $direction "ASC"|"DESC"|mixed
...@@ -43,6 +52,8 @@ class RestrictionWithOrdering extends Restriction ...@@ -43,6 +52,8 @@ class RestrictionWithOrdering extends Restriction
$this->orderBys[$order] = $direction; $this->orderBys[$order] = $direction;
} }
/** /**
* @param string $order self::ORDER_* * @param string $order self::ORDER_*
* @param string $direction "ASC"|"DESC"|mixed * @param string $direction "ASC"|"DESC"|mixed
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment