Skip to content

Commit 2471226

Browse files
refactor: rename folder and files
1 parent 36d5868 commit 2471226

File tree

15 files changed

+33
-55
lines changed

15 files changed

+33
-55
lines changed
File renamed without changes.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<?php
22
declare(strict_types=1);
3-
namespace RestJS\Abstract;
3+
namespace RestJS\Controller;
44

5-
use RestJS\Class\Response;
5+
use RestJS\Message\Response;
66
use function RestJS\errorHandler;
77
use function RestJS\response;
88
use Slim\Exception\HttpBadRequestException;
99
use Slim\Exception\HttpUnauthorizedException;
1010

11-
/** Abstract Authorization Functions */
12-
abstract class Authorization extends Controller {
11+
/** Abstract Authorization Controller Functions */
12+
class AbstractAuthController extends AbstractController {
1313

1414
/** Login Function */
1515
public function login($req, $res) {
Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,22 @@
11
<?php
22
declare(strict_types=1);
3-
namespace RestJS\Abstract;
3+
namespace RestJS\Controller;
44

5-
use RestJS\Class\Response;
5+
use RestJS\Message\Response;
66
use function RestJS\response, RestJS\checkNull;
77

88
/** Abstract Controller Functions */
9-
abstract class Controller {
9+
class AbstractController {
1010

1111
/** Entity All Data */
1212
private $data;
1313

1414
/** Model Class Object */
15-
protected $model;
15+
private $model;
1616

17-
/** Abstract Function for Set Model Class Object */
18-
abstract protected function setModel();
19-
20-
/** Abstract Function for Set Entity All Data */
21-
abstract protected function setData();
22-
23-
public function __construct() {
24-
$this->model = $this->setModel();
25-
$this->data = $this->setdata();
17+
public function __construct($model, $data) {
18+
$this->data = $data;
19+
$this->model = $model;
2620
}
2721

2822
/** Find All Data */
File renamed without changes.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22
declare(strict_types=1);
3-
namespace RestJS\Class;
3+
namespace RestJS\Entity;
44

55
use Firebase\JWT\JWT;
66
use Doctrine\ORM\Mapping as ORM;
77
use Doctrine\ORM\Event as Event;
88

9-
/** Authorization Entity Functions */
10-
class AuthEntity extends Entity {
9+
/** Abstract Authorization Entity Functions */
10+
class AbstractAuthEntity extends AbstractEntity {
1111

1212
#[ORM\PrePersist]
1313
public function prePersist() {
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22
declare(strict_types=1);
3-
namespace RestJS\Class;
3+
namespace RestJS\Entity;
44

5-
/** Entity Functions */
6-
class Entity {
5+
/** Abstract Entity Functions */
6+
class AbstractEntity {
77

88
/** Get Value by Column */
99
public function __get($key) {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
declare(strict_types=1);
3-
namespace RestJS\Class;
3+
namespace RestJS\Message;
44

55
/** Create Response Object */
66
class Response {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22
declare(strict_types=1);
3-
namespace RestJS\Abstract;
3+
namespace RestJS\Model;
44

55
use Doctrine\ORM\EntityManager;
66

77
/** Abstract Model Functions */
8-
abstract class Model {
8+
abstract class AbstractModel {
99

1010
/** Create Repository from Entity */
1111
private $repository;

src/api/category/Category.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
namespace RestJS\Api\Category;
44

55
use Doctrine\ORM\Mapping as ORM;
6-
use RestJS\Class\Entity;
6+
use RestJS\Entity\AbstractEntity;
77

88
#[ORM\Entity]
99
#[ORM\Table('category')]
10-
class Category extends Entity {
10+
class Category extends AbstractEntity {
1111

1212
#[ORM\Id]
1313
#[ORM\Column, ORM\GeneratedValue]

0 commit comments

Comments
 (0)