mageprince /
magento2-FAQ
| 1 | <?php |
||||
| 2 | /** |
||||
| 3 | * MagePrince |
||||
| 4 | * |
||||
| 5 | * NOTICE OF LICENSE |
||||
| 6 | * |
||||
| 7 | * This source file is subject to the mageprince.com license that is |
||||
| 8 | * available through the world-wide-web at this URL: |
||||
| 9 | * https://mageprince.com/end-user-license-agreement |
||||
| 10 | * |
||||
| 11 | * DISCLAIMER |
||||
| 12 | * |
||||
| 13 | * Do not edit or add to this file if you wish to upgrade this extension to newer |
||||
| 14 | * version in the future. |
||||
| 15 | * |
||||
| 16 | * @category MagePrince |
||||
| 17 | * @package Mageprince_Faq |
||||
| 18 | * @copyright Copyright (c) MagePrince (https://mageprince.com/) |
||||
| 19 | * @license https://mageprince.com/end-user-license-agreement |
||||
| 20 | */ |
||||
| 21 | |||||
| 22 | namespace Mageprince\Faq\Block\Adminhtml\FaqGroup\Edit; |
||||
| 23 | |||||
| 24 | use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface; |
||||
|
0 ignored issues
–
show
|
|||||
| 25 | |||||
| 26 | class DeleteButton extends GenericButton implements ButtonProviderInterface |
||||
| 27 | { |
||||
| 28 | /** |
||||
| 29 | * Delete button |
||||
| 30 | * |
||||
| 31 | * @return array |
||||
| 32 | */ |
||||
| 33 | public function getButtonData() |
||||
| 34 | { |
||||
| 35 | $data = []; |
||||
| 36 | if ($this->getModelId()) { |
||||
|
0 ignored issues
–
show
The expression
$this->getModelId() of type integer|null is loosely compared to true; this is ambiguous if the integer can be 0. You might want to explicitly use !== null instead.
In PHP, under loose comparison (like For 0 == false // true
0 == null // true
123 == false // false
123 == null // false
// It is often better to use strict comparison
0 === false // false
0 === null // false
Loading history...
|
|||||
| 37 | $data = [ |
||||
| 38 | 'label' => __('Delete FAQ group'), |
||||
|
0 ignored issues
–
show
The function
__ was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 39 | 'class' => 'delete', |
||||
| 40 | 'on_click' => 'deleteConfirm(\'' . __( |
||||
| 41 | 'Are you sure you want to do this?' |
||||
| 42 | ) . '\', \'' . $this->getDeleteUrl() . '\')', |
||||
| 43 | 'sort_order' => 20, |
||||
| 44 | ]; |
||||
| 45 | } |
||||
| 46 | return $data; |
||||
| 47 | } |
||||
| 48 | |||||
| 49 | /** |
||||
| 50 | * Get URL for delete button |
||||
| 51 | * |
||||
| 52 | * @return string |
||||
| 53 | */ |
||||
| 54 | public function getDeleteUrl() |
||||
| 55 | { |
||||
| 56 | return $this->getUrl('*/*/delete', ['faqgroup_id' => $this->getModelId()]); |
||||
| 57 | } |
||||
| 58 | } |
||||
| 59 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths