Security

Token

There is no security token.

Firewall

main Name
Security enabled
Stateless

Configuration

Key Value
provider security.user.provider.concrete.app_user_provider
context main
entry_point App\Security\KbinAuthenticator
user_checker App\Security\UserChecker
access_denied_handler (none)
access_denied_url (none)
authenticators
[
  "two_factor"
  "remember_me"
  "App\Security\KbinAuthenticator"
  "App\Security\FacebookAuthenticator"
  "App\Security\GoogleAuthenticator"
  "App\Security\GithubAuthenticator"
  "App\Security\KeycloakAuthenticator"
]

Listeners

Listener Duration Response
Symfony\Component\Security\Http\Firewall\ChannelListener {#723
  -map: Symfony\Component\Security\Http\AccessMap {#722 …}
  -logger: Monolog\Logger {#783 …}
  -httpPort: 80
  -httpsPort: 443
}
0.00 ms (none)
Symfony\Component\Security\Http\Firewall\ContextListener {#706
  -tokenStorage: Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage {#1017 …}
  -sessionKey: "_security_main"
  -logger: Monolog\Logger {#783 …}
  -userProviders: Symfony\Component\DependencyInjection\Argument\RewindableGenerator {#705 …}
  -dispatcher: Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher {#747 …}
  -registered: false
  -trustResolver: Scheb\TwoFactorBundle\Security\Authentication\AuthenticationTrustResolver {#780 …}
  -sessionTrackerEnabler: Symfony\Component\Security\Core\Authentication\Token\Storage\UsageTrackingTokenStorage::enableUsageTracking(): void {#703 …}
}
0.23 ms (none)
Symfony\Component\Security\Http\Firewall\AuthenticatorManagerListener {#584
  -authenticatorManager: Symfony\Component\Security\Http\Authentication\AuthenticatorManager {#595 …}
}
0.00 ms (none)
Scheb\TwoFactorBundle\Security\Http\Firewall\TwoFactorAccessListener {#582
  -twoFactorFirewallConfig: Scheb\TwoFactorBundle\Security\TwoFactor\TwoFactorFirewallConfig {#842 …}
  -tokenStorage: Symfony\Component\Security\Core\Authentication\Token\Storage\UsageTrackingTokenStorage {#1018 …}
  -twoFactorAccessDecider: Scheb\TwoFactorBundle\Security\Authorization\TwoFactorAccessDecider {#581 …}
}
0.04 ms (none)
Symfony\Component\Security\Http\Firewall\AccessListener {#579
  -tokenStorage: Symfony\Component\Security\Core\Authentication\Token\Storage\UsageTrackingTokenStorage {#1018 …}
  -accessDecisionManager: Symfony\Component\Security\Core\Authorization\TraceableAccessDecisionManager {#937 …}
  -map: Symfony\Component\Security\Http\AccessMap {#722 …}
}
0.00 ms (none)
Symfony\Component\Security\Http\Firewall\LogoutListener {#786
  -tokenStorage: Symfony\Component\Security\Core\Authentication\Token\Storage\UsageTrackingTokenStorage {#1018 …}
  -options: [
    "csrf_parameter" => "_csrf_token"
    "csrf_token_id" => "logout"
    "logout_path" => "app_logout"
  ]
  -httpUtils: Symfony\Component\Security\Http\HttpUtils {#841 …}
  -csrfTokenManager: Symfony\Component\Security\Csrf\CsrfTokenManager {#1015 …}
  -eventDispatcher: Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher {#747 …}
}
0.00 ms (none)

Authenticators

No authenticators have been recorded. Check previous profiles on your authentication endpoint.

Access Decision

affirmative Strategy
# Voter class
1
"Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter"
2
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
3
"Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter"
4
"Symfony\Component\Security\Core\Authorization\Voter\ExpressionVoter"
5
"App\Security\Voter\EntryCommentVoter"
6
"App\Security\Voter\EntryVoter"
7
"App\Security\Voter\MagazineVoter"
8
"App\Security\Voter\MessageThreadVoter"
9
"App\Security\Voter\MessageVoter"
10
"App\Security\Voter\NotificationVoter"
11
"App\Security\Voter\OAuth2UserConsentVoter"
12
"App\Security\Voter\PostCommentVoter"
13
"App\Security\Voter\PostVoter"
14
"App\Security\Voter\UserVoter"

Access decision log

# Result Attributes Object
1 DENIED ROLE_USER
null
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter"
ACCESS DENIED
"App\Security\Voter\EntryCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryVoter"
ACCESS ABSTAIN
"App\Security\Voter\MagazineVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details
2 DENIED moderate
App\Entity\EntryComment {#1369
  +user: Proxies\__CG__\App\Entity\User {#1370 …}
  +entry: App\Entity\Entry {#1810 …}
  +magazine: App\Entity\Magazine {#313
    +icon: Proxies\__CG__\App\Entity\Image {#294 …}
    +name: "programmer_humor@programming.dev"
    +title: "programmer_humor"
    +description: """
      Welcome to Programmer Humor!\n
      \n
      This is a place where you can post jokes, memes, humor, etc. related to programming!\n
      \n
      For sharing awful code theres also [Programming Horror](https://programming.dev/c/programming_horror).\n
      \n
      Rules\n
      -----\n
      \n
      - Keep content in english\n
      - No advertisements\n
      - Posts must be related to programming or programmer topics
      """
    +rules: null
    +subscriptionsCount: 1
    +entryCount: 297
    +entryCommentCount: 2799
    +postCount: 1
    +postCommentCount: 0
    +isAdult: false
    +customCss: null
    +lastActive: DateTime @1729523671 {#323
      date: 2024-10-21 17:14:31.0 +02:00
    }
    +markedForDeletionAt: null
    +tags: null
    +moderators: Doctrine\ORM\PersistentCollection {#285 …}
    +ownershipRequests: Doctrine\ORM\PersistentCollection {#281 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#270 …}
    +entries: Doctrine\ORM\PersistentCollection {#228 …}
    +posts: Doctrine\ORM\PersistentCollection {#186 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#248 …}
    +bans: Doctrine\ORM\PersistentCollection {#165 …}
    +reports: Doctrine\ORM\PersistentCollection {#151 …}
    +badges: Doctrine\ORM\PersistentCollection {#129 …}
    +logs: Doctrine\ORM\PersistentCollection {#119 …}
    +awards: Doctrine\ORM\PersistentCollection {#108 …}
    +categories: Doctrine\ORM\PersistentCollection {#95 …}
    -id: 100
    +apId: "programmer_humor@programming.dev"
    +apProfileId: "https://programming.dev/c/programmer_humor"
    +apPublicUrl: "https://programming.dev/c/programmer_humor"
    +apFollowersUrl: "https://programming.dev/c/programmer_humor/followers"
    +apInboxUrl: "https://programming.dev/inbox"
    +apDomain: "programming.dev"
    +apPreferredUsername: "programmer_humor"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: null
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1726902871 {#317
      date: 2024-09-21 09:14:31.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1700391429 {#316
      date: 2023-11-19 11:57:09.0 +01:00
    }
  }
  +image: null
  +parent: null
  +root: null
  +body: """
    `//Get CustomerInfo from CustomerRepository by Customer ID or else throw an CustomerNotFoundException\n
    \n
    public CustomerInfo getById(String customerId) {\n
    \n
    ```\n
    \n
    <span style="color:#323232;">return customerRepository.getById(customerId).orElseThrow(new CustomerNotFoundException());\n
    </span>\n
    ```\n
    \n
    }`\n
    \n
    This is the kind of pointless comment I see in my codebase all the time. Best I can tell, a couple of my coworkers like to plan out their code using comments, then backfill in the actual executable code. That’s fine, but they leave the comments in when they add no value.\n
    \n
    ` public static LocalDate parseEndDateFromString(String dateString) {\n
    \n
    ```\n
    \n
    <span style="color:#323232;">    try {\n
    </span><span style="color:#323232;">\n
    </span><span style="color:#323232;">        String[] split = dateString.split("-");\n
    </span><span style="color:#323232;">\n
    </span><span style="color:#323232;">        //In order to get the last day of the desired month, we go to the first day of the next month, account for rollover, then subtract one day\n
    </span><span style="color:#323232;">\n
    </span><span style="color:#323232;">        int month = Integer.parseInt(split[0]) == 12 ? 1 : Integer.parseInt(split[0]) + 1;\n
    </span><span style="color:#323232;">\n
    </span><span style="color:#323232;">        return LocalDate.of(Integer.parseInt(split[1]), month, 1).minusDays(1);\n
    </span><span style="color:#323232;">\n
    </span><span style="color:#323232;">    } catch (Exception e) {\n
    </span><span style="color:#323232;">\n
    </span><span style="color:#323232;">        throw new RuntimeException("Invalid date format - must be MM-YYYY");\n
    </span><span style="color:#323232;">\n
    </span><span style="color:#323232;">    }\n
    </span><span style="color:#323232;">\n
    </span><span style="color:#323232;">}`\n
    </span>\n
    ```\n
    \n
    Stuff like this, otoh, is where comments are useful. The required format is obvious from the error message, the param and return from the method signature, the only part that requires a comment is the fiddly logic of accounting for the edge case where month == 12 and the rationale behind how we determine the last day of the month. As a rule, comments are for *why* something is being done, if it’s not obvious, and for magic numbers. Code should tell you what code does.\n
    \n
    edit: can anyone spot the bug that I introduced with that parseEndDateFromString() method?
    """
  +lang: "en"
  +isAdult: false
  +favouriteCount: 19
  +score: 0
  +lastActive: DateTime @1701108178 {#1605
    date: 2023-11-27 19:02:58.0 +01:00
  }
  +ip: null
  +tags: [
    "323232"
  ]
  +mentions: [
    "@CowsLookLikeMaps@sh.itjust.works"
  ]
  +children: Doctrine\ORM\PersistentCollection {#1371 …}
  +nested: Doctrine\ORM\PersistentCollection {#1379 …}
  +votes: Doctrine\ORM\PersistentCollection {#2446 …}
  +reports: Doctrine\ORM\PersistentCollection {#1891 …}
  +favourites: Doctrine\ORM\PersistentCollection {#2409 …}
  +notifications: Doctrine\ORM\PersistentCollection {#2358 …}
  -id: 170890
  -bodyTs: "'/get':1 '/in':87 '0':119,124 '1':121,125,130,132,134 '12':120,194 'account':108,187 'actual':60 'add':74 'anyon':237 'backfil':57 'behind':198 'best':39 'bug':240 'case':191 'catch':135 'code':53,62,228,233 'codebas':35 'comment':30,55,70,155,181,211 'coupl':44 'cowork':47 'custom':6 'customerid':17,20 'customerinfo':2,14 'customernotfoundexcept':12,23 'customerrepositori':4 'customerrepository.getbyid':19 'date':142 'datestr':82 'datestring.split':86 'day':93,103,114,204 'desir':96 'determin':201 'done':218 'e':137 'edg':190 'edit':235 'els':9 'error':165 'except':136 'execut':61 'fidd':184 'fine':65 'first':102 'format':143,160 'get':90 'getbyid':15 'go':99 'id':7 'int':115 'integer.parseint':117,122,128 'introduc':243 'invalid':141 'kind':27 'last':92,203 'leav':68 'like':48,150 'locald':79 'localdate.of':127 'logic':185 'magic':226 'messag':166 'method':173,247 'minusday':133 'mm':147 'mm-yyyy':146 'month':97,107,116,131,193,207 'must':144 'new':22,139 'next':106 'number':227 'obvious':162,223 'one':113 'order':88 'orelsethrow':21 'otoh':152 'param':168 'parseenddatefromstr':80,246 'part':177 'plan':50 'pointless':29 'public':13,77 'rational':197 'requir':159,179 'return':18,126,170 'rollov':110 'rule':210 'runtimeexcept':140 'see':32 'signatur':174 'someth':215 'split':85,118,123,129 'spot':238 'static':78 'string':16,81,84 'stuff':149 'subtract':112 'tell':42,230 'throw':10,138 'time':38 'tri':83 'use':54,157 'valu':76 'yyyi':148"
  +ranking: 0
  +commentCount: 0
  +upVotes: 0
  +downVotes: 0
  +visibility: "visible             "
  +apId: "https://lemm.ee/comment/6657473"
  +editedAt: DateTimeImmutable @1702525098 {#1945
    date: 2023-12-14 04:38:18.0 +01:00
  }
  +createdAt: DateTimeImmutable @1701108178 {#1368
    date: 2023-11-27 19:02:58.0 +01:00
  }
}
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryCommentVoter"
ACCESS DENIED
"App\Security\Voter\EntryVoter"
ACCESS ABSTAIN
"App\Security\Voter\MagazineVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details
3 DENIED edit
App\Entity\EntryComment {#1369
  +user: Proxies\__CG__\App\Entity\User {#1370 …}
  +entry: App\Entity\Entry {#1810 …}
  +magazine: App\Entity\Magazine {#313
    +icon: Proxies\__CG__\App\Entity\Image {#294 …}
    +name: "programmer_humor@programming.dev"
    +title: "programmer_humor"
    +description: """
      Welcome to Programmer Humor!\n
      \n
      This is a place where you can post jokes, memes, humor, etc. related to programming!\n
      \n
      For sharing awful code theres also [Programming Horror](https://programming.dev/c/programming_horror).\n
      \n
      Rules\n
      -----\n
      \n
      - Keep content in english\n
      - No advertisements\n
      - Posts must be related to programming or programmer topics
      """
    +rules: null
    +subscriptionsCount: 1
    +entryCount: 297
    +entryCommentCount: 2799
    +postCount: 1
    +postCommentCount: 0
    +isAdult: false
    +customCss: null
    +lastActive: DateTime @1729523671 {#323
      date: 2024-10-21 17:14:31.0 +02:00
    }
    +markedForDeletionAt: null
    +tags: null
    +moderators: Doctrine\ORM\PersistentCollection {#285 …}
    +ownershipRequests: Doctrine\ORM\PersistentCollection {#281 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#270 …}
    +entries: Doctrine\ORM\PersistentCollection {#228 …}
    +posts: Doctrine\ORM\PersistentCollection {#186 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#248 …}
    +bans: Doctrine\ORM\PersistentCollection {#165 …}
    +reports: Doctrine\ORM\PersistentCollection {#151 …}
    +badges: Doctrine\ORM\PersistentCollection {#129 …}
    +logs: Doctrine\ORM\PersistentCollection {#119 …}
    +awards: Doctrine\ORM\PersistentCollection {#108 …}
    +categories: Doctrine\ORM\PersistentCollection {#95 …}
    -id: 100
    +apId: "programmer_humor@programming.dev"
    +apProfileId: "https://programming.dev/c/programmer_humor"
    +apPublicUrl: "https://programming.dev/c/programmer_humor"
    +apFollowersUrl: "https://programming.dev/c/programmer_humor/followers"
    +apInboxUrl: "https://programming.dev/inbox"
    +apDomain: "programming.dev"
    +apPreferredUsername: "programmer_humor"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: null
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1726902871 {#317
      date: 2024-09-21 09:14:31.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1700391429 {#316
      date: 2023-11-19 11:57:09.0 +01:00
    }
  }
  +image: null
  +parent: null
  +root: null
  +body: """
    `//Get CustomerInfo from CustomerRepository by Customer ID or else throw an CustomerNotFoundException\n
    \n
    public CustomerInfo getById(String customerId) {\n
    \n
    ```\n
    \n
    <span style="color:#323232;">return customerRepository.getById(customerId).orElseThrow(new CustomerNotFoundException());\n
    </span>\n
    ```\n
    \n
    }`\n
    \n
    This is the kind of pointless comment I see in my codebase all the time. Best I can tell, a couple of my coworkers like to plan out their code using comments, then backfill in the actual executable code. That’s fine, but they leave the comments in when they add no value.\n
    \n
    ` public static LocalDate parseEndDateFromString(String dateString) {\n
    \n
    ```\n
    \n
    <span style="color:#323232;">    try {\n
    </span><span style="color:#323232;">\n
    </span><span style="color:#323232;">        String[] split = dateString.split("-");\n
    </span><span style="color:#323232;">\n
    </span><span style="color:#323232;">        //In order to get the last day of the desired month, we go to the first day of the next month, account for rollover, then subtract one day\n
    </span><span style="color:#323232;">\n
    </span><span style="color:#323232;">        int month = Integer.parseInt(split[0]) == 12 ? 1 : Integer.parseInt(split[0]) + 1;\n
    </span><span style="color:#323232;">\n
    </span><span style="color:#323232;">        return LocalDate.of(Integer.parseInt(split[1]), month, 1).minusDays(1);\n
    </span><span style="color:#323232;">\n
    </span><span style="color:#323232;">    } catch (Exception e) {\n
    </span><span style="color:#323232;">\n
    </span><span style="color:#323232;">        throw new RuntimeException("Invalid date format - must be MM-YYYY");\n
    </span><span style="color:#323232;">\n
    </span><span style="color:#323232;">    }\n
    </span><span style="color:#323232;">\n
    </span><span style="color:#323232;">}`\n
    </span>\n
    ```\n
    \n
    Stuff like this, otoh, is where comments are useful. The required format is obvious from the error message, the param and return from the method signature, the only part that requires a comment is the fiddly logic of accounting for the edge case where month == 12 and the rationale behind how we determine the last day of the month. As a rule, comments are for *why* something is being done, if it’s not obvious, and for magic numbers. Code should tell you what code does.\n
    \n
    edit: can anyone spot the bug that I introduced with that parseEndDateFromString() method?
    """
  +lang: "en"
  +isAdult: false
  +favouriteCount: 19
  +score: 0
  +lastActive: DateTime @1701108178 {#1605
    date: 2023-11-27 19:02:58.0 +01:00
  }
  +ip: null
  +tags: [
    "323232"
  ]
  +mentions: [
    "@CowsLookLikeMaps@sh.itjust.works"
  ]
  +children: Doctrine\ORM\PersistentCollection {#1371 …}
  +nested: Doctrine\ORM\PersistentCollection {#1379 …}
  +votes: Doctrine\ORM\PersistentCollection {#2446 …}
  +reports: Doctrine\ORM\PersistentCollection {#1891 …}
  +favourites: Doctrine\ORM\PersistentCollection {#2409 …}
  +notifications: Doctrine\ORM\PersistentCollection {#2358 …}
  -id: 170890
  -bodyTs: "'/get':1 '/in':87 '0':119,124 '1':121,125,130,132,134 '12':120,194 'account':108,187 'actual':60 'add':74 'anyon':237 'backfil':57 'behind':198 'best':39 'bug':240 'case':191 'catch':135 'code':53,62,228,233 'codebas':35 'comment':30,55,70,155,181,211 'coupl':44 'cowork':47 'custom':6 'customerid':17,20 'customerinfo':2,14 'customernotfoundexcept':12,23 'customerrepositori':4 'customerrepository.getbyid':19 'date':142 'datestr':82 'datestring.split':86 'day':93,103,114,204 'desir':96 'determin':201 'done':218 'e':137 'edg':190 'edit':235 'els':9 'error':165 'except':136 'execut':61 'fidd':184 'fine':65 'first':102 'format':143,160 'get':90 'getbyid':15 'go':99 'id':7 'int':115 'integer.parseint':117,122,128 'introduc':243 'invalid':141 'kind':27 'last':92,203 'leav':68 'like':48,150 'locald':79 'localdate.of':127 'logic':185 'magic':226 'messag':166 'method':173,247 'minusday':133 'mm':147 'mm-yyyy':146 'month':97,107,116,131,193,207 'must':144 'new':22,139 'next':106 'number':227 'obvious':162,223 'one':113 'order':88 'orelsethrow':21 'otoh':152 'param':168 'parseenddatefromstr':80,246 'part':177 'plan':50 'pointless':29 'public':13,77 'rational':197 'requir':159,179 'return':18,126,170 'rollov':110 'rule':210 'runtimeexcept':140 'see':32 'signatur':174 'someth':215 'split':85,118,123,129 'spot':238 'static':78 'string':16,81,84 'stuff':149 'subtract':112 'tell':42,230 'throw':10,138 'time':38 'tri':83 'use':54,157 'valu':76 'yyyi':148"
  +ranking: 0
  +commentCount: 0
  +upVotes: 0
  +downVotes: 0
  +visibility: "visible             "
  +apId: "https://lemm.ee/comment/6657473"
  +editedAt: DateTimeImmutable @1702525098 {#1945
    date: 2023-12-14 04:38:18.0 +01:00
  }
  +createdAt: DateTimeImmutable @1701108178 {#1368
    date: 2023-11-27 19:02:58.0 +01:00
  }
}
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryCommentVoter"
ACCESS DENIED
"App\Security\Voter\EntryVoter"
ACCESS ABSTAIN
"App\Security\Voter\MagazineVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details
4 DENIED moderate
App\Entity\EntryComment {#1369
  +user: Proxies\__CG__\App\Entity\User {#1370 …}
  +entry: App\Entity\Entry {#1810 …}
  +magazine: App\Entity\Magazine {#313
    +icon: Proxies\__CG__\App\Entity\Image {#294 …}
    +name: "programmer_humor@programming.dev"
    +title: "programmer_humor"
    +description: """
      Welcome to Programmer Humor!\n
      \n
      This is a place where you can post jokes, memes, humor, etc. related to programming!\n
      \n
      For sharing awful code theres also [Programming Horror](https://programming.dev/c/programming_horror).\n
      \n
      Rules\n
      -----\n
      \n
      - Keep content in english\n
      - No advertisements\n
      - Posts must be related to programming or programmer topics
      """
    +rules: null
    +subscriptionsCount: 1
    +entryCount: 297
    +entryCommentCount: 2799
    +postCount: 1
    +postCommentCount: 0
    +isAdult: false
    +customCss: null
    +lastActive: DateTime @1729523671 {#323
      date: 2024-10-21 17:14:31.0 +02:00
    }
    +markedForDeletionAt: null
    +tags: null
    +moderators: Doctrine\ORM\PersistentCollection {#285 …}
    +ownershipRequests: Doctrine\ORM\PersistentCollection {#281 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#270 …}
    +entries: Doctrine\ORM\PersistentCollection {#228 …}
    +posts: Doctrine\ORM\PersistentCollection {#186 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#248 …}
    +bans: Doctrine\ORM\PersistentCollection {#165 …}
    +reports: Doctrine\ORM\PersistentCollection {#151 …}
    +badges: Doctrine\ORM\PersistentCollection {#129 …}
    +logs: Doctrine\ORM\PersistentCollection {#119 …}
    +awards: Doctrine\ORM\PersistentCollection {#108 …}
    +categories: Doctrine\ORM\PersistentCollection {#95 …}
    -id: 100
    +apId: "programmer_humor@programming.dev"
    +apProfileId: "https://programming.dev/c/programmer_humor"
    +apPublicUrl: "https://programming.dev/c/programmer_humor"
    +apFollowersUrl: "https://programming.dev/c/programmer_humor/followers"
    +apInboxUrl: "https://programming.dev/inbox"
    +apDomain: "programming.dev"
    +apPreferredUsername: "programmer_humor"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: null
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1726902871 {#317
      date: 2024-09-21 09:14:31.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1700391429 {#316
      date: 2023-11-19 11:57:09.0 +01:00
    }
  }
  +image: null
  +parent: null
  +root: null
  +body: """
    `//Get CustomerInfo from CustomerRepository by Customer ID or else throw an CustomerNotFoundException\n
    \n
    public CustomerInfo getById(String customerId) {\n
    \n
    ```\n
    \n
    <span style="color:#323232;">return customerRepository.getById(customerId).orElseThrow(new CustomerNotFoundException());\n
    </span>\n
    ```\n
    \n
    }`\n
    \n
    This is the kind of pointless comment I see in my codebase all the time. Best I can tell, a couple of my coworkers like to plan out their code using comments, then backfill in the actual executable code. That’s fine, but they leave the comments in when they add no value.\n
    \n
    ` public static LocalDate parseEndDateFromString(String dateString) {\n
    \n
    ```\n
    \n
    <span style="color:#323232;">    try {\n
    </span><span style="color:#323232;">\n
    </span><span style="color:#323232;">        String[] split = dateString.split("-");\n
    </span><span style="color:#323232;">\n
    </span><span style="color:#323232;">        //In order to get the last day of the desired month, we go to the first day of the next month, account for rollover, then subtract one day\n
    </span><span style="color:#323232;">\n
    </span><span style="color:#323232;">        int month = Integer.parseInt(split[0]) == 12 ? 1 : Integer.parseInt(split[0]) + 1;\n
    </span><span style="color:#323232;">\n
    </span><span style="color:#323232;">        return LocalDate.of(Integer.parseInt(split[1]), month, 1).minusDays(1);\n
    </span><span style="color:#323232;">\n
    </span><span style="color:#323232;">    } catch (Exception e) {\n
    </span><span style="color:#323232;">\n
    </span><span style="color:#323232;">        throw new RuntimeException("Invalid date format - must be MM-YYYY");\n
    </span><span style="color:#323232;">\n
    </span><span style="color:#323232;">    }\n
    </span><span style="color:#323232;">\n
    </span><span style="color:#323232;">}`\n
    </span>\n
    ```\n
    \n
    Stuff like this, otoh, is where comments are useful. The required format is obvious from the error message, the param and return from the method signature, the only part that requires a comment is the fiddly logic of accounting for the edge case where month == 12 and the rationale behind how we determine the last day of the month. As a rule, comments are for *why* something is being done, if it’s not obvious, and for magic numbers. Code should tell you what code does.\n
    \n
    edit: can anyone spot the bug that I introduced with that parseEndDateFromString() method?
    """
  +lang: "en"
  +isAdult: false
  +favouriteCount: 19
  +score: 0
  +lastActive: DateTime @1701108178 {#1605
    date: 2023-11-27 19:02:58.0 +01:00
  }
  +ip: null
  +tags: [
    "323232"
  ]
  +mentions: [
    "@CowsLookLikeMaps@sh.itjust.works"
  ]
  +children: Doctrine\ORM\PersistentCollection {#1371 …}
  +nested: Doctrine\ORM\PersistentCollection {#1379 …}
  +votes: Doctrine\ORM\PersistentCollection {#2446 …}
  +reports: Doctrine\ORM\PersistentCollection {#1891 …}
  +favourites: Doctrine\ORM\PersistentCollection {#2409 …}
  +notifications: Doctrine\ORM\PersistentCollection {#2358 …}
  -id: 170890
  -bodyTs: "'/get':1 '/in':87 '0':119,124 '1':121,125,130,132,134 '12':120,194 'account':108,187 'actual':60 'add':74 'anyon':237 'backfil':57 'behind':198 'best':39 'bug':240 'case':191 'catch':135 'code':53,62,228,233 'codebas':35 'comment':30,55,70,155,181,211 'coupl':44 'cowork':47 'custom':6 'customerid':17,20 'customerinfo':2,14 'customernotfoundexcept':12,23 'customerrepositori':4 'customerrepository.getbyid':19 'date':142 'datestr':82 'datestring.split':86 'day':93,103,114,204 'desir':96 'determin':201 'done':218 'e':137 'edg':190 'edit':235 'els':9 'error':165 'except':136 'execut':61 'fidd':184 'fine':65 'first':102 'format':143,160 'get':90 'getbyid':15 'go':99 'id':7 'int':115 'integer.parseint':117,122,128 'introduc':243 'invalid':141 'kind':27 'last':92,203 'leav':68 'like':48,150 'locald':79 'localdate.of':127 'logic':185 'magic':226 'messag':166 'method':173,247 'minusday':133 'mm':147 'mm-yyyy':146 'month':97,107,116,131,193,207 'must':144 'new':22,139 'next':106 'number':227 'obvious':162,223 'one':113 'order':88 'orelsethrow':21 'otoh':152 'param':168 'parseenddatefromstr':80,246 'part':177 'plan':50 'pointless':29 'public':13,77 'rational':197 'requir':159,179 'return':18,126,170 'rollov':110 'rule':210 'runtimeexcept':140 'see':32 'signatur':174 'someth':215 'split':85,118,123,129 'spot':238 'static':78 'string':16,81,84 'stuff':149 'subtract':112 'tell':42,230 'throw':10,138 'time':38 'tri':83 'use':54,157 'valu':76 'yyyi':148"
  +ranking: 0
  +commentCount: 0
  +upVotes: 0
  +downVotes: 0
  +visibility: "visible             "
  +apId: "https://lemm.ee/comment/6657473"
  +editedAt: DateTimeImmutable @1702525098 {#1945
    date: 2023-12-14 04:38:18.0 +01:00
  }
  +createdAt: DateTimeImmutable @1701108178 {#1368
    date: 2023-11-27 19:02:58.0 +01:00
  }
}
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryCommentVoter"
ACCESS DENIED
"App\Security\Voter\EntryVoter"
ACCESS ABSTAIN
"App\Security\Voter\MagazineVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details
5 DENIED edit
App\Entity\Magazine {#313
  +icon: Proxies\__CG__\App\Entity\Image {#294 …}
  +name: "programmer_humor@programming.dev"
  +title: "programmer_humor"
  +description: """
    Welcome to Programmer Humor!\n
    \n
    This is a place where you can post jokes, memes, humor, etc. related to programming!\n
    \n
    For sharing awful code theres also [Programming Horror](https://programming.dev/c/programming_horror).\n
    \n
    Rules\n
    -----\n
    \n
    - Keep content in english\n
    - No advertisements\n
    - Posts must be related to programming or programmer topics
    """
  +rules: null
  +subscriptionsCount: 1
  +entryCount: 297
  +entryCommentCount: 2799
  +postCount: 1
  +postCommentCount: 0
  +isAdult: false
  +customCss: null
  +lastActive: DateTime @1729523671 {#323
    date: 2024-10-21 17:14:31.0 +02:00
  }
  +markedForDeletionAt: null
  +tags: null
  +moderators: Doctrine\ORM\PersistentCollection {#285 …}
  +ownershipRequests: Doctrine\ORM\PersistentCollection {#281 …}
  +moderatorRequests: Doctrine\ORM\PersistentCollection {#270 …}
  +entries: Doctrine\ORM\PersistentCollection {#228 …}
  +posts: Doctrine\ORM\PersistentCollection {#186 …}
  +subscriptions: Doctrine\ORM\PersistentCollection {#248 …}
  +bans: Doctrine\ORM\PersistentCollection {#165 …}
  +reports: Doctrine\ORM\PersistentCollection {#151 …}
  +badges: Doctrine\ORM\PersistentCollection {#129 …}
  +logs: Doctrine\ORM\PersistentCollection {#119 …}
  +awards: Doctrine\ORM\PersistentCollection {#108 …}
  +categories: Doctrine\ORM\PersistentCollection {#95 …}
  -id: 100
  +apId: "programmer_humor@programming.dev"
  +apProfileId: "https://programming.dev/c/programmer_humor"
  +apPublicUrl: "https://programming.dev/c/programmer_humor"
  +apFollowersUrl: "https://programming.dev/c/programmer_humor/followers"
  +apInboxUrl: "https://programming.dev/inbox"
  +apDomain: "programming.dev"
  +apPreferredUsername: "programmer_humor"
  +apDiscoverable: true
  +apManuallyApprovesFollowers: null
  +privateKey: null
  +publicKey: null
  +apFetchedAt: DateTime @1726902871 {#317
    date: 2024-09-21 09:14:31.0 +02:00
  }
  +apDeletedAt: null
  +apTimeoutAt: null
  +visibility: "visible             "
  +createdAt: DateTimeImmutable @1700391429 {#316
    date: 2023-11-19 11:57:09.0 +01:00
  }
}
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryVoter"
ACCESS ABSTAIN
"App\Security\Voter\MagazineVoter"
ACCESS DENIED
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details