Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
C
Core
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 914
    • Issues 914
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • Development
  • Core
  • Issues
  • #1534

Closed
Open
Opened Jan 16, 2020 by JonGold@JonGoldDeveloper

Position on scalar type checking?

Coleman's recent API4 PR to return values with their correct types made me realize that now that we have a PHP 7.0 requirement, we can start using type hinting for scalars.

I was wondering if this has been discussed yet, and if not, this can be the space for it. I'd be curious to hear the more active devs' positions on starting to use them in the codebase. Some questions to consider:

  • Strong type-checking, or weak? Is it something that perhaps should be different for new vs. legacy classes?
  • Do we want to implement Jenkins testing for type checking?
  • Do we want to consider some sort of wholesale shift, like when we implemented code formatting standards? I just spotted this: https://github.com/dunglas/phpdoc-to-typehint
To upload designs, you'll need to enable LFS and have admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: dev/core#1534