Примечание: доступ к stati c свойству PhpArrayAdapter :: $ valuesCache как non stati c при попытке получить коллекцию данных с помощью платформы api - PullRequest
0 голосов
/ 08 мая 2020

Я использую symfony и платформу api pplatform, и у меня проблема с получением набора данных с помощью операции GET для объекта пользователя с платформой Api.

Сначала он работал над веткой с другими операциями , после того, как я выполнил слияние с другой веткой с JWT, это не сработает, все остальные операции {PUT, DELETE и GET one user} работают нормально, но если я попытаюсь получить данные всех пользователей, используя GET / api / users показывает эту ошибку:

  Notice: Accessing static property Symfony\\Component\\Cache\\Adapter\\PhpArrayAdapter::$valuesCache as non static

Ошибка полного стека:

{
"type": "https://tools.ietf.org/html/rfc2616#section-10",
"title": "An error occurred",
"detail": "Notice: Accessing static property Symfony\\Component\\Cache\\Adapter\\PhpArrayAdapter::$valuesCache as non static",
"trace": [
    {
        "namespace": "",
        "short_class": "",
        "class": "",
        "type": "",
        "function": "",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/jms/serializer/src/Accessor/DefaultAccessorStrategy.php",
        "line": 86,
        "args": []
    },
    {
        "namespace": "Symfony\\Component\\Cache\\Adapter",
        "short_class": "PhpArrayAdapter",
        "class": "Symfony\\Component\\Cache\\Adapter\\PhpArrayAdapter",
        "type": "::",
        "function": "JMS\\Serializer\\Accessor\\{closure}",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/jms/serializer/src/Accessor/DefaultAccessorStrategy.php",
        "line": 91,
        "args": []
    },
    {
        "namespace": "JMS\\Serializer\\Accessor",
        "short_class": "DefaultAccessorStrategy",
        "class": "JMS\\Serializer\\Accessor\\DefaultAccessorStrategy",
        "type": "->",
        "function": "getValue",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/jms/serializer/src/GraphNavigator/SerializationGraphNavigator.php",
        "line": 236,
        "args": []
    },
    {
        "namespace": "JMS\\Serializer\\GraphNavigator",
        "short_class": "SerializationGraphNavigator",
        "class": "JMS\\Serializer\\GraphNavigator\\SerializationGraphNavigator",
        "type": "->",
        "function": "accept",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/jms/serializer/src/JsonSerializationVisitor.php",
        "line": 136,
        "args": []
    },
    {
        "namespace": "JMS\\Serializer",
        "short_class": "JsonSerializationVisitor",
        "class": "JMS\\Serializer\\JsonSerializationVisitor",
        "type": "->",
        "function": "visitProperty",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/jms/serializer/src/GraphNavigator/SerializationGraphNavigator.php",
        "line": 243,
        "args": []
    },
    {
        "namespace": "JMS\\Serializer\\GraphNavigator",
        "short_class": "SerializationGraphNavigator",
        "class": "JMS\\Serializer\\GraphNavigator\\SerializationGraphNavigator",
        "type": "->",
        "function": "accept",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/jms/serializer/src/JsonSerializationVisitor.php",
        "line": 136,
        "args": []
    },
    {
        "namespace": "JMS\\Serializer",
        "short_class": "JsonSerializationVisitor",
        "class": "JMS\\Serializer\\JsonSerializationVisitor",
        "type": "->",
        "function": "visitProperty",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/jms/serializer/src/GraphNavigator/SerializationGraphNavigator.php",
        "line": 243,
        "args": []
    },
    {
        "namespace": "JMS\\Serializer\\GraphNavigator",
        "short_class": "SerializationGraphNavigator",
        "class": "JMS\\Serializer\\GraphNavigator\\SerializationGraphNavigator",
        "type": "->",
        "function": "accept",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/jms/serializer/src/JsonSerializationVisitor.php",
        "line": 136,
        "args": []
    },
    {
        "namespace": "JMS\\Serializer",
        "short_class": "JsonSerializationVisitor",
        "class": "JMS\\Serializer\\JsonSerializationVisitor",
        "type": "->",
        "function": "visitProperty",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/jms/serializer/src/GraphNavigator/SerializationGraphNavigator.php",
        "line": 243,
        "args": []
    },
    {
        "namespace": "JMS\\Serializer\\GraphNavigator",
        "short_class": "SerializationGraphNavigator",
        "class": "JMS\\Serializer\\GraphNavigator\\SerializationGraphNavigator",
        "type": "->",
        "function": "accept",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/jms/serializer/src/JsonSerializationVisitor.php",
        "line": 93,
        "args": []
    },
    {
        "namespace": "JMS\\Serializer",
        "short_class": "JsonSerializationVisitor",
        "class": "JMS\\Serializer\\JsonSerializationVisitor",
        "type": "->",
        "function": "visitArray",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/jms/serializer/src/GraphNavigator/SerializationGraphNavigator.php",
        "line": 159,
        "args": []
    },
    {
        "namespace": "JMS\\Serializer\\GraphNavigator",
        "short_class": "SerializationGraphNavigator",
        "class": "JMS\\Serializer\\GraphNavigator\\SerializationGraphNavigator",
        "type": "->",
        "function": "accept",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/jms/serializer/src/JsonSerializationVisitor.php",
        "line": 136,
        "args": []
    },
    {
        "namespace": "JMS\\Serializer",
        "short_class": "JsonSerializationVisitor",
        "class": "JMS\\Serializer\\JsonSerializationVisitor",
        "type": "->",
        "function": "visitProperty",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/jms/serializer/src/GraphNavigator/SerializationGraphNavigator.php",
        "line": 243,
        "args": []
    },
    {
        "namespace": "JMS\\Serializer\\GraphNavigator",
        "short_class": "SerializationGraphNavigator",
        "class": "JMS\\Serializer\\GraphNavigator\\SerializationGraphNavigator",
        "type": "->",
        "function": "accept",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/jms/serializer/src/JsonSerializationVisitor.php",
        "line": 93,
        "args": []
    },
    {
        "namespace": "JMS\\Serializer",
        "short_class": "JsonSerializationVisitor",
        "class": "JMS\\Serializer\\JsonSerializationVisitor",
        "type": "->",
        "function": "visitArray",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/jms/serializer/src/GraphNavigator/SerializationGraphNavigator.php",
        "line": 159,
        "args": []
    },
    {
        "namespace": "JMS\\Serializer\\GraphNavigator",
        "short_class": "SerializationGraphNavigator",
        "class": "JMS\\Serializer\\GraphNavigator\\SerializationGraphNavigator",
        "type": "->",
        "function": "accept",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/jms/serializer/src/JsonSerializationVisitor.php",
        "line": 136,
        "args": []
    },
    {
        "namespace": "JMS\\Serializer",
        "short_class": "JsonSerializationVisitor",
        "class": "JMS\\Serializer\\JsonSerializationVisitor",
        "type": "->",
        "function": "visitProperty",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/jms/serializer/src/GraphNavigator/SerializationGraphNavigator.php",
        "line": 243,
        "args": []
    },
    {
        "namespace": "JMS\\Serializer\\GraphNavigator",
        "short_class": "SerializationGraphNavigator",
        "class": "JMS\\Serializer\\GraphNavigator\\SerializationGraphNavigator",
        "type": "->",
        "function": "accept",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/jms/serializer/src/JsonSerializationVisitor.php",
        "line": 136,
        "args": []
    },
    {
        "namespace": "JMS\\Serializer",
        "short_class": "JsonSerializationVisitor",
        "class": "JMS\\Serializer\\JsonSerializationVisitor",
        "type": "->",
        "function": "visitProperty",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/jms/serializer/src/GraphNavigator/SerializationGraphNavigator.php",
        "line": 243,
        "args": []
    },
    {
        "namespace": "JMS\\Serializer\\GraphNavigator",
        "short_class": "SerializationGraphNavigator",
        "class": "JMS\\Serializer\\GraphNavigator\\SerializationGraphNavigator",
        "type": "->",
        "function": "accept",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/jms/serializer/src/JsonSerializationVisitor.php",
        "line": 136,
        "args": []
    },
    {
        "namespace": "JMS\\Serializer",
        "short_class": "JsonSerializationVisitor",
        "class": "JMS\\Serializer\\JsonSerializationVisitor",
        "type": "->",
        "function": "visitProperty",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/jms/serializer/src/GraphNavigator/SerializationGraphNavigator.php",
        "line": 243,
        "args": []
    },
    {
        "namespace": "JMS\\Serializer\\GraphNavigator",
        "short_class": "SerializationGraphNavigator",
        "class": "JMS\\Serializer\\GraphNavigator\\SerializationGraphNavigator",
        "type": "->",
        "function": "accept",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/jms/serializer/src/JsonSerializationVisitor.php",
        "line": 136,
        "args": []
    },
    {
        "namespace": "JMS\\Serializer",
        "short_class": "JsonSerializationVisitor",
        "class": "JMS\\Serializer\\JsonSerializationVisitor",
        "type": "->",
        "function": "visitProperty",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/jms/serializer/src/GraphNavigator/SerializationGraphNavigator.php",
        "line": 243,
        "args": []
    },
    {
        "namespace": "JMS\\Serializer\\GraphNavigator",
        "short_class": "SerializationGraphNavigator",
        "class": "JMS\\Serializer\\GraphNavigator\\SerializationGraphNavigator",
        "type": "->",
        "function": "accept",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/jms/serializer/src/JsonSerializationVisitor.php",
        "line": 136,
        "args": []
    },
    {
        "namespace": "JMS\\Serializer",
        "short_class": "JsonSerializationVisitor",
        "class": "JMS\\Serializer\\JsonSerializationVisitor",
        "type": "->",
        "function": "visitProperty",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/jms/serializer/src/GraphNavigator/SerializationGraphNavigator.php",
        "line": 243,
        "args": []
    },
    {
        "namespace": "JMS\\Serializer\\GraphNavigator",
        "short_class": "SerializationGraphNavigator",
        "class": "JMS\\Serializer\\GraphNavigator\\SerializationGraphNavigator",
        "type": "->",
        "function": "accept",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/jms/serializer/src/Serializer.php",
        "line": 249,
        "args": []
    },
    {
        "namespace": "JMS\\Serializer",
        "short_class": "Serializer",
        "class": "JMS\\Serializer\\Serializer",
        "type": "->",
        "function": "visit",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/jms/serializer/src/Serializer.php",
        "line": 162,
        "args": []
    },
    {
        "namespace": "JMS\\Serializer",
        "short_class": "Serializer",
        "class": "JMS\\Serializer\\Serializer",
        "type": "->",
        "function": "serialize",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/friendsofsymfony/rest-bundle/Serializer/JMSSerializerAdapter.php",
        "line": 60,
        "args": []
    },
    {
        "namespace": "FOS\\RestBundle\\Serializer",
        "short_class": "JMSSerializerAdapter",
        "class": "FOS\\RestBundle\\Serializer\\JMSSerializerAdapter",
        "type": "->",
        "function": "serialize",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/friendsofsymfony/rest-bundle/View/ViewHandler.php",
        "line": 468,
        "args": []
    },
    {
        "namespace": "FOS\\RestBundle\\View",
        "short_class": "ViewHandler",
        "class": "FOS\\RestBundle\\View\\ViewHandler",
        "type": "->",
        "function": "initResponse",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/friendsofsymfony/rest-bundle/View/ViewHandler.php",
        "line": 431,
        "args": []
    },
    {
        "namespace": "FOS\\RestBundle\\View",
        "short_class": "ViewHandler",
        "class": "FOS\\RestBundle\\View\\ViewHandler",
        "type": "->",
        "function": "createResponse",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/friendsofsymfony/rest-bundle/View/ViewHandler.php",
        "line": 315,
        "args": []
    },
    {
        "namespace": "FOS\\RestBundle\\View",
        "short_class": "ViewHandler",
        "class": "FOS\\RestBundle\\View\\ViewHandler",
        "type": "->",
        "function": "handle",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/friendsofsymfony/rest-bundle/EventListener/ViewResponseListener.php",
        "line": 139,
        "args": []
    },
    {
        "namespace": "FOS\\RestBundle\\EventListener",
        "short_class": "ViewResponseListener",
        "class": "FOS\\RestBundle\\EventListener\\ViewResponseListener",
        "type": "->",
        "function": "onKernelView",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/symfony/event-dispatcher/Debug/WrappedListener.php",
        "line": 126,
        "args": []
    },
    {
        "namespace": "Symfony\\Component\\EventDispatcher\\Debug",
        "short_class": "WrappedListener",
        "class": "Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener",
        "type": "->",
        "function": "__invoke",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/symfony/event-dispatcher/EventDispatcher.php",
        "line": 264,
        "args": []
    },
    {
        "namespace": "Symfony\\Component\\EventDispatcher",
        "short_class": "EventDispatcher",
        "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
        "type": "->",
        "function": "doDispatch",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/symfony/event-dispatcher/EventDispatcher.php",
        "line": 239,
        "args": []
    },
    {
        "namespace": "Symfony\\Component\\EventDispatcher",
        "short_class": "EventDispatcher",
        "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
        "type": "->",
        "function": "callListeners",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/symfony/event-dispatcher/EventDispatcher.php",
        "line": 73,
        "args": []
    },
    {
        "namespace": "Symfony\\Component\\EventDispatcher",
        "short_class": "EventDispatcher",
        "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
        "type": "->",
        "function": "dispatch",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php",
        "line": 168,
        "args": []
    },
    {
        "namespace": "Symfony\\Component\\EventDispatcher\\Debug",
        "short_class": "TraceableEventDispatcher",
        "class": "Symfony\\Component\\EventDispatcher\\Debug\\TraceableEventDispatcher",
        "type": "->",
        "function": "dispatch",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/symfony/http-kernel/HttpKernel.php",
        "line": 163,
        "args": []
    },
    {
        "namespace": "Symfony\\Component\\HttpKernel",
        "short_class": "HttpKernel",
        "class": "Symfony\\Component\\HttpKernel\\HttpKernel",
        "type": "->",
        "function": "handleRaw",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/symfony/http-kernel/HttpKernel.php",
        "line": 80,
        "args": []
    },
    {
        "namespace": "Symfony\\Component\\HttpKernel",
        "short_class": "HttpKernel",
        "class": "Symfony\\Component\\HttpKernel\\HttpKernel",
        "type": "->",
        "function": "handle",
        "file": "/home/ahmed/Desktop/mondevisbe/vendor/symfony/http-kernel/Kernel.php",
        "line": 201,
        "args": []
    },
    {
        "namespace": "Symfony\\Component\\HttpKernel",
        "short_class": "Kernel",
        "class": "Symfony\\Component\\HttpKernel\\Kernel",
        "type": "->",
        "function": "handle",
        "file": "/home/ahmed/Desktop/mondevisbe/public/index.php",
        "line": 25,
        "args": []
    }
]}

Зная, что у меня были конфликты после слияния, и я их исправил, это что-то, что я пропустил во время этого, или некоторые недостающие библиотеки?

Заранее спасибо.

1 Ответ

0 голосов
/ 20 мая 2020

Поскольку я только что наткнулся на ту же ошибку symfony:

  1. Проверьте, работает ли старая версия без ваших модификаций / слияния.
  2. Если 1) является ДА, тогда у него есть что-то делать с вашим кодом

В моем случае у меня была сломанная часть в некоторых из моих doctrine запросов ORM, что вызвало сообщение об ошибке.

Возможно этот небольшой совет поможет вам решить вашу проблему.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...