Skip to content

Instantly share code, notes, and snippets.

@harikt
Last active January 2, 2016 03:50
Show Gist options
  • Save harikt/7d9aadc9ed769acd1d67 to your computer and use it in GitHub Desktop.
Save harikt/7d9aadc9ed769acd1d67 to your computer and use it in GitHub Desktop.
When there is no double star `/**` it is no more a doc comment, but comment only.
<?php
/**
* @Entity @Table(name="products")
*/
class Product
{
/**
* @Id @Column(type="integer")
* @GeneratedValue
* @var int
*/
protected $id;
/*
* @Column(type="string")
* @var string
*/
protected $name;
public function getId()
{
return $this->id;
}
public function getName()
{
return $this->name;
}
public function setName($name)
{
$this->name = $name;
}
}
@harikt
Copy link
Author

harikt commented Jan 2, 2016

I did asked the question on twitter : https://twitter.com/harikt/status/682972117785169924

Thank you Jonathan H. Wage and Damon Jones

The answer is : Without the double asterisk, it’s just a block comment. Annotations are parsed from docblocks only.

http://php.net/manual/en/reflectionclass.getdoccomment.php#99938

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment