Skip to content

Commit

Permalink
Merge pull request #4 from kristijorgji/feature/pseudo-models
Browse files Browse the repository at this point in the history
Feature/pseudo models
  • Loading branch information
kristijorgji authored Aug 23, 2022
2 parents b874787 + e97eb27 commit 1706c37
Show file tree
Hide file tree
Showing 71 changed files with 2,602 additions and 821 deletions.
5 changes: 5 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
MYSQL_DB_HOST=192.168.66.7
MYSQL_DB_PORT=3306
MYSQL_DB_DATABASE=test_db_to_php
MYSQL_DB_USERNAME=root
MYSQL_DB_PASSWORD=Test123@
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ tests/coverage/
Thumbs.db
desktop.ini
.DS_Store
.phpunit.result.cache
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ return [
'outputDirectory' => 'Entities',
'namespace' => 'Entities',
'includeAnnotations' => true,
'typeHintProperties' => true,
'includeSetters' => true,
'includeGetters' => true,
'fluentSetters' => true,
Expand Down Expand Up @@ -99,7 +100,7 @@ Example with ```typehint=true```:
* @param array $data
* @return TestEntity
*/
public static function make(array $data = []) : TestEntity
public static function make(array $data = []): TestEntity
{
return self::makeFromData(self::makeData($data));
}
Expand Down Expand Up @@ -257,7 +258,7 @@ class UsersDemoEntity
/**
* @return int
*/
public function getId() : int
public function getId(): int
{
return $this->id;
}
Expand All @@ -275,7 +276,7 @@ class UsersDemoEntity
/**
* @return string
*/
public function getName() : string
public function getName(): string
{
return $this->name;
}
Expand All @@ -293,7 +294,7 @@ class UsersDemoEntity
/**
* @return string
*/
public function getSurname() : string
public function getSurname(): string
{
return $this->surname;
}
Expand All @@ -311,7 +312,7 @@ class UsersDemoEntity
/**
* @return string|null
*/
public function getPreferences() : ?string
public function getPreferences(): ?string
{
return $this->preferences;
}
Expand All @@ -329,7 +330,7 @@ class UsersDemoEntity
/**
* @return int
*/
public function getBirthYear() : int
public function getBirthYear(): int
{
return $this->birthYear;
}
Expand All @@ -347,7 +348,7 @@ class UsersDemoEntity
/**
* @return int
*/
public function getNrCars() : int
public function getNrCars(): int
{
return $this->nrCars;
}
Expand All @@ -365,7 +366,7 @@ class UsersDemoEntity
/**
* @return float
*/
public function getSalary() : float
public function getSalary(): float
{
return $this->salary;
}
Expand All @@ -383,7 +384,7 @@ class UsersDemoEntity
/**
* @return bool
*/
public function getActive() : bool
public function getActive(): bool
{
return $this->active;
}
Expand All @@ -401,7 +402,7 @@ class UsersDemoEntity
/**
* @return string
*/
public function getCreatedAt() : string
public function getCreatedAt(): string
{
return $this->createdAt;
}
Expand Down Expand Up @@ -482,7 +483,7 @@ class UsersDemoEntityFactory extends AbstractEntityFactory
* @param array $data
* @return UsersDemoEntity
*/
public static function make(array $data = []) : UsersDemoEntity
public static function make(array $data = []): UsersDemoEntity
{
return self::makeFromData(self::makeData($data));
}
Expand All @@ -491,7 +492,7 @@ class UsersDemoEntityFactory extends AbstractEntityFactory
* @param array $data
* @return UsersDemoEntity
*/
public static function makeFromData(array $data) : UsersDemoEntity
public static function makeFromData(array $data): UsersDemoEntity
{
return self::mapArrayToEntity($data, UsersDemoEntity::class);
}
Expand All @@ -500,7 +501,7 @@ class UsersDemoEntityFactory extends AbstractEntityFactory
* @param array $data
* @return array
*/
public static function makeData(array $data = []) : array
public static function makeData(array $data = []): array
{
return [
'id' => $data['id'] ?? self::randomInt64(),
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
],
"require": {
"php": ">=7.1",
"symfony/console": ">=3.3"
"symfony/console": ">=3.3",
"vlucas/phpdotenv": "^5.2"
},
"require-dev": {
"fzaninotto/faker": "~1.7",
"phpunit/phpunit": "~5.7"
"phpunit/phpunit": "^9.5"
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit 1706c37

Please sign in to comment.