Browse Source

phpcs fixes.

Florian Krämer 11 years ago
parent
commit
5510adfd5b

+ 4 - 3
src/ORM/Behavior/TreeBehavior.php

@@ -797,10 +797,11 @@ class TreeBehavior extends Behavior
 /**
  * Returns the depth level of a node in the tree.
  *
- * @param int|string $id
+ * @param int|string $id Primary key of the node.
  * @return int|bool Integer of the level or false if the node does not exist.
  */
-    public function getLevel($id) {
+    public function getLevel($id)
+    {
         $config = $this->config();
         $entity = $this->_table->find('all')
             ->select([$config['left'], $config['right']])
@@ -813,7 +814,7 @@ class TreeBehavior extends Behavior
 
         $query = $this->_table->find('all')->where([
             $config['left'] . ' <' => $entity[$config['left']],
-            $config['right'] . ' >'=> $entity[$config['right']]
+            $config['right'] . ' >' => $entity[$config['right']]
         ]);
 
         return $this->_scope($query)->count();

+ 2 - 1
tests/TestCase/ORM/Behavior/TreeBehaviorTest.php

@@ -862,7 +862,8 @@ class TreeBehaviorTest extends TestCase
      *
      * @return void
      */
-    public function testGetLevel() {
+    public function testGetLevel()
+    {
         $result = $this->table->getLevel(8);
         $this->assertEquals(3, $result);