Comments (3)
@BrianHenryIE as a more general question, would you say polyfills like these should be excluded from Strauss treatments?
Considering that for example this Normalizer
polyfill defines missing global functions like normalizer_is_normalized
and normalizer_normalize
only when they're not defined in the first place, and that those functions aren't renamed themselves (or contained in a namespace)
from strauss.
I didn't mean to close this. Still more work to do!
from strauss.
OK, @alexmigf , the actual bug is fixed.
But as @Spreeuw points out, this might not be worth prefixing.
bootstrap.php operates in the global namespace. Strauss adds prefixes to existing namespaces, it does not add a namespace to files with none in them (although that's an interesting idea and could work as an alternative to prefixing classnames).
So when our plugin autoloader runs, Symphony's boostrap is going to check for a global normalizer_is_normalized()
function, and add it if absent. If another plugin has loaded an older (or newer) version of polyfill-intl-normalizer, normalizer_is_normalized()
will already be defined and that code used.
So the problem Strauss aims to solve is not correctly addressed here. And I don't think there is any benefit to prefixing the namespace.
I've seen suggestions for unit testing global functions by redefining them inside the project root namespace. i.e. Normalizer_Test\normalizer_is_normalized()
. I think if normalizer_is_normalized()
is called within the Normalizer_Test
namespace, it will call normalizer_is_normalized()
if available and Normalizer_Test\normalizer_is_normalized()
otherwise.
I'll leave this open for discussion and until I test that idea out.
This is the config for excluding it, and this may end up being the default configuration:
{
"require": {
"symfony/polyfill-intl-normalizer": "^1.23"
},
"extra": {
"strauss": {
"exclude_from_prefix": {
"packages": [
"symfony/polyfill-intl-normalizer"
]
}
}
}
}
from strauss.
Related Issues (20)
- Workflows are referencing vulnerable actions HOT 1
- Deprecated: Return type of MyCLabs\Enum\Enum::jsonSerialize() should... HOT 4
- Fatal error: Uncaught Error: Class "BrianHenryIE\Strauss\Console\Application" not found HOT 4
- Error on call to undefined WP function HOT 2
- Problem with package name `"Blockchain/Blockchain"` HOT 1
- Unprefixed static function call in ternary operation
- Double namespacing issue when using nested namespace prefix HOT 1
- #[\ReturnTypeWillChange] becomes #[\MY_CUSTOM_PREFIX_ReturnTypeWillChange]
- Local symlinked repositories fail HOT 2
- Not prefixing all classes? HOT 3
- Incorrect binary name when installed using composer HOT 2
- Good idea to set `target_directory`to 'vendor'? HOT 1
- Feature: Change WordPress translation domain HOT 1
- Still works? HOT 3
- Add warning about using composer packages installed with symlink HOT 3
- Issue bundling AWS S3 package HOT 3
- Troubles Namespacing WPGraphQL HOT 5
- `exclude_from_copy` does not apply to `files` autoloaders
- delete_vendor_packages deletes needed composer files HOT 2
- Troubles namespacing nesbot/carbon HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from strauss.