What are the Slack Archives?
Itβs a history of our time together in the Slack Community! Thereβs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonβt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hi , is there any reasons why "UtilTextService" instantiates directly in "PropelSchemaMerg
Comments
-
Because it works , I guess
0 -
IMO - If it works, it's OK. You won't blame people for taking another road to the store, just because you like another road more. Let programmers do it the way it works for them the best. π
0 -
I don't want to blame someone else.
0 -
hi
0 -
can you point me to some code?
0 -
and i absolutely disagree with @UK5DS29L2 π
0 -
of course there can always be a shortcut, but it should be a reflected decision. These things can make the life of people further down the road harder than necessary
0 -
-
private function getElementName(SimpleXMLElement $fromXmlChildElement, $tagName) { $elementName = (array)$fromXmlChildElement->attributes(); $elementName = current($elementName); if (is_array($elementName) && isset($elementName['name'])) { $elementName = $tagName . '|' . $elementName['name']; } if (empty($elementName) || is_array($elementName)) { $utilTextService = new UtilTextService(); $elementName = 'anonymous_' . $utilTextService->generateRandomString(32); } return $elementName; }
0 -
change was introduced in https://github.com/spryker/propel/commit/11b7a10f26896b1dd8430c09f9a0842c4387a6ec
stereomon committed on Dec 5, 2016
0 -
looks like that particular commit was about replacing the library with a service, and not βinjecting it properlyβ. I think question from @UKBF1R1S5 is not to finger-point, but rather to understand something that doesnβt fit to the general picture. And I donβt see a good reason why not injecting it properly..
0 -
i agree, this was probably a semi-automatic refactoring
0 -
it is still unclean from Spryker side, should not look like that
0 -
sure, the line was touched (for service replacement) ~3Β½ years ago and nobody was taking any further care to check for
new FooService()
usages in business models..As an answer to original question: "legacy code" could be the only reasonable explanation why proper injection was not used
0 -
i agree, unfortunately
0 -
FYI. I created a pull request by spryker.
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 930 Developer Corner
- 788 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random