Skip to content

Commit

Permalink
minor #164 Fixed a bunch of PHPdocs errors and missings (javiereguiluz)
Browse files Browse the repository at this point in the history
This PR was merged into the master branch.

Discussion
----------

Fixed a bunch of PHPdocs errors and missings

Commits
-------

0d21db7 Fixed a bunch of PHPdocs errors and missings
  • Loading branch information
javiereguiluz committed May 23, 2015
2 parents a17d16f + 0d21db7 commit 1146d53
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 13 deletions.
13 changes: 7 additions & 6 deletions src/Easybook/DependencyInjection/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use Pimple\Container;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Yaml\Yaml;
Expand All @@ -29,7 +30,7 @@

class Application extends Container
{
const VERSION = '4.9.0';
const VERSION = '5.0-DEV';

public function __construct()
{
Expand Down Expand Up @@ -494,7 +495,7 @@ public function highlight($code, $language = 'code')
* Shortcut method to dispatch events.
*
* @param string $eventName The name of the dispatched event
* @param mixed $eventObject The object that stores event data
* @param Event $eventObject The object that stores event data
*/
public function dispatch($eventName, $eventObject = null)
{
Expand Down Expand Up @@ -553,8 +554,8 @@ public function loadEasybookConfiguration()
* // sets 'New author' as the value of 'author' option
* $app->book('author', 'New author');
*
* @param mixed $key The configuration option key
* @param mixed $newValue The new value of the configuration option
* @param string $key The configuration option key
* @param mixed $newValue The new value of the configuration option
*
* @return mixed It only returns a value when the second argument is null
*/
Expand All @@ -579,8 +580,8 @@ public function book($key, $newValue = null)
* // sets 'US-letter' as the value of 'page_size' option
* $app->edition('page_size', 'US-Letter');
*
* @param mixed $key The configuration option key
* @param mixed $newValue The new value of the configuration option
* @param string $key The configuration option key
* @param mixed $newValue The new value of the configuration option
*
* @return mixed It only returns a value when the second argument is null
*/
Expand Down
6 changes: 4 additions & 2 deletions src/Easybook/Util/CodeHighlighter.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@

namespace Easybook\Util;

use Pimple\Container;

class CodeHighlighter
{
private $app;

/**
* @param array app The object that represents the whole dependency container
* @param Container app The object that represents the whole dependency container
*/
public function __construct($app)
public function __construct(Container $app)
{
$this->app = $app;
}
Expand Down
34 changes: 29 additions & 5 deletions src/Easybook/Util/TwigCssExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ function ($matches) use ($factor) {

// -- Internal methods to convert between units ---------------------------

/**
* Transforms the given hexadecimal color string into an RGB array.
*
* @param string $hex
* @return array
*/
private function hex2rgb($hex)
{
$hex = str_replace('#', '', $hex);
Expand All @@ -184,13 +190,25 @@ private function hex2rgb($hex)
);
}

private function rgb2hex($rgb)
/**
* Transforms the given RGB array into an hexadecimal color string.
*
* @param array $rgb
* @return string
*/
private function rgb2hex(array $rgb)
{
return sprintf('#%02s%02s%02s', dechex($rgb[0]), dechex($rgb[1]), dechex($rgb[2]));
}

/* code copied from Drupal CMS */
private function rgb2hsl($rgb)
/**
* Transforms the given RGB color array into an HSL color array.
* Code copied from Drupal CMS project.
*
* @param array $rgb
* @return array
*/
private function rgb2hsl(array $rgb)
{
list($r, $g, $b) = $rgb;
$r /= 255;
Expand Down Expand Up @@ -226,8 +244,14 @@ private function rgb2hsl($rgb)
return array($h, $s, $l);
}

/* code copied from Drupal CMS */
private function hsl2rgb($hsl)
/**
* Transforms the given HSL color array into an RGB color array.
* Code copied from Drupal CMS project.
*
* @param array $hsl
* @return array
*/
private function hsl2rgb(array $hsl)
{
list($h, $s, $l) = $hsl;

Expand Down

0 comments on commit 1146d53

Please sign in to comment.