Merge pull request #17894 from owncloud/since-check-for-classes-and-interfaces

Implement OCP Since Check for classes and interfaces
remotes/origin/handlebars-approach
Morris Jobke 10 years ago
commit e68741c1b0
  1. 22
      build/OCPSinceChecker.php
  2. 3
      lib/public/db/querybuilder/iliteral.php
  3. 3
      lib/public/db/querybuilder/iparameter.php
  4. 3
      lib/public/db/querybuilder/iqueryfunction.php
  5. 1
      lib/public/files/mount/imountmanager.php
  6. 2
      lib/public/template.php

@ -54,12 +54,22 @@ class SinceTagCheckVisitor extends \PhpParser\NodeVisitorAbstract {
/** @var \PhpParser\Comment\Doc[] $comments */
$comments = $node->getAttribute('comments');
if(count($comments) !== 0) {
$comment = $comments[count($comments) - 1];
$text = $comment->getText();
if(strpos($text, '@deprecated') !== false) {
$this->deprecatedClass = true;
}
if(count($comments) === 0) {
$this->errors[] = 'PHPDoc is needed for ' . $this->namespace . '\\' . $this->className . '::' . $node->name;
return;
}
$comment = $comments[count($comments) - 1];
$text = $comment->getText();
if(strpos($text, '@deprecated') !== false) {
$this->deprecatedClass = true;
}
if($this->deprecatedClass === false && strpos($text, '@since') === false && strpos($text, '@deprecated') === false) {
$type = $node instanceof \PhpParser\Node\Stmt\Interface_ ? 'interface' : 'class';
$this->errors[] = '@since or @deprecated tag is needed in PHPDoc for ' . $type . ' ' . $this->namespace . '\\' . $this->className;
return;
}
}

@ -20,6 +20,9 @@
*/
namespace OCP\DB\QueryBuilder;
/**
* @since 8.2.0
*/
interface ILiteral {
/**
* @return string

@ -20,6 +20,9 @@
*/
namespace OCP\DB\QueryBuilder;
/**
* @since 8.2.0
*/
interface IParameter {
/**
* @return string

@ -20,6 +20,9 @@
*/
namespace OCP\DB\QueryBuilder;
/**
* @since 8.2.0
*/
interface IQueryFunction {
/**
* @return string

@ -25,6 +25,7 @@ namespace OCP\Files\Mount;
* Interface IMountManager
*
* Manages all mounted storages in the system
* @since 8.2.0
*/
interface IMountManager {

@ -137,6 +137,8 @@ function html_select_options($options, $selected, $params=array()) {
/**
* This class provides the template system for owncloud. You can use it to load
* specific templates, add data and generate the html code
*
* @since 8.0.0
*/
class Template extends \OC_Template {
/**

Loading…
Cancel
Save