Skip to content

Reformat with phptidy.#63

Merged
wurstbrot merged 1 commit intodevsecopsmaturitymodel:masterfrom
ioggstream:ioggstream-reindent
Mar 11, 2021
Merged

Reformat with phptidy.#63
wurstbrot merged 1 commit intodevsecopsmaturitymodel:masterfrom
ioggstream:ioggstream-reindent

Conversation

@ioggstream
Copy link
Copy Markdown
Contributor

This PR

reformats code with phptidy

wget https://github.com/cmrcx/phptidy/blob/master/phptidy.php
php phptidy.php replace *.php
sed -i 's,\t,  ,g' *.php

@wurstbrot
Copy link
Copy Markdown
Collaborator

wurstbrot commented Feb 26, 2021

At the moment DSOMM is more script based and not Object Oriented. Therefore, we mostly get "unknown" type.

How does a documentation

/**
 *
 * @param unknown $dimensions
 * @param unknown $elementImplementation
 * @return unknown
 */

help?

To have a clean code guideline and test the code against it, is a good idea and it looks like phptidy does a good job. Should we put that in a github action?

The comments are useless from my point of view.

@ioggstream
Copy link
Copy Markdown
Contributor Author

It's just for reformatting code, so that we don't need to care about '\n'' in patches.

@AndreBaumeier
Copy link
Copy Markdown
Contributor

How does a documentation

/**
 *
 * @param unknown $dimensions
 * @param unknown $elementImplementation
 * @return unknown
 */

This might be a good starting point for further improvement. It looks like phpdoc, but not sure since phptidy doesn't provide documentation on this - in case the formatting is from phptidy. Anyways, phpdoc is a valuable. A good example might be the documentation standard of Drupal: https://www.drupal.org/docs/develop/standards/api-documentation-and-comment-standards

Example use:

/**
 * Returns HTML for a foo.
 *
 * @param array $variables
 *   An associative array containing:
 *   - foo: The foo object that is being formatted.
 *   - show_bar: TRUE to show the bar component, FALSE to omit it.
 *
 * @ingroup themeable
 */
function theme_foo($variables) {

Use of @return

@wurstbrot wurstbrot merged commit 5f4d2ca into devsecopsmaturitymodel:master Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants