File tree Expand file tree Collapse file tree 5 files changed +29
-4
lines changed Expand file tree Collapse file tree 5 files changed +29
-4
lines changed Original file line number Diff line number Diff line change 16
16
*/
17
17
declare (strict_types = 1 );
18
18
19
- namespace Magento2 \Sniffs \Phtml ;
19
+ namespace Magento2 \Sniffs \Templates ;
20
20
21
21
use PHP_CodeSniffer \Files \File ;
22
22
use PHP_CodeSniffer \Sniffs \Sniff ;
23
23
24
24
/**
25
- * Class PhtmlTemplateObjectManagerSniff
26
- *
27
25
* Templates must not instantiate new objects within their code.
28
26
* All objects must be passed from the Block object.
29
27
*
28
+ * @see https://developer.adobe.com/commerce/php/coding-standards/technical-guidelines/#62-presentation-layer 6.2.6
29
+ * @link https://developer.adobe.com/commerce/frontend-core/guide/layouts/xml-instructions/#obtain-arguments-examples-in-template
30
30
* @link https://developer.adobe.com/commerce/frontend-core/guide/templates/override/#getting-argument-values-from-layout
31
31
*/
32
32
class PhtmlTemplateObjectManagerSniff implements Sniff
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /************************************************************************
3
+ *
4
+ * Copyright 2024 Adobe
5
+ * All Rights Reserved.
6
+ *
7
+ * NOTICE: All information contained herein is, and remains
8
+ * the property of Adobe and its suppliers, if any. The intellectual
9
+ * and technical concepts contained herein are proprietary to Adobe
10
+ * and its suppliers and are protected by all applicable intellectual
11
+ * property laws, including trade secret and copyright laws.
12
+ * Dissemination of this information or reproduction of this material
13
+ * is strictly forbidden unless prior written permission is obtained
14
+ * from Adobe.
15
+ * **********************************************************************
16
+ */
17
+
18
+ $ objectManager = \Magento \Framework \App \ObjectManager::getInstance ();
19
+ ?>
20
+
21
+ <div class="block test">
22
+ </div>
23
+ <script type="jquery/ui">
24
+ </script>
25
+
File renamed without changes.
Original file line number Diff line number Diff line change 350
350
<severity >8</severity >
351
351
<type >warning</type >
352
352
</rule >
353
- <rule ref =" Magento2.Phtml.PhtmlTemplateObjectManager " >
353
+ <rule ref =" Magento2.Templates.ObjectManager " >
354
354
<include-pattern >*\.phtml$</include-pattern >
355
355
<severity >8</severity >
356
356
<type >warning</type >
You can’t perform that action at this time.
0 commit comments