Skip to content

Sample code in Entity documentation contains useless statement #1534

Description

@hwiesmann

name: Bug report
about: Sample code in Entity documentation contains useless statement


Describe the bug
The function getCreated() in section "Handling Business Logic" of the documentation contains the following code:

public function getCreatedAt(string $format = 'Y-m-d H:i:s')
{
...
        return $format === true ? $this->created_at : $this->created_at->format($format);
}

If the function requires as a parameter a string $format === true can never be true.

CodeIgniter 4 version
CodeIgniter 4.0.0 alpha 2

Affected module(s)
Documentation section "Working with Entities" sub-section "Handling Business Logic".

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions