@param array $trailer

@return bool
@throws \Exception
186188
protected function processarTrailerLote(array $trailer)
    {
        $this->getTrailerLote()
            ->setLoteServico($this->rem(4, 7, $trailer))
            ->setTipoRegistro($this->rem(8, 8, $trailer))
            ->setQtdRegistroLote((int) $this->rem(18, 23, $trailer))
            ->setQtdTitulosCobrancaSimples((int) $this->rem(24, 29, $trailer))
            ->setValorTotalTitulosCobrancaSimples(Util::nFloat($this->rem(30, 46, $trailer)/100, 2, false))
            ->setQtdTitulosCobrancaVinculada((int) $this->rem(47, 52, $trailer))
            ->setValorTotalTitulosCobrancaVinculada(Util::nFloat($this->rem(53, 69, $trailer)/100, 2, false))
            ->setQtdTitulosCobrancaCaucionada((int) $this->rem(70, 75, $trailer))
            ->setValorTotalTitulosCobrancaCaucionada(Util::nFloat($this->rem(76, 92, $trailer)/100, 2, false))
            ->setQtdTitulosCobrancaDescontada((int) $this->rem(93, 98, $trailer))
            ->setValorTotalTitulosCobrancaDescontada(Util::nFloat($this->rem(99, 115, $trailer)/100, 2, false));

        return true;
    }
365672
public function run(array $args = null) {
		$exec = escapeshellcmd($this->command);
		if ($args) {
			$exec .= " ". implode(" ", array_map("escapeshellarg", (array) $args));
		}
		
		if ($this->sudo) {
			$this->suExec(sprintf($this->sudo." 2>&1", $exec), $this->verbose);
		} elseif ($this->verbose) {
			ob_start(function($s) {
				$this->output .= $s;
				return $s;
			}, 1);
			passthru($exec, $this->status);
			ob_end_flush();
		} elseif ($this->verbose !== false /* !quiet */) {
			ob_start([$this, "progress"], 1);
			passthru($exec . " 2>&1", $this->status);
			ob_end_flush();
		} else {
			exec($exec ." 2>&1", $output, $this->status);
			$this->output = implode("\n", $output);
		}
		
		if ($this->status) {
			throw new Exception("Command {$exec} failed ({$this->status})");
		}

		return $this;
	}
552666
public static function checkForPdoDriver($driver)
    {
        if (!extension_loaded('PDO')) {
            throw new \Exception("Required PDO extension is not installed or loaded.");
        }

        // see overrides for specific driver checks
        $drivers = \PDO::getAvailableDrivers();
        if (!in_array($driver, $drivers)) {
            throw new \Exception("Required PDO driver '$driver' is not installed or loaded properly.");
        }
    }
530106
public function getPermissionStatus(string $role, string $permission, string $resource) : bool
    {
        if (!$this->roleRegistry->exists($role)) {
            throw new \Exception(
                sprintf(
                    "The role: %s doesnt exist",
                    (string)$role
                )
            );
        }

        if (!$this->permissionRegistry->exists($permission)) {
            throw new \Exception(
                sprintf(
                    "The permission: %s doesnt exist",
                    (string)$permission
                )
            );
        }

        if (!$this->resourceRegistry->exists($resource)) {
            throw new \Exception(
                sprintf(
                    "The resource: %s doesnt exist",
                    (string)$resource
                )
            );
        }

        $roleObject = $this->globalRegistry->get($role);

        if (isset($roleObject[$resource][$permission]["status"]))
        {
            return $roleObject[$resource][$permission]["status"];
        }

        $parents = $this->roleRegistry->getRegistry()[$role];

        foreach ($parents as $parentRole)
        {
            $permissionStatus = $this->getPermissionStatus($parentRole, $permission, $resource);

            if ($permissionStatus)
            {
                return true;
            }
        }

        return false;
    }
14609
public function execute($request)
    {
        $result = $request->authHeaders()->send();

        if ($result->status === self::API_STATUS_FAIL) {
            throw new Exception('Error: '.$result->error);
        }

        return $result;
    }
606803
public function isAll($role)
    {
        foreach ($this->getArrayFrom($role) as $role) {
            if (!$this->hasRole($role)) {
                return false;
            }
        }

        return true;
    }
779122
public function isAll($roles, &$failed = null)
    {
        $this->isOne($roles, $failed);

        return $failed->isEmpty();
    }
889452
protected function processarTrailerLote(array $trailer)
    {
        $this->getTrailerLote()
            ->setLoteServico($this->rem(4, 7, $trailer))
            ->setTipoRegistro($this->rem(8, 8, $trailer))
            ->setQtdRegistroLote((int) $this->rem(18, 23, $trailer))
            ->setQtdTitulosCobrancaSimples((int) $this->rem(24, 29, $trailer))
            ->setValorTotalTitulosCobrancaSimples(Util::nFloat($this->rem(30, 46, $trailer)/100, 2, false))
            ->setQtdTitulosCobrancaVinculada((int) $this->rem(47, 52, $trailer))
            ->setValorTotalTitulosCobrancaVinculada(Util::nFloat($this->rem(53, 69, $trailer)/100, 2, false));

        return true;
    }
482188
public function create($address)
    {
        if (is_array($address)) {
            $address = new OrderAddress($address);
        }

        if ($address instanceof OrderAddress) {
            if ($this->fireEvent('creating', array($address)) === false) {
                return false;
            }

            $address->setCaller($this);
            $address->save();

            $this->fireEvent('created', array($address));

            $address = $this->find($address->id);

            return $address;
        }

        throw new Exception(sprintf(Exception::CANT_CREATE_MODEL,
            'Subbly\\Model\\Order',
            $this->name()
        ));
    }
129914
public function writeManifest(array $manifest)
    {
        if (! is_writable(dirname($this->manifestPath))) {
            throw new Exception('The bootstrap/cache directory must be present and writable.');
        }

        $this->files->put(
            $this->manifestPath,
            '<?php return '.var_export($manifest, true).';'
        );

        return array_merge(['when' => []], $manifest);
    }
755885
public function EstFerie($date = null)
    {
        if (!is_null($date)) {
            if ( $this->set_date($date) === false ){
                throw new \Exception("bad initialization: " . var_export($date, 1));
            }
        }
        return array_key_exists($this->format("%Y%m%d"), $this->joursferies);
        
    }
659402
public function supports($phrase, array $arguments)
    {
        if (!isset($this->forms[$phrase])) {
            return false;
        }

        $argumentMatch = $this->forms[$phrase];

        if ($this->validateNoArgumentsCondition($arguments, $argumentMatch)
            || $this->validateStrictArgumentCountCondition($arguments, $argumentMatch)) {
            return false;
        }

        return true;
    }
561319
private function validateTwigTemplate($template)
    {
        $loader = $this->twig->getLoader();
        if (!$loader->exists($template)) {
            throw new \Exception(sprintf(
                'Unable to find template "%s".',
                $template
            ));
        }
    }
236598
public function getEncoding($direction)
    {
        if (!isset($this->encoding[$direction])) {
            throw new Exception("Encoding direction invalid");
        }

        return $this->encoding[$direction];
    }
1051556
public function checkBefore($date, $latest)
    {
        try {
            return $this->toTimestamp($date) < $this->toTimestamp($latest);
        } catch (InvalidArgumentException $e) {
            return false;
        }
    }
35738
public function sets(array $keyArray, $timeout) {
		if (!is_array($keyArray)) {
			throw new Exception('Call  ' . __FUNCTION__ . ' method  parameter  Error !');
		}
		$retRes = $this->driver->mset($keyArray);
		if ($timeout <= 0) {
			return $retRes;
		}
		foreach ($keyArray as $key => $value) {
			$this->driver->expire($key, $timeout);
		}
		return true;
	}
892563
protected function readTrailer()
    {
        try {
            $trailerKeyword = $this->parser->readValue(null, PdfToken::class);
            if ($trailerKeyword->value !== 'trailer') {
                throw new CrossReferenceException(
                    \sprintf(
                        'Unexpected end of cross reference. "trailer"-keyword expected, got: %s.',
                        $trailerKeyword->value
                    ),
                    CrossReferenceException::UNEXPECTED_END
                );
            }
        } catch (PdfTypeException $e) {
            throw new CrossReferenceException(
                'Unexpected end of cross reference. "trailer"-keyword expected, got an invalid object type.',
                CrossReferenceException::UNEXPECTED_END,
                $e
            );
        }

        try {
            $trailer = $this->parser->readValue(null, PdfDictionary::class);
        } catch (PdfTypeException $e) {
            throw new CrossReferenceException(
                'Unexpected end of cross reference. Trailer not found.',
                CrossReferenceException::UNEXPECTED_END,
                $e
            );
        }

        $this->trailer = $trailer;
    }