Skip to content

Refactor the code #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

Rjiegit
Copy link

@Rjiegit Rjiegit commented Jul 30, 2021

No description provided.

Comment on lines +1 to +10
<?php

namespace App\Http;

class Status
{
public const OK = 200;
public const ERROR = 500;
public const UPDATED = 201;
}
Copy link

@agus24 agus24 Jul 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you dont need to create enum class. you can use Symfony\Component\HttpFoundation\Response
Response::HTTP_OK will return 200
Response::HTTP_CREATED will return 201
Response::HTTP_NOT_FOUND will return 404
Response::HTTP_INTERNAL_SERVER_ERROR will return 500

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants