When I try to use my own copyright I get this warning when running phpcs:
"0: line: 3, col: 1, Copyright is missing or has wrong format"
But if I use Magento copyright, I get no warning.
No Warning:
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
Warning:
/**
* Copyright © MyCompany, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
Actual Code
<?php
/**
* Copyright © MyCompany All rights reserved.
* See License for license details.
*/
namespace MyCompany\MyApp\ViewModel;
use Magento\Framework\View\Element\Block\ArgumentInterface;
use Magento\Framework\View\Element\Template;
/**
* Gets current products Categories
*/
class CalculatorLogic extends Template implements
ArgumentInterface
{
/**
* @param Registry $registry
* @param Category $categoryModel
*/
public function __construct(
\Magento\Framework\Registry $registry,
\Magento\Catalog\Model\Category $categoryModel
) {
$this->registry = $registry;
$this->categoryModel = $categoryModel;
}
/**
* Gets current products Categories
*
* @return Category[]
*/
public function getProductCatagory()
{
$product = $this->registry->registry('current_product');
$categories = $product->getCategoryIds(); /*will return category ids array*/
$arr =[];
foreach ($categories as $category) {
$cat = $this->categoryModel->load($category);
$arr[] = $cat->getName();
}
return $arr;
}
}
phpcs results
{"totals":{"errors":0,"warnings":1,"fixable":0},"files":{"\/var\/www\/html\/mage\/app\/code\/MyComany\/MyApp\/ViewModel\/CalculatorLogic.php":{"errors":0,"warnings":1,"messages":[{"message":"Copyright is missing or has wrong format","source":"Magento2.Legacy.Copyright.FoundCopyrightMissingOrWrongFormat","severity":5,"fixable":false,"type":"WARNING","line":3,"column":1}]}}}