I run php bin/magento setup:upgrade command in magento2.4.6.
But I got error like this.
Ced\PwaNotifications\Ui\Component\Listing\Massaction\Templates.php
<?php
namespace Ced\PwaNotifications\Ui\Component\Listing\MassAction;
use Magento\Framework\UrlInterface;
use Zend\Stdlib\JsonSerializable;
use \Ced\PwaNotifications\Model\ResourceModel\Template\CollectionFactory;
/**
- Class Options
/
class Templates implements JsonSerializable
{
/*
* @var array
*/
protected $options;
/**
* @var CollectionFactory
*/
protected $collectionFactory;
/**
* Additional options params
*
* @var array
*/
protected $data;
/**
* @var UrlInterface
*/
protected $urlBuilder;
/**
* Base URL for subactions
*
* @var string
*/
protected $urlPath;
/**
* Param name for subactions
*
* @var string
*/
protected $paramName;
/**
* Additional params for subactions
*
* @var array
*/
protected $additionalData = [];
/**
* Constructor
*
* @param CollectionFactory $collectionFactory
* @param UrlInterface $urlBuilder
* @param array $data
*/
public function __construct(
CollectionFactory $collectionFactory,
UrlInterface $urlBuilder,
array $data = []
) {
$this->collectionFactory = $collectionFactory;
$this->data = $data;
$this->urlBuilder = $urlBuilder;
}
/**
* Get action options
*
* @return array
*/
public function jsonSerialize():mixed
{
$i = 0;
if ($this->options === null) {
// get the massaction data from the database table
$templateCollection = $this->collectionFactory->create();
if (!count($templateCollection)) {
return $this->options;
}
//make a array of massaction
foreach ($templateCollection as $key => $value) {
$options[$i]['value'] = $value->getId();
$options[$i]['label'] = $value->getTitle();
$i++;
}
$this->prepareData();
foreach ($options as $optionCode) {
$this->options[$optionCode['value']] = [
'type' => $optionCode['value'],
'label' => $optionCode['label'],
];
if ($this->urlPath && $this->paramName) {
$this->options[$optionCode['value']]['url'] = $this->urlBuilder->getUrl(
$this->urlPath,
[$this->paramName => $optionCode['value']]
);
}
$this->options[$optionCode['value']] = array_merge_recursive(
$this->options[$optionCode['value']],
$this->additionalData
);
}
// return the massaction data
$this->options = array_values($this->options);
}
return $this->options;
}
/**
* Prepare addition data for subactions
*
* @return void
*/
protected function prepareData()
{
foreach ($this->data as $key => $value) {
switch ($key) {
case 'urlPath':
$this->urlPath = $value;
break;
case 'paramName':
$this->paramName = $value;
break;
default:
$this->additionalData[$key] = $value;
break;
}
}
}
}

app/code, follow these steps to upgrade that module to the latest version: 1. Download the latest version of the module from the module provider website. 2. Remove all files and directories in theCed_PwaNotificationsmodule located at app/code/Ced/PwaNotifications. 3. Extract the latest version of the module to theCed_PwaNotificationsmodule located at app/code/Ced/PwaNotifications. 4. Run the upgrade command and recompile code (and redeploy static content if you are not in the Developer mode). You're done! – Tu Van Aug 30 '23 at 04:15