Skip to content

Issue #349: Remove repetitive property declarations.#350

Merged
arhimede merged 1 commit into
4.0from
issue-349
Feb 17, 2023
Merged

Issue #349: Remove repetitive property declarations.#350
arhimede merged 1 commit into
4.0from
issue-349

Conversation

@alexmerlin
Copy link
Copy Markdown
Member

Note:
laminas-servicemanager requires ocramius/proxy-manager
ocramius/proxy-manager cannot be installed because it requires PHP ~8.0.0 BUT DK Frontend requires PHP ~8.1.0 || ~8.2.0
friendsofphp/proxy-manager-lts is a fork of ocramius/proxy-manager that replaces ocramius/proxy-manager
I added friendsofphp/proxy-manager-lts as a requirement in composer.json

@alexmerlin alexmerlin self-assigned this Feb 16, 2023
@arhimede arhimede merged commit 165f460 into 4.0 Feb 17, 2023
*/
class UserController extends AbstractActionController
{
protected CookieService $cookieService;
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.

Can we use the CookieServiceInterface here? And everywhere else where it's possible.

* @throws MissingConfigurationException
*/
public function slugManipulation(Slug $slug, string $attribute, string $value)
public function slugManipulation(Slug $slug, string $attribute, string $value): bool|string
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.

Should we change this method to return only string and null?

if (! isset($this->config['orm_default']['identity_property'])) {
throw new Exception("No or invalid param 'identity_class' provided.");
if (!isset($this->config['identity_property'])) {
throw new Exception("Missing or invalid param 'identity_class' provided.");
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.

This was my mistake back it the day, the error message should be "Missing or invalid param 'identity_property' provided." because we are checking for the "identity_property" not "identity_class".

'uuid' => $this->getUuid()->toString(),
'detail' => ($this->getDetail() instanceof UserDetail) ? $this->getDetail()->getArrayCopy() : null,
'avatar' => ($this->getAvatar() instanceof UserAvatar) ? $this->getAvatar()->getArrayCopy() : null,
'detail' => $this->getDetail()?->getArrayCopy(),
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.

finally <3

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.

3 participants