Skip to content

Instantly share code, notes, and snippets.

@adrienbrault
Forked from jonathaningram/docblocks.php
Created August 17, 2012 06:06
Show Gist options
  • Save adrienbrault/3376336 to your computer and use it in GitHub Desktop.
Save adrienbrault/3376336 to your computer and use it in GitHub Desktop.
<?php
class OptionA
{
/**
* @var \DateTime $date
*/
private $date;
// the $date in the docblock seems redundant?
}
class OptionB
{
/**
* @var \DateTime
*/
private $date;
//
}
class OptionC
{
/**
* @var \DateTime The date of creation
*/
private $date;
//
}
@jonathaningram
Copy link

@adrienbrault cheers. That probably works for properties that can be described briefly. What if you need to describe a property with more than one sentence? E.g.

<?php

class OptionD
{
    /**
     * The date of creation.
     * 
     * This will never be a date less than 1970.
     *
     * @var \DateTime 
     */
    private $date;
}

class OptionE
{
    /**
     * This will never be a date less than 1970.
     *
     * @var \DateTime The date of creation
     */
    private $date;
}

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