Skip to content

Commit

Permalink
docs: Mark internal code as private
Browse files Browse the repository at this point in the history
* ImportVisitor is relatively new, but was forgotten to be marked as
  private. As such, it became listed on doc.wikimedia.org, even though
  it is not a public or stable API for external usage
  https://doc.wikimedia.org/mediawiki-libs-less.php/

* Idem for several Less_Parser utility functions.

* Fix Doxygen warning about missing param doc for saturate().

* Fix Doxygen warning about invalid param doc for SetImportDirs.

* Remove noise from `@param-` comments on doc.wikimedia.org by
  setting this to noop. We do the same in MediaWiki for example
  https://gerrit.wikimedia.org/g/mediawiki/core/+/2e9414bd80/maintenance/Doxyfile#64

* Hide two internal functions from the output. Note that `@private`
  only works on classes and other entities not explicitly marked
  public. To hide a "public" static function, we use `@internal`
  instead.
  https://www.doxygen.nl/manual/commands.html#cmdprivate

Change-Id: I3b51240577a6aec48045c15c2e7d32d491be655e
  • Loading branch information
Krinkle committed Aug 22, 2024
1 parent fff1924 commit c6922de
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ INPUT = README.md API.md SECURITY.md CHANGES.md lib/
FILE_PATTERNS = *.php
RECURSIVE = YES
USE_MDFILE_AS_MAINPAGE = README.md
ALIASES = "phan=\noop"
HTML_COLORSTYLE = LIGHT
HTML_DYNAMIC_SECTIONS = YES
GENERATE_TREEVIEW = YES
Expand Down
1 change: 1 addition & 0 deletions lib/Less/Functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ public function saturate( $color = null, $amount = null, $method = null ) {
/**
* @param Less_Tree_Color|null $color
* @param Less_Tree_Dimension|null $amount
* @param Less_Tree_Quoted|Less_Tree_Color|Less_Tree_Keyword|null $method
*/
public function desaturate( $color = null, $amount = null, $method = null ) {
if ( !$color instanceof Less_Tree_Color ) {
Expand Down
4 changes: 3 additions & 1 deletion lib/Less/ImportVisitor.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

/**
* @private
*/
class Less_ImportVisitor extends Less_Visitor {

public $env;
Expand Down
7 changes: 5 additions & 2 deletions lib/Less/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -596,11 +596,11 @@ public function SetCacheDir( $dir ) {
* }
* }
*
*
* @param array<string|callable> $dirs The key should be a server directory from which LESS
* @param array $dirs The key should be a server directory from which LESS
* files may be imported. The value is an optional public URL or URL base path that corresponds to
* the same directory (use empty string otherwise). The value may also be a closure, in
* which case the key is ignored.
* @phan-param array<string,string|callable> $dirs
*/
public function SetImportDirs( $dirs ) {
self::$options['import_dirs'] = [];
Expand Down Expand Up @@ -3217,6 +3217,7 @@ public static function serializeVars( $vars ) {
/**
* Some versions of PHP have trouble with method_exists($a,$b) if $a is not an object
*
* @internal For internal use only
* @param mixed $a
* @param string $b
*/
Expand All @@ -3227,6 +3228,8 @@ public static function is_method( $a, $b ) {
/**
* Round numbers similarly to javascript
* eg: 1.499999 to 1 instead of 2
*
* @internal For internal use only
*/
public static function round( $input, $precision = 0 ) {
$precision = pow( 10, $precision );
Expand Down

0 comments on commit c6922de

Please sign in to comment.