/** * Read content from file * * @param int $length Length of content to read * @param bool $asArray Get as array * * @return array|string|bool */ public function read($length = 0, $asArray = false) { if ($asArray && Number::isZero($length)) { return file($this->file); } elseif (Number::isPositive($length)) { $this->setHandle('r'); return fread($this->handle, $length); } else { return Collection::implode($this->read(0, true), ''); } }
/** * */ public function testIsPositiveWithWrongDatatype() { /** @noinspection PhpParamsInspection */ $this->assertFalse(Number::isPositive('abc')); }