Skip to content

Commit

Permalink
Merge pull request zendframework#17 from juriansluiman/feature/console
Browse files Browse the repository at this point in the history
Feature/console docblocks
  • Loading branch information
Thinkscape committed Jul 24, 2012
2 parents e1c7260 + c3c02b2 commit 4b4eda8
Show file tree
Hide file tree
Showing 27 changed files with 322 additions and 15 deletions.
24 changes: 19 additions & 5 deletions library/Zend/Console/Adapter/AbstractAdapter.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Console
*/

namespace Zend\Console\Adapter;

use Zend\Console\AdapterInterface;
Expand All @@ -7,6 +16,11 @@
use Zend\Console\Exception\BadMethodCallException;
use Zend\Console;

/**
* @category Zend
* @package Zend_Console
* @subpackage Adapter
*/
abstract class AbstractAdapter implements AdapterInterface
{
protected static $hasMBString;
Expand Down Expand Up @@ -150,7 +164,7 @@ public function writeBox(
/**
* Validate coordinates
*/
if ($x1 < 0
if ($x1 < 0
|| $y1 < 0
|| $x2 < $x1
|| $y2 < $y1) {
Expand Down Expand Up @@ -311,11 +325,11 @@ public function writeBox(
*/
public function writeTextBlock(
$text,
$width,
$height = null,
$x = 0,
$width,
$height = null,
$x = 0,
$y = 0,
$color = null,
$color = null,
$bgColor = null)
{

Expand Down
12 changes: 12 additions & 0 deletions library/Zend/Console/Adapter/Posix.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Console
*/

namespace Zend\Console\Adapter;

use Zend\Console\AdapterInterface;
Expand All @@ -9,6 +18,9 @@

/**
* @link http://en.wikipedia.org/wiki/ANSI_escape_code
* @category Zend
* @package Zend_Console
* @subpackage Adapter
*/
class Posix extends AbstractAdapter implements AdapterInterface
{
Expand Down
13 changes: 13 additions & 0 deletions library/Zend/Console/Adapter/Virtual.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Console
*/

namespace Zend\Console\Adapter;

use Zend\Console\AdapterInterface;
Expand All @@ -8,6 +17,10 @@

/**
* Virtual buffer adapter
*
* @category Zend
* @package Zend_Console
* @subpackage Adapter
*/
class Virtual extends AbstractAdapter implements AdapterInterface
{
Expand Down
14 changes: 14 additions & 0 deletions library/Zend/Console/Adapter/Windows.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Console
*/

namespace Zend\Console\Adapter;

use Zend\Console\AdapterInterface;
Expand All @@ -7,6 +16,11 @@
use Zend\Console\Exception\RuntimeException;
use Zend\Console;

/**
* @category Zend
* @package Zend_Console
* @subpackage Adapter
*/
class Windows extends Virtual implements AdapterInterface
{
protected static $hasMBString;
Expand Down
13 changes: 13 additions & 0 deletions library/Zend/Console/Adapter/WindowsAnsicon.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Console
*/

namespace Zend\Console\Adapter;

use Zend\Console\AdapterInterface;
Expand All @@ -20,6 +29,10 @@
* Console should not run in UTF8 code page (65001), because ANSICON does not behave well with it.
* It's best to use non-unicode code page 437, 850, 851, 852 or similar. Run "help mode" for more
* information on how to change Windows console code page.
*
* @category Zend
* @package Zend_Console
* @subpackage Adapter
*/
class WindowsAnsicon extends Posix implements AdapterInterface
{
Expand Down
13 changes: 13 additions & 0 deletions library/Zend/Console/AdapterInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Console
*/

namespace Zend\Console;

/**
* @category Zend
* @package Zend_Console
*/
interface AdapterInterface
{
const LINE_NONE = 1;
Expand Down
15 changes: 14 additions & 1 deletion library/Zend/Console/Charset/Ascii.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Console
*/

namespace Zend\Console\Charset;

use Zend\Console\CharsetInterface;

/**
* Basic (low) ASCII line drawing characters.
*
* @category Zend
* @package Zend_Console
* @subpackage Charset
*/
class Ascii implements CharsetInterface{

Expand All @@ -23,7 +36,7 @@ class Ascii implements CharsetInterface{
const LINE_SINGLE_SE = "+";
const LINE_SINGLE_SW = "+";
const LINE_SINGLE_CROSS = "+";

const LINE_DOUBLE_EW = "=";
const LINE_DOUBLE_NS = "|";
const LINE_DOUBLE_NW = "+";
Expand Down
14 changes: 13 additions & 1 deletion library/Zend/Console/Charset/AsciiExtended.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Console
*/

namespace Zend\Console\Charset;

use Zend\Console\CharsetInterface;
Expand All @@ -7,6 +16,9 @@
* Extended ASCII character set (positions 127+, MS DOS & Windows compatible)
*
* @link http://en.wikipedia.org/wiki/Box-drawing_characters
* @category Zend
* @package Zend_Console
* @subpackage Charset
*/
class AsciiExtended implements CharsetInterface{

Expand All @@ -25,7 +37,7 @@ class AsciiExtended implements CharsetInterface{
const LINE_SINGLE_SE = "\xd9";
const LINE_SINGLE_SW = "\xc0";
const LINE_SINGLE_CROSS = "\xc5";

const LINE_DOUBLE_EW = "\xcd";
const LINE_DOUBLE_NS = "\xba";
const LINE_DOUBLE_NW = "\xc9";
Expand Down
18 changes: 15 additions & 3 deletions library/Zend/Console/Charset/DECSG.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Console
*/

namespace Zend\Console\Charset;

use Zend\Console\CharsetInterface;
Expand All @@ -7,6 +16,9 @@
* DEC Special Graphics (VT100 line drawing) character set
*
* @link http://vt100.net/docs/vt220-rm/table2-4.html
* @category Zend
* @package Zend_Console
* @subpackage Charset
*/
class DECSG implements CharsetInterface{

Expand All @@ -25,21 +37,21 @@ class DECSG implements CharsetInterface{
const LINE_SINGLE_SE = "\x6a";
const LINE_SINGLE_SW = "\x6d";
const LINE_SINGLE_CROSS = "\x6e";

const LINE_DOUBLE_EW = "\x73";
const LINE_DOUBLE_NS = "\x78";
const LINE_DOUBLE_NW = "\x6c";
const LINE_DOUBLE_NE = "\x5b";
const LINE_DOUBLE_SE = "\x6a";
const LINE_DOUBLE_SW = "\x6d";
const LINE_DOUBLE_CROSS = "\x6e";

const LINE_BLOCK_EW = "\x61";
const LINE_BLOCK_NS = "\x61";
const LINE_BLOCK_NW = "\x61";
const LINE_BLOCK_NE = "\x61";
const LINE_BLOCK_SE = "\x61";
const LINE_BLOCK_SW = "\x61";
const LINE_BLOCK_CROSS = "\x61";

}
16 changes: 14 additions & 2 deletions library/Zend/Console/Charset/Utf8.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Console
*/

namespace Zend\Console\Charset;

use Zend\Console\CharsetInterface;
Expand All @@ -7,6 +16,9 @@
* UTF-8 box drawing
*
* @link http://en.wikipedia.org/wiki/Box-drawing_characters
* @category Zend
* @package Zend_Console
* @subpackage Charset
*/
class Utf8 implements CharsetInterface{
const ACTIVATE = "";
Expand All @@ -24,15 +36,15 @@ class Utf8 implements CharsetInterface{
const LINE_SINGLE_SE = "";
const LINE_SINGLE_SW = "";
const LINE_SINGLE_CROSS = "";

const LINE_DOUBLE_EW = "";
const LINE_DOUBLE_NS = "";
const LINE_DOUBLE_NW = "";
const LINE_DOUBLE_NE = "";
const LINE_DOUBLE_SE = "";
const LINE_DOUBLE_SW = "";
const LINE_DOUBLE_CROSS = "";

const LINE_BLOCK_EW = "";
const LINE_BLOCK_NS = "";
const LINE_BLOCK_NW = "";
Expand Down
12 changes: 12 additions & 0 deletions library/Zend/Console/Charset/Utf8Heavy.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Console
*/

namespace Zend\Console\Charset;

/**
* UTF-8 box drawing (modified to use heavy single lines)
*
* @link http://en.wikipedia.org/wiki/Box-drawing_characters
* @category Zend
* @package Zend_Console
* @subpackage Charset
*/
class Utf8Heavy extends Utf8 {

Expand Down
14 changes: 13 additions & 1 deletion library/Zend/Console/CharsetInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
<?php
namespace Zend\Console;
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Console
*/

namespace Zend\Console;

/**
* @category Zend
* @package Zend_Console
*/
interface CharsetInterface {
}
13 changes: 12 additions & 1 deletion library/Zend/Console/ColorInterface.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Console
*/

namespace Zend\Console;


/**
* @category Zend
* @package Zend_Console
*/
interface ColorInterface {
const NORMAL = 0;
const RESET = 0;
Expand Down
Loading

0 comments on commit 4b4eda8

Please sign in to comment.