Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing static property as non static #960

Closed
porozhnyy opened this issue Jun 1, 2018 · 9 comments
Closed

Accessing static property as non static #960

porozhnyy opened this issue Jun 1, 2018 · 9 comments
Labels
Milestone

Comments

@porozhnyy
Copy link

Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no

Hi! After update to 1.12.0 I started to get an error Accessing static property Ramsey\Uuid\Uuid::$factory as non static.

An error occurs when trying to get a static method https://github.com/ramsey/uuid/blob/master/src/Uuid.php#L127 on a line https://github.com/schmittjoh/serializer/blob/1.12.0/src/JMS/Serializer/Metadata/PropertyMetadata.php#L187
in version 1.11.0 of this code was not

@porozhnyy
Copy link
Author

@goetas this is your commit. Can you tell me how you can solve the problem?

@goetas goetas added this to the v1.x milestone Jun 1, 2018
@goetas goetas added the bug label Jun 1, 2018
@goetas goetas closed this as completed in a87e92e Jun 1, 2018
@porozhnyy
Copy link
Author

@goetas Can we wait for the new version?

@goetas
Copy link
Collaborator

goetas commented Jun 1, 2018

@porozhnyy
Copy link
Author

@goetas Many thanks for such a quick fix! You're cool!

@goetas
Copy link
Collaborator

goetas commented Jun 1, 2018

ttr

time to resolution 40 min 😃 !

@porozhnyy
Copy link
Author

This is the fastest fix in my memory! ))))

@goetas
Copy link
Collaborator

goetas commented Sep 13, 2019

I could not find that property in https://github.com/egulias/EmailValidator/blob/92dd169c32f6f55ba570c309d83f5209cefb5e23/EmailValidator/EmailLexer.php ... can you share more details about it?

@danielchodusov
Copy link

danielchodusov commented Sep 13, 2019

Hi @goetas sorry I messed an issue a little bid (created a new issue 1122 meanwhile), so I closed it there.

The original issue I wrote here:

In DefaultAccessorStrategy.php line 86:

  [ErrorException]
  Notice: Accessing static property Egulias\EmailValidator\EmailLexer::$nullToken as non static

When I dump in vendor/jms/serializer/src/Accessor/DefaultAccessorStrategy.php:

dump($metadata->name); --> "nullToken"
dump($object);

Egulias\EmailValidator\EmailLexer^ {#1914
  #charValue: array:26 [
    "(" => 49
    ")" => 261
    "<" => 272
    ">" => 273
    "[" => 262
    "]" => 263
    ":" => 265
    ";" => 275
    "@" => 64
    "\" => 92
    "/" => 278
    "," => 274
    "." => 46
    """ => 34
    "-" => 264
    "::" => 266
    " " => 267
    "\t" => 268
    "\r" => 269
    "\n" => 270
    "\r\n" => 301
    "IPv6" => 271
    "{" => 276
    "}" => 277
    "" => null
    "\0" => 0
  ]
  #hasInvalidTokens: false
  #previous: array:3 [
    "value" => "com"
    "type" => 300
    "position" => 25
  ]
  -input: "[email protected]"
  -tokens: array:9 [
    0 => array:3 [
      "value" => "legal"
      "type" => 300
      "position" => 0
    ]
    1 => array:3 [
      "value" => "-"
      "type" => 264
      "position" => 5
    ]
    2 => array:3 [
      "value" => "entity"
      "type" => 300
      "position" => 6
    ]
    3 => array:3 [
      "value" => "@"
      "type" => 64
      "position" => 12
    ]
    4 => array:3 [
      "value" => "test"
      "type" => 300
      "position" => 13
    ]
    5 => array:3 [
      "value" => "."
      "type" => 46
      "position" => 17
    ]
    6 => array:3 [
      "value" => "arodax"
      "type" => 300
      "position" => 18
    ]
    7 => array:3 [
      "value" => "."
      "type" => 46
      "position" => 24
    ]
    8 => array:3 [
      "value" => "com"
      "type" => 300
      "position" => 25
    ]
  ]
  -position: 9
  -peek: 0
  +lookahead: null
  +token: array:3 [
    "value" => ""
    "type" => null
    "position" => 0
  ]
  -regex: "/([a-zA-Z_]+[46]?)|([^\x00-\x7F])|([0-9]+)|(\r\n)|(::)|(\s+?)|(.)|[\xA0-\xff]+/iu"
}

Did it help?

edit: the null token is here https://github.com/egulias/EmailValidator/blob/92dd169c32f6f55ba570c309d83f5209cefb5e23/EmailValidator/EmailLexer.php#L80

@goetas
Copy link
Collaborator

goetas commented Sep 13, 2019

Hmm... this (

$this->forceReflectionAccess = $class->isInternal() || $class->getProperty($name)->isStatic();
) check should have detected it... can you check if this line is ever executed for the Egulias\EmailValidator\EmailLexer class ? (clear the cache first...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants