Skip to content

Commit

Permalink
Implemented phpdox to be able to generate some internal documentation…
Browse files Browse the repository at this point in the history
…. Decided it would be easier to follow if each class at least had a one-liner description.
  • Loading branch information
howardjones committed Jan 7, 2018
1 parent c6c8066 commit fb18c82
Show file tree
Hide file tree
Showing 91 changed files with 509 additions and 172 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ composer.lock
!build/network-weathermap.doxy
vendor/*
dev/generated/
dev/docs/
dev/phpcs/
dev/vagrant-testers/*.zip
node_modules/
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"phpunit/php-code-coverage": "~4",
"jakub-onderka/php-parallel-lint": "^0.9.2",
"johnkary/phpunit-speedtrap": "^1.1",
"lstrojny/phpunit-clever-and-smart": "^0.5.0"
"lstrojny/phpunit-clever-and-smart": "^0.5.0",
"phploc/phploc": "^4.0"
},
"autoload": {
"psr-4": {"Weathermap\\": "lib/Weathermap"}
Expand Down
3 changes: 3 additions & 0 deletions lib/Weathermap/CLI/MapProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
use Weathermap\Core\Map;
use Weathermap\Core\MapUtility;

/**
* A base class for various command-line tools that take in a map config file, process it, and spit out a new one.
*/
class MapProcessor
{
/** @var GetOpt $getOpt */
Expand Down
5 changes: 5 additions & 0 deletions lib/Weathermap/CLI/Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
use Weathermap\Core\Map;
use Weathermap\Core\MapUtility;

/**
* The CLI map-creation tool
*
* @package Weathermap\CLI
*/
class Runner
{
/** @var GetOpt $getOpt */
Expand Down
5 changes: 5 additions & 0 deletions lib/Weathermap/Core/AngledLinkGeometry.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

namespace Weathermap\Core;

/**
* All the parts of LinkGeometry that are specific to angled links
*
* @package Weathermap\Core
*/
class AngledLinkGeometry extends LinkGeometry
{

Expand Down
8 changes: 1 addition & 7 deletions lib/Weathermap/Core/App.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
<?php
/**
* Created by PhpStorm.
* User: howie
* Date: 23/09/17
* Time: 18:27
*/

namespace Weathermap\Core;

// XXX - unused
/** XXX - unused */

class App
{
Expand Down
5 changes: 5 additions & 0 deletions lib/Weathermap/Core/BoundingBox.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<?php
namespace Weathermap\Core;

/**
* Given a series of points or rectangles, keep track of the minimum-sized rectangle that will contain them.
*
* @package Weathermap\Core
*/
class BoundingBox
{
private $minimumX;
Expand Down
11 changes: 10 additions & 1 deletion lib/Weathermap/Core/CatmullRom1D.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

namespace Weathermap\Core;

// Given 4 ordinates and a parameter from 0 to 1, calculate a point on the Catmull Rom spline through them.
/**
* Given 4 ordinates and a parameter from 0 to 1, calculate a point on the Catmull-Rom spline through them.
*/

class CatmullRom1D
{
private $aParam;
Expand All @@ -18,6 +21,12 @@ public function __construct($point0, $point1, $point2, $point3)
$this->dParam = 2 * $point1;
}

/**
* Calculate the ordinate given the parameter (t)
*
* @param float $parameter
* @return float
*/
public function calculate($parameter)
{
$parameterSquared = $parameter * $parameter;
Expand Down
2 changes: 1 addition & 1 deletion lib/Weathermap/Core/ConfigItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Weathermap\Core;

// XXX - unused
/** XXX - unused */

class ConfigItem
{
Expand Down
6 changes: 1 addition & 5 deletions lib/Weathermap/Core/ConfigReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

namespace Weathermap\Core;

/*
* Refactoring of all the ReadConfig code out of the giant Weathermap class
*
/**
* A ConfigReader holds state for parsing through a config file. Includes are done by
* creating a new ConfigReader and passing it the state of the current one. Shared state
* reduces the amount of junk passed to HANDLE_* functions.
*
*/


class ConfigReader
{
private $lineCount = 0;
Expand Down
5 changes: 5 additions & 0 deletions lib/Weathermap/Core/CurvedLinkGeometry.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<?php
namespace Weathermap\Core;

/**
* All the parts of LinkGeometry that are specific to curved links
*
* @package Weathermap\Core
*/
class CurvedLinkGeometry extends LinkGeometry
{
protected function calculateSpine($pointsPerSpan = 32)
Expand Down
4 changes: 4 additions & 0 deletions lib/Weathermap/Core/Font.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

namespace Weathermap\Core;

/**
* Base class for a font in the FontTable
* @package Weathermap\Core
*/
class Font
{
public $type;
Expand Down
11 changes: 5 additions & 6 deletions lib/Weathermap/Core/FontTable.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<?php
/**
* Created by PhpStorm.
* User: howie
* Date: 23/09/17
* Time: 11:12
*/

namespace Weathermap\Core;

/**
* A manager for loading fonts, and also producing their config for getConfig()
*
* @package Weathermap\Core
*/
class FontTable
{
/** @var Font[] $table */
Expand Down
11 changes: 5 additions & 6 deletions lib/Weathermap/Core/GDFont.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<?php
/**
* Created by PhpStorm.
* User: howie
* Date: 23/09/17
* Time: 11:12
*/

namespace Weathermap\Core;

/**
* FontTable member representing a GD format bitmap font
*
* @package Weathermap\Core
*/
class GDFont extends Font
{
public $gdnumber;
Expand Down
5 changes: 5 additions & 0 deletions lib/Weathermap/Core/HTMLImagemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@

use Weathermap\Core\HTMLImagemapArea;

/**
* The base class that contains the ImagemapArea objects, and produces the map HTML. (UNUSED?)
*
* @package Weathermap\Core
*/
class HTMLImagemap
{
/** @var HTMLImagemapArea[] $shapes */
Expand Down
10 changes: 4 additions & 6 deletions lib/Weathermap/Core/HTMLImagemapArea.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<?php
/**
* Created by PhpStorm.
* User: howie
* Date: 23/09/17
* Time: 11:14
*/

namespace Weathermap\Core;

/**
* Base class for the other ImagemapArea classes - just the common stuff
* @package Weathermap\Core
*/
class HTMLImagemapArea
{
public $href;
Expand Down
10 changes: 4 additions & 6 deletions lib/Weathermap/Core/HTMLImagemapAreaCircle.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<?php
/**
* Created by PhpStorm.
* User: howie
* Date: 23/09/17
* Time: 11:15
*/

namespace Weathermap\Core;

/**
* A circle for HTMLImagemap (not used by Weathermap)
* @package Weathermap\Core
*/
class HTMLImagemapAreaCircle extends HTMLImagemapArea
{
public $centx;
Expand Down
11 changes: 5 additions & 6 deletions lib/Weathermap/Core/HTMLImagemapAreaPolygon.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<?php
/**
* Created by PhpStorm.
* User: howie
* Date: 23/09/17
* Time: 11:14
*/

namespace Weathermap\Core;

/**
* A polygon for HTMLImagemap (used for link arrows)
*
* @package Weathermap\Core
*/
class HTMLImagemapAreaPolygon extends HTMLImagemapArea
{
public $points = array();
Expand Down
11 changes: 5 additions & 6 deletions lib/Weathermap/Core/HTMLImagemapAreaRectangle.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<?php
/**
* Created by PhpStorm.
* User: howie
* Date: 23/09/17
* Time: 11:14
*/

namespace Weathermap\Core;

/**
* A rectangle for HTMLImagemap
*
* @package Weathermap\Core
*/
class HTMLImagemapAreaRectangle extends HTMLImagemapArea
{
public $x1;
Expand Down
7 changes: 7 additions & 0 deletions lib/Weathermap/Core/ImageLoader.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
<?php
namespace Weathermap\Core;

/**
* A handler for loading images required by the map (e.g. backgrounds and icons). It also
* is responsible for any colorizing and resizing necessary. It maintains a cache, to try and speed up
* maps with many resized icons, in particular.
*
* @package Weathermap\Core
*/
class ImageLoader
{
private $cache = array();
Expand Down
5 changes: 5 additions & 0 deletions lib/Weathermap/Core/ImageUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

namespace Weathermap\Core;

/**
* Utility functions related to manipulating GD images
*
* @package Weathermap\Core
*/
class ImageUtility
{
/**
Expand Down
5 changes: 5 additions & 0 deletions lib/Weathermap/Core/Legend.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

use Weathermap\Core\MapScale;

/**
* The in-map display of a scale
*
* @package Weathermap\Core
*/
class Legend extends MapItem
{
/** @var MapScale $scale */
Expand Down
10 changes: 4 additions & 6 deletions lib/Weathermap/Core/LineSegment.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<?php
/**
* Created by PhpStorm.
* User: howie
* Date: 23/09/17
* Time: 11:16
*/

namespace Weathermap\Core;

/**
* A LineSegment is a Line that only exists between two points (UNUSED?)
* @package Weathermap\Core
*/
class LineSegment
{
public $point1;
Expand Down
4 changes: 2 additions & 2 deletions lib/Weathermap/Core/LinkGeometry.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Weathermap\Core;

/***
* Class WMLinkGeometry - everything needed to draw a link
/**
* everything needed to draw a link
*
* Actually collect all the link-drawing code into an object!
*
Expand Down
5 changes: 5 additions & 0 deletions lib/Weathermap/Core/LinkGeometryFactory.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<?php
namespace Weathermap\Core;

/**
* Given the link style, return an appropriate LinkGeometry object to draw it
*
* @package Weathermap\Core
*/
class LinkGeometryFactory
{
/**
Expand Down
Loading

0 comments on commit fb18c82

Please sign in to comment.