René's URL Explorer Experiment


Title: Improve option and result type precision by GrahamCampbell · Pull Request #613 · phpdotenv/phpdotenv · GitHub

Open Graph Title: Improve option and result type precision by GrahamCampbell · Pull Request #613 · phpdotenv/phpdotenv

X Title: Improve option and result type precision by GrahamCampbell · Pull Request #613 · phpdotenv/phpdotenv

Description: With the covariant option and result types in place, several annotations can now say precisely what the code does. The five concrete adapters declare create() as returning an option of the adapter itself rather than of the interface, which removes the widening casts inside them and gives callers the concrete type. The repository builder's reader, writer and adapter parameters now document the actual acceptance, an instance of the respective interface or a class-string of an adapter, which matches the runtime guards exactly and lets the builder closures type-check without laundering. The string and regex helpers declare the non-negative integer ranges they actually produce, correcting a wrong-shaped cast in Str::pos. None of this changes behaviour, and code typed against the old signatures only ever sees narrower types. The phpstan baseline shrinks from sixteen entries to five as a byproduct.

Open Graph Description: With the covariant option and result types in place, several annotations can now say precisely what the code does. The five concrete adapters declare create() as returning an option of the adapter ...

X Description: With the covariant option and result types in place, several annotations can now say precisely what the code does. The five concrete adapters declare create() as returning an option of the adapter ...

Opengraph URL: https://github.com/phpdotenv/phpdotenv/pull/613

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:17469827-cf6f-8bf4-17c0-7666780e8010
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD4BC:3E3AC8:9D99ED:CC7EBB:6B063426
html-safe-noncef9400b87a0f08e5bcb4fc7a5689baa809b9c4774e3a6ac4bf0275021252473a3
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENEJDOjNFM0FDODo5RDk5RUQ6Q0M3RUJCOjZCMDYzNDI2IiwidmlzaXRvcl9pZCI6IjczOTIzMTc5ODg3NjQyNjc1NTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac6e3747f37bc11b20c3e9761b8f16e9615c1c5452b39f0670e3461dee2fd12e03
hovercard-subject-tagpull_request:4347646982
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/phpdotenv/phpdotenv/pull/613/files
twitter:imagehttps://avatars.githubusercontent.com/u/2829600?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/2829600?s=400&v=4
og:image:altWith the covariant option and result types in place, several annotations can now say precisely what the code does. The five concrete adapters declare create() as returning an option of the adapter ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonec3584c853cd39700ecff6e2cf8364295ffdb5313e571046c41cd2479270f7df0
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/phpdotenv/phpdotenv git https://github.com/phpdotenv/phpdotenv.git
octolytics-dimension-user_id320763234
octolytics-dimension-user_loginphpdotenv
octolytics-dimension-repository_id7769432
octolytics-dimension-repository_nwophpdotenv/phpdotenv
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id7769432
octolytics-dimension-repository_network_root_nwophpdotenv/phpdotenv
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release9eb3bb1597d09170a5f282cd38ae376dee1a5ec1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/phpdotenv/phpdotenv/pull/613/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fphpdotenv%2Fphpdotenv%2Fpull%2F613%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fphpdotenv%2Fphpdotenv%2Fpull%2F613%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=phpdotenv%2Fphpdotenv
Reloadhttps://github.com/phpdotenv/phpdotenv/pull/613/files
Reloadhttps://github.com/phpdotenv/phpdotenv/pull/613/files
Reloadhttps://github.com/phpdotenv/phpdotenv/pull/613/files
phpdotenvhttps://github.com/phpdotenv
phpdotenvhttps://github.com/phpdotenv/phpdotenv
Codehttps://github.com/phpdotenv/phpdotenv
Issues1 (1)https://github.com/phpdotenv/phpdotenv/issues
Pull requestshttps://github.com/phpdotenv/phpdotenv/pulls
Actionshttps://github.com/phpdotenv/phpdotenv/actions
Projectshttps://github.com/phpdotenv/phpdotenv/projects
Security and quality4 (4)https://github.com/phpdotenv/phpdotenv/security
Insightshttps://github.com/phpdotenv/phpdotenv/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fphpdotenv%2Fphpdotenv%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fphpdotenv%2Fphpdotenv%2Fissues%2Fnew%2Fchoose
GrahamCampbellhttps://github.com/GrahamCampbell
masterhttps://github.com/phpdotenv/phpdotenv/tree/master
types/option-result-precisionhttps://github.com/phpdotenv/phpdotenv/tree/types/option-result-precision
Conversation 0 https://github.com/phpdotenv/phpdotenv/pull/613
Commits 1 https://github.com/phpdotenv/phpdotenv/pull/613/commits
Checks 42 https://github.com/phpdotenv/phpdotenv/pull/613/checks
Files changed https://github.com/phpdotenv/phpdotenv/pull/613/files
Please reload this pagehttps://github.com/phpdotenv/phpdotenv/pull/613/files
Improve option and result type precision https://github.com/phpdotenv/phpdotenv/pull/613/files#top
Show all changes 1 commit https://github.com/phpdotenv/phpdotenv/pull/613/files
46e982e Improve option and result type precision GrahamCampbell Aug 24, 2026 https://github.com/phpdotenv/phpdotenv/pull/613/commits/46e982efecbe59e9996dab3cd76141e7db14b3ae
Clear filters https://github.com/phpdotenv/phpdotenv/pull/613/files
Please reload this pagehttps://github.com/phpdotenv/phpdotenv/pull/613/files
Please reload this pagehttps://github.com/phpdotenv/phpdotenv/pull/613/files
phpstan-baseline.neon https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-995edee38ad4f8387e58ebd52c31bcc04c56cc2448d331b1cf5e0b35c57b9efa
ApacheAdapter.php https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-99f94a445b937834632f00d19519ab9b6d4e9b0ea0c93cdff13e38a6ce440cae
ArrayAdapter.php https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-098ee09513ea4dd84b2a5d578c5687c8a7c33bb2cdbf26ab85851ef9d0a4bbed
EnvConstAdapter.php https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-05a4c063b3446bbfd95096da5c7a4008c73ec37ce0ed71fc46afdccf30724234
PutenvAdapter.php https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-aeaa06db01cc9126a11254c1f8ff96a9618317c3abf7c37c41fb76d205244302
ServerConstAdapter.php https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-8038030f4ec072779640760d70973d2edacb0d06d46bc3e0743e98b81e88d207
RepositoryBuilder.php https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-0407400bf4ac12fe98d89248540bfdae29720d67211ea5e912137828f16e855a
Regex.php https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-32cd7c2c00d47154615c6b423ff36bfc29453d773d7ebcd42cd7d26f0bbb1aae
Str.php https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-d5691cf921b4725a3ebb6ed32b05373fb875a2770e350adff6ad3d190eec3e73
phpstan-baseline.neonhttps://github.com/phpdotenv/phpdotenv/pull/613/files#diff-995edee38ad4f8387e58ebd52c31bcc04c56cc2448d331b1cf5e0b35c57b9efa
View file https://github.com/phpdotenv/phpdotenv/blob/46e982efecbe59e9996dab3cd76141e7db14b3ae/phpstan-baseline.neon
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/phpdotenv/phpdotenv/pull/613/{{ revealButtonHref }}
https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-995edee38ad4f8387e58ebd52c31bcc04c56cc2448d331b1cf5e0b35c57b9efa
src/Repository/Adapter/ApacheAdapter.phphttps://github.com/phpdotenv/phpdotenv/pull/613/files#diff-99f94a445b937834632f00d19519ab9b6d4e9b0ea0c93cdff13e38a6ce440cae
View file https://github.com/phpdotenv/phpdotenv/blob/46e982efecbe59e9996dab3cd76141e7db14b3ae/src/Repository/Adapter/ApacheAdapter.php
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/phpdotenv/phpdotenv/pull/613/{{ revealButtonHref }}
https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-99f94a445b937834632f00d19519ab9b6d4e9b0ea0c93cdff13e38a6ce440cae
https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-99f94a445b937834632f00d19519ab9b6d4e9b0ea0c93cdff13e38a6ce440cae
src/Repository/Adapter/ArrayAdapter.phphttps://github.com/phpdotenv/phpdotenv/pull/613/files#diff-098ee09513ea4dd84b2a5d578c5687c8a7c33bb2cdbf26ab85851ef9d0a4bbed
View file https://github.com/phpdotenv/phpdotenv/blob/46e982efecbe59e9996dab3cd76141e7db14b3ae/src/Repository/Adapter/ArrayAdapter.php
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/phpdotenv/phpdotenv/pull/613/{{ revealButtonHref }}
https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-098ee09513ea4dd84b2a5d578c5687c8a7c33bb2cdbf26ab85851ef9d0a4bbed
https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-098ee09513ea4dd84b2a5d578c5687c8a7c33bb2cdbf26ab85851ef9d0a4bbed
src/Repository/Adapter/EnvConstAdapter.phphttps://github.com/phpdotenv/phpdotenv/pull/613/files#diff-05a4c063b3446bbfd95096da5c7a4008c73ec37ce0ed71fc46afdccf30724234
View file https://github.com/phpdotenv/phpdotenv/blob/46e982efecbe59e9996dab3cd76141e7db14b3ae/src/Repository/Adapter/EnvConstAdapter.php
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/phpdotenv/phpdotenv/pull/613/{{ revealButtonHref }}
https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-05a4c063b3446bbfd95096da5c7a4008c73ec37ce0ed71fc46afdccf30724234
https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-05a4c063b3446bbfd95096da5c7a4008c73ec37ce0ed71fc46afdccf30724234
src/Repository/Adapter/PutenvAdapter.phphttps://github.com/phpdotenv/phpdotenv/pull/613/files#diff-aeaa06db01cc9126a11254c1f8ff96a9618317c3abf7c37c41fb76d205244302
View file https://github.com/phpdotenv/phpdotenv/blob/46e982efecbe59e9996dab3cd76141e7db14b3ae/src/Repository/Adapter/PutenvAdapter.php
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/phpdotenv/phpdotenv/pull/613/{{ revealButtonHref }}
https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-aeaa06db01cc9126a11254c1f8ff96a9618317c3abf7c37c41fb76d205244302
https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-aeaa06db01cc9126a11254c1f8ff96a9618317c3abf7c37c41fb76d205244302
src/Repository/Adapter/ServerConstAdapter.phphttps://github.com/phpdotenv/phpdotenv/pull/613/files#diff-8038030f4ec072779640760d70973d2edacb0d06d46bc3e0743e98b81e88d207
View file https://github.com/phpdotenv/phpdotenv/blob/46e982efecbe59e9996dab3cd76141e7db14b3ae/src/Repository/Adapter/ServerConstAdapter.php
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/phpdotenv/phpdotenv/pull/613/{{ revealButtonHref }}
https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-8038030f4ec072779640760d70973d2edacb0d06d46bc3e0743e98b81e88d207
https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-8038030f4ec072779640760d70973d2edacb0d06d46bc3e0743e98b81e88d207
src/Repository/RepositoryBuilder.phphttps://github.com/phpdotenv/phpdotenv/pull/613/files#diff-0407400bf4ac12fe98d89248540bfdae29720d67211ea5e912137828f16e855a
View file https://github.com/phpdotenv/phpdotenv/blob/46e982efecbe59e9996dab3cd76141e7db14b3ae/src/Repository/RepositoryBuilder.php
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/phpdotenv/phpdotenv/pull/613/{{ revealButtonHref }}
https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-0407400bf4ac12fe98d89248540bfdae29720d67211ea5e912137828f16e855a
https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-0407400bf4ac12fe98d89248540bfdae29720d67211ea5e912137828f16e855a
https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-0407400bf4ac12fe98d89248540bfdae29720d67211ea5e912137828f16e855a
https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-0407400bf4ac12fe98d89248540bfdae29720d67211ea5e912137828f16e855a
https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-0407400bf4ac12fe98d89248540bfdae29720d67211ea5e912137828f16e855a
https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-0407400bf4ac12fe98d89248540bfdae29720d67211ea5e912137828f16e855a
src/Util/Regex.phphttps://github.com/phpdotenv/phpdotenv/pull/613/files#diff-32cd7c2c00d47154615c6b423ff36bfc29453d773d7ebcd42cd7d26f0bbb1aae
View file https://github.com/phpdotenv/phpdotenv/blob/46e982efecbe59e9996dab3cd76141e7db14b3ae/src/Util/Regex.php
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/phpdotenv/phpdotenv/pull/613/{{ revealButtonHref }}
https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-32cd7c2c00d47154615c6b423ff36bfc29453d773d7ebcd42cd7d26f0bbb1aae
https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-32cd7c2c00d47154615c6b423ff36bfc29453d773d7ebcd42cd7d26f0bbb1aae
src/Util/Str.phphttps://github.com/phpdotenv/phpdotenv/pull/613/files#diff-d5691cf921b4725a3ebb6ed32b05373fb875a2770e350adff6ad3d190eec3e73
View file https://github.com/phpdotenv/phpdotenv/blob/46e982efecbe59e9996dab3cd76141e7db14b3ae/src/Util/Str.php
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/phpdotenv/phpdotenv/pull/613/{{ revealButtonHref }}
https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-d5691cf921b4725a3ebb6ed32b05373fb875a2770e350adff6ad3d190eec3e73
https://github.com/phpdotenv/phpdotenv/pull/613/files#diff-d5691cf921b4725a3ebb6ed32b05373fb875a2770e350adff6ad3d190eec3e73
Please reload this pagehttps://github.com/phpdotenv/phpdotenv/pull/613/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.