Skip to content

Add missing .md files. Author entity updated with github#21

Open
OStefan2001 wants to merge 3 commits into
developfrom
stefan-dev
Open

Add missing .md files. Author entity updated with github#21
OStefan2001 wants to merge 3 commits into
developfrom
stefan-dev

Conversation

@OStefan2001

Copy link
Copy Markdown
Collaborator

No description provided.

@alexmerlin alexmerlin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You did not comit the new migration file.


#[ORM\Column(name: 'email', type: 'text', unique: true)]
private string $email;
#[ORM\Column(name: 'github', type: 'text', unique: true, nullable: true)]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
#[ORM\Column(name: 'github', type: 'text', unique: true, nullable: true)]
#[ORM\Column(name: 'github', type: 'string', length: 191, unique: true, nullable: true)]

https://github.com/orgs/community/discussions/133913#discussioncomment-10178406
The max length seems to be 39 characters for a GitHub username - but we can go above that, just in case...
But, text is defintely too much for this.

* postDate: string,
* category: array{id: non-empty-string, name: string, slug: string},
* author: array{id: non-empty-string, name: string, slug: string, bio: string|null}
* author: array{id: non-empty-string, name: string, slug: string, github: string|null}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To avoid such duplications, you can create a PHPStan type and the include it wherever you need it.

Example:

This way, if you need to change a property in an entity, you will need to update only the type.

Comment thread bin/doctrine-fixtures

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Missing empty line at the end of the file.

Rule

All files that contain code must end with an empty line.
Exception: auto-generated files (example: public/js/app.js).

</svg>
</span>
<a href="mailto:{{ author.email }}">{{ author.email }}</a>
{% if author.github and author.github is not null %}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
{% if author.github and author.github is not null %}
{% if author.github %}

This should suffice.
As long as author.github is truthy, the logic inside the if statement will be executed.

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