NumPHP\Core\NumArray::abs PHP Метод

abs() публичный Метод

Applies abs on every value of the NumArray
С версии: 1.0.0
public abs ( )
    public function abs()
    {
        $this->data = Filter::filterArray($this->data, function ($data) {
            return abs($data);
        });
        $this->flushCache();
        return $this;
    }

Usage Example

Пример #1
0
 /**
  * Tests if cache will be flushed after using NumArray::abs
  */
 public function testAbsCache()
 {
     $numArray = new NumArray(5);
     $numArray->setCache('key', 6);
     $numArray->abs();
     $this->assertFalse($numArray->inCache('key'));
 }