File tree Expand file tree Collapse file tree 2 files changed +3
-32
lines changed
dev/tests/static/testsuite/Magento/Test/Integrity/Library
lib/internal/Magento/Framework/View/Element/Html/Link Expand file tree Collapse file tree 2 files changed +3
-32
lines changed Original file line number Diff line number Diff line change @@ -96,35 +96,6 @@ function ($file) {
9696 );
9797 }
9898
99- public function testAppCodeUsage ()
100- {
101- $ files = Files::init ();
102- $ componentRegistrar = new ComponentRegistrar ();
103- $ libPaths = $ componentRegistrar ->getPaths (ComponentRegistrar::LIBRARY );
104- $ invoker = new AggregateInvoker ($ this );
105- $ invoker (
106- function ($ file ) use ($ libPaths ) {
107- $ content = file_get_contents ($ file );
108- foreach ($ libPaths as $ libPath ) {
109- if (strpos ($ file , $ libPath ) === 0 ) {
110- $ this ->assertSame (
111- 0 ,
112- preg_match ('~(?<![a-z \\d_:]|->|function \\s)__ \\s* \\(~iS ' , $ content ),
113- 'Function __() is defined outside of the library and must not be used there. ' .
114- 'Replacement suggestion: new \\Magento \\Framework \\Phrase() '
115- );
116- }
117- }
118- },
119- $ files ->getPhpFiles (
120- Files::INCLUDE_PUB_CODE |
121- Files::INCLUDE_LIBS |
122- Files::AS_DATA_SET |
123- Files::INCLUDE_NON_CLASSES
124- )
125- );
126- }
127-
12899 /**
129100 * @inheritdoc
130101 */
Original file line number Diff line number Diff line change @@ -104,21 +104,21 @@ protected function _toHtml()
104104 if ($ this ->isCurrent ()) {
105105 $ html = '<li class="nav item current"> ' ;
106106 $ html .= '<strong> '
107- . $ this ->escapeHtml (( string ) new \ Magento \ Framework \ Phrase ($ this ->getLabel ()))
107+ . $ this ->escapeHtml (__ ($ this ->getLabel ()))
108108 . '</strong> ' ;
109109 $ html .= '</li> ' ;
110110 } else {
111111 $ html = '<li class="nav item ' . $ highlight . '"><a href=" ' . $ this ->escapeHtml ($ this ->getHref ()) . '" ' ;
112112 $ html .= $ this ->getTitle ()
113- ? ' title=" ' . $ this ->escapeHtml (( string ) new \ Magento \ Framework \ Phrase ($ this ->getTitle ())) . '" '
113+ ? ' title=" ' . $ this ->escapeHtml (__ ($ this ->getTitle ())) . '" '
114114 : '' ;
115115 $ html .= $ this ->getAttributesHtml () . '> ' ;
116116
117117 if ($ this ->getIsHighlighted ()) {
118118 $ html .= '<strong> ' ;
119119 }
120120
121- $ html .= $ this ->escapeHtml (( string ) new \ Magento \ Framework \ Phrase ($ this ->getLabel ()));
121+ $ html .= $ this ->escapeHtml (__ ($ this ->getLabel ()));
122122
123123 if ($ this ->getIsHighlighted ()) {
124124 $ html .= '</strong> ' ;
You can’t perform that action at this time.
0 commit comments