2017 © Pedro Peláez
 

silverstripe-module silverstripe-ideannotator

Generate PHP DocBlock annotations for DataObject and DataExtension databasefields and relation methods

image

axyr/silverstripe-ideannotator

Generate PHP DocBlock annotations for DataObject and DataExtension databasefields and relation methods

  • Monday, May 22, 2017
  • by axyr
  • Repository
  • 5 Watchers
  • 32 Stars
  • 13,582 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 11 Forks
  • 11 Open issues
  • 21 Versions
  • 4 % Grown

The README.md

silverstripe-ideannotator

Scrutinizer Travis codecov Packagist Packagist Packagist Pre Release, (*1)

This module generates @property, @method and @mixin tags for DataObjects, PageControllers and (Data)Extensions, so ide's like PHPStorm recognize the database and relations that are set in the $db, $has_one, $has_many and $many_many arrays., (*2)

The docblocks can be generated/updated with each dev/build and with a DataObjectAnnotatorTask per module or classname., (*3)

Requirements

SilverStripe Framework and possible custom code., (*4)

By default, mysite and app are enabled "modules"., (*5)

Version ^2:

SilverStripe 3.x framework, (*6)

Version ^3:

SilverStripe 4.x+, (*7)

Installation

{
  "require-dev": {
    "silverleague/ideannotator": "3.x-dev"
  }
}

Please note, this example omitted any possible modules you require yourself!, (*8)

Example result

<?php

/**
 * Class NewsItem
 *
 * @property string $Title
 * @property int $Sort
 * @property int $Version
 * @property int $AuthorID
 * @method \SilverStripe\Security\Member Author()
 * @method \SilverStripe\ORM\DataList|Category[] Categories()
 * @method \SilverStripe\ORM\ManyManyList|Tag[] Tags()
 * @mixin Versioned
 */
class NewsItem extends \SilverStripe\ORM\DataObject
{
    private static $db = array(
        'Title' => 'Varchar(255)',
        'Sort'  => 'Int'
    );

    private static $has_one = array(
        'Author' => Member::class
    );

    private static $has_many = array(
        'Categories' => Category::class
    );

    private static $many_many = array(
        'Tags' => Tag::class
    );
}

Further information

For installation, see installation, (*9)

For the Code of Conduct, see CodeOfConduct, (*10)

For contributing, see Contributing, (*11)

For further documentation information, see the docs, (*12)

A word of caution

This module changes the content of your files and currently there is no backup functionality. PHPStorm has a Local history for files and of course you have your code version controlled... I tried to add complete UnitTests, but I can't garantuee every situation is covered., (*13)

Windows users should be aware that the PHP Docs are generated with PSR in mind and use \n for line endings rather than Window's \r\n, some editors may have a hard time with these line endings., (*14)

This module should never be installed on a production environment., (*15)

The Versions

22/05 2017

3.x-dev

3.9999999.9999999.9999999-dev

Generate PHP DocBlock annotations for DataObject and DataExtension databasefields and relation methods

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Martijn van Nieuwenhoven

orm database docblock annotations silverstripe ide

15/05 2017

dev-master

9999999-dev

Generate PHP DocBlock annotations for DataObject and DataExtension database fields and relation methods

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Martijn van Nieuwenhoven

orm database docblock annotations silverstripe ide

29/04 2017

3.0-alpha1

3.0.0.0-alpha1

Generate PHP DocBlock annotations for DataObject and DataExtension databasefields and relation methods

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Martijn van Nieuwenhoven

orm database docblock annotations silverstripe ide

16/02 2017

dev-Zauberfisch-patch-2

dev-Zauberfisch-patch-2

Generate PHP DocBlock annotations for DataObject and DataExtension databasefields and relation methods

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Martijn van Nieuwenhoven

orm database docblock annotations silverstripe ide

13/07 2016

2.0.7

2.0.7.0

Generate PHP DocBlock annotations for DataObject and DataExtension databasefields and relation methods

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Martijn van Nieuwenhoven

orm database docblock annotations silverstripe ide

13/07 2016

dev-Zauberfisch-patch-1

dev-Zauberfisch-patch-1

Generate PHP DocBlock annotations for DataObject and DataExtension databasefields and relation methods

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Martijn van Nieuwenhoven

orm database docblock annotations silverstripe ide

02/06 2016

dev-develop

dev-develop

Generate PHP DocBlock annotations for DataObject and DataExtension databasefields and relation methods

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Martijn van Nieuwenhoven

orm database docblock annotations silverstripe ide

13/05 2016

dev-ss-4

dev-ss-4

Generate PHP DocBlock annotations for DataObject and DataExtension databasefields and relation methods

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Martijn van Nieuwenhoven

orm database docblock annotations silverstripe ide

12/05 2016

2.0.6

2.0.6.0

Generate PHP DocBlock annotations for DataObject and DataExtension databasefields and relation methods

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Martijn van Nieuwenhoven

orm database docblock annotations silverstripe ide

03/05 2016

2.0.5

2.0.5.0

Generate PHP DocBlock annotations for DataObject and DataExtension databasefields and relation methods

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Martijn van Nieuwenhoven

orm database docblock annotations silverstripe ide

29/04 2016

2.0.4

2.0.4.0

Generate PHP DocBlock annotations for DataObject and DataExtension databasefields and relation methods

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Martijn van Nieuwenhoven

orm database docblock annotations silverstripe ide

21/04 2016

2.0.3

2.0.3.0

Generate PHP DocBlock annotations for DataObject and DataExtension databasefields and relation methods

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Martijn van Nieuwenhoven

orm database docblock annotations silverstripe ide

19/04 2016

2.0.2

2.0.2.0

Generate PHP DocBlock annotations for DataObject and DataExtension databasefields and relation methods

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Martijn van Nieuwenhoven

orm database docblock annotations silverstripe ide

17/04 2016

2.0.1

2.0.1.0

Generate PHP DocBlock annotations for DataObject and DataExtension databasefields and relation methods

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Martijn van Nieuwenhoven

orm database docblock annotations silverstripe ide

14/04 2016

2.0.0

2.0.0.0

Generate PHP DocBlock annotations for DataObject and DataExtension databasefields and relation methods

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Martijn van Nieuwenhoven

orm database docblock annotations silverstripe ide

04/04 2016

1.0.4

1.0.4.0

Generate PHP DocBlock annotations for DataObject and DataExtension databasefields and relation methods

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Martijn van Nieuwenhoven

orm database docblock annotations silverstripe ide

03/04 2016

1.0.3

1.0.3.0

Generate PHP DocBlock annotations for DataObject and DataExtension databasefields and relation methods

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Martijn van Nieuwenhoven

orm database docblock annotations silverstripe ide

30/03 2016

1.0.2

1.0.2.0

Generate PHP DocBlock annotations for DataObject and DataExtension databasefields and relation methods

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Martijn van Nieuwenhoven

orm database docblock annotations silverstripe ide

28/03 2016

1.0

1.0.0.0

Generate PHP DocBlock annotations for DataObject and DataExtension databasefields and relation methods

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Martijn van Nieuwenhoven

orm database docblock annotations silverstripe ide

28/03 2016

1.0.1

1.0.1.0

Generate PHP DocBlock annotations for DataObject and DataExtension databasefields and relation methods

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Martijn van Nieuwenhoven

orm database docblock annotations silverstripe ide

25/10 2015

0.8

0.8.0.0

Generate PHP DocBlock annotations for DataObject and DataExtension databasefields and relation methods

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Martijn van Nieuwenhoven

orm database docblock annotations silverstripe ide