Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save alexsoyes/0baa5d30668cf533fb84e554d861d3ba to your computer and use it in GitHub Desktop.
Save alexsoyes/0baa5d30668cf533fb84e554d861d3ba to your computer and use it in GitHub Desktop.
Single Responsibility Principle in PHP (not working)
<?php
/**
*** Single Responsibility Principle in PHP (not working)
**/
class UserService
{
public function updateFromAPI( User $user): User
{
// ...
}
public function removeSession( User $user ): void
{
// ...
}
public function isUserAllowedToAccessAdmin( User $user ): bool
{
// ...
}
public function serialize( User $user ): string
{
// ...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment