Skip to content

Commit

Permalink
Check and correct phpdoc #7
Browse files Browse the repository at this point in the history
  • Loading branch information
imsamurai committed Sep 18, 2014
1 parent 97b0a3b commit 0fba77e
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 4 deletions.
12 changes: 12 additions & 0 deletions Test/Case/AllArraySortTest.php
@@ -1,5 +1,17 @@
<?php

/**
* Description of Array
*
* @author imsamurai
*/

/**
* AllArraySortTest
*
* @package ArraySortTest
* @subpackage Test
*/
class AllArraySortTest extends PHPUnit_Framework_TestSuite {

/**
Expand Down
67 changes: 63 additions & 4 deletions Test/Case/Utility/ArraySortTest.php
Expand Up @@ -8,12 +8,14 @@
*/
App::uses('ArraySort', 'ArraySort.Utility');

/**
* ArraySortTest
*
* @package ArraySortTest
* @subpackage Utility
*/
class ArraySortTest extends CakeTestCase {

public function setUp() {
parent::setUp();
}

/**
* Test multisort
*
Expand Down Expand Up @@ -325,30 +327,69 @@ public function cacheProvider() {
}

//@codingStandardsIgnoreStart
/**
* ArraySortTestObject
*
* @package ArraySortTest
* @subpackage Utility
*/
class ArraySortTestObject {

/**
* Constructor
*
* @param int $weight
* @param int $count
*/
public function __construct($weight, $count) {
$this->_weight = $weight;
$this->_count = $count;
}

/**
* Count
*
* @return int
*/
public function count() {
return $this->_count;
}

/**
* Weight
*
* @return int
*/
public function weight() {
return $this->_weight;
}

}

/**
* ArraySortTestCachedObject
*
* @package ArraySortTest
* @subpackage Utility
*/
class ArraySortTestCachedObject extends ArraySortTestObject {

/**
* Run counts
*
* @var array
*/
protected $_run = array(
'count' => false,
'weight' => false
);

/**
* {@inheritdoc}
*
* @return int
* @throws Exception
*/
public function count() {
if ($this->_run['count']) {
throw new Exception('Method count must be callad only once');
Expand All @@ -357,6 +398,12 @@ public function count() {
return parent::count();
}

/**
* {@inheritdoc}
*
* @return int
* @throws Exception
*/
public function weight() {
if ($this->_run['weight']) {
throw new Exception('Method weight must be callad only once');
Expand All @@ -367,8 +414,20 @@ public function weight() {

}

/**
* ArraySortTestObject2
*
* @package ArraySortTest
* @subpackage Utility
*/
class ArraySortTestObject2 {

/**
* Count
*
* @param ArraySortTestObject $Object
* @return int
*/
public static function count(ArraySortTestObject $Object) {
return -1 * $Object->count();
}
Expand Down
7 changes: 7 additions & 0 deletions Utility/ArraySort.php
Expand Up @@ -5,6 +5,13 @@
*
* @author imsamurai
*/

/**
* Array sort
*
* @package ArraySort
* @subpackage Utility
*/
class ArraySort {

/**
Expand Down

0 comments on commit 0fba77e

Please sign in to comment.