^ TypeError {#125 #message: "Local\ComponentSystem\Components\ProductCard\Data\ProductCardRaw::defaultSKU(): Return value must be of type ?array, false returned" #code: 0 #file: "/var/www/html/lib/Local/ComponentSystem/Components/ProductCard/Data/ProductCardRaw.php" #line: 156 trace: { /var/www/html/lib/Local/ComponentSystem/Components/ProductCard/Data/ProductCardRaw.php:156 { Local\ComponentSystem\Components\ProductCard\Data\ProductCardRaw->defaultSKU(): ?array … › ]); › }); › } } /var/www/html/lib/Local/ComponentSystem/Components/ProductCard/Data/ProductCardRaw.php:176 { Local\ComponentSystem\Components\ProductCard\Data\ProductCardRaw->{closure:Local\ComponentSystem\Components\ProductCard\Data\ProductCardRaw::skuFields():176} … › return $this->getStored(__METHOD__, › fn() => $this->defaultSKU() ? DataFactory::getInstance()->make(SKUFields::class, › $this->defaultSKU()) : null); } /var/www/html/lib/Local/ComponentSystem/Traits/InstanceStorage.php:16 { Local\ComponentSystem\Components\ProductCard\Data\ProductCardRaw->getStored(string $key, $default = null) … › if (is_callable($default)) { › $val = $default(); › $this->store($key, $val); } /var/www/html/lib/Local/ComponentSystem/Components/ProductCard/Data/ProductCardRaw.php:175 { Local\ComponentSystem\Components\ProductCard\Data\ProductCardRaw->skuFields(): SKUFields … › { › return $this->getStored(__METHOD__, › fn() => $this->defaultSKU() ? DataFactory::getInstance()->make(SKUFields::class, arguments: { $key: "Local\ComponentSystem\Components\ProductCard\Data\ProductCardRaw::skuFields" $default: Closure() {#126 …} } } /var/www/html/lib/Local/ComponentSystem/Components/ProductCard/Data/ProductCardRaw.php:182 { Local\ComponentSystem\Components\ProductCard\Data\ProductCardRaw->productId() … › { › return $this->coalesce('id', $this->skuFields()); › } } /var/www/html/lib/Local/ComponentSystem/Components/ProductCard/Templates/Detail/template.php:16 { include … › <div class="ProductCard__Detail__container" x-data="{ › pid: <?= $data->productId() ?>, › is_fav: <?= $data->isFavorite() ? 'true' : 'false' ?>, } /var/www/html/lib/Local/ComponentSystem/Core/ComponentRenderer.php:108 { Local\ComponentSystem\Core\ComponentRenderer::{closure:Local\ComponentSystem\Core\ComponentRenderer::renderTemplate():105} … › ob_start(); › include $__file; › return ob_get_clean(); arguments: { "/var/www/html/lib/Local/ComponentSystem/Components/ProductCard/Templates/Detail/template.php" } } /var/www/html/lib/Local/ComponentSystem/Core/ComponentRenderer.php:110 { Local\ComponentSystem\Core\ComponentRenderer->renderTemplate(string $componentName, string $templateName, array $vars): string … › return ob_get_clean(); › })($templateFile, $vars); › } arguments: { "/var/www/html/lib/Local/ComponentSystem/Core/../Components/ProductCard/Templates/Detail/template.php" array:3 [ …3] } } /var/www/html/lib/Local/ComponentSystem/Core/ComponentRenderer.php:69 { Local\ComponentSystem\Core\ComponentRenderer->render(string $componentClass, ?DataInterface $args = null, ?string $template = null): string … › // --- Рендерим шаблон --- › $html = $this->renderTemplate( › componentName: $meta->name, arguments: { $componentName: "ProductCard" $templateName: "Detail" $vars: array:3 [ …3] } } /var/www/html/lib/Local/ComponentSystem/Core/BaseComponent.php:85 { Local\ComponentSystem\Core\BaseComponent::render(?DataInterface $args = null, $template = null): string … › { › return ComponentRenderer::getInstance()->render(static::class, $args, $template); › } arguments: { $componentClass: "Local\ComponentSystem\Components\ProductCard\ProductCard" $args: Local\ComponentSystem\Components\ProductCard\Data\ProductCardRaw {#133 …} $template: "Detail" } } /var/www/html/templates/default/controllers/shop/item_view.tpl.php:141 { include … › <div class="container"> › <?= ProductCard::render(ProductCardRaw::make($item), 'Detail') ?> › </div> arguments: { $args: Local\ComponentSystem\Components\ProductCard\Data\ProductCardRaw {#133 …} $template: "Detail" } } /var/www/html/system/core/template.php:1498 { cmsTemplate->processRender($tpl_file, $data = [], $request = false) … › › extract($data); include($tpl_file); › arguments: { "/var/www/html/templates/default/controllers/shop/item_view.tpl.php" } } /var/www/html/system/core/template.php:1466 { cmsTemplate->render($tpl_file, $data = [], $request = false) … › // dump($data); › return $this->processRender($tpl_file, $data, $request); › arguments: { $tpl_file: "/var/www/html/templates/default/controllers/shop/item_view.tpl.php" $data: array:8 [ …8] $request: cmsRequest {#8 …} } } /var/www/html/system/controllers/shop/actions/item_view.php:304 { actionShopItemView->run() … › › return $this->cms_template->render('item_view', $return); › } arguments: { $tpl_file: "/var/www/html/templates/default/controllers/shop/item_view.tpl.php" $data: array:8 [ …8] } } /var/www/html/system/core/controller.php:549 { cmsController->runExternalAction($action_name, $params = []) … › Tracing::startSpan("running {$class_name_ex} action", ['params'=>$params]); › $r = call_user_func_array(array($action_object, 'run'), $params); › Tracing::endSpan(); arguments: { "catalog" "metallicheskaja-dver-titan-metall-metall-2050-960" } } /var/www/html/system/core/controller.php:435 { cmsController->runAction($action_name, $params = []) … › Tracing::startSpan("runExternalAction", ['action_name'=>$action_name, 'action_params'=>$this->current_params] ); › $result = $this->runExternalAction($action_name, $this->current_params); › Tracing::endSpan(); arguments: { $action_name: "index" $params: [] } } /var/www/html/system/core/action.php:29 { cmsAction->__call($name, $arguments) … › public function __call($name, $arguments) { › return call_user_func_array(array($this->controller, $name), $arguments); › } arguments: { $action_name: "item_view" $params: array:2 [ …2] } } /var/www/html/system/controllers/shop/actions/index.php:135 { actionShopIndex->run() … › › return $this->runAction('item_view', array( › 'catalog', arguments: { $name: "runAction" $arguments: array:2 [ …2] } } /var/www/html/system/core/controller.php:549 { cmsController->runExternalAction($action_name, $params = []) … › Tracing::startSpan("running {$class_name_ex} action", ['params'=>$params]); › $r = call_user_func_array(array($action_object, 'run'), $params); › Tracing::endSpan(); arguments: { "catalog" "metallicheskaja-dver-titan-metall-metall-2050-960" } } /var/www/html/system/core/controller.php:435 { cmsController->runAction($action_name, $params = []) … › Tracing::startSpan("runExternalAction", ['action_name'=>$action_name, 'action_params'=>$this->current_params] ); › $result = $this->runExternalAction($action_name, $this->current_params); › Tracing::endSpan(); arguments: { $action_name: "index" $params: [] } } /var/www/html/system/controllers/shop/frontend.php:136 { shop->route($uri) … › if (!$action_name) { cmsCore::error404(); } › $this->runAction($action_name); › } arguments: { $action_name: "index" } } /var/www/html/system/core/controller.php:465 { cmsController->runAction($action_name, $params = []) … › if ($this->current_params) { $route_uri .= '/' . implode('/', $this->current_params); } › $result = call_user_func(array($this, 'route'), $route_uri); › arguments: { $uri: "products/zheleznaya-mebel/metallicheskaja-dver-titan-metall-metall-2050-960" } } /var/www/html/system/core/core.php:815 { cmsCore->runController() … › // запускаем действие › $controller->runAction($this->uri_action, $this->uri_params); › return true; arguments: { $action_name: "products" $params: array:2 [ …2] } } /var/www/html/index.php:136 { › Tracing::startSpan('run controller');\r › $core->runController();\r › Tracing::endSpan();\r } } }
]);
});
}
return $this->getStored(__METHOD__,
fn() => $this->defaultSKU() ? DataFactory::getInstance()->make(SKUFields::class,
$this->defaultSKU()) : null);
if (is_callable($default)) {
$val = $default();
$this->store($key, $val);
{
return $this->coalesce('id', $this->skuFields());
<div class="ProductCard__Detail__container" x-data="{
pid: <?= $data->productId() ?>,
is_fav: <?= $data->isFavorite() ? 'true' : 'false' ?>,
ob_start();
include $__file;
return ob_get_clean();
})($templateFile, $vars);
// --- Рендерим шаблон ---
$html = $this->renderTemplate(
componentName: $meta->name,
return ComponentRenderer::getInstance()->render(static::class, $args, $template);
<div class="container">
<?= ProductCard::render(ProductCardRaw::make($item), 'Detail') ?>
</div>
extract($data); include($tpl_file);
// dump($data);
return $this->processRender($tpl_file, $data, $request);
return $this->cms_template->render('item_view', $return);
Tracing::startSpan("running {$class_name_ex} action", ['params'=>$params]);
$r = call_user_func_array(array($action_object, 'run'), $params);
Tracing::endSpan();
Tracing::startSpan("runExternalAction", ['action_name'=>$action_name, 'action_params'=>$this->current_params] );
$result = $this->runExternalAction($action_name, $this->current_params);
public function __call($name, $arguments) {
return call_user_func_array(array($this->controller, $name), $arguments);
return $this->runAction('item_view', array(
'catalog',
if (!$action_name) { cmsCore::error404(); }
$this->runAction($action_name);
if ($this->current_params) { $route_uri .= '/' . implode('/', $this->current_params); }
$result = call_user_func(array($this, 'route'), $route_uri);
// запускаем действие
$controller->runAction($this->uri_action, $this->uri_params);
return true;
Tracing::startSpan('run controller');\r
$core->runController();\r
Tracing::endSpan();\r