@@ -6,7 +6,7 @@ |
||
| 6 | 6 | * |
| 7 | 7 | * @author d.lanec |
| 8 | 8 | */ |
| 9 | -interface ModuleInterface{
|
|
| 9 | +interface ModuleInterface {
|
|
| 10 | 10 | |
| 11 | 11 | public function process(); |
| 12 | 12 | |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | * |
| 7 | 7 | * @author Dmitriy |
| 8 | 8 | */ |
| 9 | -interface SeedInterface{ |
|
| 9 | +interface SeedInterface { |
|
| 10 | 10 | |
| 11 | 11 | static public function build($id = 1); |
| 12 | 12 | |
@@ -14,10 +14,10 @@ discard block |
||
| 14 | 14 | * @return type |
| 15 | 15 | */ |
| 16 | 16 | static public function build($id = 1){ |
| 17 | - $generator = \Faker\Factory::create(); |
|
| 18 | - $populator = new \Faker\ORM\Propel2\Populator($generator); |
|
| 19 | - $populator->addEntity(\Core\Models\User\User::class, $id); |
|
| 20 | - return $populator->execute(); |
|
| 17 | + $generator = \Faker\Factory::create(); |
|
| 18 | + $populator = new \Faker\ORM\Propel2\Populator($generator); |
|
| 19 | + $populator->addEntity(\Core\Models\User\User::class, $id); |
|
| 20 | + return $populator->execute(); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
@@ -25,6 +25,6 @@ discard block |
||
| 25 | 25 | * @return type |
| 26 | 26 | */ |
| 27 | 27 | public static function reset(){ |
| 28 | - return \Core\Models\User\UserQuery::create()->deleteAll(); |
|
| 28 | + return \Core\Models\User\UserQuery::create()->deleteAll(); |
|
| 29 | 29 | } |
| 30 | 30 | } |
@@ -6,14 +6,14 @@ discard block |
||
| 6 | 6 | * |
| 7 | 7 | * @author Dmitriy |
| 8 | 8 | */ |
| 9 | -class User implements \Frameworkless\SeedInterface{ |
|
| 9 | +class User implements \Frameworkless\SeedInterface { |
|
| 10 | 10 | |
| 11 | 11 | /** |
| 12 | 12 | * |
| 13 | 13 | * @param type $id |
| 14 | 14 | * @return type |
| 15 | 15 | */ |
| 16 | - static public function build($id = 1){ |
|
| 16 | + static public function build($id = 1) { |
|
| 17 | 17 | $generator = \Faker\Factory::create(); |
| 18 | 18 | $populator = new \Faker\ORM\Propel2\Populator($generator); |
| 19 | 19 | $populator->addEntity(\Core\Models\User\User::class, $id); |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | * |
| 25 | 25 | * @return type |
| 26 | 26 | */ |
| 27 | - public static function reset(){ |
|
| 27 | + public static function reset() { |
|
| 28 | 28 | return \Core\Models\User\UserQuery::create()->deleteAll(); |
| 29 | 29 | } |
| 30 | 30 | } |
@@ -8,12 +8,12 @@ |
||
| 8 | 8 | * |
| 9 | 9 | * @author Dmitriy |
| 10 | 10 | */ |
| 11 | -class ServiceProvider extends AbstractServiceProvider{ |
|
| 11 | +class ServiceProvider extends AbstractServiceProvider { |
|
| 12 | 12 | |
| 13 | 13 | protected $provides = [ |
| 14 | 14 | ]; |
| 15 | 15 | |
| 16 | - public function register(){ |
|
| 16 | + public function register() { |
|
| 17 | 17 | |
| 18 | 18 | } |
| 19 | 19 | } |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | class UserRepository implements \Frameworkless\CrudInterface{ |
| 13 | 13 | |
| 14 | 14 | public function find(array $conditions = []){ |
| 15 | - return UserQuery::create()->findOneByArray($conditions); |
|
| 15 | + return UserQuery::create()->findOneByArray($conditions); |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | /** |
@@ -22,24 +22,24 @@ discard block |
||
| 22 | 22 | * @throws \InvalidArgumentException |
| 23 | 23 | */ |
| 24 | 24 | public function findById($id){ |
| 25 | - if(!$User = UserQuery::create()->findPk($id)){ |
|
| 26 | - throw new \InvalidArgumentException(sprintf('User with ID %d does not exist', $id)); |
|
| 27 | - } |
|
| 25 | + if(!$User = UserQuery::create()->findPk($id)){ |
|
| 26 | + throw new \InvalidArgumentException(sprintf('User with ID %d does not exist', $id)); |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | - return $User; |
|
| 29 | + return $User; |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | public function findMany(array $conditions = [], $limit = false){ |
| 33 | - $Users = UserQuery::create() |
|
| 34 | - ->_if($limit) |
|
| 35 | - ->limit($limit) |
|
| 36 | - ->_endif() |
|
| 37 | - ->findByArray($conditions); |
|
| 38 | - return $Users; |
|
| 33 | + $Users = UserQuery::create() |
|
| 34 | + ->_if($limit) |
|
| 35 | + ->limit($limit) |
|
| 36 | + ->_endif() |
|
| 37 | + ->findByArray($conditions); |
|
| 38 | + return $Users; |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | public function delete(ActiveRecordInterface $Model){ |
| 42 | - return $Model->delete(); |
|
| 42 | + return $Model->delete(); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | * @throws \DomainException |
| 50 | 50 | */ |
| 51 | 51 | public function save(ActiveRecordInterface $Model){ |
| 52 | - return $Model->save(); |
|
| 52 | + return $Model->save(); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
@@ -57,6 +57,6 @@ discard block |
||
| 57 | 57 | * @return \Core\Models\User\User $User |
| 58 | 58 | */ |
| 59 | 59 | public function build(){ |
| 60 | - return new User; |
|
| 60 | + return new User; |
|
| 61 | 61 | } |
| 62 | 62 | } |
@@ -9,9 +9,9 @@ discard block |
||
| 9 | 9 | * |
| 10 | 10 | * @author Dmitriy |
| 11 | 11 | */ |
| 12 | -class UserRepository implements \Frameworkless\CrudInterface{ |
|
| 12 | +class UserRepository implements \Frameworkless\CrudInterface { |
|
| 13 | 13 | |
| 14 | - public function find(array $conditions = []){ |
|
| 14 | + public function find(array $conditions = []) { |
|
| 15 | 15 | return UserQuery::create()->findOneByArray($conditions); |
| 16 | 16 | } |
| 17 | 17 | |
@@ -21,15 +21,15 @@ discard block |
||
| 21 | 21 | * @return \Models\User\User $User |
| 22 | 22 | * @throws \InvalidArgumentException |
| 23 | 23 | */ |
| 24 | - public function findById($id){ |
|
| 25 | - if(!$User = UserQuery::create()->findPk($id)){ |
|
| 24 | + public function findById($id) { |
|
| 25 | + if (!$User = UserQuery::create()->findPk($id)) { |
|
| 26 | 26 | throw new \InvalidArgumentException(sprintf('User with ID %d does not exist', $id)); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | return $User; |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - public function findMany(array $conditions = [], $limit = false){ |
|
| 32 | + public function findMany(array $conditions = [], $limit = false) { |
|
| 33 | 33 | $Users = UserQuery::create() |
| 34 | 34 | ->_if($limit) |
| 35 | 35 | ->limit($limit) |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | return $Users; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - public function delete(ActiveRecordInterface $Model){ |
|
| 41 | + public function delete(ActiveRecordInterface $Model) { |
|
| 42 | 42 | return $Model->delete(); |
| 43 | 43 | } |
| 44 | 44 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | * @return boolean |
| 49 | 49 | * @throws \DomainException |
| 50 | 50 | */ |
| 51 | - public function save(ActiveRecordInterface $Model){ |
|
| 51 | + public function save(ActiveRecordInterface $Model) { |
|
| 52 | 52 | return $Model->save(); |
| 53 | 53 | } |
| 54 | 54 | |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | * |
| 57 | 57 | * @return \Core\Models\User\User $User |
| 58 | 58 | */ |
| 59 | - public function build(){ |
|
| 59 | + public function build() { |
|
| 60 | 60 | return new User; |
| 61 | 61 | } |
| 62 | 62 | } |