PHPackages                             arielenter/laravel-phpdoc-management - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. arielenter/laravel-phpdoc-management

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

arielenter/laravel-phpdoc-management
====================================

Manages the phpdoc comments of a given file.

1.0.1(5mo ago)031GPL-3.0PHP

Since Nov 26Pushed 5mo agoCompare

[ Source](https://github.com/arielenter/laravel-phpdoc-management)[ Packagist](https://packagist.org/packages/arielenter/laravel-phpdoc-management)[ RSS](/packages/arielenter-laravel-phpdoc-management/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (3)Used By (1)

[Español](README.es.md)

class FilePhpdocManager
-----------------------

[](#class-filephpdocmanager)

Manages the phpdoc comments of a given file.

### method \_\_construct

[](#method-__construct)

```
/** @param string $file Route of the file whose phpdoc wants to be manage. */
```

### method update

[](#method-update)

```
/**
 * Inserts or replaces the phpdoc of the file.
 *
 * @param array $phpdoc Doc blocks that will be inserted or replaced. Keys
 *                      ‘methods’, ‘properties’ and ‘constants’
 *                      should hold the doc blocks for every corresponding
 *                      element. For instance, if methods ‘update’ and
 *                      ‘delete’ exist, the value of the ‘methods’ key
 *                      would be an array containing keys ‘update’ and
 *                      ‘delete’, while their values should be their
 *                      corresponding doc blocks. Key ‘file’ would contain
 *                      the file’s doc block. Every other key would be used
 *                      for any line that starts with such key, this could
 *                      include the words ‘class’, ‘interface’,
 *                      ‘trail’, ‘final’, ‘abstract’ or any other
 *                      word you might need. Lastly, every doc block should be
 *                      given as an array or a string in accordance to the
 *                      arielenter/array-to-phpdoc package.
 *
 * @return string The new content of the file.
 */
```

#### Usage example

[](#usage-example)

Suppose we have a file ‘tests/ExampleClass.php’ with the following content:

```
